<span style="font-size:18px;">SpriteFrame* frame=NULL;</span>
創建一個Vector容器
vector<SpriteFrame*> sp_vc;
將圖片循環加入容器Vector中:int iFrameNum=10;//以自己的圖片數量爲準
for(int i=1;i<=iFrameNum;i++)
{
frame=SpriteFrame::create(String::createWithFormat("run%d.png",i)->getCString(),CCRectMake(0,0,130,130));
sp_vc.pushBack(frame);
}
然後就可以將容器內的數據加入到Animation::createWithSpriteFrames()函數中了。