[英]How to use JBox2D debug-draw in Slick2D?
Using the JBox2D DebugDraw class for Slick2D it is simple to add debug drawing. 通过将JBox2D DebugDraw类用于Slick2D,可以很容易地添加调试图。 Put the below code in your
init
method: 将以下代码放入您的
init
方法中:
Slick2DJBox2DDebugDraw debugDraw = new Slick2DJBox2DDebugDraw(gameContainer);
debugDraw.setFlags(DebugDraw.e_shapeBit);
world.setDebugDraw(debugDraw); // Where world is your JBox2D world
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.