@lightningjs/renderer
    Preparing search index...

    Class CoreNode

    A visual Node in the Renderer scene graph.

    CoreNode is an internally used class that represents a Renderer Node in the scene graph. See INode.ts for the public APIs exposed to Renderer users that include generic types for Shaders.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    _globalIsTranslate: boolean = false

    True when globalTransform is a pure translation. Read by child nodes in update() to determine if the translate-only global fast path applies.

    _id: number = ...
    _localIsTranslate: boolean = false

    True when localTransform is known to be in identity-shape (ta=1, tb=0, tc=0, td=1) so that subsequent updateLocalTransform calls can skip the 4 redundant field writes and use setTranslate() instead.

    autosizer: null | Autosizer = null

    Autosize properties

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

    only used when rtt = true

    globalTransform?: Matrix3d
    hasRTTupdates: boolean = false
    hasShaderTimeFn: boolean = false
    isCoreNode: boolean = ...
    isQuadDirty: boolean = false
    isRenderable: boolean = false
    isSimple: boolean = true

    True when the node has no rotation, no scale, no mount offset, and no contain-resize. The vast majority of nodes in a typical TV UI are "simple" — their local transform is a pure translation.

    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
    quadBufferIndex: 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
    stencilDepth: number = 0
    strictBound?: Bound
    textureCoords?: Bound
    updateShaderUniforms: boolean = false
    updateType: UpdateType = UpdateType.All
    worldAlpha: number = 1

    Accessors

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

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

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

      Parameters

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

      Returns void

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

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

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

      Parameters

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

      Returns void

    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

    • Checks if the node is renderable based on world alpha, dimensions and out of bounds status.

      Returns boolean

    • Clear all listeners for the given event names by setting their array length to 0, WITHOUT deleting the keys. This keeps the eventListeners object in V8's fast-properties mode and avoids re-allocating the arrays on the next on() call. Use this for objects with a known fixed set of event names (e.g. CoreAnimation, CoreAnimationController).

      Only writes arr.length = 0 when the array is non-empty -- skips the write (and the write barrier on old-gen objects) when already empty, which is the common case after unregisterAnimation() has removed all listeners.

      Parameters

      • events: readonly string[]

      Returns void

    • Check whether this emitter has any listeners registered.

      Parameters

      • Optionalevent: string

        Optional event name. When provided, checks only that event. When omitted, checks all events.

      Returns boolean

      true if at least one listener is registered.

    • Checks if the node is out of the viewport bounds.

      Returns boolean

    • 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

    • @todo: test for correct calculation flag

      Parameters

      • delta: number
      • parentClippingRect: RectWithValid

      Returns void

    • Updates the isRenderable property based on various conditions.

      Returns void

    • Recompute the isSimple flag and the cached contain-resize check.

      Returns void

      Called from property setters that affect whether the node is "simple" (rotation, scaleX, scaleY, mountX, mountY, texture, textureOptions). This runs on the cold setter path, not per-frame.

    • Changes the renderable state of the node.

      Parameters

      • isRenderable: boolean

      Returns void