Files
hotdesking/Gameplay/ManagerPanel.cs
2025-07-28 23:39:40 -04:00

37 lines
862 B
C#

using Godot;
using System;
public partial class ManagerPanel : Panel
{
public bool _hovered = false;
public void SetPosition(Vector2 POSITION)
{
Position = POSITION;
}
public void SetSprite(string PATH)
{
GetNode<Sprite2D>("Image").Texture = GD.Load<Texture2D>(PATH);
}
public void SetValue(int VALUE)
{
GetNode<Control>("Health").GetNode<RichTextLabel>("Value").Text = VALUE.ToString();
GetNode<Control>("Health").GetNode<ProgressBar>("Bar").Value = VALUE;
}
public void SetMax(int MAX)
{
GetNode<Control>("Health").GetNode<RichTextLabel>("Max").Text = MAX.ToString();
GetNode<Control>("Health").GetNode<ProgressBar>("Bar").MaxValue = MAX;
}
private void OnMouseEntered()
{
_hovered = true;
}
private void OnMouseExited()
{
_hovered = false;
}
}