随笔分类 -  coco2d-x

摘要:1 std::string CSLoader::GetTextureListFromCsb(const std::string& filename) 2 { 5 std::string path = filename; 6 size_t pos = path.find_last_of('.'); 7 std::string suffix = path.subst... 阅读全文
posted @ 2019-03-21 13:02 小翔momo 阅读(211) 评论(0) 推荐(0)
摘要:解决办法: 在空闲时候异步预加载,后面切换场景就会快很多,前提是内存充足的情况下。 cocos2d-x lua图片资源异步预加载示例: 阅读全文
posted @ 2019-03-21 12:54 小翔momo 阅读(936) 评论(0) 推荐(0)
摘要:在开发过程中,发现小米4c调用CallStaticObjectMethod就会奔溃解决办法:把CallStaticObjectMethod换成CallStaticIntMethod后正常调用PS:怀疑是小米4c手机CallStaticObjectMethod函数底层有bug 阅读全文
posted @ 2015-11-18 14:55 小翔momo 阅读(621) 评论(0) 推荐(0)
摘要:—设置叠加模式,高亮setBlend=function(sp,ctype) local blendType={ {GL_ONE,GL_ONE_MINUS_SRC_ALPHA}, {GL_SRC_ALPHA,GL_ONE} } local cc=ccBle... 阅读全文
posted @ 2015-08-01 06:47 小翔momo 阅读(665) 评论(0) 推荐(0)
摘要://克隆精灵CCSprit *clone(CCNode *sp){CCSprite *csp=NULL;CCSize size=sp->getContentSize();float tempX=sp->getPositionX();float tempY=sp->getPositionY();sp-... 阅读全文
posted @ 2015-08-01 06:46 小翔momo 阅读(233) 评论(0) 推荐(0)
摘要:HelloWorldScene.h 1 #ifndef __HELLOWORLD_SCENE_H__ 2 #define __HELLOWORLD_SCENE_H__ 3 4 #include "cocos2d.h" 5 #include "GameOverScene.h" 6 7 USING_... 阅读全文
posted @ 2015-01-25 18:51 小翔momo 阅读(614) 评论(0) 推荐(0)
摘要:mac:1.用终端进入/Users/lixiang/Desktop/cocos2d-x-3.2/tools/cocos2d-console/bin目录执行./cocos.py。(出现Permission denied,是权限问题,可以先使用chmod命令获得权限,输入chmod u+x ./coco... 阅读全文
posted @ 2015-01-25 18:01 小翔momo 阅读(198) 评论(0) 推荐(0)