Portrait?

Hi,

I’m trying to get a portrait view setup in both the LY Editor as well as on device, and am running into a few problems:

(1) There’s no way that I can find to set a portrait aspect ratio / resolution in the editor and have it “stick”. I’ve tried modifying the aspect ratio and resolution settings in the top right top right of editor view, but it simply resizes the containing window as much as it can. E.g., setting window res to “750x1334” only lets me do “750 x 821”, and any movement on the window will resize that view. Makes it rather difficult to work close to the final view of the game.

(2) On device the aspect ratio is wrong - looks like it’s using the default resolution (1280x720) as the aspect ratio.

PC Build: (1280x720 - correct aspect ratio, given by black square in center)

5561-pc-small.png

Android Build (Nexus 5, 1920x1080, using 1280x720 aspect ratio) – black square is very … unsquarelike :wink: … :

re: 1: The safe frames only include landscape aspect ratios. Any way to have that include portrait? (e.g. 9:16)? Outside of “locking” the view to portrait mode, it would be quite useful to just be able to see what I can expect on device.

re: 2: Is there a good way to update the device W/H so that the aspect ratio can be updated accordingly? Updating autoexec.cfg to match the device res helps, but unsure how to pull it automatically? See below - manually setting r_Width/r_Height to 1080x1920 in autoexec.cfg yields the correct result:

Thanks!

Hi Scott,

I tried this, though given your description I only specified “r_MaxWidth”:


r_WidthAndHeightAsFractionOfScreenSize=1.0
r_MaxWidth=1080
map WorldMap

… And the aspect ratio is still wildly off.

I also used your code verbatim, and couldn’t get that to work either.

Thoughts?

Hi @Twolewis,

Instead of using r_width and r_height you should be able to accomplish proportional scaling using the following config vars:

r_WidthAndHeightAsFractionOfScreenSize=1.0
r_MaxWidth=1080
r_MaxHeight=1920

r_WidthAndHeightAsFractionOfScreenSize - This takes a value between 0.1 and 1.0 and will proportionally scale the resolution based on the physical dimensions of the device. This also takes r_MaxWidth and r_MaxHeight into account when doing the proportional scaling.

r_MaxWidth - Max width in pixels. Will scale the height to match the device aspect ratio.

r_MaxHeight - Max height in pixels. Will scale the width to match the device aspect ratio.

Let me know how that works for you.

Hmmmm. The execution of autoexec.cfg might be too late for those config vars. Could you try moving them into system_android_es3.cfg and see if that helps?

That seemed to do it! Is there any way to do this outside of system_android_es3.cfg? I’d like contain my game and all of its dependencies/settings/etc in a source control repo…

Unfortunately it doesn’t look like it’s possible to use those config vars outside of the system_android_es3.cfg file. At this time, they are only being used to initialize the renderer which happens much earlier than the execution of autoexec.cfg.

Hi @Twolewis,

There is another config file I completely forgot about that will achieve this, my apologies - game.cfg in the root of your game project.

Hi @Scott@AGS - I just saw your latest response. Adding the r_Width and r_Height in game.cfg worked like a charm. Cheers!!