Post Game jam commit
This commit is contained in:
commit
6db2131520
164 changed files with 172524 additions and 0 deletions
22
scripts/debug_ui.gd
Normal file
22
scripts/debug_ui.gd
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
extends Control
|
||||
|
||||
var lines : Array[String] = []
|
||||
|
||||
func _ready() -> void:
|
||||
EventBus.debug_print.connect(_on_debug_print)
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
$Label.text = "FPS: " + str(Engine.get_frames_per_second()) + "\n"
|
||||
for l in lines:
|
||||
$Label.text += l + "\n"
|
||||
|
||||
|
||||
func _on_debug_print(msg : String):
|
||||
lines.append(msg)
|
||||
if len(lines) > 10:
|
||||
lines.pop_front()
|
||||
|
||||
|
||||
func _shortcut_input(event: InputEvent) -> void:
|
||||
if (event.is_action_pressed("debug")):
|
||||
visible = !visible
|
||||
Loading…
Add table
Add a link
Reference in a new issue