feat: Change player stamina ControlLabel to a ControlRect

This commit is contained in:
Dendy 2026-03-05 13:23:34 +01:00
parent ef014bdd07
commit 8d0ca1a769
2 changed files with 4 additions and 5 deletions

View File

@ -26,7 +26,7 @@ func _process(delta: float) -> void:
if $FailControl.visible:
return
$HUD/StaminaLabel.text = str(int(stamina))
$HUD/StaminaRect.scale.x = stamina / max_stamina
var time_left = int($TimeLimit.time_left)
@warning_ignore("integer_division")

View File

@ -47,6 +47,7 @@ wait_time = 10.0
one_shot = true
[node name="FailControl" type="Control" parent="." unique_id=640174831]
visible = false
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
@ -99,7 +100,6 @@ grow_vertical = 2
text = "Reiniciar"
[node name="HUD" type="Control" parent="." unique_id=1781259393]
visible = false
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
@ -116,14 +116,13 @@ offset_bottom = 33.0
theme_override_colors/font_color = Color(0, 0, 0, 1)
text = "XX:XX"
[node name="StaminaLabel" type="Label" parent="HUD" unique_id=762689230]
[node name="StaminaRect" type="ColorRect" parent="HUD" unique_id=706658940]
layout_mode = 0
offset_left = 10.0
offset_top = 41.0
offset_right = 110.0
offset_bottom = 64.0
theme_override_colors/font_color = Color(0.83137256, 0, 0.18039216, 1)
text = "Stamina"
color = Color(0.8197299, 0.0039063096, 0.18416114, 1)
[node name="Hurtbox" type="Area3D" parent="." unique_id=2004081669]