vkmEngine 1.0.15
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
glm::vec4 shadow = {0.0f, 0.0f, 0.0f, 0.0f}
bool wrap = false
 Whether a line too wide for the element rect breaks onto the next.

Static Public Attributes

static constexpr float SHADOW_DROP = 1.0f / 16.0f
 How far the shadow falls, down and right, in the text's heights.

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).

Member Data Documentation

◆ valign

VAlign Vkm::Engine::UIText::valign = VAlign::Top

Vertical alignment within the element rect.

◆ shadow

glm::vec4 Vkm::Engine::UIText::shadow = {0.0f, 0.0f, 0.0f, 0.0f}

A drop shadow under the text, down and right by SHADOW_DROP of its height, so it reads over the scene without a panel behind it; none while transparent.


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