Set scale for build window (SOLVED)


#1

Hi, when i try to build the mobile template in my laptop the result window have wrong aspect ratio because of not much space is there for window, so it decided to mess up ratio and change the height of window, so the result window is not that accurate as you want to check.
is there a way to scale down the build window so it can fit the screen and keep it’s origin aspect ratio (like in AVD there is a scale parameter)? or is there any other workaround with this issue?

as you can see result window doesn’t have it’s original aspect ratio


#2

There’s not much you can do to keep the aspect ratio of the window. It’s up to the OS and the user. You can try to force an aspect ratio on resize using DefOS, but that’s not the proper way to solve this.

Ideally, you should just make your game responsive (so that it works on almost any aspect ratio). Nobody likes a stretched game just because they have a taller phone.

Look into setting up your projection in your render script.


#3

You can do this in several ways:

  1. Make a copy and modify your renderscript. The original is in /builtins/render/default.render_script. Change from stretch_projection() to fixed_fit_projection().
  2. Use a camera extension from the Asset Portal. There’s both RenderCam and Defold-Orthographic

#4

thanks, i used fixed_fit_projection and now i can test my game properly