Can I get when the app is changed to full screen as a signal or something?
Asked Answered
S

3

0

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.

Spitter answered 6/4, 2023 at 19:36 Comment(0)
A
0

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 answered 6/4, 2023 at 21:30 Comment(0)
S
0

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.

Spitter answered 6/4, 2023 at 23:53 Comment(0)
C
0

You can keep a bool variable like is_full_screen. I assume you are triggering the fullscreen mode in code?

Colligan answered 7/4, 2023 at 1:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.