hey everyone, i am stuck in how to import frames from plist into project and also add them into array and how to animate those frames ??
please help me friends
thank you
That`s easy!
//First load frames:
CCSpriteFrameCache::sharedSpriteFrameCache()>addSpriteFramesWithFile;>spriteFrameByName(fileName~~>getCString);
//Then:
CCArray* frames = new CCArray;
CCSpriteFrameCache* frameCache = CCSpriteFrameCache::sharedSpriteFrameCache;
for
{
CCString* fileName = CCString::createWithFormat;
CCSpriteFrame* frame = frameCache
frames~~>addObject(frame);
}
CCAnimation* animation = CCAnimation::createWithSpriteFrames(frames, 1);
CCAnimate* animate = CCAnimate::create(animation);
sprite->runAction(animate);
//Don`t forget to delete Array!
It works fine thanks for your help…