StateMachineInstance

The StateMachineInstance is a helper to wrap common operations to play a state machine.

This object has a counterpart in C++, which implements a lot of functionality. The unsafeCppPointer keeps track of this relationship.

Use this to keep track of a state machine's current state and progress, and to help apply changes that the state machine makes to components in an Artboard.

Parameters

unsafeCppPointer

Pointer to the C++ counterpart.

fileLock

Lock shared by the File and native graph this state machine belongs to.

Constructors

Link copied to clipboard
constructor(unsafeCppPointer: Long, fileLock: ReentrantLock)

Properties

Link copied to clipboard

Getter/Setter for the underlying C++ pointer value.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Whether this objects underlying pointer is still valid.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val name: String
Link copied to clipboard
open val refCount: Int
Link copied to clipboard
override var refs: AtomicInteger
Link copied to clipboard
Link copied to clipboard

The ViewModelInstance assigned to this state machine. Once assigned, modifications to the properties of the instance will be reflected in the bindings of this state machine.

Functions

Link copied to clipboard
open override fun acquire(): Int

Increments the references for this counter. Cannot be used for initialization - use refs.incrementAndGet instead.

Link copied to clipboard
fun advance(elapsed: Float): Boolean

Advance the state machine.

Link copied to clipboard
open external override fun cppDelete(pointer: Long)
Link copied to clipboard
fun eventAt(index: Int): RiveEvent

Get a specific event fired in the last advance.

Link copied to clipboard
fun input(index: Int): SMIInput

Get the input instance at a given index in the state machine.

fun input(name: String): SMIInput

Get the input with a given name in the state machine.

Link copied to clipboard
fun pointerDown(pointerID: Int, x: Float, y: Float): Boolean
Link copied to clipboard
fun pointerExit(pointerID: Int, x: Float, y: Float)
Link copied to clipboard
fun pointerMove(pointerID: Int, x: Float, y: Float)
Link copied to clipboard
fun pointerUp(pointerID: Int, x: Float, y: Float): Boolean
Link copied to clipboard
open override fun release(): Int

Decrements the reference counter.

Link copied to clipboard

Get a specific state changed in the last advance.