Hersir Posted July 17, 2017 Share Posted July 17, 2017 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 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 17, 2017 Share Posted July 17, 2017 I'm pretty ok with it (as I did it :D)) If this is unclear in the doc, we should improve the doc Quote Link to comment Share on other sites More sharing options...
Hersir Posted July 18, 2017 Author Share Posted July 18, 2017 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 . 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. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 18, 2017 Share Posted July 18, 2017 Fancy doing a PR? Quote Link to comment Share on other sites More sharing options...
Hersir Posted July 19, 2017 Author Share Posted July 19, 2017 @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. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 19, 2017 Share Posted July 19, 2017 I was more thinking about a pull request on the doc Quote Link to comment Share on other sites More sharing options...
Hersir Posted July 19, 2017 Author Share Posted July 19, 2017 Sorry Will do PR Quote Link to comment Share on other sites More sharing options...
Hersir Posted July 19, 2017 Author Share Posted July 19, 2017 Added PR Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 19, 2017 Share Posted July 19, 2017 Thanks a lot! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.