Implements text rendering and management for the UI system. More...
Go to the source code of this file.
Classes | |
| struct | UI_TextData |
| Data structure for UI text elements. More... | |
Typedefs | |
| typedef struct UI_TextData | UI_TextData |
| Data structure for UI text elements. | |
Enumerations | |
| enum | UI_TextAlignment { UI_TEXT_ALIGN_LEFT , UI_TEXT_ALIGN_CENTER , UI_TEXT_ALIGN_RIGHT } |
| An enum for text alignment. More... | |
Functions | |
| UIElement * | UI_CreateText (const char *text, SDL_Rect rect, SDL_Color color, float scale, UI_TextAlignment alignment, TTF_Font *font) |
| SDL_Texture * | UI_CreateTextTexture (const char *text, SDL_Color color, TTF_Font *font) |
| void | UI_UpdateText (UIElement *element) |
| void | UI_RenderText (UIElement *element) |
| void | UI_DestroyText (UIElement *element) |
| void | UI_ChangeText (UIElement *element, const char *text) |
| void | UI_ChangeTextColor (UIElement *element, SDL_Color color) |
| void | UI_SetHovered (UIElement *element, bool hovered) |
| bool | UI_IsHovered (UIElement *element) |
Implements text rendering and management for the UI system.
Creating and managing text elements:
| typedef struct UI_TextData UI_TextData |
Data structure for UI text elements.
This structure holds all necessary data for rendering and managing text UI elements, including the text content, texture, font and alignment properties.
| enum UI_TextAlignment |
| void UI_ChangeText | ( | UIElement * | element, |
| const char * | text | ||
| ) |
| void UI_ChangeTextColor | ( | UIElement * | element, |
| SDL_Color | color | ||
| ) |
| UIElement * UI_CreateText | ( | const char * | text, |
| SDL_Rect | rect, | ||
| SDL_Color | color, | ||
| float | scale, | ||
| UI_TextAlignment | alignment, | ||
| TTF_Font * | font | ||
| ) |
| SDL_Texture * UI_CreateTextTexture | ( | const char * | text, |
| SDL_Color | color, | ||
| TTF_Font * | font | ||
| ) |
| void UI_DestroyText | ( | UIElement * | element | ) |
| bool UI_IsHovered | ( | UIElement * | element | ) |
| void UI_RenderText | ( | UIElement * | element | ) |
| void UI_SetHovered | ( | UIElement * | element, |
| bool | hovered | ||
| ) |
| void UI_UpdateText | ( | UIElement * | element | ) |