summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Tuomi <jan.tuomi@valuemotive.com>2020-08-01 16:49:06 +0300
committerJan Tuomi <jan.tuomi@valuemotive.com>2020-08-01 16:49:06 +0300
commitfd406c55d05f172589b4cf14377d7cc568e5d2b7 (patch)
treee3756bfecf8f611945fc1d26377e7e112934e44d
parent9dfb7f8037be735d5e5f88fb47ae07d98dc39274 (diff)
Allow disabling debug
-rw-r--r--scenes/GUI.tscn2
-rw-r--r--scripts/GUI.gd6
2 files changed, 5 insertions, 3 deletions
diff --git a/scenes/GUI.tscn b/scenes/GUI.tscn
index 8a328c8..6434d81 100644
--- a/scenes/GUI.tscn
+++ b/scenes/GUI.tscn
@@ -17,6 +17,6 @@ __meta__ = {
margin_right = 984.0
margin_bottom = 14.0
-[node name="Label" type="Label" parent="VBoxContainer"]
+[node name="DebugLabel" type="Label" parent="VBoxContainer"]
margin_right = 984.0
margin_bottom = 14.0
diff --git a/scripts/GUI.gd b/scripts/GUI.gd
index 1e0a781..90a84bb 100644
--- a/scripts/GUI.gd
+++ b/scripts/GUI.gd
@@ -1,5 +1,7 @@
extends MarginContainer
class_name GUI
+export (bool) var show_debug = true
+onready var debug_label = $VBoxContainer/DebugLabel
# Declare member variables here. Examples:
# var a = 2
@@ -8,11 +10,11 @@ class_name GUI
# Called when the node enters the scene tree for the first time.
func _ready():
- pass # Replace with function body.
+ debug_label.set_visible(show_debug)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(_delta):
pass
func set_debug_text(text: String):
- $VBoxContainer/Label.set_text(text)
+ debug_label.set_text(text)