我最近开始学习如何创建动画,按照文档来的,但是在CCArray处报了错
CCSpriteFrameCache* cache = CCSpriteFrameCache::sharedSpriteFrameCache(); cache->addSpriteFramesWithFile("laugh.plist","laugh.png"); int iframeNum=6; CCSpriteFrame * frame=NULL; CCArray * frameArray=CCArray::create(); for(int i=i;i<=iframeNum;i++) { frame=cache->spriteFrameByName(CCString::createWithFormat("laugh%02d.png",i)->getCString); frameArray->addObject(frame); } CCAnimation * animation=CCAnimation::createWithSpriteFrames(frameArray); animation->setLoops(-1);//设置循环次数,-1表示无限循环 animation->setDelayPerUnit(0.1f); CCAnimate * action=CCAnimate::create(animation); sprite->runAction(action); ``` 下面这一句出错了CCAnimation * animation=CCAnimation::createWithSpriteFrames(frameArray); ``` 出错原因是参数不对 不存在从 "cocos2d::CCArray *" 转换到 "cocos2d::Vector" 的适当构造函数