随笔分类 -  Cocos2d-x

摘要:b2DebugDraw提供调试功能,由于Box2D中所有对象都是不可见的,要创建可见对象我们得用刚体定义中的userData属性来创建自己的图形,如果不创建自己的图形,则用b2DebugDraw类来实现物体的可见,方便调试。 具体代码: private function showDebug():vo 阅读全文
posted @ 2016-08-30 10:33 微风&细雨 阅读(217) 评论(0) 推荐(0)
摘要://粒子系统,使用系统自己的粒子系统的书写方法 if(!CCLayer::init()) return false; CCTexture2D* fire=CCTextureCache::sharedTextureCache()->addImage("fire.png"); CCParticleSystem* firePartical = CCParticleFir... 阅读全文
posted @ 2016-08-29 23:22 微风&细雨 阅读(323) 评论(0) 推荐(0)
摘要:在做数据转换时,最好包含以下头文件 #include <iostream> #include <cmath> #include <string> #include <sstream> USING_NS_CC; using namespace std; 在做数据转换时,最好包含以下头文件 #inclu 阅读全文
posted @ 2016-08-28 15:05 微风&细雨 阅读(657) 评论(0) 推荐(0)