1

I'm using cocos2d v0.99.5-beta2 and I have a strange problem only on iPhone 1st gen and iPhone 3g.

When I change iPhone's orientation all my CCSprite are deformed and duplicated. I already have tested many methods to rotate my scene but I always have the same result.

But I haven't this problem on simulator, iPhone 4 and iPad.

See screenshots

I wonder if it's not a problem linked to the hardware. It looks like as the graphic hardware doesn't support orientation changes. But it's only suppositions.

I hope someone can help me.

bmaruani
  • 11
  • 2

1 Answers1

0

Not sure if this will make a difference but are you specifying the content size of the texture or are you letting cocos2d define it? Here I am using a subclass of CCSprite (spuButton):

CCTexture2D *redButtonNormal = [[CCTextureCache sharedTextureCache] addImage:@"RedButtonNormal.png"];  //I don't specify the content size.

spuButton *redButton = [spuButton spuButtonWithTexture:redButtonNormal];
        redButton.position = ccp(((size.width / 2) - (redButton.contentSize.width / 2)), ((size.height / 2) + (redButton.contentSize.height / 2)));

[self addChild:redButton];

Hope this helps 8)

Mark7777G
  • 1,246
  • 2
  • 16
  • 26