Rive Events
Access Rive Events in Unreal.
For more information on Rive Events see the respective runtime and editor documentation.
Overview
Rive Events provides a way to communicate information from the graphic to your runtime code, such as a button press. An event can contain any number of the following properties: boolean, number, or string.
Accessing Events
To access a Rive event, bind the Event Name to a Custom Event from the Artboard. In this example, the CustomRiveEvent
will fire each time an event named Rating
is reported.
An Event is accessed by its string name from an Artboard (retrieved from a RiveFile).
The function Print to Texts
takes the Rive Event and loops over all of the event's properties.
Example
Let's take a look at an example. The video below demonstrates a Rive file using the "Star Rating" example. This example reports an event each time one of the stars are pressed. The event is named Rating
and contains a number property named value
that matches the pressed star.
In Blueprint, we:
Bind Named Rive Event:
Rating
Break the RiveEvent, and loop over the number properties
Break each RiveEventNumberProperty
Find the number property named
value
Print the value of the number property