summaryrefslogtreecommitdiff
path: root/scripts/GUI/Hud.cs
blob: 11497284afa76a4378bbb5ebd8c6b7ef7344c6cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using Godot;

namespace TheLegendOfGustav.GUI;

public partial class Hud : Node
{
	private TextureProgressBar HpBar { get; set; }

	public override void _Ready()
	{
		base._Ready();
		HpBar = GetNode<TextureProgressBar>("VBoxContainer/InfoBar/Stats/MarginContainer/HBoxContainer/AspectRatioContainer/HPbar");
	}

	public void OnHealthChanged(int hp, int maxHp)
	{
		HpBar.Value = hp;
		HpBar.MaxValue = maxHp;
	}
}