0
使用我正在使用的代碼加載紋理圖集:無法添加精靈幀和CCSprite
[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"zones.plist"];
CGSize screenSize = [CCDirector sharedDirector].viewSize;
sprite = [CCSprite spriteWithImageNamed:@"Z_11.png"];
sprite.position = ccp(screenSize.width * 0.5, screenSize.height * 0.5);
[self addChild:sprite];
,但沒有加入。 我也試過:
CCSpriteFrame *sf = [[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName:@"ZONE_2"];
sprite = [CCSprite spriteWithSpriteFrame:sf];
我得到的錯誤:
'Invalid spriteFrame for sprite'
我做錯什麼了嗎?
顯示zones-hd.plist的內容(如果您支持hd)。 – YvesLeBorg 2015-02-06 13:22:07