Hi,
I know this is an old thread - but is this a bug, or does CCSpriteFrameCache not support rotated sprites?
I have a sound toggle button, where I switch the texture for a sprite (using a spritesheet made with TexturePacker - with "Allow rotation" enabled)
To switch texture for my sprite, I'm using: (buttonSoundToggle is a CCSprite)
CCSpriteFrame *newIcon = [[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName:@"newSoundIcon.png"];
[buttonSoundToggle setTextureRect:[newIcon rect]];
My icon's is rotated in the spritesheet. If I try to change texture for a sprite, where to code in CCSprite is (aka. no change):
[self setTextureRectInPixels: rectInPixels Rotated: NO untrimmedSize: rectInPixels.size];
then the sprite appears just like it is in the spritesheet - rotated - which it wrong. But if I change the CCSprite code and use:
[self setTextureRectInPixels: rectInPixels Rotated: rectRotated_ untrimmedSize: rectInPixels.size];
The sprite is properly rotated.
I do not like to change in CCSprite if I'm not sure that it is a bug. I can see that version 2.0 is still set it to NO
Or do I switch the texture in a completely wrong way ?
/Dan - using v. 1.0.1