Renderer · interface

TextStyle

Explained in Hello world.

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

Properties

NameTypeDescription
cellSizereadonlynumberPixels per cell. A 5x7 glyph is 5x and 7x this.
colorreadonlyVec3
glowreadonlynumberSelf-illumination, 0 for matte and ~1 for something that reads as lit.
alphareadonlynumber
revealreadonlynumber0 to 1 through the arrival animation.
spinreadonlynumberRadians of entry spin. Zero for text that should not tumble in.
punchreadonlynumberExtra scale at the moment of arrival.
bobreadonlynumberIdle vertical bob, in pixels.
charOffsetreadonlyoptionalnumberWhere this piece sits in a longer line, for the arrival stagger.
More

Only needed when one line is drawn as several objects — words around a keycap. Left at the defaults, a piece staggers across itself, which is right for a line drawn in one go.

charSpanreadonlyoptionalnumber