Thursday, 18 July 2013

To find Specific CCSprite from a sprite-sheet using plist



[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"playerSS.plist"];   // plist name
    NSString *frameName = [NSString stringWithFormat:@"a%04i.png",10]; 

 // sprite names leg. a0001 -- a000n.png


   //[[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName:frameName];
 CCSprite *arm2 = [CCSprite spriteWithSpriteFrame:[[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName:frameName]];