cocos2d-x-3.0rc1 学习笔记1
2014-04-11 17:08
316 查看
恩,下了个vs2012、cocos2d-x-3.0rc1 ,搭配环境后,在build目录了直接打开,设置默认的启动项目,就可以运行HelloWorld 了
然后看到一个项目里面各种文件、、、、现在才知道main是入口函数、AppDelegate是控制生命周期的,里面创建导演,导演在调用scene()函数,实现场景的调用,基本不用改,要写的就是HelloWorldScene 了,这个文件的话scene() 是场景创建的,里面还有层的创建,也就是layer,创建layer的时候调用init()函数,就是在这里实现各种层的
场景创建:
然后看到一个项目里面各种文件、、、、现在才知道main是入口函数、AppDelegate是控制生命周期的,里面创建导演,导演在调用scene()函数,实现场景的调用,基本不用改,要写的就是HelloWorldScene 了,这个文件的话scene() 是场景创建的,里面还有层的创建,也就是layer,创建layer的时候调用init()函数,就是在这里实现各种层的
场景创建:
Scene* HelloWorld::scene() { // 'scene' is an autorelease object auto scene = Scene::create(); // 'layer' is an autorelease object HelloWorld *layer = HelloWorld::create(); // add layer as a child to scene scene->addChild(layer);//不加的话就是一片漆黑,什么都没有的空场景 // return the scene return scene; }
相关文章推荐
- cocos2d-x-3.0rc1 学习笔记3(场景切换)
- cocos2d-x-3.0rc1 学习笔记2( 什么标题、菜单按钮、粒子效果之类的)
- cocos2d-x-3.0rc1 学习笔记4(场景切换2)
- cocos2d-x-3.0rc1 学习笔记5 (几个最近用的多的动作) lua 写的
- cocos2d-html5学习笔记(二)——cocos2d中的layer
- cocos2d-x学习笔记(17)--简单游戏实例1--双枪手
- cocos2d-x学习笔记—单点触控
- cocos2d-x学习笔记-CCSprite(精灵)
- 我的Cocos2d-x学习笔记(六)坐标体系与锚点
- Cocos2D-X2.2.3学习笔记10(几何图形)
- cocos2d-x 学习笔记—缓存中创建精灵
- Cocos2d-x学习笔记1
- cocos2d-x学习笔记
- cocos2d-x3.1.1 step by step 学习笔记6 Sprite精灵类
- cocos2d-x学习笔记1:cocos2dx 3.0 安装及项目创建
- 【麦可网】Cocos2d-X跨平台游戏开发学习笔记---第一课:游戏原理与机制
- cocos2d-x-3.0学习笔记之标签类
- cocos2d-x 3.1.1 学习笔记[17] 关于这些活动功能
- cocos2d-x 3.1.1 学习笔记[3]Action 动作
- Cocos2d-x 3.x学习笔记:猩先生带你打飞机(三)物理引擎的使用