Clutter Engine 0.0.1
|
Represents a UI panel that manages WidgetElements and their z-ordering. More...
#include <UIPanel.h>
Public Member Functions | |
UIPanel (HUDComponent *hud) | |
Constructs a UIPanel with the given HUD component. | |
~UIPanel () | |
Destructor for UIPanel. Cleans up all elements. | |
template<typename T , typename... Args> | |
T * | CreateElement (const std::string &pName, Args &&... args) |
Creates a new WidgetElement of type T and adds it to the panel. | |
template<typename T > | |
T * | GetElement (const std::string &pName) |
Gets a WidgetElement of type T by name. | |
void | RemoveElement (const std::string &pName) |
Removes a WidgetElement from the panel by name. | |
virtual void | Update () |
Updates the panel and its elements. Override to provide custom update logic. | |
HUDComponent * | GetHUD () const |
Gets the HUD component that owns this panel. | |
std::vector< WidgetElement * > | GetElements () |
Gets all WidgetElements in the panel, sorted by Z order. | |
Represents a UI panel that manages WidgetElements and their z-ordering.
|
inline |
Constructs a UIPanel with the given HUD component.
hud | The HUD component that owns this panel. |
|
inline |
Creates a new WidgetElement of type T and adds it to the panel.
T | The type of WidgetElement to create. |
Args | Constructor argument types for T. |
pName | The unique name for the element. |
args | Arguments to forward to the constructor of T. |
|
inline |
Gets a WidgetElement of type T by name.
T | The type of WidgetElement to retrieve. |
pName | The name of the element. |
|
inline |
Gets all WidgetElements in the panel, sorted by Z order.
|
inline |
Gets the HUD component that owns this panel.
void UIPanel::RemoveElement | ( | const std::string & | pName | ) |
Removes a WidgetElement from the panel by name.
pName | The name of the element to remove. |