Avoid resizing only height or width

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

How do set that the player can’t resize only the width or height, only both at the same time?
See this video to understand what I’m talking about: https://youtu.be/uaZ81rEm-iI

:bust_in_silhouette: Reply From: Zylann

If you are talking about the window itself, I’m not aware of ways to do so in Godot (never saw Windows applications resizing like that). At worse you could place a check in _process which forcefully sets OS.window_size to the closest valid size?
However, you could use another stretch aspect option to keep the aspect ratio (and allow players to play fullscreen if they don’t own a screen of the same ratio as your game), but due to the above it will always cause black bars to appear.
See here for more info: Multiple resolutions — Godot Engine (3.0) documentation in English