Resize viewport on change display orientation

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

Using godot 4 with all default project screen setting, except:
Viewport Width: 1280
Viewport Height: 1280
Orientation: Sensor
With such settings, engine calculate viewport on game start and fill all the screen. But! If I rotate my android device from portrait to landscape - viewport keep it’s size like is still portrait. How can I fix this behaviour and automatically resize viewport on screen rotation?

This looks like it must be a default behaviour in case you chose orientation = sensor and stretch = disabled. In any other orientation mod with stretch = disabled, viewport fill all screen and looks perfect.

:bust_in_silhouette: Reply From: purple_mage

does the signal ----> size_changed ( ) can help ? if the size change while rotation you can prolly set the screen to the size you want after the flip . Im looking in this but i cant find ! Viewport — Godot Engine (stable) documentation in English this guy play with the resolution dont know if that help

:bust_in_silhouette: Reply From: Rubycrafter

Solution was found in project settings - rendering - renderer. Rotation works fine with mobile and forward_plus renderers. There is unsolved issue: