I do not know much about android and Im finding it difficult to make my game scale in different andoid devices.
Thanks in advance =)
I do not know much about android and Im finding it difficult to make my game scale in different andoid devices.
Thanks in advance =)
You'll probably need to mess around with the mode
and aspect
settings within the project settings. You can find the settings in general -> display -> window
, with the settings for mode
and aspect
on the bottom.
Personally, I generally use 2d
for mode
and keep
for aspect
on most of my projects, as then I can work with a single aspect ratio for the entire game. This combination of settings enforces the aspect ratio set by the width
and height
set in the project settings, with black bars to resize the game window for screens that do not have the correct aspect ratio.
The only issue with this approach, especially on mobile devices, is that there is not a widely used/accepted aspect ratio, so it is possible that many uses will experience the game with the black bars, which may irritate some users. It also means that your game will only be playable in portrait or landscape, not both. You might need to mess around with the settings to find a combination that works for the target device(s) you are developing for.
This page in the docs might also be useful: https://docs.godotengine.org/en/3.1/tutorials/viewports/multiple_resolutions.html
@TwistedTwigleg said: The only issue with this approach, especially on mobile devices, is that there is not a widely used/accepted aspect ratio, so it is possible that many uses will experience the game with the black bars, which may irritate some users. It also means that your game will only be playable in portrait or landscape, not both. You might need to mess around with the settings to find a combination that works for the target device(s) you are developing for.
To solve this, you can use the expand
stretch aspect (instead of keep
). Once you set up GUI anchors correctly, the project should work well with any aspect ratio without stretching.