rive-android icon indicating copy to clipboard operation
rive-android copied to clipboard

Animation touch / click events

Open mspnr opened this issue 3 years ago • 2 comments

Is there any way to retrieve user click events from the animation clip?

  • In the blog https://blog.rive.app/rives-flutter-runtime-part-1/ is described how to trigger animations from outside.
  • In the old Flare documentation https://docs.rive.app/runtimes/components is described how to manipulate nodes from outside

What I'm currently missing is how to let the user to interact with animation elements. E.g. if a user clicks some area in the clip, I can trigger some animation or react somehow else:

Question to implementation mentioned in https://blog.rive.app/rives-flutter-runtime-part-1/ Frame 2 (3)

There is of course a solution, where you intercept the touch / click events for the animation view. And react to the area where the certain animation element should be. But it looks not a totally reliable solution, because you have to align / sync touch processing with animation elements.

mspnr avatar Nov 20 '20 11:11 mspnr

keren banget

mfth12 avatar Nov 27 '20 15:11 mfth12

Hi @applikationsprogramvara you're totally right, right now we don't expose this through the rive-android runtime (or any of our cpp based runtimes for that matter). I've added this enquiry to our more general feedback tracker, as it applies to not just android https://feedback.rive.app/228

We are talking internally about what the api for this should look like, there are a few things being talked about. But we are also in need of exposing more basic information about objects in the hierarchy. Even with just these we should be able to get you a few steps closer to better hit detection for something while it is being animated.

mjtalbot avatar Dec 07 '20 18:12 mjtalbot