Hello,
I am trying to load resources generated from cocostudio to visual studio project. My cocos2d version is 3.2rc0
Auto generated project file (via “cocos new” command) (proj.win32) for visual studio orginaly contains mygame, libAudio, libchipmunk, libcocos2d so I added libCocosStudio project aswell. Without it there were include problems. Classes were not found problems.
Than I use http://upyun.cocimg.com/CocoStudio/helpdoc/v1.0.0.0/en/index.html this link and code block at the end of the page to load resources. When I try to compile project I got these errrors.
Warning 1 warning C4996: 'cocos2d::GL::deleteTextureN': was declared deprecated c:\flashy\flashy\cocos2d\cocos\deprecated\ccdeprecated.h 1023
Error 2 error C2061: syntax error : identifier 'CocoLoader' c:\flashy\flashy\cocos2d\cocos\editor-support\cocostudio\ccsscenereader.h 80
Error 3 error C2061: syntax error : identifier 'CocoLoader' c:\flashy\flashy\cocos2d\cocos\editor-support\cocostudio\ccsscenereader.h 81
Warning 4 warning C4996: 'cocos2d::CCScene': was declared deprecated c:\flashy\flashy\classes\helloworldscene.cpp 38
Warning 5 warning C4996: 'cocos2d::CCNode': was declared deprecated c:\flashy\flashy\classes\helloworldscene.cpp 40
Error 6 error C1903: unable to recover from previous error(s); stopping compilation C:\flashy\flashy\proj.win32\c1xx
here is my code block
bool HelloWorld::init()
{
//////////////////////////////
// 1. super init first
if ( !Layer::init() )
{
return false;
}
//cocostudio::SceneReader readme;
//Creat new scene
CCScene * newscene = CCScene::create();
//Creat root node frome export file by scene editor.
CCNode *pNode = cocostudio::SceneReader::getInstance()->createNodeWithSceneFile("publish/FishJoy2.json");
//Get a audio component by name
cocostudio::ComAudio *pAudio = (cocostudio::ComAudio*)(pNode->getComponent("Audio"));
//paly audio
pAudio->playBackgroundMusic(pAudio->getFile(), pAudio->isLoop());
//Get a ComRender component by tag
cocostudio::ComRender *pFishRender = (cocostudio::ComRender*)(pNode->getChildByTag(10010)->getComponent( "butterFlyFish"));
//convert to armature
cocostudio::CCArmature *pButterFlyFish= (cocostudio::CCArmature *)(pFishRender->getNode());
pButterFlyFish->getAnimation()->playByIndex(0);
//add the node to new scene
newscene->addChild(pNode, 0, 1);
//replace scene
CCDirector::sharedDirector()->replaceScene(newscene);
return true;
}