2014-07-09 31 views
0

當我嘗試從SpriteBuilder中的智能sprite表複製紋理時遇到了問題。SpriteBuilder&CCTexture - 從SpriteBuilder中的智能sprite表複製紋理

當我複製一個sprite.texture它似乎複製完整的智能精靈表而不是個別圖像。

例如

如果我創建使用圖像名稱

CCSprite *redSprite = [CCSprite spriteWithImageNamed:@"Images/Red-Sprite.png"]; 

,並使用該精靈,它工作正常精靈。

但是如果我

_textureRedSprite = redSprite.texture; 

將複製完整的精靈表並使用它作爲紋理而不是單個圖像我需要。

任何想法我可能做錯了什麼?

感謝

回答

1

而是與工作/引用精靈的質地:

_textureRedSprite = redSprite.texture; 

..用它包含兩個紋理參考精靈的精靈幀以及紋理的偏移和矩形對於該特定圖像的地圖集:

CCSpriteFrame* redSpriteFrame = redSprite.spriteFrame; 
otherSprite.spriteFrame = redSpriteFrame; 
+0

你是男人steffan ...生病給它去並報告回 – Tom

+0

幹得好的男人....該死的我希望我是熟練掌握cocos2d – Tom

相關問題