Created LoadingSimple Control
Created a simple Loading control to cover other UI controls, when something is loading.
This commit is contained in:
parent
c0825b4c28
commit
59bb3d323d
3 changed files with 34 additions and 0 deletions
16
UI/Controls/loading_simple.gd
Normal file
16
UI/Controls/loading_simple.gd
Normal file
|
|
@ -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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue