Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset the current animation. #1029

Closed
wants to merge 1 commit into from
Closed

Reset the current animation. #1029

wants to merge 1 commit into from

Conversation

lucbloom
Copy link
Contributor

When going from an animating Sprite with multiple frames to an image
with 1 frame, the AnimationManager keeps setting invalid frames upon
the single-frame image.

This fix may not be correct for it overwrites the currentAnimation
always

When going from an animating Sprite with multiple frames to an image
with 1 frame, the AnimationManager keeps setting invalid frames upon
the single-frame image.

This fix may not be correct for it overwrites the currentAnimation
_always_…
photonstorm added a commit that referenced this pull request Jul 15, 2014
…er which will halt the currently running animation (if any) after changing the texture (based on #1029).
photonstorm added a commit that referenced this pull request Jul 15, 2014
…nto an existing animation, even if currently running (based on #1029)

AnimationManager.loadFrameData will now update all existing Animations to use the newly loaded FrameData (based on #1029)
@photonstorm
Copy link
Collaborator

Yes good point. I've added in an optional stopAnimation boolean, which if true will basically just stop the current animation from running, otherwise it carries on going.

@lucbloom
Copy link
Contributor Author

Yesss! Your 2nd commit (updateFrameData) was what I was hoping for. Thanks a lot!
One minor thing: stopping the animation is not the default, if you ask me...

mySprite.loadTexture("car");
mySprite.animations.stop();

Is not that big a deal.

@lucbloom
Copy link
Contributor Author

Also, shouldn't updateFrameData check for an out of bounds error with some kind of mod?

this._frameData.getFrame(this._frames[this._frameIndex % this._frames.length])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants