Hi, can i get a basic example of using animation events in JS?
The documentation code is in C#
anim.AnimationEventTriggered = HandleAnimationEvent;
void HandleAnimationEvent(tk2dSpriteAnimator animator, tk2dSpriteAnimationClip clip, int frameNo) {
tk2dSpriteAnimationFrame frame = clip.GetFrame( frameNo );
Debug.Log( frame.eventInt );
}
I get that i attach the script to the object with the spriteanimator but the example JS script doesn't have any event callback syntax, and I'm not sure how to do it.
http://www.unikronsoftware.com/2dtoolkit/docs/latest/tutorial/scripting_a_sprite_animator.htmlIs there some simple way to check callback like:
OnAnimationEvent(eventdata : data){
if(eventdata.info = FRAME3){
CODE
}
}
I just need a super basic example. Thanks