I’d like to be able to list some recommended window sizes in the game options. When the player selects one, the window size will change.
I’m surprised Defold doesn’t offer this, since every other engine I can think of offers it as a basic window function.
1 Like
AGulev
January 24, 2020, 9:20pm
2
You are able to change window size using the following message:
msg.post("@render:", "resize", { width = 1024, height = 768 } )
Defold is a multi-platform game engine that simplifies development of 2D games for all major platforms – HTML5, Android, iOS, Windows, Mac OS X and Linux
7 Likes
britzl
January 25, 2020, 12:23am
3
There is also DefOS if you wish to make more changes to the window, mouse cursor etc
Defold is a multi-platform game engine that simplifies development of 2D games for all major platforms – HTML5, Android, iOS, Windows, Mac OS X and Linux
5 Likes
Ah, I looked up how to do it in old posts and the response was that there is no way. Maybe those were outdated. Oops. Great, thank you both!
1 Like
Unless I’m missing something both render “resize” message and defos are not supported on iOS?
Is there a solution to set the window/display size at runtime on iOS platforms?
britzl
November 15, 2024, 8:51am
6
Not really. Your window/display size will always be the size of the screen itself.
But if you need “chunkier” pixels or a more zoomed in view you can ofc use a camera and apply or zoom (Camera component manual ) or tell the render script to zoom (The render pipeline in Defold ).
Note that window.get_size() will still report the size in pixels of the screen, even if you zoom with a camera or render script.