Interactivity powered by state machines
Interactivity is currently in it’s early stages of developement and not production ready. Please be aware that this API will change. If your state machine is not working as expected please create an issue on Github.
Creation
Learn how to create dotLotties with state machines here.
Usage
The state machines defined inside your .lottie
file are usable with the following methods on the DotLottie
instance:
Method | Description | Value |
---|---|---|
loadStateMachine(stateMachineId: string) | Loads the state machine configuration contained inside the .lottie using its ID as specified in the manifest.json file of the .lottie file. | |
startStateMachine() | Starts the state machine. | |
stopStateMachine() | Stops the state machine. Any events sent will now be ignored. | |
postStateMachineEvent(event: string) | Send an event to the state machine. | ”Bool: true”, “Bool: false”, “String: …”, “Numeric: 0.0”, “OnPointerDown: 0.0 0.0”, “OnPointerUp: 0.0 0.0”, “OnPointerMove: 0.0 0.0”, “OnPointerEnter: 0.0 0.0”, “OnPointerExit: 0.0 0.0”, “OnComplete” |