UI Element structure. More...
#include <UI.h>
Public Attributes | |
| UIElementType | type |
| Element-specific data (depends on type) | |
| void * | data |
| Pointer to element-specific data. | |
| SDL_Rect | rect |
| Common properties. | |
| bool | visible |
| Is this element visible? | |
| bool | enabled |
| Is this element interactive? | |
| bool | hovered |
| Is mouse over this element? | |
| bool | pressed |
| Is mouse button pressed on this element? | |
| SDL_Rect | srcRect |
| Rendering properties. | |
| SDL_Rect | dstRect |
| Destination rectangle for rendering. | |
| SDL_Rect | textureSize |
| Texture size. | |
| SDL_Color | color |
| Color tint/modulation. | |
| float | scale |
| Scale factor for the texture. | |
| void(* | render )(UIElement *self) |
| Render function. | |
| void(* | update )(UIElement *self) |
| Update logic. | |
| void(* | cleanup )(UIElement *self) |
| Free resources. | |
UI Element structure.
Base structure for all UI elements. Contains common properties and callbacks for different element types.
| void(* UIElement::cleanup) (UIElement *self) |
Free resources.
| SDL_Color UIElement::color |
Color tint/modulation.
| void* UIElement::data |
Pointer to element-specific data.
e.g, UI texts use a UI_TextData variable here
| SDL_Rect UIElement::dstRect |
Destination rectangle for rendering.
| bool UIElement::enabled |
Is this element interactive?
| bool UIElement::hovered |
Is mouse over this element?
| bool UIElement::pressed |
Is mouse button pressed on this element?
| SDL_Rect UIElement::rect |
Common properties.
Position and size
| void(* UIElement::render) (UIElement *self) |
Render function.
| float UIElement::scale |
Scale factor for the texture.
| SDL_Rect UIElement::srcRect |
Rendering properties.
Source rectangle for texture (NULL for entire texture)
| SDL_Rect UIElement::textureSize |
Texture size.
| UIElementType UIElement::type |
Element-specific data (depends on type)
Type of UI element
| void(* UIElement::update) (UIElement *self) |
Update logic.
| bool UIElement::visible |
Is this element visible?