Hi everyone
I'm using box2d and pyglet to make a simple demo.
All I want is to enable the debug draw method to see what's going on underneath, so I don't have to put test sprites for everything i draw.
I've used box2d in Java before, and in Java, it's as simple as enabling the debug renderer and it's done! But I don't know if that's possible in python.
I saw some solutions suggesting that I should implement the class b2draw manually and put my code in the draw methods. I tried it to some extend but I have no clue what i'm doing. 😕
so here's the code from the b2Draw class that I'm trying to change to make it draw a circle so far:
Could someone point me to the right direction ?
Thanks
I'm using box2d and pyglet to make a simple demo.
All I want is to enable the debug draw method to see what's going on underneath, so I don't have to put test sprites for everything i draw.
I've used box2d in Java before, and in Java, it's as simple as enabling the debug renderer and it's done! But I don't know if that's possible in python.
I saw some solutions suggesting that I should implement the class b2draw manually and put my code in the draw methods. I tried it to some extend but I have no clue what i'm doing. 😕
so here's the code from the b2Draw class that I'm trying to change to make it draw a circle so far:
Code: Select all
class DebugDraw(Box2D.b2Draw):
def __init__(self):
super(DebugDraw,self).__init__()
def DrawCircle(self, *args, **kwargs):
"""
DrawCircle(b2Draw self, b2Vec2 center, float32 radius, b2Color color)
Draw a circle.
"""
return _Box2D.b2Draw_DrawCircle(self, *args, **kwargs)
Could someone point me to the right direction ?
Thanks