I've been figuring out Godot 4. In Godot 3 I could use a system signal, "size_changed" that is sent every time the user changes the window size to have the interface do specific things when the window size is changed. In Godot 4 I got what I need mostly working, but the commands I have linked to window_size aren't being executed when the window size is changed to full screen. If there is just a way to detect when full screen is switched to that would be an easy fix, so I'm hoping someone can tell me if there is something like that.
Can I get when the app is changed to full screen as a signal or something?
Asked Answered
Maybe DisplayServer.window_set_rect_changed_callback()
?
https://docs.godotengine.org/en/stable/classes/class_displayserver.html#class-displayserver-method-window-set-rect-changed-callback
Airily apparently switching to full screen just happens too fast for it. I solved the problem by putting a very short await timer before the commands in the function that executes at a screen size change and it works with switching to full screen now... And, i don't really anticipate the screen size being changed all that much, so that should be fine i guess.
You can keep a bool variable like is_full_screen
. I assume you are triggering the fullscreen mode in code?
© 2022 - 2024 — McMap. All rights reserved.