标签:cache mes blog 系统 nali span anim unit original
1、plist文件的使用:
导入到系统缓存中。
auto pSpriteFrameCache = SpriteFrameCache::getInstance();
pSpriteFrameCache->addSpriteFramesWithFile("PersonalInfoLayer/Plist.plist", "PersonalInfoLayer/Plist.png");
2、Animation动画:
flag_Hua = AnimationCache::getInstance()->getAnimation(flag); flag_Hua = Animation::create(); flag_Hua->setDelayPerUnit(0.4f); flag_Hua->setRestoreOriginalFrame(true); int i = 1; while (mum) { sprintf(buf, "hua%d.png", i); auto pFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(buf); if (!pFrame) break; flag_Hua->addSpriteFrame(pFrame); --mum; ++i; } AnimationCache::getInstance()->addAnimation(flag_Hua, flag); Animate * animete = Animate::create(flag_Hua);
标签:cache mes blog 系统 nali span anim unit original
原文地址:http://www.cnblogs.com/xiaohaige/p/7687882.html