解决了。
我的cocos2d-x版本是3.3, cocostudio版本是1.6
cocos2d-x的项目是空项目,把cocostudio导出的文件放到Resource目录下(“anim/DemoPlayer0.png”, “anim/DemoPlayer0.plist”, “anim/DemoPlayer.ExportJson”)
在HelloWorldScene.cpp的init()里加上:
// add cocos studio animation
ArmatureDataManager::sharedArmatureDataManager()->addArmatureFileInfo(“anim/DemoPlayer0.png”, “anim/DemoPlayer0.plist”, “anim/DemoPlayer.ExportJson”);
//创建动画精灵,参数为cocoStudio动画编辑器创建的动画项目的名称
CCArmature *armature = CCArmature::create(“DemoPlayer”);
CCArmatureAnimation *pAnimation = armature->getAnimation();
//播放动画
pAnimation->playWithIndex(0);
armature->setScale(0.5);
armature->setPosition(visibleSize.width / 2, visibleSize.height / 2);
//添加动画精灵
addChild(armature);
VisualStudio工程里里添加libCocosStudio项目,游戏主项目的属性/Linker/Input, Additional Dependencies里添加 “E:\Projects\cocos\AndroidTest_cocostudio_anim\proj.win32\Debug.win32\libCocosStudio.lib”
生成后就通过了