Skip to main content

Function: addRiveRenderLayer()

addRiveRenderLayer(riveFileUri, gameContainer, layerService, riveCache, riveParameters?): Promise<readonly [RiveRenderLayer, HTMLCanvasElement, RiveFile]>

Defined in: rendering/utilities/add-rive-render-layer.ts:28

Adds a Rive render layer to the game container and registers it with the layer service. It also creates a canvas for the layer.

Parameters

riveFileUri

string

The URI of the Rive file to load.

gameContainer

HTMLElement

The HTML element that will contain the canvas.

layerService

LayerService

The layer service to register the layer with.

riveCache

RiveCache

The Rive cache to load the Rive file from.

riveParameters?

Partial<RiveParameters>

Additional parameters for the Rive layer.

Returns

Promise<readonly [RiveRenderLayer, HTMLCanvasElement, RiveFile]>

An array containing the created layer, canvas, and Rive file.