03 2015 档案

摘要:1 什么时候会用到此设计模式?1)当一个抽象模型有两个方面,其中一个方面依赖于另一方面。将这二者封装在独立的对象中以使它们可以各自独立地改变和复用。2)当对一个对象的改变需要同时改变其它对象,而不知道具体有多少对象有待改变。3)当一个对象必须通知其它对象,而它又不能假定其它对象是谁。换言之,你不希望... 阅读全文
posted @ 2015-03-25 10:55 R_bin 阅读(136) 评论(0) 推荐(0)
摘要:LeetCode之Add Two NumbersYou are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their... 阅读全文
posted @ 2015-03-24 09:59 R_bin 阅读(150) 评论(0) 推荐(0)
摘要:转自:http://blog.csdn.net/tt5267621/article/details/89390201. 切换全屏场景的时候最好使用replaceScene而不是pushScene。因为pushScene并不会销毁前一个scene,仅仅是将后一个scene按照堆栈的方式加入到前一个sc... 阅读全文
posted @ 2015-03-23 17:45 R_bin 阅读(258) 评论(0) 推荐(0)
摘要:1、记得在头文件里包含“../extensions/cocos-ext.h",顺便声明下作用域:USING_NS_CC_EXT;2、在类的继承里 加上ScrollViewDelegate,如下:view sourceprint?1.classHelloWorld :publiccocos2d::La... 阅读全文
posted @ 2015-03-23 15:05 R_bin 阅读(220) 评论(0) 推荐(0)
摘要:init()和onEnter()这俩个方法都是CCNode的方法。其区别如下:1.其被调用的顺序是先init(),后onEnter()。2.init()在类的初始化时只会调用一次。3.onEnter在该类被载入场景的时候被调用,可能会发生多次。4.CCLayer* cclayer = new MyL... 阅读全文
posted @ 2015-03-23 09:59 R_bin 阅读(167) 评论(0) 推荐(0)
摘要:1. ControlButton的介绍ControlButton按钮的大小可以根据标签内容进行缩放,同时它具有很多按钮所需要的功能。2. ControlButton的使用[html]view plaincopyprint?//正常状态下的按钮图片Scale9Sprite*btnNormal=Scal... 阅读全文
posted @ 2015-03-20 10:59 R_bin 阅读(284) 评论(0) 推荐(0)
摘要:1. Scale9Sprite 认识Scale9Sprite 是一张可拉伸的精灵。只要给他设置一下大小,它就能自动拉伸。2.Scale9Sprite的使用[html]view plaincopyprint?Scale9Sprite*nineGirl=Scale9Sprite::create("but... 阅读全文
posted @ 2015-03-20 10:57 R_bin 阅读(187) 评论(0) 推荐(0)
摘要:http://www.cnblogs.com/ShadowLoki/p/3679929.html 阅读全文
posted @ 2015-03-18 14:26 R_bin 阅读(257) 评论(0) 推荐(0)
摘要:时间2014-06-21 20:20:10CSDN博客原文http://blog.csdn.net/u010019717/article/details/32942641转载请注明出处:游戏开发实验室http://blog.csdn.net/u010019717/article/details/32... 阅读全文
posted @ 2015-03-17 15:27 R_bin 阅读(365) 评论(0) 推荐(0)
摘要:1 3.0beta版可以使用CCLog打印,正式版会报错。 阅读全文
posted @ 2015-03-10 17:57 R_bin 阅读(200) 评论(0) 推荐(0)
摘要:转自:http://www.cnblogs.com/haogj/p/3835258.html在 cocos2d-x 中有三个类可以在层或精灵中添加文字:LabelTTFLabelBMFontLabelAtlasLabelTTF 直接支持使用 TTF 字库,可以支持全部的中文,但是效率稍低。Label... 阅读全文
posted @ 2015-03-09 17:42 R_bin 阅读(360) 评论(0) 推荐(0)