Rive Canvas Session
constructor(riveWorker: RiveWorker, artboard: Artboard, stateMachine: StateMachine, viewModelInstance: ViewModelInstance? = null, fit: Fit = RenderingDefaults.defaultFit(), @ColorInt clearColor: Int = RenderingDefaults.CLEAR_COLOR)
Parameters
rive Worker
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.
state Machine
The state machine to advance and render. Must be from the supplied artboard.
view Model Instance
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.
clear Color
The color used to clear the draw region before drawing each frame. Defaults to RenderingDefaults.CLEAR_COLOR.