2010-10-04 31 views
1

我使用的是cocos2d v0.99.5-beta2,我只有iPhone 1 gen和iPhone 3g有一個奇怪的問題。問題與cocos2d和方向的變化,紋理變形

當我更改iPhone的方向時,我的所有CCSprite都變形並重復了。 我已經測試了很多方法來旋轉我的場景,但我總是有相同的結果。

但我在模擬器,iPhone 4和iPad上沒有這個問題。

See screenshots

我不知道,如果它不是鏈接到硬件問題。它看起來像圖形硬件不支持方向更改。但這只是假設。

我希望有人能幫助我。

回答

0

不知道這是否會有所作爲,但您是指定紋理的內容大小還是讓cocos2d定義它?在這裏我使用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]; 

希望這有助於8)