38 lines
905 B
C#
38 lines
905 B
C#
using Godot;
|
|
using System;
|
|
|
|
public partial class ManagerPanel : Panel
|
|
{
|
|
public bool _hovered = false;
|
|
public int _returnCount = 0;
|
|
|
|
public void SetPosition(Vector2 POSITION)
|
|
{
|
|
Position = POSITION;
|
|
}
|
|
public void SetSprite(string IMAGEPATH)
|
|
{
|
|
GetNode<Sprite2D>("Image").Texture = GD.Load<Texture2D>(IMAGEPATH);
|
|
}
|
|
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;
|
|
}
|
|
}
|