Skip to content

Dynamic Text

TechnologicalTurtle edited this page Jul 18, 2026 · 8 revisions

Dynamic Text

DynamicText class is used to quickly render text on screen.

Initialization

// load font
DT_TextureAtlas roboto("roboto.ttf");

// create the text         font  | position
LibGui::DynamicText MyText(roboto, {0, 0});
// set text value
MyText.text = "Hello world!";

// you can add some parameters
//                         window  | font  | pos   | text color| back color
LibGui::DynamicText MyText(MyWindow, roboto, {0, 0}, Color::Red, Color::Blue);

Usage

After initialization, use Render() in a loop to render.

Methods

int RenderChar(char character, Vec2 add_pos)

Used to render single character, character. add_pos is literally added to MyText.pos.
Returns width of character image.

void Render()

Renders whole text.

Clone this wiki locally