mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-07-13 02:53:48 +00:00
refactor(*): Make hud more performant and maintainable
This commit is contained in:
+2
-70
@@ -1,6 +1,7 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://p07epxnh8wwp"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dyq1n7q1bqjps" path="res://scripts/ship.gd" id="1_efag7"]
|
||||
[ext_resource type="PackedScene" uid="uid://c8kak2l3m4n5" path="res://scenes/HUD.tscn" id="2_hud_scene"]
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_efag7"]
|
||||
size = Vector3(1, 1, 4)
|
||||
@@ -8,9 +9,6 @@ size = Vector3(1, 1, 4)
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_dsjou"]
|
||||
size = Vector3(1, 1, 4)
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_efag7"]
|
||||
font_size = 32
|
||||
|
||||
[node name="Ship" type="RigidBody3D"]
|
||||
mass = 10.0
|
||||
gravity_scale = 10.0
|
||||
@@ -25,70 +23,4 @@ shape = SubResource("BoxShape3D_dsjou")
|
||||
[node name="Camera3D" type="Camera3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.867366, 0.497671, 0, -0.497671, 0.867366, 0, 2.04336, 3.31556)
|
||||
|
||||
[node name="HUD" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="Control" type="Control" parent="HUD"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="TimerLabel" type="Label" parent="HUD/Control"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 5
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
offset_left = -90.5
|
||||
offset_right = 90.5
|
||||
offset_bottom = 62.0
|
||||
grow_horizontal = 2
|
||||
label_settings = SubResource("LabelSettings_efag7")
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="InfoPanel" type="VBoxContainer" parent="HUD/Control"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 2
|
||||
anchor_top = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 10.0
|
||||
offset_top = -200.0
|
||||
offset_right = 300.0
|
||||
offset_bottom = -10.0
|
||||
grow_vertical = 0
|
||||
|
||||
[node name="SpeedLabel" type="Label" parent="HUD/Control/InfoPanel"]
|
||||
layout_mode = 2
|
||||
text = "Speed: 0.0 m/s"
|
||||
label_settings = SubResource("LabelSettings_efag7")
|
||||
|
||||
[node name="AltitudeLabel" type="Label" parent="HUD/Control/InfoPanel"]
|
||||
layout_mode = 2
|
||||
text = "Altitude: 0.0 m"
|
||||
label_settings = SubResource("LabelSettings_efag7")
|
||||
|
||||
[node name="AngularVelLabel" type="Label" parent="HUD/Control/InfoPanel"]
|
||||
layout_mode = 2
|
||||
text = "Angular Vel: 0.0 rad/s"
|
||||
label_settings = SubResource("LabelSettings_efag7")
|
||||
|
||||
[node name="CameraModeLabel" type="Label" parent="HUD/Control/InfoPanel"]
|
||||
layout_mode = 2
|
||||
text = "Camera: Ball Cam"
|
||||
label_settings = SubResource("LabelSettings_efag7")
|
||||
|
||||
[node name="AttitudeLabel" type="Label" parent="HUD/Control/InfoPanel"]
|
||||
layout_mode = 2
|
||||
text = "Pitch: 0° Roll: 0°"
|
||||
label_settings = SubResource("LabelSettings_efag7")
|
||||
|
||||
[node name="HeadingLabel" type="Label" parent="HUD/Control/InfoPanel"]
|
||||
layout_mode = 2
|
||||
text = "Heading: 0°"
|
||||
label_settings = SubResource("LabelSettings_efag7")
|
||||
|
||||
[node name="ThrustLabel" type="Label" parent="HUD/Control/InfoPanel"]
|
||||
layout_mode = 2
|
||||
text = "Thrust: 0%"
|
||||
label_settings = SubResource("LabelSettings_efag7")
|
||||
[node name="HUD" parent="." instance=ExtResource("2_hud_scene")]
|
||||
|
||||
Reference in New Issue
Block a user