bullet counter
This commit is contained in:
parent
3f2b7e3bd3
commit
5f732e1e6f
7 changed files with 30 additions and 2 deletions
|
|
@ -3,7 +3,12 @@ extends CanvasLayer
|
|||
|
||||
@export_group("Internal References")
|
||||
@export var _fps_counter: Label
|
||||
@export var _bullet_counter: Label
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if not visible:
|
||||
return
|
||||
|
||||
_fps_counter.text = str(Engine.get_frames_per_second())
|
||||
_bullet_counter.text = str(get_tree().get_node_count_in_group(&"bullets"))
|
||||
|
|
|
|||
|
|
@ -2,10 +2,11 @@
|
|||
|
||||
[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")]
|
||||
[node name="DebugOverlay" type="CanvasLayer" node_paths=PackedStringArray("_fps_counter", "_bullet_counter")]
|
||||
layer = 1000
|
||||
script = ExtResource("1_7e5kj")
|
||||
_fps_counter = NodePath("VBoxContainer/FPS/FPSCounter")
|
||||
_bullet_counter = NodePath("VBoxContainer/Bullets/BulletCount")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
|
||||
|
|
@ -18,3 +19,13 @@ text = "FPS:"
|
|||
|
||||
[node name="FPSCounter" type="Label" parent="VBoxContainer/FPS"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Bullets" type="HBoxContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="VBoxContainer/Bullets"]
|
||||
layout_mode = 2
|
||||
text = "Total Bullets"
|
||||
|
||||
[node name="BulletCount" type="Label" parent="VBoxContainer/Bullets"]
|
||||
layout_mode = 2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue