RiveCanvasSession

constructor(riveWorker: RiveWorker, artboard: Artboard, stateMachine: StateMachine, viewModelInstance: ViewModelInstance? = null, fit: Fit = RenderingDefaults.defaultFit(), @ColorInt clearColor: Int = RenderingDefaults.CLEAR_COLOR)

Parameters

riveWorker

The Rive worker that holds the resources to render. See the note above regarding polling.

artboard

The artboard to render. Must be from the supplied riveWorker.

stateMachine

The state machine to advance and render. Must be from the supplied artboard.

viewModelInstance

An optional view model instance to bind to the state machine. Must be from the supplied riveWorker.

fit

The Fit to use when rendering. This controls how the artboard is scaled to fit the target surface. Defaults to RenderingDefaults.defaultFit.

clearColor

The color used to clear the draw region before drawing each frame. Defaults to RenderingDefaults.CLEAR_COLOR.