I am making ios game using cocos2d-x (version on 2.1rc0-x-2.1.3), now stuck on Key Frame Animation problem:
Here is my problem's detail: Currently We just need key frame animation in games(simple,no bones),but in cocos2d-x, the animation is a bit of too simple: when make animation, I have to load several separate images, to code the animation process manually, like animation example code:
CCAnimation *animation = CCAnimation::create();
for (int i = 1; i < 15; i++)
{
char szImageFileName[128] = {0};
sprintf(szImageFileName, "Images/grossini_dance_%02d.png", i);
animation->addSpriteFrameWithFileName(szImageFileName);
}
CCAnimate *action = CCAnimate::create(animation);
sprite->runAction(action);
It really sucks...then I make a deep search, found that cocosBuilder may do this job,and there have two kickstarer projects may support my request:
1 Spriter: this tool can easily create key frame animation(with bone or not, really simple to use!!), and it can export animation data into a self-made (.scml)XML format,But it has a big weak spot!! is it has no offical cocos2d-x runtime support, some developers has made their code, but all buggy and lack of docs.
2 "Cocos-builder": It's a shame not found cocos-builder has this kind of function(mainly because I currently do not have a Mac, still working on windows),It seems can edit key frame sprites and export to .ccb files, and I see cocos2d-x has code support for it(like CCBAnimationManager etc. I do not read the code in details..)
3 "Spine": It's a great tool,much same like Spriter it has power functions export animation data into jason file and most important is!!: it has fully cocos2d-x runtime support.But this tool is a little bit hard to get hands on(I have to read its doc to know how to add a key frame, and now still trying to figure out how to create "not-bone type" key frame animation)
Is there anyone can give us some guide to choose the best way for Data-Driven non-bone Key Frame Animation?
Any helps will be appericated.
UPDATE:After a little ask in Spine forum,I found out the solution(Spine does support in a hidden way). So now Spine are our choice.
Best Regards, Frank Cheng