然后我们在 项目(MyCppGame)上点击右键选择添加引用
dio导出的骨骼动画" title="Cocos2dx3.0
然后,我们 MyCppGame 项目属性(点击右键选择属性)中选择 "配置属性" => "C/C++" => "附加包含目录" 并编辑.
添加下面几行
$(EngineRoot)cocos
$(EngineRoot)extensions
$(EngineRoot)cocos\editor-support\
$(EngineRoot)cocos\editor-support\cocostudio
$(EngineRoot)cocos
结束之后是这样
项目工程文件夹 ......\Resources下面.
我们打开HelloWorld.cpp给其添加引用以及命名空间
好了,赶快运行下吧.
#include "CocoStudio.h"
using namespace cocostudio;
ArmatureDataManager::getInstance()->addArmatureFileInfo("Hero0.png","Hero0.plist","Hero.ExportJson");
Armature *armature = Armature::create( "Hero");
armature->setPosition(ccp(visibleSize.width * 0.5,visibleSize.height * 0.5));
armature->getAnimation()->playWithIndex(0);
this->addChild(armature);
return true;