我决定使用BatchNodes进行一些练习,但是我被卡住了 这是一些代码:
[[CCSpriteFrameCache sharedSpriteFrameCache]addSpriteFramesWithFile:@"scene1atlas.plist"];
[[CCSpriteFrameCache sharedSpriteFrameCache]addSpriteFramesWithFile:@"CloudsAtlas.plist"];
sceneSpriteBatchNode = [CCSpriteBatchNode batchNodeWithFile:@"scene1atlas.png"];
cloudSpriteBatchNode = [CCSpriteBatchNode batchNodeWithFile:@"CloudsAtlas.png"];
[self addChild:sceneSpriteBatchNode z:20];
[self addChild:cloudSpriteBatchNode z:21];
SomeGameObject *gameObject = [[SomeGameObject alloc]
initWithSpriteFrameName:@"sv_anim_1.png"];
gameObject.texture=[sceneSpriteBatchNode texture];
[sceneSpriteBatchNode addChild:gameObject
z:1000 tag:kGameObjectTagValue];
*** Assertion failure in -[GameObject setTexture:]
如何正确设置纹理?