上一页 1 2 3 4 5 6 7 8 9 10 ··· 28 下一页
摘要: 1. playBackgroudMusic() playBackgroudMusic 只适合播放持续时间比较长的声音文件,比如背景音乐。 [html] view plain copy print? bool PlayMusic::init() { if ( !Layer::init() ) { re 阅读全文
posted @ 2016-07-19 13:22 silent-bobo 阅读(810) 评论(0) 推荐(0) 编辑
摘要: 功能需求: 1. 需要实现倒计时功能,在屏幕上显示00:00格式的倒计时时间 2. 跳转到别的页面中,也需要在后台倒计时来恢复体力 3. 游戏关闭后,再次进入的时候在指定页面中显示倒计时时间和剩余体力值 4. 体力恢复最大值时,显示Max 。。。。。。 思路: 1. 存储一个时间值(心的倒计时结束时 阅读全文
posted @ 2016-07-14 12:30 silent-bobo 阅读(1040) 评论(0) 推荐(0) 编辑
摘要: 方法没有最好,只有适不适合。 选择合适的变量来存储日期和时间是根据应用场景而定的。 C语言标准库中提供了以下有关时间的函数: time()函数可以得到一个从1900年1月1日0点0分0秒到目前的秒数 localtime()函数,将该整数转换为一个时间结构体struct tm中。 ctime()和as 阅读全文
posted @ 2016-07-14 11:00 silent-bobo 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 在同事的一语道破下,想到了, 在最底层设置一个Layer,用来添加需要弹窗的界面, 每次添加的时候都要求先删除所有的子节点, 这样每次添加后就只有一个弹窗层了。 阅读全文
posted @ 2016-07-11 18:32 silent-bobo 阅读(147) 评论(0) 推荐(0) 编辑
摘要: [mw_shl_code=cpp,true] //3D晃动的特效 //CCActionInterval* shaky3D = CCShaky3D::create(5, CCSize(10, 10), 15, false); //pSprite->runAction(shaky3D); //3D瓷砖晃 阅读全文
posted @ 2016-07-07 11:12 silent-bobo 阅读(1171) 评论(0) 推荐(0) 编辑
摘要: 以上是获取当前年月日 详解的其他方法 linux,ios下的 win32下 阅读全文
posted @ 2016-07-06 17:30 silent-bobo 阅读(1803) 评论(0) 推荐(0) 编辑
摘要: cocos2d-x中的字符串: <1>:使用 const char* 和 std::string const char* 是C风格的字符串 ,std::string 是C++风格的字符串,它封装了 const char * 初始化 std::string 对象: std::string name = 阅读全文
posted @ 2016-07-06 17:29 silent-bobo 阅读(1152) 评论(0) 推荐(0) 编辑
摘要: ? 1 class HelloWorld : public cocos2d::Layer,public ScrollViewDelegate ? 1 class HelloWorld : public cocos2d::Layer,public ScrollViewDelegate ? 1 clas 阅读全文
posted @ 2016-07-05 15:24 silent-bobo 阅读(2430) 评论(0) 推荐(0) 编辑
摘要: 本文主要介绍下ScrollView在cocos2dx中的使用,其主要用来实现关卡的选择,以及人物拖拽选择等方面。比如: 人物选择: 关卡选择: 其他不多说直接进入主题: .h文件 #include "cocos2d.h" #include "cocos-ext.h" USING_NS_CC_EXT; 阅读全文
posted @ 2016-07-05 15:11 silent-bobo 阅读(6134) 评论(0) 推荐(0) 编辑
摘要: 第二天了,终于弄好了,生活不易啊。 引擎版本 cocos2d-x 3.10 先配置环境变量, 引入头文件: 配置属性: 在 init() 方法中添加如下内容: 效果演示: 阅读全文
posted @ 2016-07-05 12:39 silent-bobo 阅读(180) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 28 下一页