AltParty2024/scripts/auto_scale.gd
2024-10-11 16:31:12 +03:00

14 lines
402 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:
(get_parent() as SubViewport).size = get_tree().get_root().get_viewport().size;