Base class for UI widget elements.
More...
#include <WidgetElement.h>
|
| | WidgetElement (Vector2 size={ 1, 1 }, Vector2 position={ 0, 0 }, int ZOrder=0) |
| | Constructs a WidgetElement with given size, position, and Z-order.
|
| |
|
| ~WidgetElement ()=default |
| | Default destructor.
|
| |
| virtual void | Update () |
| | Updates the widget element. Override in derived classes.
|
| |
| virtual void | Draw (RendererGL *renderer)=0 |
| | Draws the widget element. Must be implemented by derived classes.
|
| |
| int | GetZOrder () const |
| | Gets the Z-order of the widget.
|
| |
| void | SetZOrder (int ZOrder) |
| | Sets the Z-order and updates the widget order in the owner panel.
|
| |
| virtual Vector2 | GetSize () const |
| | Gets the size of the widget.
|
| |
| Vector2 | GetPosition () const |
| | Gets the position of the widget.
|
| |
| float | GetRotation () const |
| | Gets the rotation of the widget.
|
| |
| virtual Transform2D | GetTransform () const |
| | Gets the transform of the widget.
|
| |
| void | SetSize (Vector2 size) |
| | Sets the size of the widget.
|
| |
| void | SetSize (float size) |
| | Sets the size of the widget (uniform scale).
|
| |
| void | SetAnchor (Anchor anchor) |
| | Sets the anchor type for the widget.
|
| |
| void | SetPosition (Vector2 position) |
| | Sets the position of the widget.
|
| |
| void | SetRotation (float rotation) |
| | Sets the rotation of the widget.
|
| |
|
void | ToggleVisibility () |
| | Toggles the visibility of the widget.
|
| |
Base class for UI widget elements.
◆ WidgetElement()
| clt::WidgetElement::WidgetElement |
( |
Vector2 | size = { 1,1 }, |
|
|
Vector2 | position = { 0, 0 }, |
|
|
int | ZOrder = 0 ) |
|
inline |
Constructs a WidgetElement with given size, position, and Z-order.
- Parameters
-
| size | Size of the widget (default: {1,1}). |
| position | Position of the widget (default: {0,0}). |
| ZOrder | Z-order for rendering (default: 0). |
◆ Draw()
| virtual void clt::WidgetElement::Draw |
( |
RendererGL * | renderer | ) |
|
|
pure virtual |
◆ GetPosition()
| Vector2 clt::WidgetElement::GetPosition |
( |
| ) |
const |
|
inline |
Gets the position of the widget.
- Returns
- The position as a Vector2.
◆ GetRotation()
| float clt::WidgetElement::GetRotation |
( |
| ) |
const |
|
inline |
Gets the rotation of the widget.
- Returns
- The rotation in radians.
◆ GetSize()
| virtual Vector2 clt::WidgetElement::GetSize |
( |
| ) |
const |
|
inlinevirtual |
◆ GetTransform()
| virtual Transform2D clt::WidgetElement::GetTransform |
( |
| ) |
const |
|
inlinevirtual |
◆ GetZOrder()
| int clt::WidgetElement::GetZOrder |
( |
| ) |
const |
|
inline |
Gets the Z-order of the widget.
- Returns
- The Z-order value.
◆ SetAnchor()
| void clt::WidgetElement::SetAnchor |
( |
Anchor | anchor | ) |
|
|
inline |
Sets the anchor type for the widget.
- Parameters
-
| anchor | The new anchor type. |
◆ SetOwner()
| void clt::WidgetElement::SetOwner |
( |
UIPanel * | pOwner | ) |
|
|
inlineprotected |
Sets the owner UIPanel of this widget.
- Parameters
-
| pOwner | Pointer to the UIPanel owner. |
◆ SetPosition()
| void clt::WidgetElement::SetPosition |
( |
Vector2 | position | ) |
|
|
inline |
Sets the position of the widget.
- Parameters
-
| position | The new position as a Vector2. |
◆ SetRotation()
| void clt::WidgetElement::SetRotation |
( |
float | rotation | ) |
|
|
inline |
Sets the rotation of the widget.
- Parameters
-
| rotation | The new rotation in radians. |
◆ SetSize() [1/2]
| void clt::WidgetElement::SetSize |
( |
float | size | ) |
|
|
inline |
Sets the size of the widget (uniform scale).
- Parameters
-
| size | The new size as a float. |
◆ SetSize() [2/2]
| void clt::WidgetElement::SetSize |
( |
Vector2 | size | ) |
|
|
inline |
Sets the size of the widget.
- Parameters
-
◆ SetZOrder()
| void clt::WidgetElement::SetZOrder |
( |
int | ZOrder | ) |
|
|
inline |
Sets the Z-order and updates the widget order in the owner panel.
- Parameters
-
◆ Update()
| virtual void clt::WidgetElement::Update |
( |
| ) |
|
|
inlinevirtual |
◆ mTransform
2D transform for position, scale, rotation
◆ mVisibility
| bool clt::WidgetElement::mVisibility |
The documentation for this class was generated from the following file:
- D:/DEV JEUX/2025/CPP/Opengl/ClutterEngineOpenGL/ClutterEngine/Engine/Graphics/UI/WidgetElement.h