Topic was automatically imported from the old Question2Answer platform.
Asked By
Ramxa
Old Version
Published before Godot 3 was released.
I’m trying to make my own scaling system for different systems of the game, so far using the signal “screen_resized” from the SceneTree I didn’t had any issues, but it seems it doesn’t work if the screen gets maximized (using the window bar button), thus everything looks out of place.
I’ve tried using “OS.is_window_maximized()” as it seemed the most logical step, but I always get a “false” return no matter what I do or try… (I’m only trying to print the value for now).
OS.is_window_maximized() only returns true if you’ve maximized the window from godot (using OS.set_window_maximized()).
If you’re resizing using the window titlebar, it will stilll print false even when the window is actually maximized.
I see! Seeing the implementation was useful, Thank you!
Is there any way then to check if the window itself is maximized? (regardless of the editor/game options)
I could make it check for positions and scale every frame, but I feel that’s not ideal performance wise…
Ramxa | 2016-08-29 14:44
I’m afraid there’s no way to do this currently (other than checking it manually, as you said).
However, I’m pretty sure that on the c++ side, windows provides some kind of calback or notificiation for when then window gets maximized. So it shouldn’t be too hard to listen for these and set the maximized property accordingly.
Feel free to open an issue on Github about it