AltParty2024/scripts/auto_scale.gd

14 lines
402 B
GDScript3
Raw Permalink Normal View History

2024-10-08 15:50:32 +03:00
# THIS SCRIPT WILL BE ADDED AS PART OF MiniDemoTools soon
extends Node
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
(get_parent() as SubViewport).size = get_tree().get_root().get_viewport().size;
get_tree().get_root().size_changed.connect(resize)
func resize() -> void:
(get_parent() as SubViewport).size = get_tree().get_root().get_viewport().size;