2016年5月22日

linux静态库和动态库编译

摘要: 今天要用到静态库和动态库,于是写了几个例子来巩固一下基础。hello1.c ———————————————————— #include <stdio.h>void print1(int i) { int j; for(j=0;j<i;j++) { printf("%d * %d = %d\n",j, 阅读全文

posted @ 2016-05-22 18:35 W.C 阅读(1203) 评论(0) 推荐(1) 编辑

2016年5月12日

虚拟机打不开解决方法

摘要: http://so.trust.blog.163.com/blog/static/17188620020111222444441/ 阅读全文

posted @ 2016-05-12 08:19 W.C 阅读(220) 评论(0) 推荐(0) 编辑

2016年5月3日

cocos2dx数据传递

摘要: 一:GameScene场景向TestLayer层中数据传递(传递结构体等大量数据) 1:TestLayer.h中定义GameScene *gameScene 2:TestLayer()的构造函数中添加参数GameScene *scene,并在TestLayer中gameScene=scene 3:使 阅读全文

posted @ 2016-05-03 12:19 W.C 阅读(288) 评论(0) 推荐(0) 编辑

2016年4月21日

场景中添加图层

摘要: 一:GameScene中添加一个Layer图层 1:GameScene.h中定义两个结点 cocos2d::Node *rootNode; cocos2d::Node *BL_rootNode; 2:GameScene.cpp的init函数中添加两结点 //获取visibleSize visible 阅读全文

posted @ 2016-04-21 11:32 W.C 阅读(296) 评论(0) 推荐(0) 编辑

cocos2dx场景之间数据传递

摘要: 一:简单数据直接用UserDefault传递 二:较复杂数据(HelloWorldScene向MainScene传递数据) 1:MainScene.h文件中定义数据int m 2:HelloWorld场景转换代码 auto scene=Scene::create(); MainScene *laye 阅读全文

posted @ 2016-04-21 11:28 W.C 阅读(540) 评论(0) 推荐(0) 编辑

场景基本动作

摘要: 1:场景切换 Director::getInstance()->replaceScene(TransitionFade::create(0.0f,HelpScene::createScene() )); 阅读全文

posted @ 2016-04-21 10:00 W.C 阅读(134) 评论(0) 推荐(0) 编辑

IOS移植到安卓

摘要: 1:判断是IOS或安卓 #if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) #elif (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) #endif 阅读全文

posted @ 2016-04-21 09:57 W.C 阅读(340) 评论(0) 推荐(0) 编辑

音效

摘要: 1:播放声音 #include "SimpleAudioEngine.h" CocosDenshion::SimpleAudioEngine::getInstance()->playEffect("Public/right.wav"); 阅读全文

posted @ 2016-04-21 09:51 W.C 阅读(123) 评论(0) 推荐(0) 编辑

常用图片打包与具体使用

摘要: 1:用TexturepPacker将图片打包,导出QF.plist,QF.png两个文件放到res/Public目录下 2:AppDelegate.cpp中将图片加载到缓存中 //预处理 //加载图片到缓存中 SpriteFrameCache *cache=SpriteFrameCache::sha 阅读全文

posted @ 2016-04-21 09:49 W.C 阅读(266) 评论(0) 推荐(0) 编辑

倒计时实现

摘要: 1:.h文件中设置计时器回调函数 void nextTime(float dt); 2:.cpp文件中添加计时器 //设置计时器 schedule(schedule_selector(GameScene0::nextTime),1.f,CC_REPEAT_FOREVER,1.f); 3:计时器回调函 阅读全文

posted @ 2016-04-21 09:41 W.C 阅读(146) 评论(0) 推荐(0) 编辑

导航