我试图让图像移动而不是 jbox2d 中的几何形状。我没有看到图像。
BodyDef bodyDef =new BodyDef();
bodyDef.position.set(100,100);
bodyDef.type=BodyType.DYNAMIC;
//texture=TextureLoader.getTexture("PNG",ResourceLoader.getResourceAsStream("resources/small.png"));
BufferedImage img = null;
try {
img = ImageIO.read(new File("resources/small.png"));
} catch (IOException e) {
}
bodyDef.userData=img;