Rive Events

These events are specific to rive component and can be added to rive components only. These fire callback at various events in rive component. To know more about other events in fastn, checkout events page.

on-rive-play[<timeline>]

The on-rive-play[<timeline>] event gets fired when the animation starts playing.

on-rive-pause[<timeline>]

The on-rive-pause[<timeline>] event gets fired when the animation pauses.
Input
-- string $idle: Unknown Idle State

-- ftd.text: $idle

-- ftd.rive:
id: vehicle
src: https://cdn.rive.app/animations/vehicles.riv
autoplay: false
artboard: Jeep
$on-rive-play[idle]$: $ftd.set-string($a = $idle, v = Playing Idle)
$on-rive-pause[idle]$: $ftd.set-string($a = $idle, v = Pausing Idle)


-- ftd.text: Idle/Run
$on-click$: $ftd.toggle-play-rive(rive = vehicle, input = idle)
Lang:
ftd
Output
Unknown Idle State
Idle/Run

on-rive-state-change[<timeline>]

The on-rive-state-change[<timeline>] event gets fired when a state change occurs.
Input
-- integer $bounce: 0

-- ftd.row:
spacing.fixed.px: 5

-- ftd.text: Number of times bounce occur:
-- ftd.integer: $bounce

-- end: ftd.row

-- ftd.rive:
id: van
src: https://cdn.rive.app/animations/vehicles.riv
state-machine: bumpy
$on-rive-state-change[bounce]$: $ftd.increment($a = $bounce)

-- ftd.text: Click to Bump
$on-click$: $ftd.fire-rive(rive = van, input = bump)
Lang:
ftd
Output
Number of times bounce occur:
0
Click to Bump

Support fastn!

Enjoying fastn? Please consider giving us a star ⭐️ on GitHub to show your support!

Getting Help

Have a question or need help?

Visit our GitHub Q&A discussion to get answers and subscribe to it to stay tuned.

Join our Discord channel and share your thoughts, suggestion, question etc.

Connect with our community!

Found an issue?

If you find some issue, please visit our GitHub issues to tell us about it.

Join us

We welcome you to join our Discord community today.

We are trying to create the language for human beings and we do not believe it would be possible without your support. We would love to hear from you.
Copyright © 2023 - FifthTry.com