Created
February 7, 2023 02:56
-
-
Save valkyrienyanko/d17664fe3241c32743abea9755106528 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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