标签:style blog color os io strong for ar
Animation
直接贴代码,具体里面一些加载SpriteFrame等操作,参考我的上一篇文章。这个是创建一个多帧动画在一个Sprite上显示。
Sprite* buble = Sprite::createWithSpriteFrameName("buble.png"); Vector<SpriteFrame*>frames; for (int i=0;i<iAnimCount; i++) { char pngName[20]; sprintf(pngName, "%s%d.png",strAnimName.c_str(),i+1); SpriteFrame *frame = SpriteFrameCache::getInstance()->spriteFrameByName(pngName); frames.pushBack(frame); } //生成Animation对象 Animation* animation =Animation::createWithSpriteFrames(frames,fps); //创建动画 Animate* AnimAction = Animate::create(animation); buble->runAction(AnimAction);
cocos2dx-3.2 笔记 - Animation,布布扣,bubuko.com
标签:style blog color os io strong for ar
原文地址:http://www.cnblogs.com/kee-chen/p/3928715.html