Managing multiple resolutions/viewport sizes #2507
-
I know this question has been asked a bunch in the DIscord server but it would be good to have it documented here as well for searchability. Also it's a question I genuinely want to know the answer to :) I know there's FlxRes by Harpwood out there which I plan on checking out but what's the best way to a) Create a game for mobile that will support multiple mobile viewport sizes |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
When working on mobile, I found much simpler to address this problem via the screen ratio instead of the resolution. On PC we use the concept of resolution because:
That's complicated to do on mobile, as:
What I usually do:
By default, But! You can use So you define which ratios you want to support fully, and calculate for each one the smaller rectangle where it is "safe" to draw. In this safe area you'll draw the UI, place the buttons, show the game world etc. Outside of the safe area you'll put backgrounds, vignettes, decorative objects etc. I mostly used Flixel-UI for keeping track of this; you can define several layouts, one for each ratio (e.g. one for 16:9, one for 4:3, one for 16:10, etc.) via the As for the (b) question; if you want to make that on PC:
You can try that on mobile too, but it probably won't work. |
Beta Was this translation helpful? Give feedback.
When working on mobile, I found much simpler to address this problem via the screen ratio instead of the resolution. On PC we use the concept of resolution because:
That's complicated to do on mobile, as:
What I usually do: