游戏历程
文章平均质量分 64
知风23_
这个作者很懒,什么都没留下…
展开
-
json读取和写入数据
一、从字符串中读取JSONa.cpp?1234567891011121314151617181920212223242526272829303132#include #include "json/json.h"转载 2014-09-10 11:26:05 · 7520 阅读 · 1 评论 -
cocos2dx 字符串管理
在Cocos2d-x中能够使用的字符串constchar*、std::string和cocos2d::__String等,其中const char*是C风格的字符串,std::string是C++风格的字符串,它封装了const char*。cocos2d::__String才是Cocos2d-x引擎提供的字符串类,这些字符串都可以互相转换,它们会在不同的场景下使用,具体使用那个可以看具体的API转载 2014-09-10 09:30:37 · 933 阅读 · 0 评论 -
jsoncpp使用总结
Introductionjson is a lightweight data-interchange format. It can represent integer, real number, string, an ordered sequence of value, and a collection of name/value pairs. For detail:http://www.转载 2014-09-11 09:27:15 · 641 阅读 · 0 评论 -
cocos2dx 在button回调函数里removeFromParent崩溃
找到UIWidget.cpp文件:然后做以下修改(最新版本貌似已经做出了修正):void Widget::pushDownEvent(){ this->retain(); if (_touchEventCallback) { _touchEventCallback(this, TouchEventType::BEGAN); } if (_tou原创 2014-12-01 14:38:05 · 2058 阅读 · 0 评论 -
使用cocos-2dx 3.x 封装的PageView
直接上代码:HelloWorldScene.cpp#include "HelloWorldScene.h"USING_NS_CC;#define COIN_WIDTH 212 //coin 图片宽度#define COIN_GAP 100 //间隔#define COIN_COUNT 11 //个数Scene* HelloWorld::createScene(转载 2014-12-01 17:51:06 · 1503 阅读 · 0 评论 -
cocos2dx判断一个点是否在三角形中
// 判断点P(x, y)与有向直线P1P2的关系. 小于0表示点在直线左侧,等于0表示点在直线上,大于0表示点在直线右侧float PosBase::EvaluatePointToLine(float x, float y, float x1, float y1, float x2, float y2){ float a = y2 - y1; float b = x1 - x2; fl转载 2014-12-03 18:02:07 · 962 阅读 · 0 评论