add debug screen

This commit is contained in:
Persephone Bubblegum-Holiday 2025-08-05 22:03:14 -07:00
parent d9c92ccb98
commit 156757d6e4
6 changed files with 93 additions and 1 deletions

13
Scripts/DebugMenu.gd Normal file
View file

@ -0,0 +1,13 @@
extends Control
func _ready() -> void:
$VersionLabel.text = "Pneumatic Plaything v%s" % ProjectSettings.get_setting("application/config/version")
$PlatformLabel.text = "%s %s %s" % [OS.get_name(), OS.get_version(), Engine.get_architecture_name()]
func _process(_delta: float) -> void:
if (visible):
$FPSLabel.text = "FPS: %.0f" % Engine.get_frames_per_second()
var pos = get_node("../").position
var angle = get_node("../Camera").rotation_degrees
$PositionLabel.text = "X: %.2f, Y: %.2f, Z: %.2f" % [ pos.x, pos.y, pos.z ]
$AngleLabel.text = "Pitch: %.2f, Yaw: %.2f" % [ angle.x, angle.y ]

1
Scripts/DebugMenu.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://724u7h4bui7r

View file

@ -55,6 +55,8 @@ func _unhandled_input(event: InputEvent) -> void:
$InGameMenu.visible = true
$InGameMenu/Buttons/ReturnButton.grab_focus()
pass
elif event.is_action_pressed(&"freeroam_debug_menu"):
$DebugMenu.visible = !$DebugMenu.visible
func _physics_process(delta: float) -> void:
if (interact):

View file

@ -1,7 +1,8 @@
[gd_scene load_steps=4 format=3 uid="uid://cdk6hwb4hi2wc"]
[gd_scene load_steps=5 format=3 uid="uid://cdk6hwb4hi2wc"]
[ext_resource type="Script" uid="uid://b0c02p6ckmpdq" path="res://Scripts/Player/player.gd" id="1_2f8j2"]
[ext_resource type="PackedScene" uid="uid://cd67bfok34xhy" path="res://Scenes/GUI/InGameMenu.tscn" id="2_0s4r2"]
[ext_resource type="PackedScene" uid="uid://fjveglbs1vfv" path="res://Scenes/GUI/DebugMenu.tscn" id="3_ejydr"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_3rsb5"]
radius = 0.3
@ -27,5 +28,9 @@ spot_range = 1000.0
spot_angle = 30.0
spot_angle_attenuation = 0.25
[node name="DebugMenu" parent="." instance=ExtResource("3_ejydr")]
visible = false
mouse_filter = 2
[node name="InGameMenu" parent="." instance=ExtResource("2_0s4r2")]
visible = false