随笔分类 - cocos2d-x
摘要:1. 首先,声明一个2个大小的sprite数组class GameScreen : public cocos2d::Layer{public: ... cocos2d::Sprite *backgroundSpriteArray[2];};2. 完成初始化,1张图片用于当前显示,另1张用...
阅读全文
摘要:Scene* MainMenu::createScene(){ // 'scene' is an autorelease object auto scene = Scene::create(); // 'layer' is an autorelease object ...
阅读全文
摘要:iOS:This is done using XCode project details (select the requiredorientation) Android:AndroidManifest.xml (android:screenOrientation=portrait)
阅读全文
摘要:代码如下:Size visibleSize = Director::getInstance()->getVisibleSize(); /* create two sprites which have overlapped parts */ Sprite* sp1 = Sprite::cr...
阅读全文
摘要:#include "base/ccMacros.h"
阅读全文
摘要:1. 配置引擎根目录支持C/C++->常规->附加包含目录->增加->$(EngineRoot)2. 引入头文件#include "cocos-ext.h"using namespace cocos2d::extension;3. 测试代码:bool HelloWorld::init(){ i...
阅读全文
摘要:菜单都以MenuItem开头MenuItemLabel - 文本菜单项MenuItemImage - 图片菜单项// on "init" you need to initialize your instancebool HelloWorld::init(){ if (!Layer::init(...
阅读全文
摘要:1. 进入console目录cd/Users/apple/Documents/MyArchitecture/Cocos2d-x/Framework/cocos2d-x-3.4/tools/cocos2d-console/bin2. 编写shell脚本存放在自己的程序目录newproject.sh#!...
阅读全文
摘要:在Xcode 6 beta里编译Cocos2d-x iOS项目时可能会失败,提示如下错误:Undefined symbols for architecture i386:"_fwrite$UNIX2003", referenced from: _unixErrorHandler in libcoco...
阅读全文
摘要:方法一:$ cd cocos2d-x$ ./setup.py$ source FILE_TO_SAVE_SYSTEM_VARIABLE$ cocos new MyGame -p com.your_company.mygame -l cpp -d NEW_PROJECTS_DIR方法二:>cd You...
阅读全文