Hello kind people of the box2d,
dabbling with this fine piece of code, i failed to have Debug Draw draw me anything much.
I get no error and i know bodies exist and move, but nothing at all is displayed.
This is my code and i've no idea what's wrong with it. Would any of you be kind enough to lend a hand?
dabbling with this fine piece of code, i failed to have Debug Draw draw me anything much.
I get no error and i know bodies exist and move, but nothing at all is displayed.
This is my code and i've no idea what's wrong with it. Would any of you be kind enough to lend a hand?
Code:
private function DDraw():void
{
var sprite:Sprite = new Sprite();
var drawer:b2DebugDraw = new b2DebugDraw();
drawer.SetSprite(sprite);
drawer.SetDrawScale(20);
drawer.SetFlags(1);
drawer.SetAlpha(0.8);
drawer.SetLineThickness(1);
world.SetDebugDraw(drawer);
addChild(sprite);
}
{
var sprite:Sprite = new Sprite();
var drawer:b2DebugDraw = new b2DebugDraw();
drawer.SetSprite(sprite);
drawer.SetDrawScale(20);
drawer.SetFlags(1);
drawer.SetAlpha(0.8);
drawer.SetLineThickness(1);
world.SetDebugDraw(drawer);
addChild(sprite);
}