7-17-25 @ 3:55am

This commit is contained in:
2025-07-17 03:55:30 -04:00
parent c5795028f0
commit 3884c07811
23 changed files with 371 additions and 103 deletions

36
Gameplay/ActorPanel.cs Normal file
View File

@@ -0,0 +1,36 @@
using Godot;
using System;
public partial class ActorPanel : Panel
{
public static ActorPanel _Create(Actor ACTOR)
{
PackedScene scene = ResourceLoader.Load<PackedScene>("res://Gameplay/actor_panel.tscn");
ActorPanel newActorPanel = scene.Instantiate<ActorPanel>();
newActorPanel.SetSprite(ACTOR.Texture);
newActorPanel.SetMax(ACTOR._healthMax);
newActorPanel.SetValue(ACTOR._health);
newActorPanel.SetPosition(new Vector2(1500, 0));
return newActorPanel;
}
public void SetPosition(Vector2 POSITION)
{
Position = POSITION;
}
public void SetSprite(Texture2D TEXTURE)
{
GetNode<Sprite2D>("Image").Texture = TEXTURE;
}
public void SetValue(int VALUE)
{
GetNode<Node2D>("Health").GetNode<RichTextLabel>("Value").Text = VALUE.ToString();
GetNode<Node2D>("Health").GetNode<ProgressBar>("Bar").Value = VALUE;
}
public void SetMax(int MAX)
{
GetNode<Node2D>("Health").GetNode<RichTextLabel>("Max").Text = MAX.ToString();
GetNode<Node2D>("Health").GetNode<ProgressBar>("Bar").MaxValue = MAX;
}
}