Geometry · interface

TextMeshStyle

Explained in Hello world, Meshes and geometry.

interface TextMeshStyle
import type { TextMeshStyle } from '@driftengine/core';

Properties

NameTypeDescription
cellSizeMnumberWorld size of one glyph cell. A glyph is five of these across, seven tall.
cellHeightMoptionalnumberCell height, where it differs from the width. Defaults to square.
More

For text read at a shallow angle: a word laid flat on the ground is foreshortened along the direction it is read from, and stretching the cells that way is what road markings have always done about it. It is a property of the viewing rather than of the font, which is why it belongs to a style and not to the glyph table.

colorVec3
depthMoptionalnumberDepth through the plane, world units. Defaults to the cell size, which gives cubes — the shape the flat-shaded look is built out of, and the one that catches a light from the side rather than going flat as the sun moves.
emissiveoptionalnumber
alignoptional'left' | 'center'Where the origin sits horizontally. Centred by default: a marker is aimed at a place, and left-aligning it would move the thing being marked whenever the string changed length.
baselineoptional'bottom' | 'center'Where the origin sits vertically: on the baseline, or at the middle.