7-28-25 @ 11:39pm
This commit is contained in:
36
Gameplay/ManagerPanel.cs
Normal file
36
Gameplay/ManagerPanel.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user