Constructors

Properties

animationManager: AnimationManager
boundsMargin: [number, number, number, number]
contextSpy: null | ContextSpy = null
currentFrameTime: number = 0
defShaderCtr: BaseShaderController
deltaTime: number = 0
eventBus: EventEmitter

Renderer Event Bus for the Stage to emit events onto

In reality this is just the RendererMain instance, which is an EventEmitter. this allows us to directly emit events from the Stage to RendererMain without having to set up forwarding handlers.

fontManager: TrFontManager
lastFrameTime: number = 0
options: StageOptions
preloadBound: Bound
renderer: CoreRenderer
root: CoreNode
shManager: CoreShaderManager
strictBound: Bound
strictBounds: boolean
textRenderers: Partial<TextRendererMap>
txMemManager: TextureMemoryManager

Methods

  • Parameters

    • props: Partial<CoreNodeProps>

    Returns CoreNode

  • Parameters

    • props: Partial<CoreTextNodeProps>

    Returns CoreTextNode

  • Emit all queued frame events

    Returns void

    This method should be called after the frame has been rendered to emit all events that were queued during the frame.

    See queueFrameEvent for more information.

  • Queue an event to be emitted after the current/next frame is rendered

    Parameters

    • name: string
    • data: unknown

    Returns void

    When we are operating in the context of the render loop, we may want to emit events that are related to the current frame. However, we generally do NOT want to emit events directly in the middle of the render loop, since this could enable event handlers to modify the scene graph and cause unexpected behavior. Instead, we queue up events to be emitted and then flush the queue after the frame has been rendered.

  • Request a render pass without forcing an update

    Returns void

  • Resolves the default property values for a Node

    Parameters

    • props: Partial<CoreNodeProps>

    Returns CoreNodeProps

    This method is used internally by the RendererMain to resolve the default property values for a Node. It is exposed publicly so that it can be used by Core Driver implementations.

  • Given a font name, and possible renderer override, return the best compatible text renderer.

    Parameters

    • trProps: TrProps
    • textRendererOverride: null | (keyof TextRendererMap) = null

    Returns null | TextRenderer<TextRendererState>

    Will try to return a canvas renderer if no other suitable renderer can be resolved.