Open katccat opened 3 months ago
It might also depend on how you use your sprites. If this is the correct offset, it looks to me like you are using a trimmed sprite and draw it around its center - but it's hard to know from the details you are providing here.
Can you check out this tutorial: https://www.codeandweb.com/physicseditor/tutorials/libgdx-physics
It might help you getting it fixed.
When I chose the LibGDX exporter I kept noticing that bodies created using data from the PhysicsEditor would end up nowhere near the location of the Box2d BodyDef passed to the createBody method of the PhysicsShapeCache object. That is because as long as you draw fixtures within the canvas borders, every coordinate will be positive and that is either an oversight or it is just handled incorrectly by the loader. For example, in order for this fixture to be centered horizontally in game, it has to be clipping in the middle of the editor's left wall.