Jump to content

Resetting Animation


Cless
 Share

Recommended Posts

Assume I try to reset a Sprite's animation:

this.animations.currentAnim.stop(true);

or

this.animations.stop(null, true);

The "true" indicates that the animation should be reset. I'm confused about its behavior. In particular, there is a discrepancy between AnimationManager.currentFrame and Animation.currentFrame. AnimationManager.currentFrame remains unchanged, while Animation.currentFrame is properly set to frame 0. Consequently, the Sprite does not change to frame 0. If I change the code to

this.animations.stop(null, true);this.animations.currentFrame = this.animations.currentAnim.currentFrame;

then it works as expected.

 

Is this supposed to be the case? Is the reset option just a way to "clean up" for the next time the animation is played?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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