19 lines
691 B
GDScript3
Raw Normal View History

2023-12-01 22:26:46 -08:00
extends PanelContainer
func _process(delta):
if visible:
pass
2024-05-28 20:23:39 -07:00
func add_property(title : String, value, order : int): # This can either be called once for a static property or called every frame for a dynamic property
2023-12-01 22:26:46 -08:00
var target
2024-05-28 20:23:39 -07:00
target = $MarginContainer/VBoxContainer.find_child(title, true, false) # I have no idea what true and false does here, the function should be more specific
2023-12-01 22:26:46 -08:00
if !target:
2024-05-28 20:23:39 -07:00
target = Label.new() # Debug lines are of type Label
2023-12-01 22:26:46 -08:00
$MarginContainer/VBoxContainer.add_child(target)
target.name = title
target.text = title + ": " + str(value)
elif visible:
target.text = title + ": " + str(value)
$MarginContainer/VBoxContainer.move_child(target, order)