-
Notifications
You must be signed in to change notification settings - Fork 0
Dynamic Text
DynamicText class is used to quickly render text on screen.
// 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);After initialization, use Render() in a loop to render.
Used to render single character, character. add_pos is literally added to MyText.pos.
Returns width of character image.
Renders whole text.
Returns final size of DynamicText (final size -> minimum size of rectangle that would cover whole field + backgroundAddSize).
Returns if mouse cursor is on this dynamic text, ignore anchor parameter, as it's override of RectanlgeInput::Rect_OnMouseEnter.
If Rect_OnMouseEnter() then it should return mouue is on, else returns -1.
If left_side is true returns position of lower left corner of character on character_index,
else it ________________ returns position of lower right corner of character on character_index.
|Type|Name|Description| |----|-----------| |DT_TextureAtlas atlas`|Font of this text.| |Vec2i|pos|Position of upper left corner of object.|
Features