using Godot; using System; public partial class ActorPanel : Panel { public static ActorPanel _Create(Actor ACTOR) { PackedScene scene = ResourceLoader.Load("res://Gameplay/actor_panel.tscn"); ActorPanel newActorPanel = scene.Instantiate(); 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("Image").Texture = TEXTURE; } public void SetValue(int VALUE) { GetNode("Health").GetNode("Value").Text = VALUE.ToString(); GetNode("Health").GetNode("Bar").Value = VALUE; } public void SetMax(int MAX) { GetNode("Health").GetNode("Max").Text = MAX.ToString(); GetNode("Health").GetNode("Bar").MaxValue = MAX; } }