Description
The panel
field represents the panel to which child elements can be added. It is a public instance field of type Sandbox.UI.Panel
within the Sandbox.UI.Construct.PanelCreator
struct. This field is used to manage and organize UI components by allowing the addition of child panels.
Usage
To use the panel
field, you typically instantiate a PanelCreator
and then use the panel
field to add child panels. This is useful for constructing complex UI layouts programmatically.
Example
// Example of using the panel field in PanelCreator
var panelCreator = new PanelCreator();
var childPanel = panelCreator.panel.AddChild<Panel>();
childPanel.AddClass("my-custom-class");
// Add more children or configure the panel as needed
var anotherChild = panelCreator.panel.AddChild<Panel>("another-class");