My problem is that whenever I change the texture of a sprite, the new texture will retain the size of the original sprite's texture.
I have this code:
mySprite = [CCSprite spriteWithFile:@"mySprite.png"]];
...
// change current stage here
CCTexture2D *newTexture=[[[CCTexture2D alloc]initWithImage:[UIImage imageNamed:[NSString stringWithFormat:@"stage number %d.png",currentStageNumber]]]autorelease];
[mySprite setTexture:newTexture];
The new sprite is stretched or compressed depending on the size of the original sprite. If the original sprite is larger, the new texture is stretched.
I didn't have this problem when I was using cocos2d v0.8
What am I doing wrong?