cocos2d-x用rube box2d editor当关卡编辑器写游戏

cocos2d-x用rube box2d editor当关卡编辑器写游戏,第1张

概述转载请说明出处:http://www.voidcn.com/article/p-skioadww-hx.html 转载请说明出处:http://www.voidcn.com/article/p-skioadww-hx.html [cpp]  view plain copy std::string fullPath = CCFileUtils::sharedFileUtils()->fullPath

转载请说明出处:http://www.jb51.cc/article/p-skioadww-hx.html

http://www.jb51.cc/article/p-skioaDWw-hx.HTML

[cpp] view plain copy std::stringfullPath=CCfileUtils::sharedfileUtils()->fullPathFromrelativePath("images.Json"); unsignedlongsize; unsignedchar*file=CCfileUtils::sharedfileUtils()->getfileData(fullPath.c_str(),"rt+",&size); std::stringstr=""; for(inti=0;i<size;i++) { str+=file[i]; } std::stringerror; b2dJsonjson; world=Json.readFromString(str,error); b2dJsonImage*image1_=Json.getimageByname("image1"); CCSprite*image1=CCSprite::create("images/mcclory.png"); image1->setScale((image1_->scale*PTM_RATIO)/image1->getTexture()->getPixelsHigh()); image1Body->SetUserData(image1); this->addChild(image1,0);
注意在编辑的时候 图片的中心一定要和刚体的位置重合


软件地址:https://www.iforce2d.net/rube/

总结

以上是内存溢出为你收集整理的cocos2d-x用rube box2d editor当关卡编辑器游戏全部内容,希望文章能够帮你解决cocos2d-x用rube box2d editor当关卡编辑器写游戏所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/web/1021144.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-23
下一篇 2022-05-23

发表评论

登录后才能评论

评论列表(0条)

保存