Operation Null Mind 0.4.1
A 2D roguelike top down shooter game made with SDL2
 
Loading...
Searching...
No Matches
UIElement Struct Reference

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.
 

Detailed Description

UI Element structure.

Base structure for all UI elements. Contains common properties and callbacks for different element types.

Member Data Documentation

◆ cleanup

void(* UIElement::cleanup) (UIElement *self)

Free resources.

◆ color

SDL_Color UIElement::color

Color tint/modulation.

◆ data

void* UIElement::data

Pointer to element-specific data.

e.g, UI texts use a UI_TextData variable here

◆ dstRect

SDL_Rect UIElement::dstRect

Destination rectangle for rendering.

◆ enabled

bool UIElement::enabled

Is this element interactive?

◆ hovered

bool UIElement::hovered

Is mouse over this element?

◆ pressed

bool UIElement::pressed

Is mouse button pressed on this element?

◆ rect

SDL_Rect UIElement::rect

Common properties.

Position and size

◆ render

void(* UIElement::render) (UIElement *self)

Render function.

◆ scale

float UIElement::scale

Scale factor for the texture.

◆ srcRect

SDL_Rect UIElement::srcRect

Rendering properties.

Source rectangle for texture (NULL for entire texture)

◆ textureSize

SDL_Rect UIElement::textureSize

Texture size.

◆ type

UIElementType UIElement::type

Element-specific data (depends on type)

Type of UI element

◆ update

void(* UIElement::update) (UIElement *self)

Update logic.

◆ visible

bool UIElement::visible

Is this element visible?


The documentation for this struct was generated from the following file: