fps counter
This commit is contained in:
parent
3607ca7e2e
commit
3f2b7e3bd3
4 changed files with 31 additions and 0 deletions
9
globals/debug_overlay.gd
Normal file
9
globals/debug_overlay.gd
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
extends CanvasLayer
|
||||
|
||||
|
||||
@export_group("Internal References")
|
||||
@export var _fps_counter: Label
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
_fps_counter.text = str(Engine.get_frames_per_second())
|
||||
1
globals/debug_overlay.gd.uid
Normal file
1
globals/debug_overlay.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://dvn62r3oriwu8
|
||||
20
globals/debug_overlay.tscn
Normal file
20
globals/debug_overlay.tscn
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://buvye1rl1faon"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dvn62r3oriwu8" path="res://globals/debug_overlay.gd" id="1_7e5kj"]
|
||||
|
||||
[node name="DebugOverlay" type="CanvasLayer" node_paths=PackedStringArray("_fps_counter")]
|
||||
layer = 1000
|
||||
script = ExtResource("1_7e5kj")
|
||||
_fps_counter = NodePath("VBoxContainer/FPS/FPSCounter")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
|
||||
[node name="FPS" type="HBoxContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="VBoxContainer/FPS"]
|
||||
layout_mode = 2
|
||||
text = "FPS:"
|
||||
|
||||
[node name="FPSCounter" type="Label" parent="VBoxContainer/FPS"]
|
||||
layout_mode = 2
|
||||
|
|
@ -20,6 +20,7 @@ config/icon="res://icon.svg"
|
|||
Background="*res://globals/background.tscn"
|
||||
Display="*res://globals/display.tscn"
|
||||
SceneStack="*res://globals/scene_stack.gd"
|
||||
DebugOverlay="*res://globals/debug_overlay.tscn"
|
||||
|
||||
[display]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue