Jump to content

Animation stop and onAnimationEnd


Hersir
 Share

Recommended Posts

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 

Link to comment
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.

Link to comment
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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...