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

Frame texture reset when going from sprite sheet to single frame #850

Closed
lucbloom opened this issue May 27, 2014 · 1 comment
Closed

Frame texture reset when going from sprite sheet to single frame #850

lucbloom opened this issue May 27, 2014 · 1 comment

Comments

@lucbloom
Copy link
Contributor

Startup:
this.loadTexture("pusher_walk");

During play:
this.getFrameForPosition = function(p)
{
if (this.dead)
{
return 0;
}
return ;// Something with p and frame count
}

this.update = function(elapsed)
{
this.frame = this.getFrameForPosition(this);
}

On death:
this.dead = true;
this.loadTexture("pusher_dead");

BUG: This makes the sprite load pusher_walk's frame 0, because this.animations still has frameData belonging to the sprite sheet.

SOLUTION: this.animations.loadFrameData(null); WHEN game.cache.isSpriteSheet is FALSE...

photonstorm added a commit that referenced this issue May 27, 2014
…a single frame in Sprite.loadTexture (thanks @lucbloom, fix #850)
@photonstorm
Copy link
Collaborator

👍

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

No branches or pull requests

2 participants