I want to get the screen resolution data and set it programmatically at the beginning of the scene launch. is it possible?
Hi try with this options, go to OTHER ACTIONS-> Game’s window and resolution
1 Like
Please tell me how best to make a mechanism that will select the screen resolution for different devices?
No idea just search in the forum or Google it, I found this
Hi. While It’s impossible to target all screen resolutions with any game engine, Gdevelop still has some options to help accommodate this.
You can find them in Game Settings > Properties:
[image]
You can leave the “platform default” option in No. 3 for Landscape / Vertical alignment according to the mobile device (the screen rotates accordingly)
For screen ratio adjustment you have to use the option highlighted in No.4. The default is that the Game Window will adjust itself to the Device Sc…
Slash
July 8, 2021, 9:12pm
5
if you dont want to have the screen stretched, give the user settings for aspect ratios.
thats what i have done for görtan. 4:3 for tablets and 3:2 or 16:9 for phones.
I implemented a setting option for aspect ratio, to be better compatible with multiple devices,
but the camera position did not update correctly, till i used a timer to change camera after i changed the resolution. Then it works fine in prewiew:
[res]
But on phone however, the camera does not uptade at all.
maybe i need a greater timer for phone, i will test that tomorrow (2 exports done)
[settings]
Any idea why the camera on phone acts different then in preview?
i did use the felgo template UlisesFreitas has linked aswell
still not always perfectly boarderless but everything looks good and is in place.
As mentioned in multiple threads, there is no perfect resolution or magic math that works for every resolution, not in GDevelop, nor in any other engine.
Slash and Ulises’ links are pretty on topic. You can also read about how some released games from other engines have dealt with it here: Pixel Sharp Graphics at Multiple Screen Resolutions | Dev Blog | Ludicrous Games
2 Likes