From 0abec8156bd944aa883d544850ee1187219ba943 Mon Sep 17 00:00:00 2001 From: Lucas Fryzek Date: Tue, 17 Sep 2024 22:02:33 +0100 Subject: Initial commit --- addons/fpc/debug.gd | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 addons/fpc/debug.gd (limited to 'addons/fpc/debug.gd') diff --git a/addons/fpc/debug.gd b/addons/fpc/debug.gd new file mode 100644 index 0000000..efdb7a4 --- /dev/null +++ b/addons/fpc/debug.gd @@ -0,0 +1,18 @@ +extends PanelContainer + + +func _process(delta): + if visible: + pass + +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 + var target + target = $MarginContainer/VBoxContainer.find_child(title, true, false) # I have no idea what true and false does here, the function should be more specific + if !target: + target = Label.new() # Debug lines are of type Label + $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) -- cgit