How to automatically resize app based on screen size (multi monitor)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By i_love_godot

Godot 3.2 RC2

Hi,

I’m working on a PC only app and I want it to run fullscreen, but I’m struggling with getting it set up.

In the settings I have “resizable”, “borderless” and “fullscreen” ticked, but the window is never resizable. With borderless unticked, there isn’t a border that I can see either. Stretch is set to disabled, and aspect is set to expand.

When I move the app to another monitor of a different resolution (Windows + Shift + Arrow_Key), it doesn’t expand to fill to that monitor and there are no resize handles or an expand button to make it bigger.

Essentially, I want it to always fill the screen, no matter what screen it is on, but it doesn’t seem to work that way. What’s more if I switch from a 1080p monitor to a 1440p monitor and then back again, the original 1080p window shrinks to 802 pixels in height.

Has anyone experienced this weirdness or know how I should be approaching this? Thanks.

:bust_in_silhouette: Reply From: MrMrBlackDragon

“resizable” means that the user can adjust the window in size at the window borders.
Adding “borderless” removes the minimize / maximize, the close buttons etc in the top right at your window you usually have.
“fullscreen” is like “borderless” and the unticked “resizable”.
You complained that “fullscreen” not works as intended. Maybe you need to check manualy if your monitior resized and implet it as a script like so:

var screen_size : Vector2 = Vector2()
func _ready():
screen_size = OS.get_screen_size()# Gets the screen size to test in futur if its change since their

func _process(delta) -> void:
	if OS.get_screen_size() != screen_size: #Tests if your screen changed in size, e.g a different monitor
		screen_size = OS.get_screen_size()
		OS.set_window_size(screen_size)# Sets your window to your screen size

Hopefully I could help you :slight_smile: