@lightningjs/renderer
    Preparing search index...

    Class CoreTextNode

    Writable properties of a Node.

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    _id: number = ...
    autosizer: null | Autosizer = null

    Autosize properties

    calcZIndex: number = 0
    children: CoreNode[] = []
    childUpdateType: UpdateType = UpdateType.None
    clippingRect: RectWithValid = ...
    destroyed: boolean = false
    framebufferDimensions: null | Dimensions = null

    only used when rtt = true

    globalTransform?: Matrix3d
    hasRTTupdates: boolean = false
    hasShaderTimeFn: boolean = false
    isCoreNode: true = ...
    isRenderable: boolean = false
    localTransform?: Matrix3d
    numQuads: number = 0
    onTextureLoaded: TextureLoadedEventHandler = ...
    parentAutosizer: null | Autosizer = null
    parentHasRenderTexture: boolean = false
    preloadBound?: Bound
    premultipliedColorBl: number = 0
    premultipliedColorBr: number = 0
    premultipliedColorTl: number = 0
    premultipliedColorTr: number = 0
    previousZIndex: number = -1
    renderBound?: Bound
    renderCoords?: RenderCoords
    renderOpBufferIdx: number = 0
    renderOpTextures: WebGlCoreCtxTexture[] = []
    renderState: CoreNodeRenderState = CoreNodeRenderState.Init
    rttParent: null | CoreNode = null
    sceneGlobalTransform?: Matrix3d
    sceneRenderCoords?: RenderCoords
    stage: Stage
    strictBound?: Bound
    textureCoords?: Bound
    updateShaderUniforms: boolean = false
    updateType: UpdateType = UpdateType.All
    worldAlpha: number = 1

    Accessors

    • get alpha(): number

      The alpha opacity of the Node.

      Returns number

      The alpha value is a number between 0 and 1, where 0 is fully transparent and 1 is fully opaque.

      1

    • set alpha(value: number): void

      The alpha opacity of the Node.

      Parameters

      • value: number

      Returns void

      The alpha value is a number between 0 and 1, where 0 is fully transparent and 1 is fully opaque.

      1

    • get autosize(): boolean

      Autosize

      Returns boolean

      When enabled, the Node automatically resizes based on its content

      Texture Autosize Mode:

      • When the Node has a texture, it automatically resizes to match the texture's dimensions when the texture loads
      • This ensures images display at their natural size without manual sizing
      • Text Nodes always use this mode regardless of this setting

      Children Autosize Mode:

      • When the Node has no texture but contains children, it automatically resizes to encompass all children's bounds
      • Calculates the bounding box that contains all child positions, dimensions, and transforms (scale, rotation, mount/pivot points)
      • Creates container behavior where the parent grows to fit its content
      • Updates dynamically as children are added, removed, or transformed

      Mode Selection Logic:

      • Texture mode takes precedence over children mode
      • Mode switches automatically when texture is added/removed
      • If no texture and no children, autosize has no effect

      Performance:

      • Children mode uses efficient transform caching and differential updates
      • Only recalculates when child transforms actually change
      • Minimal memory allocation with factory function patterns

      false

    • set autosize(value: boolean): void

      Autosize

      Parameters

      • value: boolean

      Returns void

      When enabled, the Node automatically resizes based on its content

      Texture Autosize Mode:

      • When the Node has a texture, it automatically resizes to match the texture's dimensions when the texture loads
      • This ensures images display at their natural size without manual sizing
      • Text Nodes always use this mode regardless of this setting

      Children Autosize Mode:

      • When the Node has no texture but contains children, it automatically resizes to encompass all children's bounds
      • Calculates the bounding box that contains all child positions, dimensions, and transforms (scale, rotation, mount/pivot points)
      • Creates container behavior where the parent grows to fit its content
      • Updates dynamically as children are added, removed, or transformed

      Mode Selection Logic:

      • Texture mode takes precedence over children mode
      • Mode switches automatically when texture is added/removed
      • If no texture and no children, autosize has no effect

      Performance:

      • Children mode uses efficient transform caching and differential updates
      • Only recalculates when child transforms actually change
      • Minimal memory allocation with factory function patterns

      false

    • get boundsMargin(): null | number | [number, number, number, number]

      Margin around the Node's bounds for preloading

      Returns null | number | [number, number, number, number]

      null

    • set boundsMargin(value: null | number | [number, number, number, number]): void

      Margin around the Node's bounds for preloading

      Parameters

      • value: null | number | [number, number, number, number]

      Returns void

      null

    • get clipping(): boolean

      Clipping Mode

      Returns boolean

      Enable Clipping Mode when you want to prevent the drawing of a Node and its descendants from overflowing outside of the Node's x/y/width/height bounds.

      For WebGL, clipping is implemented using the high-performance WebGL operation scissor. As a consequence, clipping does not work for non-rectangular areas. So, if the element is rotated (by itself or by any of its ancestors), clipping will not work as intended.

      TODO: Add support for non-rectangular clipping either automatically or via Render-To-Texture.

      false

    • set clipping(value: boolean): void

      Clipping Mode

      Parameters

      • value: boolean

      Returns void

      Enable Clipping Mode when you want to prevent the drawing of a Node and its descendants from overflowing outside of the Node's x/y/width/height bounds.

      For WebGL, clipping is implemented using the high-performance WebGL operation scissor. As a consequence, clipping does not work for non-rectangular areas. So, if the element is rotated (by itself or by any of its ancestors), clipping will not work as intended.

      TODO: Add support for non-rectangular clipping either automatically or via Render-To-Texture.

      false

    • get colorBl(): number

      The color of the bottom-left corner of the Node for gradient rendering.

      Returns number

      See color for more information about color values and gradient rendering.

    • set colorBl(value: number): void

      The color of the bottom-left corner of the Node for gradient rendering.

      Parameters

      • value: number

      Returns void

      See color for more information about color values and gradient rendering.

    • get colorBottom(): number

      The color of the bottom edge of the Node for gradient rendering.

      Returns number

      See color for more information about color values and gradient rendering.

    • set colorBottom(value: number): void

      The color of the bottom edge of the Node for gradient rendering.

      Parameters

      • value: number

      Returns void

      See color for more information about color values and gradient rendering.

    • get colorBr(): number

      The color of the bottom-right corner of the Node for gradient rendering.

      Returns number

      See color for more information about color values and gradient rendering.

    • set colorBr(value: number): void

      The color of the bottom-right corner of the Node for gradient rendering.

      Parameters

      • value: number

      Returns void

      See color for more information about color values and gradient rendering.

    • get colorLeft(): number

      The color of the left edge of the Node for gradient rendering.

      Returns number

      See color for more information about color values and gradient rendering.

    • set colorLeft(value: number): void

      The color of the left edge of the Node for gradient rendering.

      Parameters

      • value: number

      Returns void

      See color for more information about color values and gradient rendering.

    • get colorRight(): number

      The color of the right edge of the Node for gradient rendering.

      Returns number

      See color for more information about color values and gradient rendering.

    • set colorRight(value: number): void

      The color of the right edge of the Node for gradient rendering.

      Parameters

      • value: number

      Returns void

      See color for more information about color values and gradient rendering.

    • get colorTl(): number

      The color of the top-left corner of the Node for gradient rendering.

      Returns number

      See color for more information about color values and gradient rendering.

    • set colorTl(value: number): void

      The color of the top-left corner of the Node for gradient rendering.

      Parameters

      • value: number

      Returns void

      See color for more information about color values and gradient rendering.

    • get colorTop(): number

      The color of the top edge of the Node for gradient rendering.

      Returns number

      See color for more information about color values and gradient rendering.

    • set colorTop(value: number): void

      The color of the top edge of the Node for gradient rendering.

      Parameters

      • value: number

      Returns void

      See color for more information about color values and gradient rendering.

    • get colorTr(): number

      The color of the top-right corner of the Node for gradient rendering.

      Returns number

      See color for more information about color values and gradient rendering.

    • set colorTr(value: number): void

      The color of the top-right corner of the Node for gradient rendering.

      Parameters

      • value: number

      Returns void

      See color for more information about color values and gradient rendering.

    • get contain(): "none" | "both" | "height" | "width"

      contain mode for text

      Returns "none" | "both" | "height" | "width"

      This property sets how the text should be contained within its bounding box.

      • 'width': The text is contained within the specified maxWidth, horizontal position of text will adjust according to textAlign.
      • 'height': The text is contained within the specified maxHeight, vertical position of text will adjust according to verticalAlign.
      • 'both': The text is contained within both the specified maxWidth and maxHeight.
      • 'none': The text is not contained within any bounding box.
      'none'
      
    • set contain(value: "none" | "both" | "height" | "width"): void

      contain mode for text

      Parameters

      • value: "none" | "both" | "height" | "width"

      Returns void

      This property sets how the text should be contained within its bounding box.

      • 'width': The text is contained within the specified maxWidth, horizontal position of text will adjust according to textAlign.
      • 'height': The text is contained within the specified maxHeight, vertical position of text will adjust according to verticalAlign.
      • 'both': The text is contained within both the specified maxWidth and maxHeight.
      • 'none': The text is not contained within any bounding box.
      'none'
      
    • get data(): undefined | CustomDataMap

      Node data element for custom data storage (optional)

      Returns undefined | CustomDataMap

      This property is used to store custom data on the Node as a key/value data store. Data values are limited to string, numbers, booleans. Strings will be truncated to a 2048 character limit for performance reasons.

      This is not a data storage mechanism for large amounts of data please use a dedicated data storage mechanism for that.

      The custom data will be reflected in the inspector as part of data-* attributes

      undefined

    • set data(d: undefined | CustomDataMap): void

      Node data element for custom data storage (optional)

      Parameters

      • d: undefined | CustomDataMap

      Returns void

      This property is used to store custom data on the Node as a key/value data store. Data values are limited to string, numbers, booleans. Strings will be truncated to a 2048 character limit for performance reasons.

      This is not a data storage mechanism for large amounts of data please use a dedicated data storage mechanism for that.

      The custom data will be reflected in the inspector as part of data-* attributes

      undefined

    • get fontFamily(): string

      Font Family

      Returns string

      fontFamily is defined currently as single string, but in the future we may want to support multiple font family fallbacks, as this is supported by CSS / Canvas2d. We can do this in a backwards compatible way by unioning an array of strings to the fontFamily property.

    • set fontFamily(value: string): void

      Font Family

      Parameters

      • value: string

      Returns void

      fontFamily is defined currently as single string, but in the future we may want to support multiple font family fallbacks, as this is supported by CSS / Canvas2d. We can do this in a backwards compatible way by unioning an array of strings to the fontFamily property.

    • get fontSize(): number

      Font Size

      Returns number

      The font size to use when looking up the font face.

      The font size is specified in pixels and is the height of the font's em-square. The em-square is essentially the height of the capital letters for the font. The actual height of the text can be larger than the specified font size, as the font may have ascenders and descenders that extend beyond the em-square.

      16
      
    • set fontSize(value: number): void

      Font Size

      Parameters

      • value: number

      Returns void

      The font size to use when looking up the font face.

      The font size is specified in pixels and is the height of the font's em-square. The em-square is essentially the height of the capital letters for the font. The actual height of the text can be larger than the specified font size, as the font may have ascenders and descenders that extend beyond the em-square.

      16
      
    • get fontStyle(): "normal" | "italic" | "oblique"

      Font Style

      Returns "normal" | "italic" | "oblique"

      The font style to use when looking up the font face. This can be one of the following strings:

      • 'normal'
      • 'italic'
      • 'oblique'
    • set fontStyle(value: "normal" | "italic" | "oblique"): void

      Font Style

      Parameters

      • value: "normal" | "italic" | "oblique"

      Returns void

      The font style to use when looking up the font face. This can be one of the following strings:

      • 'normal'
      • 'italic'
      • 'oblique'
    • get h(): number

      The height of the Node.

      Returns number

      This will be deprecated in favor of w and h properties in the future.

      0

    • set h(value: number): void

      The height of the Node.

      Parameters

      • value: number

      Returns void

      This will be deprecated in favor of w and h properties in the future.

      0

    • get imageType(): null | "svg" | "regular" | "compressed"

      Image Type to explicitly set the image type that is being loaded

      Returns null | "svg" | "regular" | "compressed"

      This property must be used with a src that points at an image. In some cases the extension doesn't provide a reliable representation of the image type. In such cases set the ImageType explicitly.

      regular is used for normal images such as png, jpg, etc compressed is used for ETC1/ETC2 compressed images with a PVR or KTX container svg is used for scalable vector graphics

      undefined

    • set imageType(type: null | "svg" | "regular" | "compressed"): void

      Image Type to explicitly set the image type that is being loaded

      Parameters

      • type: null | "svg" | "regular" | "compressed"

      Returns void

      This property must be used with a src that points at an image. In some cases the extension doesn't provide a reliable representation of the image type. In such cases set the ImageType explicitly.

      regular is used for normal images such as png, jpg, etc compressed is used for ETC1/ETC2 compressed images with a PVR or KTX container svg is used for scalable vector graphics

      undefined

    • get interactive(): undefined | boolean

      Mark the node as interactive so we can perform hit tests on it when pointer events are registered.

      Returns undefined | boolean

      false
      
    • set interactive(value: undefined | boolean): void

      Mark the node as interactive so we can perform hit tests on it when pointer events are registered.

      Parameters

      • value: undefined | boolean

      Returns void

      false
      
    • get letterSpacing(): number

      Letter spacing for text (in pixels)

      Returns number

      This property sets additional (or reduced, if value is negative) spacing between characters in the text.

      0
      
    • set letterSpacing(value: number): void

      Letter spacing for text (in pixels)

      Parameters

      • value: number

      Returns void

      This property sets additional (or reduced, if value is negative) spacing between characters in the text.

      0
      
    • get maxLines(): number

      Max lines for text

      Returns number

      This property sets max number of lines of a text paragraph. Not yet implemented in the SDF renderer.

      0
      
    • set maxLines(value: number): void

      Max lines for text

      Parameters

      • value: number

      Returns void

      This property sets max number of lines of a text paragraph. Not yet implemented in the SDF renderer.

      0
      
    • get mount(): number

      Combined position of the Node's Mount Point

      Returns number

      The value can be any number between 0.0 and 1.0:

      • 0.0 defines the Mount Point at the top-left corner of the Node.
      • 0.5 defines it at the center of the Node.
      • 1.0 defines it at the bottom-right corner of the node.

      Use the mountX and mountY props seperately for more control of the Mount Point.

      When assigned, the same value is also passed to both the mountX and mountY props.

      0 (top-left)
      
    • set mount(value: number): void

      Combined position of the Node's Mount Point

      Parameters

      • value: number

      Returns void

      The value can be any number between 0.0 and 1.0:

      • 0.0 defines the Mount Point at the top-left corner of the Node.
      • 0.5 defines it at the center of the Node.
      • 1.0 defines it at the bottom-right corner of the node.

      Use the mountX and mountY props seperately for more control of the Mount Point.

      When assigned, the same value is also passed to both the mountX and mountY props.

      0 (top-left)
      
    • get mountX(): number

      X position of the Node's Mount Point

      Returns number

      The value can be any number between 0.0 and 1.0:

      • 0.0 defines the Mount Point's X position as the left-most edge of the Node
      • 0.5 defines it as the horizontal center of the Node
      • 1.0 defines it as the right-most edge of the Node.

      The combination of mountX and mountY define the Mount Point

      0 (left-most edge)
      
    • set mountX(value: number): void

      X position of the Node's Mount Point

      Parameters

      • value: number

      Returns void

      The value can be any number between 0.0 and 1.0:

      • 0.0 defines the Mount Point's X position as the left-most edge of the Node
      • 0.5 defines it as the horizontal center of the Node
      • 1.0 defines it as the right-most edge of the Node.

      The combination of mountX and mountY define the Mount Point

      0 (left-most edge)
      
    • get mountY(): number

      Y position of the Node's Mount Point

      Returns number

      The value can be any number between 0.0 and 1.0:

      • 0.0 defines the Mount Point's Y position as the top-most edge of the Node
      • 0.5 defines it as the vertical center of the Node
      • 1.0 defines it as the bottom-most edge of the Node.

      The combination of mountX and mountY define the Mount Point

      0 (top-most edge)
      
    • set mountY(value: number): void

      Y position of the Node's Mount Point

      Parameters

      • value: number

      Returns void

      The value can be any number between 0.0 and 1.0:

      • 0.0 defines the Mount Point's Y position as the top-most edge of the Node
      • 0.5 defines it as the vertical center of the Node
      • 1.0 defines it as the bottom-most edge of the Node.

      The combination of mountX and mountY define the Mount Point

      0 (top-most edge)
      
    • get overflowSuffix(): string

      Overflow Suffix for text

      Returns string

      The suffix to be added when text is cropped due to overflow. Not yet implemented in the SDF renderer.

      "..."
      
    • set overflowSuffix(value: string): void

      Overflow Suffix for text

      Parameters

      • value: string

      Returns void

      The suffix to be added when text is cropped due to overflow. Not yet implemented in the SDF renderer.

      "..."
      
    • get parent(): null | CoreNode

      The Node's parent Node.

      Returns null | CoreNode

      The value null indicates that the Node has no parent. This may either be because the Node is the root Node of the scene graph, or because the Node has been removed from the scene graph.

      In order to make sure that a Node can be rendered on the screen, it must be added to the scene graph by setting it's parent property to a Node that is already in the scene graph such as the root Node.

      null

    • set parent(newParent: null | CoreNode): void

      The Node's parent Node.

      Parameters

      Returns void

      The value null indicates that the Node has no parent. This may either be because the Node is the root Node of the scene graph, or because the Node has been removed from the scene graph.

      In order to make sure that a Node can be rendered on the screen, it must be added to the scene graph by setting it's parent property to a Node that is already in the scene graph such as the root Node.

      null

    • get pivot(): number

      Combined position of the Node's Pivot Point

      Returns number

      The value can be any number between 0.0 and 1.0:

      • 0.0 defines the Pivot Point at the top-left corner of the Node.
      • 0.5 defines it at the center of the Node.
      • 1.0 defines it at the bottom-right corner of the node.

      Use the pivotX and pivotY props seperately for more control of the Pivot Point.

      When assigned, the same value is also passed to both the pivotX and pivotY props.

      0.5 (center)
      
    • set pivot(value: number): void

      Combined position of the Node's Pivot Point

      Parameters

      • value: number

      Returns void

      The value can be any number between 0.0 and 1.0:

      • 0.0 defines the Pivot Point at the top-left corner of the Node.
      • 0.5 defines it at the center of the Node.
      • 1.0 defines it at the bottom-right corner of the node.

      Use the pivotX and pivotY props seperately for more control of the Pivot Point.

      When assigned, the same value is also passed to both the pivotX and pivotY props.

      0.5 (center)
      
    • get pivotX(): number

      X position of the Node's Pivot Point

      Returns number

      The value can be any number between 0.0 and 1.0:

      • 0.0 defines the Pivot Point's X position as the left-most edge of the Node
      • 0.5 defines it as the horizontal center of the Node
      • 1.0 defines it as the right-most edge of the Node.

      The combination of pivotX and pivotY define the Pivot Point

      0.5 (centered on x-axis)
      
    • set pivotX(value: number): void

      X position of the Node's Pivot Point

      Parameters

      • value: number

      Returns void

      The value can be any number between 0.0 and 1.0:

      • 0.0 defines the Pivot Point's X position as the left-most edge of the Node
      • 0.5 defines it as the horizontal center of the Node
      • 1.0 defines it as the right-most edge of the Node.

      The combination of pivotX and pivotY define the Pivot Point

      0.5 (centered on x-axis)
      
    • get pivotY(): number

      Y position of the Node's Pivot Point

      Returns number

      The value can be any number between 0.0 and 1.0:

      • 0.0 defines the Pivot Point's Y position as the top-most edge of the Node
      • 0.5 defines it as the vertical center of the Node
      • 1.0 defines it as the bottom-most edge of the Node.

      The combination of pivotX and pivotY define the Pivot Point

      0.5 (centered on y-axis)
      
    • set pivotY(value: number): void

      Y position of the Node's Pivot Point

      Parameters

      • value: number

      Returns void

      The value can be any number between 0.0 and 1.0:

      • 0.0 defines the Pivot Point's Y position as the top-most edge of the Node
      • 0.5 defines it as the vertical center of the Node
      • 1.0 defines it as the bottom-most edge of the Node.

      The combination of pivotX and pivotY define the Pivot Point

      0.5 (centered on y-axis)
      
    • get quadBufferCollection(): BufferCollection

      Returns BufferCollection

    • get rotation(): number

      Rotation of the Node (in Radians)

      Returns number

      Sets the amount to rotate the Node by around it's Pivot Point (defined by the pivot props). Positive values rotate the Node clockwise, while negative values rotate it counter-clockwise.

      Example values:

      • -Math.PI / 2: 90 degree rotation counter-clockwise
      • 0: No rotation
      • Math.PI / 2: 90 degree rotation clockwise
      • Math.PI: 180 degree rotation clockwise
      • 3 * Math.PI / 2: 270 degree rotation clockwise
      • 2 * Math.PI: 360 rotation clockwise
    • set rotation(value: number): void

      Rotation of the Node (in Radians)

      Parameters

      • value: number

      Returns void

      Sets the amount to rotate the Node by around it's Pivot Point (defined by the pivot props). Positive values rotate the Node clockwise, while negative values rotate it counter-clockwise.

      Example values:

      • -Math.PI / 2: 90 degree rotation counter-clockwise
      • 0: No rotation
      • Math.PI / 2: 90 degree rotation clockwise
      • Math.PI: 180 degree rotation clockwise
      • 3 * Math.PI / 2: 270 degree rotation clockwise
      • 2 * Math.PI: 360 rotation clockwise
    • get scale(): number

      Scale to render the Node at

      Returns number

      The scale value multiplies the provided width and height of the Node around the Node's Pivot Point (defined by the pivot props).

      Behind the scenes, setting this property sets both the scaleX and scaleY props to the same value.

      NOTE: When the scaleX and scaleY props are explicitly set to different values, this property returns null. Setting null on this property will have no effect.

      1.0
      
    • set scale(value: number): void

      Scale to render the Node at

      Parameters

      • value: number

      Returns void

      The scale value multiplies the provided width and height of the Node around the Node's Pivot Point (defined by the pivot props).

      Behind the scenes, setting this property sets both the scaleX and scaleY props to the same value.

      NOTE: When the scaleX and scaleY props are explicitly set to different values, this property returns null. Setting null on this property will have no effect.

      1.0
      
    • get scaleX(): number

      Scale to render the Node at (X-Axis)

      Returns number

      The scaleX value multiplies the provided width of the Node around the Node's Pivot Point (defined by the pivot props).

      1.0
      
    • set scaleX(value: number): void

      Scale to render the Node at (X-Axis)

      Parameters

      • value: number

      Returns void

      The scaleX value multiplies the provided width of the Node around the Node's Pivot Point (defined by the pivot props).

      1.0
      
    • get scaleY(): number

      Scale to render the Node at (Y-Axis)

      Returns number

      The scaleY value multiplies the provided height of the Node around the Node's Pivot Point (defined by the pivot props).

      1.0
      
    • set scaleY(value: number): void

      Scale to render the Node at (Y-Axis)

      Parameters

      • value: number

      Returns void

      The scaleY value multiplies the provided height of the Node around the Node's Pivot Point (defined by the pivot props).

      1.0
      
    • get src(): null | string

      Image URL

      Returns null | string

      When set, the Node's texture is automatically set to an ImageTexture using the source image URL provided (with all other settings being defaults)

    • set src(imageUrl: null | string): void

      Image URL

      Parameters

      • imageUrl: null | string

      Returns void

      When set, the Node's texture is automatically set to an ImageTexture using the source image URL provided (with all other settings being defaults)

    • get srcHeight(): undefined | number

      The height of the rectangle from which the Image Texture will be extracted. This value can be negative. If not provided, the image's source natural height will be used.

      Returns undefined | number

    • set srcHeight(value: number): void

      The height of the rectangle from which the Image Texture will be extracted. This value can be negative. If not provided, the image's source natural height will be used.

      Parameters

      • value: number

      Returns void

    • get srcWidth(): undefined | number

      She width of the rectangle from which the Image Texture will be extracted. This value can be negative. If not provided, the image's source natural width will be used.

      Returns undefined | number

    • set srcWidth(value: number): void

      She width of the rectangle from which the Image Texture will be extracted. This value can be negative. If not provided, the image's source natural width will be used.

      Parameters

      • value: number

      Returns void

    • get srcX(): undefined | number

      The x coordinate of the reference point of the rectangle from which the Texture will be extracted. width and height are provided. And only works when createImageBitmap is available. Only works when createImageBitmap is supported on the browser.

      Returns undefined | number

    • set srcX(value: number): void

      The x coordinate of the reference point of the rectangle from which the Texture will be extracted. width and height are provided. And only works when createImageBitmap is available. Only works when createImageBitmap is supported on the browser.

      Parameters

      • value: number

      Returns void

    • get srcY(): undefined | number

      The y coordinate of the reference point of the rectangle from which the Texture will be extracted. Only used when source srcWidth width and srcHeight height are provided. Only works when createImageBitmap is supported on the browser.

      Returns undefined | number

    • set srcY(value: number): void

      The y coordinate of the reference point of the rectangle from which the Texture will be extracted. Only used when source srcWidth width and srcHeight height are provided. Only works when createImageBitmap is supported on the browser.

      Parameters

      • value: number

      Returns void

    • get textAlign(): "center" | "left" | "right"

      Text alignment

      Returns "center" | "left" | "right"

      Alignment of the text relative to it's contained bounds. For best results, use contain mode 'width' or 'both' and a set an explicit width for the text to be aligned within.

      'left'
      
    • set textAlign(value: "center" | "left" | "right"): void

      Text alignment

      Parameters

      • value: "center" | "left" | "right"

      Returns void

      Alignment of the text relative to it's contained bounds. For best results, use contain mode 'width' or 'both' and a set an explicit width for the text to be aligned within.

      'left'
      
    • get texture(): null | Texture

      The Node's Texture.

      Returns null | Texture

      The texture defines a rasterized image that is contained within the width and height dimensions of the Node. If null, the Node will use an opaque white ColorTexture when being drawn, which essentially enables colors (including gradients) to be drawn.

      If set, by default, the texture will be drawn, as is, stretched to the dimensions of the Node. This behavior can be modified by setting the TBD and TBD properties.

      To create a Texture in order to set it on this property, call RendererMain.createTexture.

      If the src is set on a Node, the Node will use the ImageTexture by default and the Node will simply load the image at the specified URL.

      Note: If this is a Text Node, the Texture will be managed by the Node's TextRenderer and should not be set explicitly.

    • set texture(value: null | Texture): void

      The Node's Texture.

      Parameters

      Returns void

      The texture defines a rasterized image that is contained within the width and height dimensions of the Node. If null, the Node will use an opaque white ColorTexture when being drawn, which essentially enables colors (including gradients) to be drawn.

      If set, by default, the texture will be drawn, as is, stretched to the dimensions of the Node. This behavior can be modified by setting the TBD and TBD properties.

      To create a Texture in order to set it on this property, call RendererMain.createTexture.

      If the src is set on a Node, the Node will use the ImageTexture by default and the Node will simply load the image at the specified URL.

      Note: If this is a Text Node, the Texture will be managed by the Node's TextRenderer and should not be set explicitly.

    • get verticalAlign(): TextVerticalAlign

      Vertical Align for text when lineHeight > fontSize

      Returns TextVerticalAlign

      This property sets the vertical align of the text. Not yet implemented in the SDF renderer.

      middle
      
    • set verticalAlign(value: TextVerticalAlign): void

      Vertical Align for text when lineHeight > fontSize

      Parameters

      • value: TextVerticalAlign

      Returns void

      This property sets the vertical align of the text. Not yet implemented in the SDF renderer.

      middle
      
    • get w(): number

      The width of the Node.

      Returns number

      This will be deprecated in favor of w and h properties in the future.

      0

    • set w(value: number): void

      The width of the Node.

      Parameters

      • value: number

      Returns void

      This will be deprecated in favor of w and h properties in the future.

      0

    • get wordBreak(): "overflow" | "break-all" | "break-word"

      Word Break for text

      Returns "overflow" | "break-all" | "break-word"

      This property sets how words should break when reaching the end of a line.

      • 'overflow': Uses the Css/HTML normal word-break behavior, generally not used in app development.
      • 'break-all': To prevent overflow, word breaks should happen between any two characters.
      • 'break-word': To prevent overflow, word breaks should happen between words. If words are too long word breaks happen between any two characters.
      "break-word"
      
    • set wordBreak(value: "overflow" | "break-all" | "break-word"): void

      Word Break for text

      Parameters

      • value: "overflow" | "break-all" | "break-word"

      Returns void

      This property sets how words should break when reaching the end of a line.

      • 'overflow': Uses the Css/HTML normal word-break behavior, generally not used in app development.
      • 'break-all': To prevent overflow, word breaks should happen between any two characters.
      • 'break-word': To prevent overflow, word breaks should happen between words. If words are too long word breaks happen between any two characters.
      "break-word"
      
    • get x(): number

      The x coordinate of the Node's Mount Point.

      Returns number

      See mountX and mountY for more information about setting the Mount Point.

      0

    • set x(value: number): void

      The x coordinate of the Node's Mount Point.

      Parameters

      • value: number

      Returns void

      See mountX and mountY for more information about setting the Mount Point.

      0

    • get y(): number

      The y coordinate of the Node's Mount Point.

      Returns number

      See mountX and mountY for more information about setting the Mount Point.

      0

    • set y(value: number): void

      The y coordinate of the Node's Mount Point.

      Parameters

      • value: number

      Returns void

      See mountX and mountY for more information about setting the Mount Point.

      0

    • get zIndex(): number

      The Node's z-index.

      Returns number

      Max z-index of children under the same parent determines which child is rendered on top. Higher z-index means the Node is rendered on top of children with lower z-index.

      Max value is 1000 and min value is -1000. Values outside of this range will be clamped.

    • set zIndex(value: number): void

      The Node's z-index.

      Parameters

      • value: number

      Returns void

      Max z-index of children under the same parent determines which child is rendered on top. Higher z-index means the Node is rendered on top of children with lower z-index.

      Max value is 1000 and min value is -1000. Values outside of this range will be clamped.

    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

      Returns void

    • Parameters

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

      Returns void

    • Parameters

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

      Returns void

    • Sets the renderable state and triggers changes if necessary.

      Parameters

      • isRenderable: boolean

        The new renderable state

      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

    • Override CoreNode's update method to handle text-specific updates

      Parameters

      • delta: number
      • parentClippingRect: RectWithValid

      Returns void