Hi to everyone,
I found a bug in isFrameDisplayed function in CCSprite.m file, I'm using version 0.99.5 don't know if other version are affected too.
The bug is that the function does not consider offset when evaluating if two frames are equal, then if you use animation with frames simply shifted the first frame is displayed correctly the other are not displayed at all because they are considered equal, this is problematic above all if you are using TexturePacker to make animation with auto-alias turned on.
Here is my solution:
-(BOOL) isFrameDisplayed:(CCSpriteFrame*)frame
{
CGRect r = [frame rect];
//solution
return (frame.texture.name == self.texture.name) &&
(CGRectEqualToRect(r, rect_)) &&
(CGPointEqualToPoint(unflippedOffsetPositionFromCenter_, frame.offsetInPixels));
//original
// return ( CGRectEqualToRect(r, rect_) &&
// frame.texture.name == self.texture.name );
}
Hope this can help someone, as many post on this site helped me.
Regards
Antonio