Interface TextGeometryOption

The interface to define options for TextGeometry.

TextGeometryOption

interface TextGeometryOption {
    align?: TextAlign;
    end?: number;
    flipY?: boolean;
    font?: BMFont;
    letterSpacing?: number;
    lineHeight?: number;
    mode?: WordWrapMode;
    multipage?: boolean;
    start?: number;
    tabSize?: number;
    width?: number;
}

Properties

align?: TextAlign

This can be TextAlign.left, TextAlign.center or TextAlign.right.

TextGeometryOption

TextAlign.left
end?: number

The ending index (exclusive) into the text to layout.

WordWrapOption

text.length
flipY?: boolean

Whether the texture will be Y-flipped.

TextGeometryOption

true
font?: BMFont

The BMFont definition which holds chars, kernings, etc.

TextGeometryOption

letterSpacing?: number

The letter spacing in pixels.

TextGeometryOption

0
lineHeight?: number

The line height in pixels.

TextGeometryOption

font.common.lineHeight.

A mode for word-wrapper; can be WordWrapMode.Pre (maintain spacing), or WordWrapMode.NoWrap (collapse whitespace but only break on newline characters), otherwise assumes normal word-wrap behaviour (collapse whitespace, break at width or newlines).

TextGeometryOption

undefined
multipage?: boolean

Whether to construct this geometry with an extra buffer containing page IDs. This is necessary for multi-texture fonts.

TextGeometryOption

false
start?: number

The starting index into the text to layout.

WordWrapOption

0
tabSize?: number

The number of spaces to use in a single tab .

TextGeometryOption

4
width?: number

The desired width of the text box, causes word-wrapping and clipping in WordWrapMode mode. Leave as undefined to remove word-wrapping (default behaviour).

TextGeometryOption

undefined