Skip to main content
M
9mo ago

RIve Low-Level API

Hello, I am a doing React + Rive project.
I have several issues to complete the project. I want to hear your detailed explanation.
Here is my questions.

1. How to get events with low level API

1 reply
9mo ago

Hi , you can see how we get the reported events on the high level API here. I'll include that as a code snippet as well below:

const numEventsReported = stateMachine.reportedEventCount();
if (numEventsReported) {
  for (let i = 0; i < numEventsReported; i++) {
    const event = stateMachine.reportedEventAt(i);

    if (event) {
      // Got the event
    }
  }
}
stateMachine.advance(elapsedTime);

Be sure to get the events before calling advance on the state machine