Libgdx and Box2D Draw a custom shape

2019-08-17 13:09发布

问题:

I have the following shape: http://s16.postimg.org/sfhb5wgdx/slime.png and I want to draw it in LibGDx just like that because am using Box2d wand will be used in collisions. I have heard I can used a mesh to create this but there isn't much documentation about drawing anything from an image. Do I seriously have to define all the points myself? Is there a better way to extract a shape from in image?

回答1:

Use Physics body editor https://code.google.com/p/box2d-editor/ this will solve your problem



标签: box2d libgdx