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

Text rendering and management for UI elements. More...

#include <UI_text.h>
#include <string.h>
#include <input.h>
#include <app.h>
#include <stdbool.h>

Functions

void UI_SetHovered (UIElement *element, bool hovered)
 
bool UI_IsHovered (UIElement *element)
 
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)
 

Detailed Description

Text rendering and management for UI elements.

Provides functionality for creating, updating, and rendering text elements in the user interface.

Author
Mango
Date
2025-03-02

Function Documentation

◆ UI_ChangeText()

void UI_ChangeText ( UIElement *  element,
const char *  text 
)

◆ UI_ChangeTextColor()

void UI_ChangeTextColor ( UIElement *  element,
SDL_Color  color 
)

◆ UI_CreateText()

UIElement * UI_CreateText ( const char *  text,
SDL_Rect  rect,
SDL_Color  color,
float  scale,
UI_TextAlignment  alignment,
TTF_Font *  font 
)

◆ UI_CreateTextTexture()

SDL_Texture * UI_CreateTextTexture ( const char *  text,
SDL_Color  color,
TTF_Font *  font 
)

◆ UI_DestroyText()

void UI_DestroyText ( UIElement *  element)

◆ UI_IsHovered()

bool UI_IsHovered ( UIElement *  element)

◆ UI_RenderText()

void UI_RenderText ( UIElement *  element)

◆ UI_SetHovered()

void UI_SetHovered ( UIElement *  element,
bool  hovered 
)

◆ UI_UpdateText()

void UI_UpdateText ( UIElement *  element)