# Libgdx import bin/xml/json from physics editor

I'm using Libgdx. I did a simple json file in Physics Body Editor and I don't have any idea how could I import it into my physic world in libgdx.

Any idea will be appreciated.

P.S: Sorry if there are question with the same subject, I didn't find any of them.

• One of the features listed for the Physics Body Editor is a 'Loader provided for LibGDX game framework'. The page I linked to also gives an example of how to use the loader. Isn't this what you're looking for? – NauticalMile Jun 3 '14 at 18:24

use this code. Though you must have got a file named app.java when you downloaded .zip of physics body editor. This code is from that file only which uses .json file from the editor.

    // 1. Create a BodyDef, as usual.
BodyDef bd = new BodyDef();
bd.type = BodyType.DynamicBody;

// 2. Create a FixtureDef, as usual.
FixtureDef fd = new FixtureDef();
fd.density = 1;
fd.friction = 0.5f;
fd.restitution = 0.3f;

// 3. Create a Body, as usual.
bottleModel = world.createBody(bd);

// 4. Create the body fixture automatically by using the loader.