diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2024-11-06 21:00:56 +0100 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2024-11-06 21:00:56 +0100 |
commit | f20b3a48a14f34def41d823fabb476981ef7055e (patch) | |
tree | 35608bd22ff3ec8d9210747df39186d212aa6ab7 /UI | |
parent | 6f17d6c1d458275e8744d57a7f433cc3eb5434d7 (diff) |
next commit
Diffstat (limited to 'UI')
-rw-r--r-- | UI/ContainContainer.tscn | 6 | ||||
-rw-r--r-- | UI/contain_container.gd | 10 |
2 files changed, 16 insertions, 0 deletions
diff --git a/UI/ContainContainer.tscn b/UI/ContainContainer.tscn new file mode 100644 index 0000000..d9120ed --- /dev/null +++ b/UI/ContainContainer.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=3 uid="uid://pchnqnutfth7"] + +[ext_resource type="Script" path="res://UI/contain_container.gd" id="1_oswre"] + +[node name="ContainContainer" type="Container"] +script = ExtResource("1_oswre") diff --git a/UI/contain_container.gd b/UI/contain_container.gd new file mode 100644 index 0000000..df6e3a8 --- /dev/null +++ b/UI/contain_container.gd @@ -0,0 +1,10 @@ +@tool +class_name ContainContainer +extends Container + + +func _notification(what: int) -> void: + if what == NOTIFICATION_SORT_CHILDREN: + for child in get_children(): + if child is Control: + fit_child_in_rect(child, Rect2(Vector2.ZERO, size)) |