LoadComplete fired when transitioning from a complete timeline animation state to an idle state. You can subscribe to Rive events with a callback that the runtime may invoke, and from there, your callback can handle extra functionality at just the right moment when the event fired.
Other practical use cases for events:
- Coordinating audio playback at specific moments in an animation, see Audio Events
- Opening a URL when specific interactions have occurred
- Adding haptic feedback on meaningful touch interactions
- Implementing functionality on Buttons and other UI elements
- Send semantic information
- Communicate any information your runtime needs at the right moment
Subscribing to Events
When you subscribe to Rive events at runtime, you subscribe to all Rive events that may be emitted from a state machine, and you can parse through each event by name or type to execute conditional logic. Let’s use a 5-star rater Rive example to set any text supplied with events and open a URL if one is given.Event is a sealed class with two options:
OpenUrlEventGeneralEvent
StateMachine instance:
properties returns Map<String, CustomProperty>. CustomProperty is also a sealed class with options:
CustomNumberPropertyCustomBooleanPropertyCustomStringProperty
value field. On the Event class, there are convenient accessors:
StateMachine is disposed.
RiveWidgetController, that will also dispose the StateMachine and remove all event listeners.