roscminni Posted March 19, 2015 Share Posted March 19, 2015 Hi all, I have just purchased the box2d plugin, which is awesome. I have also been looking at the RUBE editor, which looks like an ideal place to build your and test your box2d world. I'm just getting to grips with physics engines and I was wondering: How you would go about loading a world created in RUBE into Phaser? Can you import elements, like a Body with Fixtures, into Phaser? Any help appreciated or if someone can point me in the right direction. Thanks. Link to comment Share on other sites More sharing options...
Samsamsam Posted May 12, 2015 Share Posted May 12, 2015 Hi Rosc, Have you by any chance figured out how to use a scene created in Rube with Phaser? Take care Link to comment Share on other sites More sharing options...
Valafar Posted July 30, 2015 Share Posted July 30, 2015 Have you checked out the examples and tutorials? Basically, in preload function you load the exported RUBE JSON file, like this:game.load.text('rubeScene', 'rubeScene.json');In create function you initialize the scene:rubeScene = new Phaser.Physics.Box2D.RubeScene('rubeScene');rubeScene.load(0, 0, function () { yourSprite = rubeScene.getSprite('nameOfTheImageYouSetInRUBE');}You can also access bodies, fixtures, joints, etc. in similar way (i.e. by 'rubeScene.get(Body|Fixture|Sprite|Joint|...)'). kleepklep 1 Link to comment Share on other sites More sharing options...
Recommended Posts