调用骨骼动画:
//加载导出的文件
CCArmatureDataManager::sharedArmatureDataManager()->addArmatureFileInfo("animations/hero.png", "animations/hero.plist", "animations/hero.ExportJson");//创建对象
CCArmature* armature = CCArmature::create( "Hero" );
armature->setPosition(ccp(winSize.width/2, winSize.height/2));
armature->setScale(0.4);
//调用动画
armature->getAnimation()->playWithIndex(0);
this->addChild(armature, 0, 333);
=====================================================
需要包含头文件:
#include "cocos-ext.h"
using namespace cocos2d::extension;
VS项目属性中添加对 libExtension.lib 库的引用;
=====================================================
调用序列帧动画:
//加载导出的三个文件
CCArmatureDataManager ::sharedArmatureDataManager()->addArmatureFileInfo( "animations/frameAnimate0.png", "animations/frameAnimate0.plist" ,"animations/frameAnimate.ExportJson" );
//创建对象
cocos2d::extension:: CCArmature * armature;
armature = CCArmature ::create("frameAnimate" );
armature->setPosition(ccp(winSize.width/2, winSize.height/2));
//调用动画
armature->getAnimation()->playWithIndex(0);
//添加到父节点
this->addChild(armature);
=====================================================
需要包含头文件:
#include "cocos-ext.h"
using namespace cocos2d::extension;
VS项目属性中添加对 libExtension.lib 库的引用;
=====================================================
====================================================================================
使用Cosos Studio制作动画:
http://www.cocoachina.com/bbs/read.php?tid=188273
http://www.cocoachina.com/gamedev/program/2013/0807/6751.html
http://www.tairan.com/archives/4386