StateMachine

An instantiated state machine from an Artboard.

Can be used to create a Rive composable and to manually advance the state machine.

Create an instance of this class using rememberStateMachine or StateMachine.fromArtboard. When using the latter, make sure to call close when you are done with the state machine to release its resources.

Parameters

stateMachineHandle

The handle to the state machine on the command server.

riveWorker

The Rive worker that owns the state machine.

artboardHandle

The artboard handle that owns the state machine.

name

The name of the state machine, or null if it's the default state machine.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val name: String?

Functions

Link copied to clipboard
fun advance(deltaTime: Duration)

Advance the state machine by the given delta time in nanoseconds.

Link copied to clipboard
open override fun close()