Subscribing to Rive Events at runtime.
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:
addEventListener()
/ removeEventListener()
API for DOM elements, you’ll use the Rive instance’s on()
/ off()
API to subscribe to Rive events. Simply supply the RiveEvent enum and a callback for the runtime to call at the appropriate moment any Rive event gets detected.@rive-app/canvas-advanced
), you’ll need to catch Rive events reported during the render loop yourself via your created state machine instance (see docs on Low-level API Usage). To achieve this, before advancing the state machine:reportedEventCount()
APIreportedEventAt(idx)
API