This commit is contained in:
saarsena@gmail.com 2026-04-16 21:04:50 -04:00
commit e45f121fb9
89 changed files with 336069 additions and 0 deletions

View file

@ -0,0 +1,18 @@
extends CanvasLayer
# Cheap FPS + stats overlay. Attach as a child of any scene.
# The parent scene can call set_subtitle(text) to add a line below the FPS.
@onready var label: Label = $Label
var _subtitle := ""
func set_subtitle(text: String) -> void:
_subtitle = text
func _process(_delta: float) -> void:
var fps := Engine.get_frames_per_second()
var frame_ms := 0.0 if fps <= 0 else 1000.0 / fps
var txt := "FPS: %d %.2f ms" % [fps, frame_ms]
if _subtitle != "":
txt += "\n" + _subtitle
label.text = txt