Removed label from HUD

This commit is contained in:
Eduard Urbach 2024-02-16 10:29:12 +01:00
parent dc0845cc71
commit a693358e53
Signed by: akyoto
GPG Key ID: C874F672B1AF20C0
2 changed files with 8 additions and 25 deletions

View File

@ -5,10 +5,3 @@ extends Sprite3D
func _ready():
texture = $SubViewport.get_texture()
update_name(owner.name)
if owner.has_signal("name_changed"):
owner.name_changed.connect(update_name)
func update_name(new_name: String):
%Label.text = new_name

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=7 format=3 uid="uid://6jpnl6c4fdvo"]
[gd_scene load_steps=6 format=3 uid="uid://6jpnl6c4fdvo"]
[ext_resource type="Script" path="res://player/hud/HUDComponent.gd" id="1_vynft"]
[ext_resource type="Texture2D" uid="uid://d2rig4p2dfy30" path="res://assets/ui/bar-green.png" id="2_ad7qf"]
@ -6,10 +6,6 @@
[ext_resource type="Texture2D" uid="uid://deopmcycal0aq" path="res://assets/ui/bar-yellow.png" id="4_5dl20"]
[ext_resource type="Texture2D" uid="uid://cjg6cgv6hvnd" path="res://assets/ui/bar-red.png" id="5_3x8xp"]
[sub_resource type="LabelSettings" id="LabelSettings_y8qrs"]
font_size = 32
shadow_color = Color(0, 0, 0, 1)
[node name="HUD" type="Sprite3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.83994, 0)
pixel_size = 0.003
@ -20,20 +16,14 @@ script = ExtResource("1_vynft")
[node name="SubViewport" type="SubViewport" parent="."]
disable_3d = true
transparent_bg = true
size = Vector2i(200, 70)
size = Vector2i(200, 26)
[node name="VBoxContainer" type="VBoxContainer" parent="SubViewport"]
offset_right = 40.0
offset_bottom = 40.0
[node name="Label" type="Label" parent="SubViewport/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
label_settings = SubResource("LabelSettings_y8qrs")
uppercase = true
[node name="HealthBar" type="TextureProgressBar" parent="SubViewport/VBoxContainer"]
layout_mode = 2
[node name="HealthBar" type="TextureProgressBar" parent="SubViewport"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
max_value = 1.0
step = 0.0
value = 1.0