- 本帖最后由 qq200600 于 2012-11-9 13:19 编辑 *
我从一个写好的json文件中读取world 里面已经写好了 刚体的属性啥的 都写好了 是一个box2d editor里面生成的
在win32下显示出来 填满了窗口 但是编译到手机上的时候就没有满 不知道为什么 求解 跪求
709
下面是编译在手机上面显示的
711这是我解析的json文件
712这是我的解析用的第三方代码
713
这是我在工程中调用的代码
b2Vec2 gravity;
gravity.Set(0.0f, -10.0f);
bool doSleep = true;
world = new b2World(gravity);
world->SetAllowSleeping(doSleep);
world->SetContinuousPhysics(true);
std::string errorStr;
std::string fullPath = CCFileUtils::sharedFileUtils()->fullPathFromRelativePath("1.json");
unsigned long fsize;
unsigned char *file = CCFileUtils::sharedFileUtils()->getFileData(fullPath.c_str(),"rt+", &fsize);
b2dJson b2json(true);
std::string s = "";
int i;
for (i=0;i < fsize; i++)
{
s+=file*;
}
world = b2json.readFromString(s, errorStr);*