2012-08-09 61 views
0

我用Zwoptex創建了精靈表並生成.plist文件。我有問題將這些精靈錶鏈接到我的iOS遊戲。我將在Zwoptex上創建的.plist和.png文件加載到Xcode,但更改無法識別。我不知道爲什麼會發生這種情況。這場比賽是用科科斯創造的。Sprite Sheet問題?

謝謝!

+0

更需要信息...那你試試?你會得到什麼結果?你期待什麼?任何警告/錯誤消息? – LearnCocos2D 2012-08-09 20:59:47

+0

我用Zwoptex創建精靈表和.plist文件。 我手動將.plist和相關的.png文件添加到xcode項目中。所有這些文件都顯示在Project Navigator上,所以我確實看到它們。我開始使用以下代碼更新項目上的** AppDelegate.m **: – esierr1 2012-08-09 22:24:55

+0

'//刪除啓動閃爍 \t [self removeStartupFlicker];如果([GameUtils sharedUtils] .deviceType == kDeviceIPad){[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@「Images.plist」]; //加載精靈文件 [CCSpriteBatchNode batchNodeWithFile:@「Images.png」]; [[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@「[email protected]~ipad.plist」]; [CCSpriteBatchNode batchNodeWithFile:@「[email protected]~ipad.png」];' – esierr1 2012-08-09 22:26:27

回答

0

下面是如何使用在cocos2d我是個spriteSheet不知道這是你想找一個例子,以缺乏細節,但

[[CCSpriteFrameCache sharedSpriteFrameCache]addSpriteFramesWithFile:@"TreeSequance.plist"]; 
     CCSpriteBatchNode *treeSheet = [CCSpriteBatchNode batchNodeWithFile:@"TreeSequance.png"]; 

      CCSprite *smallerTree = [CCSprite spriteWithSpriteFrameName:@"Tree1.png"]; 

       smallerTree.position = ccp(500,500); 
       [treeSheet addChild:smallerTree]; 
       [self addChild:treeSheet]; 
+0

我用這個'//刪除啓動閃爍[self removeStartupFlicker]; //如果([GameUtils sharedUtils] .deviceType == kDeviceIPad){[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@「Images.plist」]加載精靈文件; [CCSpriteBatchNode batchNodeWithFile:@「Images.png」]; [[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@「[email protected]~ipad.plist」]; [CCSpriteBatchNode batchNodeWithFile:@「[email protected]~ipad.png」]; – esierr1 2012-08-09 22:28:44