A visual Node in the Renderer scene graph that renders text.

A Text Node is a special type of Node that renders text using a specific text renderer, such as Web/Canvas or Signed Distance Field (SDF) text.

For non-text rendering, see INode.

Users of the Renderer API, should generally interact with ITextNode objects instead of CoreTextNode objects.

interface ITextNode {
    absX: number;
    absY: number;
    alpha: number;
    autosize: boolean;
    calcZIndex: number;
    children: CoreNode[];
    childUpdateType: UpdateType;
    clipping: boolean;
    clippingRect: RectWithValid;
    color: number;
    colorBl: number;
    colorBottom: number;
    colorBr: number;
    colorLeft: number;
    colorRight: number;
    colorTl: number;
    colorTop: number;
    colorTr: number;
    contain: "both" | "none" | "width";
    data: undefined | CustomDataMap;
    debug: Partial<TextRendererDebugProps>;
    fontFamily: string;
    fontSize: number;
    fontStretch:
        | "normal"
        | "condensed"
        | "expanded"
        | "extra-condensed"
        | "extra-expanded"
        | "semi-condensed"
        | "semi-expanded"
        | "ultra-condensed"
        | "ultra-expanded";
    fontStyle: "normal" | "italic" | "oblique";
    fontWeight:
        | number
        | "bold"
        | "normal"
        | "lighter"
        | "bolder";
    framebufferDimensions: Dimensions;
    globalTransform?: Matrix3d;
    hasRTTupdates: boolean;
    height: number;
    id: number;
    imageType:
        | null
        | "svg"
        | "regular"
        | "compressed";
    isRenderable: boolean;
    letterSpacing: number;
    lineHeight: undefined | number;
    localTransform?: Matrix3d;
    maxLines: number;
    mount: number;
    mountX: number;
    mountY: number;
    offsetY: number;
    overflowSuffix: string;
    parent: null | INode<BaseShaderController>;
    parentHasRenderTexture: boolean;
    parentRenderTexture: null | CoreNode;
    pivot: number;
    pivotX: number;
    pivotY: number;
    preloadBound?: Bound;
    premultipliedColorBl: number;
    premultipliedColorBr: number;
    premultipliedColorTl: number;
    premultipliedColorTr: number;
    preventCleanup: boolean;
    props: CoreNodeProps;
    renderBound?: Bound;
    renderCoords?: RenderCoords;
    renderState: CoreNodeRenderState;
    rotation: number;
    rtt: boolean;
    rttParent: null | CoreNode;
    scale: number;
    scaleRotateTransform?: Matrix3d;
    scaleX: number;
    scaleY: number;
    scrollable: boolean;
    scrollY: number;
    shader: BaseShaderController;
    src: null | string;
    srcHeight: undefined | number;
    srcWidth: undefined | number;
    srcX: undefined | number;
    srcY: undefined | number;
    stage: Stage;
    strictBound?: Bound;
    strictBounds: boolean;
    text: string;
    textAlign: "center" | "left" | "right";
    textBaseline: TextBaseline;
    textRenderer: TextRenderer<TextRendererState>;
    textRendererOverride: null | (keyof TextRendererMap);
    texture: null | Texture;
    textureOptions: TextureOptions;
    trState: TextRendererState;
    updateType: UpdateType;
    verticalAlign: TextVerticalAlign;
    width: number;
    worldAlpha: number;
    x: number;
    y: number;
    zIndex: number;
    zIndexLocked: number;
    animate(props: Partial<INodeAnimateProps<BaseShaderController>>, settings: Partial<AnimationSettings>): IAnimationController;
    autosizeNode(dimensions: Dimensions): void;
    calculateClippingRect(parentClippingRect: RectWithValid): void;
    calculateRenderCoords(): void;
    calculateZIndex(): void;
    checkRenderBounds(): CoreNodeRenderState;
    createRenderBounds(): void;
    destroy(): void;
    emit(event: string, data?: any): void;
    flush(): void;
    hasRenderableProperties(): boolean;
    loadTexture(): void;
    off(event: string, listener?: ((target: any, data: any) => void)): void;
    on(event: string, listener: ((target: any, data: any) => void)): void;
    once(event: string, listener: ((target: any, data: any) => void)): void;
    onChangeIsRenderable(isRenderable: boolean): void;
    removeAllListeners(): void;
    renderQuads(renderer: CoreRenderer): void;
    setUpdateType(type: UpdateType): void;
    sortChildren(): void;
    unloadTexture(): void;
    update(delta: number, parentClippingRect: RectWithValid): void;
    updateBoundingRect(): void;
    updateIsRenderable(): void;
    updateLocalTransform(): void;
    updateRenderState(renderState: CoreNodeRenderState): void;
    updateScaleRotateTransform(): void;
}

