This question nerd-sniped me hard, so I went on a magical journey to figure out how to turn a drawn raster image into Box2D objects.
This proof of concept expects to find an input file input.png
in this project
root directory. Then run make
.
You should find a bunch of intermediate formats in out/
and if you open
game.html
, you should see a Box2D debug view with your objects loaded.
See the makefile
for how the build steps work.
-
make
-
Node.js and npm
Run
npm install
in the project root directory to download Node.js dependencies to the localnode_modules
directory. -
Inkscape
-
potrace
-
ImageMagick (
convert
andmogrify
)
To the extent possible under law, I waive all copyright and related or neighbouring rights to this work.