Refactor HUD and MainMenu components to use Node attribute for better scene integration
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
[ext_resource type="PackedScene" uid="uid://bg76mtpcmfm2j" path="res://objects/ui/charging_bar_layer.tscn" id="28_3f5nm"]
|
||||
[ext_resource type="PackedScene" uid="uid://b12tppjkkqpt4" path="res://objects/fxs/hit_particles.tscn" id="28_jh5m0"]
|
||||
[ext_resource type="Script" uid="uid://ceq8n7yw7qxpi" path="res://scripts/components/hit_component.gd" id="29_jh5m0"]
|
||||
[ext_resource type="Script" uid="uid://c1wtrgw0x77xo" path="res://scripts/components/platform_movement.gd" id="31_xoue7"]
|
||||
[ext_resource type="Script" uid="uid://cflncpa377l8l" path="res://scripts/components/platform_movement.gd" id="31_xoue7"]
|
||||
[ext_resource type="AudioStream" uid="uid://dyev46uqusimi" path="res://sfx/shoot.wav" id="32_x2b7c"]
|
||||
[ext_resource type="Script" uid="uid://d1ctdx52gskv1" path="res://scripts/components/ship_shooter.gd" id="34_gwc8i"]
|
||||
[ext_resource type="PackedScene" uid="uid://dtem8jgcyoqar" path="res://objects/entities/green_laser.tscn" id="36_oxudy"]
|
||||
|
@@ -62,9 +62,6 @@ process_material = SubResource("ParticleProcessMaterial_lgb3u")
|
||||
|
||||
[node name="UI Layer" parent="." instance=ExtResource("2_lbnsn")]
|
||||
|
||||
[node name="HUD" parent="UI Layer" index="0" node_paths=PackedStringArray("player_health")]
|
||||
player_health = NodePath("../../Brick Player/HealthComponent")
|
||||
|
||||
[node name="DeathScreen" parent="UI Layer" index="1" node_paths=PackedStringArray("nodes_to_disable")]
|
||||
current_level = ExtResource("4_c2yv5")
|
||||
nodes_to_disable = [NodePath("../../Brick Player")]
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=11 format=3 uid="uid://6foggu31cu14"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://byxf45ukq82pe" path="res://objects/ui/hud.tscn" id="1_tgtfe"]
|
||||
[ext_resource type="PackedScene" uid="uid://byxf45ukq82pe" path="res://features/ui/hud/hud.tscn" id="1_tgtfe"]
|
||||
[ext_resource type="PackedScene" uid="uid://dulkm3ah4tm0u" path="res://objects/ui/death_screen.tscn" id="2_ln68j"]
|
||||
[ext_resource type="Script" uid="uid://cp68km8bykymb" path="res://scripts/resources/level_resource.gd" id="3_5kt5k"]
|
||||
[ext_resource type="PackedScene" uid="uid://wmw6gaisyrvx" path="res://objects/ui/game_over_screen.tscn" id="4_11xmk"]
|
||||
|
@@ -1,86 +0,0 @@
|
||||
[gd_scene load_steps=8 format=3 uid="uid://byxf45ukq82pe"]
|
||||
|
||||
[ext_resource type="LabelSettings" uid="uid://rvn5ivivfvv6" path="res://resources/ui/hud_label_settings.tres" id="1_4dsh5"]
|
||||
[ext_resource type="Script" uid="uid://c3pde84b3kdco" path="res://scripts/ui/hud.gd" id="1_ueofj"]
|
||||
[ext_resource type="FontFile" uid="uid://xm0vbusjr7b7" path="res://fonts/PressStart2P-Regular.ttf" id="1_ygmwt"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_mmcdi"]
|
||||
bg_color = Color(0, 0, 0, 1)
|
||||
|
||||
[sub_resource type="Theme" id="Theme_auu2b"]
|
||||
default_font = ExtResource("1_ygmwt")
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_sp6hg"]
|
||||
bg_color = Color(0.47451, 0.47451, 0.47451, 1)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_22dp1"]
|
||||
bg_color = Color(0.858824, 0.254902, 0.380392, 1)
|
||||
|
||||
[node name="HUD" type="Control" node_paths=PackedStringArray("coins_label", "health_progressbar", "lives_label")]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 4
|
||||
script = ExtResource("1_ueofj")
|
||||
coins_label = NodePath("PanelContainer/MarginContainer/HBoxContainer/Coins label")
|
||||
health_progressbar = NodePath("PanelContainer/MarginContainer/HBoxContainer/ProgressBar")
|
||||
lives_label = NodePath("PanelContainer/MarginContainer/HBoxContainer/Lives")
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 10
|
||||
anchor_right = 1.0
|
||||
offset_bottom = 16.0
|
||||
grow_horizontal = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_mmcdi")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="PanelContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 8
|
||||
theme_override_constants/margin_top = 8
|
||||
theme_override_constants/margin_right = 8
|
||||
theme_override_constants/margin_bottom = 8
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 8
|
||||
alignment = 1
|
||||
|
||||
[node name="Health Label" type="Label" parent="PanelContainer/MarginContainer/HBoxContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "HEALTH_LABEL"
|
||||
label_settings = ExtResource("1_4dsh5")
|
||||
uppercase = true
|
||||
|
||||
[node name="ProgressBar" type="ProgressBar" parent="PanelContainer/MarginContainer/HBoxContainer"]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
theme = SubResource("Theme_auu2b")
|
||||
theme_override_styles/background = SubResource("StyleBoxFlat_sp6hg")
|
||||
theme_override_styles/fill = SubResource("StyleBoxFlat_22dp1")
|
||||
step = 0.1
|
||||
value = 60.0
|
||||
show_percentage = false
|
||||
|
||||
[node name="Lives" type="Label" parent="PanelContainer/MarginContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "LIVES_LABEL"
|
||||
label_settings = ExtResource("1_4dsh5")
|
||||
horizontal_alignment = 1
|
||||
uppercase = true
|
||||
|
||||
[node name="Coins label" type="Label" parent="PanelContainer/MarginContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "COINS_LABEL"
|
||||
label_settings = ExtResource("1_4dsh5")
|
||||
horizontal_alignment = 1
|
||||
uppercase = true
|
Reference in New Issue
Block a user