vkmEngine 1.0.0
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
Vkm::Engine::UIText Struct Reference

Text drawn within its element's rect, on as many lines as it breaks into. More...

#include <ui_text.h>

Public Attributes

std::string text
 UTF-8; what the font does not cover draws nothing.
std::string font = DEFAULT_UI_FONT
 Baked SDF font asset name; nothing draws if unresolved.
float pixelSize = 32.0f
 Text height in canvas reference pixels.
glm::vec4 color = {1.0f, 1.0f, 1.0f, 1.0f}
 Straight (non-premultiplied) RGBA.
Align align = Align::Left
 Horizontal alignment within the element rect.
VAlign valign = VAlign::Top
 Vertical alignment within the element rect.
bool wrap = false
 Whether a line too wide for the element rect breaks onto the next.

Detailed Description

Text drawn within its element's rect, on as many lines as it breaks into.

The font is a name, not a handle, because a name is what a scene file can hold; it is resolved through ResourceManager::findByName each frame. Text taller than the rect overflows unless an ancestor clips (clipChildren, or a UIScroll).


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