|
|
|
 |
Reply From: |
Gluon |
You should be able to put this as the first line of code in your main scene
OS.set_window_maximized(true)
within the ready function and it should do the trick
Thank you for your answer. I tried to use your code, but the window set to fullscreen mode. Press to link below you will see my settings.
https://imgway.cz/s/d51y
Oh well the only way I would know to do that is to set the specific window size you would want like this
OS.set_window_size(Vector2(1920, 1080))
which would set the window to that size.
I set OS.set_window_size(Vector2(1920, 1040)). (Windows taskbar in Windows 10 is 40 pixels height). It really works, but after resizing the appliacation doesn’t appear in the middle of the screen. Press to links below you can see pictures. Is there a way how to fix it?
Before resizing (1280x720)
Down for Maintenance
After resizing (1920x1040)
Down for Maintenance
Well you could use this
OS.set_window_position(OS.get_screen_size()*0.5 - OS.get_window_size()*0.5)
to center the window
If you have multiple screens you will need to do this
OS.set_window_position(
OS.get_screen_position(OS.get_current_screen()) +
OS.get_screen_size()*0.5 - OS.get_window_size()*0.5)
otherwise it will center it across both screens.
It’s almost perfect. Just top side of application window wants to move 20 pixels higher.
After resizing:
Down for Maintenance
if you are setting the window size then you have to take into account the various taskbar sizes in windows, you can have a double row taskbar or small taskbar icons
CatastrophicDInosaur | 2022-12-18 23:18