From a693358e53f0bdc41a80798cbb5fbbd8a42b69ef Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Fri, 16 Feb 2024 10:29:12 +0100 Subject: [PATCH] Removed label from HUD --- client/player/hud/HUDComponent.gd | 7 ------- client/player/hud/HUDComponent.tscn | 26 ++++++++------------------ 2 files changed, 8 insertions(+), 25 deletions(-) diff --git a/client/player/hud/HUDComponent.gd b/client/player/hud/HUDComponent.gd index f97a9fc..a53e032 100644 --- a/client/player/hud/HUDComponent.gd +++ b/client/player/hud/HUDComponent.gd @@ -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 \ No newline at end of file diff --git a/client/player/hud/HUDComponent.tscn b/client/player/hud/HUDComponent.tscn index 9b94187..73e20e3 100644 --- a/client/player/hud/HUDComponent.tscn +++ b/client/player/hud/HUDComponent.tscn @@ -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