From fd406c55d05f172589b4cf14377d7cc568e5d2b7 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Sat, 1 Aug 2020 16:49:06 +0300 Subject: Allow disabling debug --- scripts/GUI.gd | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts') 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) -- cgit v1.3