然后把导出的cocostudio项目添加到vc项目的resource中,然后是代码.h
- #ifndef__HELLOWORLD_SCENE_H__
- #define__HELLOWORLD_SCENE_H__
- #include"cocos2d.h"
- #include"cocos-ext.h"
- USING_NS_CC_EXT;
- classHelloWorld:publiccocos2d::CCLayer
- {
- public:
- //Here'sadifference.Method'init'incocos2d-xreturnsbool,insteadofreturning'id'incocos2d-iphone
- virtualboolinit();
- //there'sno'id'incpp,sowerecommandtoreturntheexactlyclasspointer
- staticcocos2d::CCScene*scene();
- //aselectorcallback
- voidmenuCloseCallback(CCObject*pSender);
- voidtouchEvent(CCObject*pSender,TouchEventTypetype);
- voidcountrytouch(CCObject*pSender,TouchEventTypetype);
- //implementthe"staticnode()"methodmanually
- UILabel*mText;
- UILabel*mCountryLabel;
- CREATE_FUNC(HelloWorld);
- };
- #endif//__HELLOWORLD_SCENE_H__
cpp