From 59bb3d323de00fe20be6958a7df69de5d06c854d Mon Sep 17 00:00:00 2001 From: Mario Steele Date: Sun, 8 Mar 2026 13:23:11 -0500 Subject: [PATCH] Created LoadingSimple Control Created a simple Loading control to cover other UI controls, when something is loading. --- UI/Controls/loading_simple.gd | 16 ++++++++++++++++ UI/Controls/loading_simple.gd.uid | 1 + UI/Controls/loading_simple.tscn | 17 +++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 UI/Controls/loading_simple.gd create mode 100644 UI/Controls/loading_simple.gd.uid create mode 100644 UI/Controls/loading_simple.tscn diff --git a/UI/Controls/loading_simple.gd b/UI/Controls/loading_simple.gd new file mode 100644 index 00000000..515b5d0d --- /dev/null +++ b/UI/Controls/loading_simple.gd @@ -0,0 +1,16 @@ +@tool +extends PanelContainer + +@export var rotation_speed: float = 1.0 + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + visibility_changed.connect(_on_visibility_changed) + +func _on_visibility_changed() -> void: + set_process(is_visible_in_tree()) + + +func _process(d: float) -> void: + %Spinner.rotation += d * TAU * rotation_speed + %Spinner.rotation = wrapf(%Spinner.rotation, 0, TAU) diff --git a/UI/Controls/loading_simple.gd.uid b/UI/Controls/loading_simple.gd.uid new file mode 100644 index 00000000..8b14aa42 --- /dev/null +++ b/UI/Controls/loading_simple.gd.uid @@ -0,0 +1 @@ +uid://bkhjets1gnsk2 diff --git a/UI/Controls/loading_simple.tscn b/UI/Controls/loading_simple.tscn new file mode 100644 index 00000000..7a5c3af6 --- /dev/null +++ b/UI/Controls/loading_simple.tscn @@ -0,0 +1,17 @@ +[gd_scene format=3 uid="uid://cbr5aed24dvty"] + +[ext_resource type="Script" uid="uid://bkhjets1gnsk2" path="res://UI/Controls/loading_simple.gd" id="1_86jie"] +[ext_resource type="Texture2D" uid="uid://btyra86eut5se" path="res://UI/assets/loading.png" id="1_iuxiu"] + +[node name="LoadingSimple" type="PanelContainer" unique_id=814067408] +script = ExtResource("1_86jie") + +[node name="CenterContainer" type="CenterContainer" parent="." unique_id=897030486] +layout_mode = 2 + +[node name="Pin" type="Control" parent="CenterContainer" unique_id=1268794672] +layout_mode = 2 + +[node name="Spinner" type="Sprite2D" parent="CenterContainer/Pin" unique_id=903875911] +unique_name_in_owner = true +texture = ExtResource("1_iuxiu")