c++11新特性
文章平均质量分 62
aiwobiezoukaicnew
平凡、简单、自律强高度。(You can destroy me , but you can't control me, this is me ,this is the fucking for myself.)
展开
-
C++11新特性(二)override, final 简单使用
#include #include #include #define CC_CONSTRUCTOR_ACCESS protected class Node { public: virtual bool runAction() = 0; virtual bool showSpritePath() = 0; virtual i原创 2014-12-19 18:46:55 · 603 阅读 · 0 评论 -
C++11新特性(五)看看外国佬写的代码move的使用
具体参考:http://www.codeproject.com/Articles/570638/Ten-Cplusplus11-Features-Every-Cplusplus-Developer 最后部分,为了理解move的使用,copy下代码调试下: 外国人写的代码就是简洁,一目了然。 #include #include template type翻译 2014-12-20 00:55:18 · 684 阅读 · 0 评论 -
C++11新特性(三)Strongly-typed enums 强类型枚举简单使用
#include enum class KObjectType { KPlayerType, kMonsterType, kNPCType, KObjectTypeCount, }; class Node { public: virtual void setType( KObjectType type原创 2014-12-19 20:01:34 · 547 阅读 · 0 评论 -
C++11新特性(六)bind,function,lambda简单使用
#include #include using namespace std; class Node; class Touch; class Event; #define FUNCTIONCALL function #define CC_CAL_BACK2(selector, target, ...) bind(&selector,原创 2014-12-20 01:53:56 · 398 阅读 · 0 评论 -
cocos2dx3.2 谈谈精灵也能加入触摸事件回调函数简单使用,呢吗有木有更有的方法
在我点游戏界面中放置两个按钮:Start, Exit,代表开始游戏,和结束游戏,如下: 看到了吧,妹妹不错吧,嘿,百度搜的。。 那么怎么做到的呢? 首先导入资源ExitButton.jpg 和StartButton.jpg, 然后创建精灵如: auto start = Sprite::create("StartButton.jpg"); start->setP原创 2014-12-23 18:14:45 · 480 阅读 · 0 评论 -
cocos2dx3.2 xcode中资源路径设置问题
在xcode中,将资源分类,然后将各自的文件夹添加到Resources,运行程序的时候老是报错, 说是找不懂资源,原因就是找不到资源路径。那么如何设置呢? 1、首先在 xcode左边的Resources上面用两个手指轻轻点下,(这个我不知道怎么表达,是双击呢,还是单击呢,好像都不是,管它呢), 然后在弹出框,选择第一个,Show in Finder,如下图: 接着创建自己的资源文件原创 2015-01-03 12:41:06 · 1538 阅读 · 0 评论