Hersir

solved
Animation stop and onAnimationEnd

9 posts in this topic

Hi,

wanted to discuss behaviour of animation stop and onAnimationEnd callback. Right now it is called on 2 scenarios if your animation played through or you stoped animation. Should we have some boolean  that indicated if onAnimationEnd should be called if animation is stopped? Or everyone is ok that callback is triggered always? Had some weird issues till found that out :D 

Share this post


Link to post
Share on other sites

For my understanding animation end callback should only be triggered if animation is played till frame that was set in beginAnimation but not on animation stop :D. I have use case where animation is played and it could be stopped at any point and there should be different behaviour if animation finished or it was stopped. But I found workaround for it, by ignoring onAnimationEnd callback if animation is stopped. 

But some info about it in docs would be nice.

Share this post


Link to post
Share on other sites

@Deltakosh Sure. Here is PG with use case that made issue. Animation is run and if it is not interrupted it will call animationEnd callback and box2 will get white color. But if you click on canvas during animation, it will be stopped and box2 should be black color butt it is still white because after stopping animation callback is called. Here is version with workaround PG. I just used animatible object and before stopping it set onAnimationEnd = undefined, so it is not called.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.