0
添加多個spritesheets我有以下代碼來設置我的spritesheets和一批節點:在cocos2d
CGSize screenSize = [[CCDirector sharedDirector] winSize];
[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"soldier-test.plist"];
[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"soldier-running.plist"];
batchNode = [CCSpriteBatchNode batchNodeWithFile:@"soldier-test.png"];
self.player = [Player spriteWithSpriteFrameName:@"shooting s0000.bmp"];
[batchNode addChild:self.player];
[player setPosition:ccp(screenSize.width/2, screenSize.height/2)];
[self addChild:batchNode];
但是,當我努力的球員(CCSprite的一個子類)使用框架從執行操作第二個spritesheet,我得到與紋理文件有關的斷言錯誤。我是否需要將這些表合併爲一個,還是有一種方法可以跨多個spritesheet跨越一個CCSprite?