Package 

Object StateMachine.Companion

    • Method Detail

      • create

         final StateMachine create(Artboard artboard, String stateMachineName)

        Creates a new StateMachine and suspends until its Rive worker confirms creation.

        This is the replacement for fromArtboard. Its temporary name avoids a source-incompatible overload; it will be renamed to fromArtboard in 12.0 when the unconfirmed API is removed.

        ⚠️ The lifetime of a successfully created state machine is managed by the caller. Make sure to call close when you are done with it to release its resources.

        Parameters:
        artboard - The Artboard to instantiate the state machine from.
        stateMachineName - The name of the state machine to load.
      • fromArtboard

        @Deprecated(message = Use create. This unconfirmed implementation will be removed in 12.0, when create will be renamed to fromArtboard as a suspending API.) final StateMachine fromArtboard(Artboard artboard, String stateMachineName)

        Creates a new StateMachine from an Artboard.

        ⚠️ The lifetime of the returned state machine is managed by the caller. Make sure to call close when you are done with it to release its resources.

        Parameters:
        artboard - The Artboard to instantiate the state machine from.
        stateMachineName - The name of the state machine to load.