Skip to content

Instantly share code, notes, and snippets.

@valkyrienyanko
Created February 7, 2023 02:56
Show Gist options
  • Save valkyrienyanko/d17664fe3241c32743abea9755106528 to your computer and use it in GitHub Desktop.
Save valkyrienyanko/d17664fe3241c32743abea9755106528 to your computer and use it in GitHub Desktop.
namespace Inventory;
public partial class ItemPanelDescription : Control
{
private static Control ItemPanelDescriptionParent { get; set; }
public static void Clear()
{
foreach (Node child in ItemPanelDescriptionParent.GetChildren())
child.QueueFree();
ItemPanelDescriptionParent.SetPhysicsProcess(false);
}
public static void Display()
{
ItemPanelDescriptionParent.SetPhysicsProcess(true);
var panelContainer = new PanelContainer();
var vbox = new VBoxContainer();
panelContainer.AddChild(vbox);
ItemPanelDescriptionParent.AddChild(panelContainer);
}
public override void _Ready()
{
SetPhysicsProcess(false);
ItemPanelDescriptionParent = this;
}
public override void _PhysicsProcess(double delta)
{
Position = GetViewport().GetMousePosition();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment