AltParty2024/scripts/auto_scale.gd

16 lines
470 B
GDScript

# 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:
print("changed")
print(get_tree().get_root().get_viewport().size)
(get_parent() as SubViewport).size = get_tree().get_root().get_viewport().size;