ActionTestCCAnimationCCAnimateCCAnimationCache執(zhí)行動(dòng)畫的三步驟1.根據(jù)文件創(chuàng)建Animation --(1)多張圖..."/>
您好,登錄后才能下訂單哦!
//1.多張分的的圖片 // Manual animation // CCAnimation* animation = CCAnimation::create(); for( int i=1;i<15;i++) { char szName[100] = {0}; sprintf(szName, "Images/grossini_dance_%02d.png", i); animation->addSpriteFrameWithFileName(szName); } // should last 2.8 seconds. And there are 14 frames. animation->setDelayPerUnit(2.8f / 14.0f); animation->setRestoreOriginalFrame(true); CCAnimate* action = CCAnimate::create(animation); m_grossini->runAction(CCSequence::create(action, action->reverse(), NULL)); //2.plist圖片加載 // File animation // // With 2 loops and reverse //AnimationCache預(yù)加載的使用 CCAnimationCache *cache = CCAnimationCache::sharedAnimationCache(); cache->addAnimationsWithFile("animations/animations-2.plist"); CCAnimation *animation2 = cache->animationByName("dance_1"); CCAnimate* action2 = CCAnimate::create(animation2); m_tamara->runAction(CCSequence::create(action2, action2->reverse(), NULL)); AnimationCache預(yù)加載的使用
//學(xué)習(xí)如何使用工具
拼圖工具:
TexturePacker
Zwoptex
骨骼動(dòng)畫:
cocosbuilder
cocostudio
紅孩兒
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。