Interface TextLayoutOptions

Options of TextLayout

interface TextLayoutOptions {
    horizontalAlign?: HorizontalAlign | VerticalAlign;
    maxHeight?: number;
    maxWidth?: number;
    verticalAlign?: HorizontalAlign | VerticalAlign;
    wrapHardBreaks?: boolean;
    wrapStyle?: WrapStyle;
}

Properties

horizontalAlign?: HorizontalAlign | VerticalAlign

Alignment of the lines relative to the widest line. Default: 'left' (before 3.0 this was called verticalAlign, values are accepted under either name)

maxHeight?: number

Lines that don't fit are cut off. Default: Infinity

maxWidth?: number

Longer lines are wrapped. Default: Infinity

verticalAlign?: HorizontalAlign | VerticalAlign

Which lines to keep when cutting off at maxHeight. Default: 'top' (before 3.0 this was called horizontalAlign, values are accepted under either name)

wrapHardBreaks?: boolean

Whether to break lines at newline characters. Default: true

wrapStyle?: WrapStyle

Whether to wrap between words or at any character. Default: 'word'