Godot Version
4.5.1
Question
I tried to set the window size to match the safe area rect at runtime, like this:
func _ready() -> void:
var safe_area_rect = DisplayServer.get_display_safe_area()
get_window().size = safe_area_rect.size
get_window().position = safe_area_rect.position
but it didn’t work on my iPhone, the size looks still 720*720:
These are my project settings:
- viewport size: 720*720
- window mode: Windowed
- stretch mode: canvas_items
- stretch_aspect: keep