18 lines
324 B
GDScript
18 lines
324 B
GDScript
extends CanvasLayer
|
|
|
|
@onready var text = $RichTextLabel
|
|
@onready var timer = $Timer
|
|
|
|
func _ready() -> void:
|
|
visible = false
|
|
|
|
func _on_timer_timeout() -> void:
|
|
text.clear()
|
|
text.add_text("FPS: %s" % Engine.get_frames_per_second())
|
|
|
|
func _on_visibility_changed() -> void:
|
|
if visible:
|
|
timer.start()
|
|
else:
|
|
timer.stop()
|