-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Example code for Animating on custom events (#4635) #5552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example code for Animating on custom events (#4635) #5552
Conversation
…sing custom events (aframevr#4635)
|
Thanks. The example uses an old version of A-Frame (1.6.0). Also I don't see any animations being triggered. I might be missing something |
|
Hi @dmarcos, thanks for the review. Best, |
|
Thanks for the patience. I'm reluctant to add more glitches to the examples because those need maintenance too and easily go out of date. Could we handle this by adding a couple of lines and pointing to the custom events section of the docs? Thanks |
…event in the existing example and link to emitting custom events.
docs/components/animation.md
Outdated
| animation__mouseenter="property: components.material.material.color; type: color; to: blue; startEvents: mouseenter; dur: 500"; | ||
| animation__mouseleave="property: components.material.material.color; type: color; to: red; startEvents: mouseleave; dur: 500";> | ||
| animation__mouseleave="property: components.material.material.color; type: color; to: red; startEvents: mouseleave; dur: 500"; | ||
| animation__customevent="property: components.material.material.color; type: color; from: red; to: blue; startEvents: startanim001; dur: 500";> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we change the event name? startanim001 not super friendly. What about 'triggeranimation`?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing! I initially named it "startanim001" because we had an emit event with the same name right below. I'll change both the event name and the emit to "triggeranimation" for consistency.
|
Thanks. One more comment |
|
Thanks so much for sticking with it! |
Description:
Need for example regarding the use of custom events to trigger animations in A-Frame. The current documentation does not explicitly show how to use the .emit() function to start animations based on custom events, which can be confusing for new users.
Changes proposed: