UI element representing a button with different states, textures, and callbacks.
More...
|
| ButtonElement (std::string text, std::unordered_map< ButtonState, const std::string & > texturesName={}) |
| Constructs a ButtonElement with text and optional texture names for each state.
|
|
| ButtonElement (std::string text, std::unordered_map< ButtonState, Texture * > textures) |
| Constructs a ButtonElement with text and textures for each state.
|
|
| ~ButtonElement ()=default |
| Destructor.
|
|
virtual void | Update () override |
| Updates the button state and handles input.
|
|
virtual void | Draw (RendererGL *renderer) override |
| Draws the button using the provided renderer.
|
|
void | SetTextures (std::unordered_map< ButtonState, const std::string & > textures) |
| Sets textures for each button state using texture names.
|
|
void | SetTextures (std::unordered_map< ButtonState, Texture * > textures) |
| Sets textures for each button state using texture pointers.
|
|
void | SetStateTexture (ButtonState state, const std::string &texture, Color tint=Color::White) |
| Sets the texture and tint for a specific button state using a texture name.
|
|
void | SetStateTexture (ButtonState state, Texture *texture, Color tint=Color::White) |
| Sets the texture and tint for a specific button state using a texture pointer.
|
|
void | SetEnable (bool enable=true) |
| Enables or disables the button.
|
|
void | Subscribe (ButtonState state, Callback callback) |
| Subscribes a callback to a specific button state event.
|
|
| SpriteElement (const std::string textureName, Vector2 size={ 1, 1 }, Vector2 position={ 0, 0 }, int ZOrder=0) |
| Constructs a SpriteElement with a texture name, size, position, and Z order.
|
|
| SpriteElement (Vector2 size={ 1, 1 }, Vector2 position={ 0, 0 }, int ZOrder=0) |
| Constructs a SpriteElement with size, position, and Z order. No texture is set.
|
|
| SpriteElement (Texture *texture, Vector2 size={ 1, 1 }, Vector2 position={ 0, 0 }, int ZOrder=0) |
| Constructs a SpriteElement with a texture pointer, size, position, and Z order.
|
|
| ~SpriteElement ()=default |
| Destructor for SpriteElement.
|
|
virtual Transform2D | GetTransform () const override |
| Gets the transform of the sprite element.
|
|
virtual Vector2 | GetSize () const override |
| Gets the size of the sprite element.
|
|
void | SetTexture (Texture *pTexture) |
| Sets the texture for the sprite element.
|
|
void | SetTexture (std::string pTexture) |
| Sets the texture for the sprite element by texture name.
|
|
Texture * | GetTexture () const |
| Gets the current texture of the sprite element.
|
|
| 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.
|
|
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.
|
|
Vector2 | GetPosition () const |
| Gets the position of the widget.
|
|
float | GetRotation () const |
| Gets the rotation 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.
|
|
UI element representing a button with different states, textures, and callbacks.