Box2d Level Editor

Hi guys,
I made a box2d level editor. You can find it here:http://www.jacobschatz.com/bisonkick
Let it load.
I made it in Flex for Actionscript3 users. I want C++ programmers to be able to use it as well.
It currently outputs an actionscript3 multidimensional array of info:
Code:
//order: x , y , height, width, rotation, isDynamic, shape, friction,density,restitution,ID
 var map:Array = [
[259,408,50,302,0,false,'SQUARE' , 0.5,0.5,0.5,'iq']
,[205,232,50,50,0,true,'CIRCLE' , 0.5,0.5,0.5,'iq']
,[279,230,50,50,0,true,'CIRCLE' , 0.5,0.5,0.5,'iq']
,[247,318,50,50,0,true,'CIRCLE' , 0.5,0.5,0.5,'iq']
];

What would be the C++ equivalent of this array?
Also in it's current state would it work for C++ programmers or does something need to change?
I know that the flash version of box2d has registration points for the shapes in the center.. Is this true for C++ as well?
hey it's great!
IMO you should add a field for additional info.
for example someone can store the sprite file name,
or other information for an element of a videogame but not strictly connected to the physics.

but it is still OK!
So is a multidimensional array the best way to send info to C++?
in Actionscript 3 I send this:
Code:
//order: x , y , height, width, rotation, isDynamic, shape, friction,density,restitution,ID
 var map:Array = [
[133,168,50,50,0.2801400450818924,false,'SQUARE' , 0.5,0.5,0.5,'iq']
,[224.2568878505796,124.18699926414965,50,50.000000000000014,0.5481100464052429,false,'SQUARE' , 0.5,0.5,0.5,'iq']
,[142.16923058555182,106.67653026016984,49.99999999999999,49.99999999999999,-0.1681296345455191,true,'SQUARE' , 0.5,0.5,0.5,'iq']
,[218,197,50,50,0,false,'CIRCLE' , 0.5,0.5,0.5,'iq']
,[243.5,83,98,101,0,true,'CIRCLE' , 0.5,0.5,0.5,'iq']
];

And this is all different types of info. I know you can't really do that in C++ right?
Very good idea ! Currently I'm using Inkscape (an opensource SVG editor) as an editor and a custom Python script to generate a world description file (in JSON). Then in my C++ program I load the JSON file and create the box2d world accordingly.

The main problem with Inkscape, I need to affects some physics values to my svg elements, to do that I need to edit the XML file and add it by myself in comments or in a useless field. Then I copy/paste this elements from a "base" level that contains all my game elements to create a new level.

I would love to see this kind of editor whatever it generates. Do you plan to make it open source ?
Hi, a little bug:
(1) press play,
(2) during the simulation press the spacebar: simulation will restart
(3) click the "x" button to stop the simulation: it will not stop
(4) re-press "x": OK

I think it create a new simulation window for each spacebar is pressed, probably?
I have updated my box2d editor a lot. goto http://www.jacobschatz.com/bisonkick
You now can create custom polygons and view live previews. Output as3 or xml. You can save your levels. And email your levels to others. output custom code. You should really check it out and let me know what you think.


Thanks,
Jacob
http://www.jacobschatz.com/bisonkick
I have added joint attachment to my box2d editor. Please check it out. It is in Beta right now so I would love to know about all the bugs you find and any improvements you would like to see. I also made an easy to use API for Actionscript 3 so you can create your levels.
http://www.jacobschatz.com/bisonkick-beta
You can still use the original at
http://www.jacobschatz.com/bisonkick
First of all, thanks for creating this level editor - it is very useful!

As future improvements I'd like to suggest the following: customizable gravity, ability to select all objects within a specified rectangle (instead of using "shift" and click), ability to move objects even when a "follower" object is specified and movable camera in live preview.

As for bugs, you probably shouldn't use "3" as a keyboard shortcut since it causes a problem when attempting to input values to textboxes. There's also a problem in the live preview which causes objects selection to be inaccurate - try to move a small object and you'll see what I mean.

Original thread: https://box2d.org/forum/viewtopic.php?t=5368