cocos2d-x用rube box2d editor当关卡编辑器写游戏
2013-03-07 23:36
288 查看
转载请说明出处:/article/1848381.html
转载请说明出处:/article/1848381.html
注意在编辑的时候 图片的中心一定要和刚体的位置重合
软件地址:https://www.iforce2d.net/rube/
转载请说明出处:/article/1848381.html
std::string fullPath = CCFileUtils::sharedFileUtils()->fullPathFromRelativePath("images.json"); unsigned long size; unsigned char *file = CCFileUtils::sharedFileUtils()->getFileData(fullPath.c_str(), "rt+", &size); std::string str = ""; for (int i = 0; i < size; i++) { str += file[i]; } std::string error; b2dJson json; 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和box2d来制作一个Breakout游戏:第一部分
- 如何使用cocos2d和box2d来制作一个Breakout游戏:第一部分
- 【Cocos2d-x游戏引擎开发笔记(14)】Tiled Map Editor(二)
- [ IOS-Cocos2d-x (Box2d)游戏开发之一] -简单创建一个Box2D
- 四 手游开发神器 cocos2d-x editor 游戏框架介绍
- Cocos2d-x加Box2D制作弹弓类游戏
- cocos2d-x游戏开发必备工具:TexturePacker+PhysicsEditor
- 【Cocos2d-x游戏引擎开发笔记(15)】Tiled Map Editor(三)
- [ IOS-Cocos2d-x (Box2d)游戏开发之二] -Box2D如何开启debugDraw
- 四 手游开发神器 cocos2d-x editor 游戏框架介绍
- 怎样在cocos2d里面如何使用物理引擎box2d制作弹球游戏
- Cocos2d-x加Box2D制作弹弓类游戏
- 7.如何使用cocos2d和box2d来制作一个Breakout游戏:第一部分
- 【iOS-Cocos2d游戏开发之十一】使用Box2d物理系统以及在cocos2d框架添加Box2d物理系统lib包的方法
- [ IOS-Cocos2d-x (Box2d)游戏开发之三] -Cocos2d-x 结合Box2D开发Android游戏配置方法
- 如何使用Box2D和Cocos2D制作一款像Fruit Ninja一样的游戏
- box2d初级教程之一cocos2d box2d 制作弹球游戏
- 使用cocos2d和box2d来制作一个Breakout游戏:第一部分
- 十四 手游开发神器 cocos2d-x editor 之串联游戏流程 推荐