上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 43 下一页
摘要: #includeusing namespace std;class A{ public: void print() { coutusing namespace std;class A{ public: virtual void print() { ... 阅读全文
posted @ 2014-12-02 16:36 yufenghou 阅读(120) 评论(0) 推荐(0)
摘要: auto menu=Menu::create(MenuItemImage::create ("normal.png","selected.png", [](Object* obj) { log("menu... 阅读全文
posted @ 2014-12-02 14:56 yufenghou 阅读(113) 评论(0) 推荐(0)
摘要: 第一次写#pragma once#include "cocos2d.h"USING_NS_CC;class Ball:public Sprite{public: virtual bool init(); static Ball* create() { Ball *b=... 阅读全文
posted @ 2014-12-02 13:21 yufenghou 阅读(162) 评论(0) 推荐(0)
摘要: 内存管理,防止内存泄露如果a类引用某个那么内存块加1,如果a类不在引用了,内存块减一,当计数为0的时候,清空这个内存块。retain()函数void Ref::retain(){ CCASSERT(_referenceCount > 0, "reference count should gre... 阅读全文
posted @ 2014-12-02 12:58 yufenghou 阅读(325) 评论(0) 推荐(0)
摘要: 以前我所想到的拆分类的方法就是通过产生新的类来拆分类但是,可以用最简单的方法来,就是分页写类的实现。首先,画出类的流程图,比如坦克的move可以卸载tankmove.cpp坦克的运动可以写到tankaction.cpp中。所有的声明写在tank.h头文件当中。 阅读全文
posted @ 2014-12-02 03:36 yufenghou 阅读(151) 评论(0) 推荐(0)
摘要: LabelTTF *label=LabelTTF::create(); label->setString("dongshen"); label->setPosition(200,200); label->setFontSize(36); addChild(label); 阅读全文
posted @ 2014-11-25 22:04 yufenghou 阅读(138) 评论(0) 推荐(0)
摘要: MessageBox("内容","标题"); 阅读全文
posted @ 2014-11-25 21:54 yufenghou 阅读(148) 评论(0) 推荐(0)
摘要: log("dongshen %d",22222); 阅读全文
posted @ 2014-11-25 21:50 yufenghou 阅读(98) 评论(0) 推荐(0)
摘要: Scene *scene=Scene::create(); Layer *layer=Layer::create(); scene->addChild(layer); Sprite *s=Sprite::create("HelloWorld.png"); s->set... 阅读全文
posted @ 2014-11-25 21:43 yufenghou 阅读(103) 评论(0) 推荐(0)
摘要: #define CREATE_FUNC(__TYPE__) \static __TYPE__* create() \{ \ __TYPE__ *pRet = new __TYPE__(); \ if (pRet && pRet->init()) \ { \ pRet-... 阅读全文
posted @ 2014-11-25 21:01 yufenghou 阅读(115) 评论(0) 推荐(0)
上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 43 下一页