GB2ShapeCache-x for V 3.2

If any one is interested, the conversion to GB2ShapeCache-x for v 3.2 can be downloaded here:

http://www.redtgames.com/blog/gb2shapecache-x-for-cocos2d-x-v3_2/

Please feel free to make any changes and let me know.

Thanks @AndreasLoew for the great work :smile:

Thanks,
Saket

2 Likes

Thanks - this is awesome.

1 Like

Hi, is there a version for chipmunk?

Send me the 2.x version, I can convert it for you!

Weā€™ve recently updated PhysicsEditor. Including an updated version of the shape cache that works with cocos2d-x out of the box. Weā€™ve renamed the class to PhysicsShapeCache - and it should really be easy to use.

Iā€™ve created a github repository containing the official exporters:

The use of the PhysicsShapeCache is simple:

  1. Load the shapes

    // Load shapes
    shapeCache = PhysicsShapeCache::getInstance();
    shapeCache->addShapesWithFile(ā€œshapes.plistā€);

  2. Create a sprite and attach itā€™s body

    auto sprite = Sprite::create(ā€œbanana.pngā€);
    shapeCache->setBodyOnSprite(ā€œbanana.pngā€, sprite);
    sprite->setPosition(pos);
    addChild(sprite);

An example project can be found here:

Full tutorial is coming soon.

1 Like

@AndreasLoew
I need Box2D generic loader. But itā€™s not compiles with latest cocos2d-x v3.14.
Created bug here https://github.com/CodeAndWeb/PhysicsEditor-Loaders/issues/8

@AndreasLoew ?

Since generic-box2d-plist-cocos2d-x is now not supported officially(so Box2D official loader for PE will not work with latest cocos2d-x): GitHub - CodeAndWeb/PhysicsEditor-Loaders: Use these classes to load the plist/xml file written by PhysicsEditor

Iā€™m looking for solution. @Meir_yanovich maybe you can help with this? Iā€™ve found your loader GitHub - meiry/PhysicsEditor-_cocos2d-x-ver3-loader: updated the cocos2d-x PhysicsEditor loader for cocos2d-x version 3 but itā€™s looks like outdated. Do you have the latest version? Iā€™d really appreciate for any help. Thank you in advance.

Or current topic starter solution works well and tested? My team just needs a well tested classā€¦