Open sbine opened 5 years ago
Hi Sara,
Sorry this issue has been left for over six months. I ran into a bit of a dead end then. Everything worked except I've had to try to figure out the JSON format PhysicsEditor uses (the program used to generate this JSON: http://labs.phaser.io/assets/physics/fruit-shapes.json). That's why the project has been inactive for all this time since I've been unable to find an answer. I will continue to look for answers regarding the format.
Hi there, Thanks for this great open source editor! I'm playing around with Phaser 3 and tried to use an export file from this tool to create a complex shape, but it seems (at least for the Matter physics engine) that Phaser expects the "type" of the shape to be
fromPhysicsEditor
: https://github.com/photonstorm/phaser/blob/c91ed91ce37ae0838ee36adc56c63e81d48ebe66/src/physics/matter-js/components/SetBody.js#L229while this tool exports "type" as
fromPhysicsShaper
: https://github.com/jaredyork/physics-shaper/blob/3b9284f0f209a7b733351d44cf6f318a2c480e8b/src/js/SceneMain.js#L14I had to change this value to
fromPhysicsEditor
in my export file to get my shapes to load correctly. For anyone else who may be Googling, the error thrown was:Perhaps you could change this value in the export, or add a note to the README explaining how to modify the export file for Phaser 3 matter physics?