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

66
Scenes/GUI/DebugMenu.tscn Normal file
View file

@ -0,0 +1,66 @@
[gd_scene load_steps=2 format=3 uid="uid://fjveglbs1vfv"]
[ext_resource type="Script" uid="uid://724u7h4bui7r" path="res://Scripts/DebugMenu.gd" id="1_gqrkn"]
[node name="DebugMenu" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_gqrkn")
[node name="FPSLabel" type="Label" parent="."]
layout_mode = 0
offset_left = 8.0
offset_top = 8.0
offset_right = 53.0
offset_bottom = 40.0
text = "FPS: 0"
vertical_alignment = 1
[node name="PositionLabel" type="Label" parent="."]
layout_mode = 0
offset_left = 8.0
offset_top = 44.0
offset_right = 175.0
offset_bottom = 76.0
text = "X: 0.00, Y: 0.00, Z: 0.00"
vertical_alignment = 1
[node name="AngleLabel" type="Label" parent="."]
offset_left = 8.0
offset_top = 80.0
offset_right = 175.0
offset_bottom = 112.0
text = "Pitch: 0.00, Yaw: 0.00"
vertical_alignment = 1
[node name="VersionLabel" type="Label" parent="."]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -203.0
offset_top = 8.0
offset_right = -8.0
offset_bottom = 40.0
grow_horizontal = 0
text = "Pneumatic Plaything v0.0"
horizontal_alignment = 2
vertical_alignment = 1
[node name="PlatformLabel" type="Label" parent="."]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -203.0
offset_top = 44.0
offset_right = -8.0
offset_bottom = 76.0
grow_horizontal = 0
text = "this is placeholder text!!!!!!!"
horizontal_alignment = 2
vertical_alignment = 1

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.visible = true
$InGameMenu/Buttons/ReturnButton.grab_focus() $InGameMenu/Buttons/ReturnButton.grab_focus()
pass pass
elif event.is_action_pressed(&"freeroam_debug_menu"):
$DebugMenu.visible = !$DebugMenu.visible
func _physics_process(delta: float) -> void: func _physics_process(delta: float) -> void:
if (interact): 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="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://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"] [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_3rsb5"]
radius = 0.3 radius = 0.3
@ -27,5 +28,9 @@ spot_range = 1000.0
spot_angle = 30.0 spot_angle = 30.0
spot_angle_attenuation = 0.25 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")] [node name="InGameMenu" parent="." instance=ExtResource("2_0s4r2")]
visible = false visible = false

View file

@ -513,6 +513,11 @@ freeroam_open_curtains={
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":67,"key_label":0,"unicode":99,"location":0,"echo":false,"script":null) "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":67,"key_label":0,"unicode":99,"location":0,"echo":false,"script":null)
] ]
} }
freeroam_debug_menu={
"deadzone": 0.2,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194334,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
]
}
[rendering] [rendering]