Skip to main content

Exporter

interface Exporter 

The main interface for implementing custom exporters.

Methods

configuration

public configuration(): PromisevoidRendererSettings

Prepare the rendering configuration.

Called at the beginning of the rendering process, before anything else has been set up. The returned value can be used to override the rendering settings provided by the user.


handleFrame

public handleFramecanvas: HTMLCanvasElementframe: numbersceneFrame: numbersceneName: stringsignal: AbortSignalcontext: CanvasRenderingContext2D: Promisevoid

Export a frame.

Called each time after a frame is rendered.

Parameters


start

public startsounds: Sound[]duration: number: Promisevoid

Begin the rendering process.

Called after the rendering has been set up, right before the first frame is rendered. Once start() is called, it is guaranteed that the stop() method will be called as well. Can be used to initialize any resources that require a clean-up.

Parameters

  • sounds: Sound[]

    The sounds to be played during the animation.

  • duration: number

    The duration of the animation in frames.


stop

public stopresult: RendererResult: Promisevoid

Finish the rendering process.

Guaranteed to be called after the rendering has finished - no matter the result. Can be used to finalize the exporting and perform any necessary clean-up.

Parameters