Add HUD component and update player state management for lives
This commit is contained in:
78
objects/hud.tscn
Normal file
78
objects/hud.tscn
Normal file
@@ -0,0 +1,78 @@
|
||||
[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" path="res://scripts/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_aa3sf"]
|
||||
bg_color = Color(0, 0, 0, 1)
|
||||
corner_detail = 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("Panel/PanelContainer/Coins label")
|
||||
health_progressbar = NodePath("Panel/PanelContainer/ProgressBar")
|
||||
lives_label = NodePath("Panel/PanelContainer/Lives")
|
||||
|
||||
[node name="Panel" type="Panel" parent="."]
|
||||
custom_minimum_size = Vector2(0, 16)
|
||||
layout_mode = 1
|
||||
anchors_preset = 10
|
||||
anchor_right = 1.0
|
||||
offset_bottom = 16.0
|
||||
grow_horizontal = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_aa3sf")
|
||||
|
||||
[node name="PanelContainer" type="HBoxContainer" parent="Panel"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 10
|
||||
anchor_right = 1.0
|
||||
offset_bottom = 16.0
|
||||
grow_horizontal = 2
|
||||
theme_override_constants/separation = 10
|
||||
|
||||
[node name="Health Label" type="Label" parent="Panel/PanelContainer"]
|
||||
layout_mode = 2
|
||||
text = "Health"
|
||||
label_settings = ExtResource("1_4dsh5")
|
||||
uppercase = true
|
||||
|
||||
[node name="ProgressBar" type="ProgressBar" parent="Panel/PanelContainer"]
|
||||
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="Panel/PanelContainer"]
|
||||
layout_mode = 2
|
||||
text = "Lives 3"
|
||||
label_settings = ExtResource("1_4dsh5")
|
||||
uppercase = true
|
||||
|
||||
[node name="Coins label" type="Label" parent="Panel/PanelContainer"]
|
||||
layout_mode = 2
|
||||
text = "Coins 33"
|
||||
label_settings = ExtResource("1_4dsh5")
|
||||
uppercase = true
|
Reference in New Issue
Block a user