摘要: 感慨什么的不多说了,就是想创建声音,音效的开关按钮,可参考cocos2d-x的Demo代码,其文件为: CCControlSwitchTest.cpp。 我将其资源放置到本人Demo的资源目录中,其大概代码如下: .h文件 #include "cocos2d.h" #include "cocos-e 阅读全文
posted @ 2016-02-01 00:53 Code~ 阅读(445) 评论(0) 推荐(0) 编辑
摘要: 如果有这样的数据,如: “100#200#300#400”,在之前使用orge引擎的情况下,可借助split来实现,如: Ogre::String str = "100#200#300#400"; StringVector strVec = StringUtil::split(str,"#"); 其 阅读全文
posted @ 2016-01-10 00:28 Code~ 阅读(624) 评论(0) 推荐(0) 编辑
摘要: 本文使用的是cocos2d-x 2.1.6版本,cocosstudio1.6.0.0版本。其调用的相关代码如下:bool HelloWorld::init(){ // ... UILayout* pWidget = dynamic_cast(GUIReader::shareRea... 阅读全文
posted @ 2016-01-05 23:48 Code~ 阅读(944) 评论(0) 推荐(0) 编辑
摘要: 我使用的是cocos2d-x 2.2.6版本,cocostudio 使用的是1.6.0.0版本,针对于UICheckBox的使用,大概代码如下: bool HelloWorld::init() { //... UILayer* m_pUILayer = UILayer::create(); m_pU 阅读全文
posted @ 2016-01-05 22:50 Code~ 阅读(462) 评论(0) 推荐(0) 编辑
摘要: 在上一篇中,声音和音效的播放的主要接口,结果编写如下代码: float m_MusicVol = 0.5f; // (0.0f~1.0f) 音量大小 float m_WavVol = 0.5f; // (0.0f~1.0f) 音效大小 CocosDenshion::SimpleAudioEngine 阅读全文
posted @ 2015-12-30 20:40 Code~ 阅读(675) 评论(0) 推荐(0) 编辑
摘要: 在编写读取.xml文件的功能时,参考网上的资料各种问题,所以不才写出以下测试用例,供程序新人作为参考使用吧。 (1) 创建UTF-8格式的.xml,命名为Item.xml,数据如下(已加注释,如果若要使用,请去掉注释): <?xml version="1.0" encoding="UTF-8" st 阅读全文
posted @ 2015-12-14 19:49 Code~ 阅读(466) 评论(0) 推荐(0) 编辑
摘要: 在web开发中通过(?)方式在浏览器地址栏传值时,浏览器是通过“&”来区分参数个数及取值的,比如:http://localhost/default.aspx?param1=10&5 &param2=20假如说,我想取值param1中的10和5,然而因为&这个转义字符的存在,会导致参数接受错误。针对于... 阅读全文
posted @ 2015-12-08 21:53 Code~ 阅读(8066) 评论(0) 推荐(0) 编辑
摘要: 使用cocostudio1.6.0 UI Editor创建的进度条UI加载在Cocos2d-x版本时,其原有的代码示例如下: UILoadingBar* pBar = NULL; pBar =dynamic_cast<UILoadingBar*>(m_pUILayer->getWidgetByNam 阅读全文
posted @ 2015-12-02 20:59 Code~ 阅读(1009) 评论(0) 推荐(0) 编辑
摘要: 使用cocostudio 在cocos2d-x 编写项目功能时,将某个UIButton设置为无效的时候,即为:Button ->SetEnable(false)出现问题: 按钮消失了。然后尝试方法:(1) Button ->setBright(false); 这样的情况下,设置的Normal,pre... 阅读全文
posted @ 2015-11-21 01:08 Code~ 阅读(1383) 评论(0) 推荐(0) 编辑
摘要: 1. 配置IIS环境(1)打开控制面板(查看方式:类别) -> 程序 ->程序和功能 -> 打开或关闭Windows功能,然后“打开或关闭Windows功能”,如果所示:(2) 将“Windows功能”下的“Internet信息服务”所有的选项都勾上,如果所示:然后点击确定,安装需要几分钟时间,安装... 阅读全文
posted @ 2015-10-31 16:52 Code~ 阅读(4444) 评论(0) 推荐(0) 编辑