From cac44eadc78efe6dff5d9239d215662a9ed068e6 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Sat, 17 Feb 2024 18:32:32 +0100 Subject: [PATCH] Demo: Init scaling and base resolution --- demo/demo/scenes/base/toggle_fullscreen.gd | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/demo/demo/scenes/base/toggle_fullscreen.gd b/demo/demo/scenes/base/toggle_fullscreen.gd index 47559e9..172889a 100644 --- a/demo/demo/scenes/base/toggle_fullscreen.gd +++ b/demo/demo/scenes/base/toggle_fullscreen.gd @@ -4,9 +4,15 @@ extends Button func _ready() -> void: pressed.connect(_toggle_fullscreen) + # Set scaling properties and base resolution + get_window().mode = Window.MODE_FULLSCREEN + get_window().content_scale_aspect = Window.CONTENT_SCALE_ASPECT_KEEP + get_window().content_scale_mode = Window.CONTENT_SCALE_MODE_CANVAS_ITEMS + get_window().content_scale_size = Vector2i(1920,1080) + func _toggle_fullscreen() -> void: if get_window().mode != Window.MODE_FULLSCREEN: get_window().mode = Window.MODE_FULLSCREEN else: - get_window().mode = Window.MODE_WINDOWED + get_window().mode = Window.MODE_MAXIMIZED