Control graphic state and state machine transitions (legacy)
onLoad
callback that’s run when the Rive file is loaded and ready for use. We use this callback to ensure that the state machine is instantiated before we query for inputs.stateMachineInputs
function on the Rive object to retrieve the inputs. Each input will have a name and type. There are three types:StateMachineInputType.Trigger
which has a fire()
functionStateMachineInputType.Number
which has a value
number property where you can get
/set
the valueStateMachineInputType.Boolean
which has a value
boolean property where you can get
/set
the valueVolume Molecule
, not Menu/Volume Molecule
.Volume Component
FX Component
/
separated string of the unique hierarchy names.FX Component
artboard, the path will be Volume Molecule/FX Component
/
in the name for your components, as that will break the search functionality at runtime.setNumberStateAtPath(inputName: string, value: number, path: string)
setBooleanStateAtPath(inputName: string, value: boolean, path: string)
fireStateAtPath(inputName: string, path: string)