blob: a1511b84ff78d296fd88dd894bdd99a613fbd926 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
using System.Runtime.InteropServices;
using Godot;
namespace TheLegendOfGustav.GUI;
public partial class Hud : CanvasLayer
{
private TextureProgressBar hpBar;
private TextureProgressBar mpBar;
public override void _Ready()
{
base._Ready();
hpBar = GetNode<TextureProgressBar>("VBoxContainer/InfoBar/Stats/MarginContainer/HBoxContainer/AspectRatioContainer/HPbar");
mpBar = GetNode<TextureProgressBar>("VBoxContainer/InfoBar/Stats/MarginContainer/HBoxContainer/AspectRatioContainer2/MPbar");
}
public void OnHealthChanged(int hp, int maxHp)
{
hpBar.Value = hp;
hpBar.MaxValue = maxHp;
}
public void OnManaChanged(int mp, int maxMp)
{
mpBar.Value = mp;
mpBar.MaxValue = maxMp;
}
}
|