Hierarchy

  • Omit<CoreTextNode, "animate" | "parent">
    • ITextNode

Properties

absX: number
absY: number
alpha: number
autosize: boolean
calcZIndex: number = 0
children: CoreNode[] = []
childUpdateType: UpdateType = UpdateType.None
clipping: boolean
clippingRect: RectWithValid = ...
color: number
colorBl: number
colorBottom: number
colorBr: number
colorLeft: number
colorRight: number
colorTl: number
colorTop: number
colorTr: number
contain: "both" | "none" | "width"
data: undefined | CustomDataMap
debug: Partial<TextRendererDebugProps>
fontFamily: string
fontSize: number
fontStretch:
    | "normal"
    | "condensed"
    | "expanded"
    | "extra-condensed"
    | "extra-expanded"
    | "semi-condensed"
    | "semi-expanded"
    | "ultra-condensed"
    | "ultra-expanded"
fontStyle: "normal" | "italic" | "oblique"
fontWeight:
    | number
    | "bold"
    | "normal"
    | "lighter"
    | "bolder"
framebufferDimensions: Dimensions
globalTransform?: Matrix3d
hasRTTupdates: boolean = false
height: number
id: number
imageType:
    | null
    | "svg"
    | "regular"
    | "compressed"
isRenderable: boolean = false
letterSpacing: number
lineHeight: undefined | number
localTransform?: Matrix3d
maxLines: number
mount: number
mountX: number
mountY: number
offsetY: number
overflowSuffix: string
parent: null | INode<BaseShaderController>
parentHasRenderTexture: boolean = false
parentRenderTexture: null | CoreNode
pivot: number
pivotX: number
pivotY: number
preloadBound?: Bound
premultipliedColorBl: number = 0
premultipliedColorBr: number = 0
premultipliedColorTl: number = 0
premultipliedColorTr: number = 0
preventCleanup: boolean
props: CoreNodeProps
renderBound?: Bound
renderCoords?: RenderCoords
renderState: CoreNodeRenderState = CoreNodeRenderState.Init
rotation: number
rtt: boolean
rttParent: null | CoreNode = null
scale: number
scaleRotateTransform?: Matrix3d
scaleX: number
scaleY: number
scrollable: boolean
scrollY: number
src: null | string
srcHeight: undefined | number
srcWidth: undefined | number
srcX: undefined | number
srcY: undefined | number
stage: Stage
strictBound?: Bound
strictBounds: boolean
text: string
textAlign: "center" | "left" | "right"
textBaseline: TextBaseline
textRenderer: TextRenderer<TextRendererState>
textRendererOverride: null | (keyof TextRendererMap)
texture: null | Texture
textureOptions: TextureOptions
trState: TextRendererState
updateType: UpdateType = UpdateType.All
verticalAlign: TextVerticalAlign
width: number
worldAlpha: number = 1
x: number
y: number
zIndex: number
zIndexLocked: number

Methods

  • This function calculates the clipping rectangle for a node.

    The function then checks if the node is rotated. If the node requires clipping and is not rotated, a new clipping rectangle is created based on the node's global transform and dimensions. If a parent clipping rectangle exists, it is intersected with the node's clipping rectangle (if it exists), or replaces the node's clipping rectangle.

    Finally, the node's parentClippingRect and clippingRect properties are updated.

    Parameters

    • parentClippingRect: RectWithValid

    Returns void

  • Parameters

    • event: string
    • Optionallistener: ((target: any, data: any) => void)
        • (target, data): void
        • Parameters

          • target: any
          • data: any

          Returns void

    Returns void

  • Parameters

    • event: string
    • listener: ((target: any, data: any) => void)
        • (target, data): void
        • Parameters

          • target: any
          • data: any

          Returns void

    Returns void

  • Parameters

    • event: string
    • listener: ((target: any, data: any) => void)
        • (target, data): void
        • Parameters

          • target: any
          • data: any

          Returns void

    Returns void

  • Parameters

    • isRenderable: boolean

    Returns void

  • Parameters

    • renderer: CoreRenderer

    Returns void

  • Change types types is used to determine the scope of the changes being applied

    Parameters

    • type: UpdateType

    Returns void

    See UpdateType for more information on each type

  • @todo: test for correct calculation flag

    Parameters

    • delta: number
    • parentClippingRect: RectWithValid

    Returns void

  • This function updates the isRenderable property based on certain conditions.

    Returns void

  • Returns void