Add HUD presenter component and player HUD scene for health and ammo display
This commit is contained in:
46
Objects/UI/player_hud.tscn
Normal file
46
Objects/UI/player_hud.tscn
Normal file
@@ -0,0 +1,46 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://b36xmciamjyc0"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c6nouigv5wsu1" path="res://Code/Presenters/HudPresenterComponent.cs" id="1_yd76s"]
|
||||
|
||||
[node name="PlayerHUD" type="Control" node_paths=PackedStringArray("_healthLabel", "_ammoLabel", "_weaponLabel")]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_yd76s")
|
||||
_healthLabel = NodePath("MarginContainer/HBoxContainer/HealthLabel")
|
||||
_ammoLabel = NodePath("MarginContainer/HBoxContainer/AmmoLabel")
|
||||
_weaponLabel = NodePath("MarginContainer/HBoxContainer/WeaponLabel")
|
||||
metadata/_custom_type_script = "uid://c6nouigv5wsu1"
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 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="MarginContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HealthLabel" type="Label" parent="MarginContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "health 100"
|
||||
uppercase = true
|
||||
|
||||
[node name="AmmoLabel" type="Label" parent="MarginContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "ammo 100"
|
||||
uppercase = true
|
||||
|
||||
[node name="WeaponLabel" type="Label" parent="MarginContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "gun"
|
||||
uppercase = true
|
||||
Reference in New Issue
Block a user