GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
grem::graphics::TextStringInstance3D Struct Reference

Configuration of a 3D instance of a string of text to draw using a Font2D. More...

#include <GREM/graphics_3d/Instances3D.hpp>

Public Attributes

uint32_t characterSize = 16
 Character size to shape the glyphs at.
vec3 position {0.0f, 0.0f, 0.0f}
 Starting position, in world coordinates, to draw the text at.
quat orientation {0.0f, 0.0f, 0.0f, 1.0f}
 Rotation of the text around its TextStringInstance3D::origin.
vec2 shapeScale {1.0f, 1.0f}
 Scaling to apply to the size of the shaped glyphs.
vec2 shapeOrigin {0.0f, 0.0f}
 Offset, in normalized coordinates, specifying the origin relative to the baseline of the first line of text.
vec2 scale {1.0f, 1.0f}
 Coefficients to scale the size of the text by.
TextAlign alignment = TextAlign::NONE
 Alignment mode of the text.
vec2 alignmentOffset {0.0f, 0.0f}
 Additional offset to apply to the text after applying the specified alignment.
Color color = Color::WHITE
 Base text color.
float distanceOrderingBias = 0.0f
 Bias to subtract from the text's distance from the camera, which is used for distance ordering when drawing transparent meshes.

Detailed Description

Configuration of a 3D instance of a string of text to draw using a Font2D.

Member Data Documentation

◆ characterSize

uint32_t grem::graphics::TextStringInstance3D::characterSize = 16

Character size to shape the glyphs at.

◆ position

vec3 grem::graphics::TextStringInstance3D::position {0.0f, 0.0f, 0.0f}

Starting position, in world coordinates, to draw the text at.

This will be the first position on the baseline of the first line of text.

◆ orientation

quat grem::graphics::TextStringInstance3D::orientation {0.0f, 0.0f, 0.0f, 1.0f}

Rotation of the text around its TextStringInstance3D::origin.

◆ shapeScale

vec2 grem::graphics::TextStringInstance3D::shapeScale {1.0f, 1.0f}

Scaling to apply to the size of the shaped glyphs.

The result is affected by Font2DOptions::useLinearFiltering.

Remarks
The best visual results are usually achieved when the text is shaped at an appropriate character size to begin with, rather than relying on this scale parameter. As such, the scale should generally be kept at (1, 1) unless many different character sizes are used with this font and there is a strict requirement on the maximum size of the texture atlas.

◆ shapeOrigin

vec2 grem::graphics::TextStringInstance3D::shapeOrigin {0.0f, 0.0f}

Offset, in normalized coordinates, specifying the origin relative to the baseline of the first line of text.

For example, a value of (0.5, 0.5) corresponds to the middle of the first line of text.

Remarks
A value of (0.5, 0.0) can be used to center text on the X axis.

◆ scale

vec2 grem::graphics::TextStringInstance3D::scale {1.0f, 1.0f}

Coefficients to scale the size of the text by.

The result is affected by Font2DOptions::useLinearFiltering.

Remarks
The best visual results are usually achieved when the text is shaped at an appropriate character size to begin with, rather than relying on this scale parameter. As such, the scale should generally be kept at (1, 1) unless many different character sizes are used with this font and there is a strict requirement on the maximum size of the texture atlas.

◆ alignment

TextAlign grem::graphics::TextStringInstance3D::alignment = TextAlign::NONE

Alignment mode of the text.

◆ alignmentOffset

vec2 grem::graphics::TextStringInstance3D::alignmentOffset {0.0f, 0.0f}

Additional offset to apply to the text after applying the specified alignment.

◆ color

Color grem::graphics::TextStringInstance3D::color = Color::WHITE

Base text color.

◆ distanceOrderingBias

float grem::graphics::TextStringInstance3D::distanceOrderingBias = 0.0f

Bias to subtract from the text's distance from the camera, which is used for distance ordering when drawing transparent meshes.


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