diff options
| author | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-09-01 17:50:25 -0300 |
|---|---|---|
| committer | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-09-01 17:50:25 -0300 |
| commit | 0456e7cd82b232a38fd9b6e008be7d49b2f9e90f (patch) | |
| tree | ea2285eaca0d68c269d07212bc6a1e3688b9aef8 /scripts/GUI/Hud.cs | |
| parent | d7d2454d5ccc1e0acb47cb679c7550e74c4e1916 (diff) | |
Logs
Diffstat (limited to 'scripts/GUI/Hud.cs')
| -rw-r--r-- | scripts/GUI/Hud.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/GUI/Hud.cs b/scripts/GUI/Hud.cs new file mode 100644 index 0000000..5f49121 --- /dev/null +++ b/scripts/GUI/Hud.cs @@ -0,0 +1,17 @@ +using Godot; +using System; + +public partial class Hud : Node +{ + private TextureProgressBar hpBar; + + public override void _Ready() { + base._Ready(); + hpBar = GetNode<TextureProgressBar>("InfoBar/Stats/MarginContainer/HBoxContainer/HPbar"); + } + + public void OnHealthChanged(int hp, int maxHp) { + hpBar.Value = hp; + hpBar.MaxValue = maxHp; + } +} |
