This is how I have done it:
var params:Object = new Object();
nape = new Nape("nape", params);
nape.touchable = false;
enableDebug();
add(nape);
private function enableDebug():void
{
debug = new ShapeDebug(GameVars.SCREEN_X,GameVars.SCREEN_Y);
debug.drawBodies = true;
debug.drawSensorArbiters = true;
debug.drawConstraints = true;
Starling.current.nativeOverlay.addChild(debug.display);
stage.addEventListener(Event.ENTER_FRAME, loop );
}
public function loop( evt:Event ) : void {It should be easy to adapt it to your needs. It's pretty straight forward!
debug.clear();
debug.draw(nape.space);
debug.flush();
}
No comments:
Post a Comment