Documentation
    Preparing search index...

    Interface TextOptions

    Optional construction arguments of Text.

    interface TextOptions {
        align?: TextAlign;
        castShadow?: boolean;
        clip?: boolean;
        direction?: ShapingDirection;
        features?: Readonly<Record<string, number>>;
        fontId?: string;
        frustumCulled?: boolean;
        language?: string;
        letterSpacing?: number;
        receiveShadow?: boolean;
        renderLayer?: number;
        renderOrder?: number;
        scissor?: ScissorRect | null;
        script?: string;
        shaper?: ShapingEngine;
        size?: number;
        text?: string;
        wrapWidth?: number;
    }

    Hierarchy (View Summary)

    • RenderableOptions
    • Pick<
          TextLayoutOptions,
          | "shaper"
          | "fontId"
          | "script"
          | "language"
          | "direction"
          | "features"
          | "wrapWidth",
      >
      • TextOptions
    Index
    align?: TextAlign

    Initial Text.align; defaults to "left".

    castShadow?: boolean

    Initial Renderable.castShadow; defaults to true (§69).

    clip?: boolean

    Initial Node.clip; defaults to false (§67).

    Here rather than on a Node options record because a clip is only meaningful on a node that draws — the mask is the node's own geometry — and this is the options record every drawable funnels through. It is also what gives the §79 readers one spelling for the field beside the three §49 flags above.

    direction?: ShapingDirection
    features?: Readonly<Record<string, number>>
    fontId?: string
    frustumCulled?: boolean

    Initial Renderable.frustumCulled; defaults to true (§87).

    language?: string
    letterSpacing?: number

    Initial Text.letterSpacing in world units; defaults to 0.

    receiveShadow?: boolean

    Initial Renderable.receiveShadow; defaults to true (§69).

    renderLayer?: number

    Initial Renderable.renderLayer; defaults to 0.

    renderOrder?: number

    Initial Renderable.renderOrder; defaults to 0.

    scissor?: ScissorRect | null

    Initial Renderable.scissor; defaults to null (§67).

    A per-draw axis-aligned rectangle in drawing-buffer pixels. null (the default) leaves the view scissor alone, so existing scenes stay transcript-identical. See scissor.ts.

    script?: string
    shaper?: ShapingEngine
    size?: number

    Initial Text.size — world units per line, not an em size (see @fourjs/text's text-layout.ts). Defaults to 1.

    text?: string

    Initial Text.text; defaults to "", which draws nothing.

    wrapWidth?: number

    Maximum line width in world units. Omitted (or Infinity) leaves line ends at explicit \n only — bit-identical to the pre-wrapping walk. A finite positive measure wraps at UAX #14-lite opportunities (line-break.ts): breaking spaces, hyphen-minus, and CJK; a single unbreakable run wider than the measure overflows rather than being clipped.