0

I found out how to change the colour of constraints:

draw_options = pymunk.pygame_util.DrawOptions(screen)
draw_options.constraint_color = 200,200,200

But when drawing small objects, the size of the constraint appears to be too large and makes it look bad.
enter image description here

Is there a way to reduce the size of those pin joints? Instead of a radius of 5 pixels, I'd prefer 1 or 2 pixel radius joints/constraints.

An alternative was to make it partly transparent, but adding an alpha component to the colour doesn't seem to work.

draw_options.constraint_color = 200,200,200,50
Nav
  • 19,885
  • 27
  • 92
  • 135

1 Answers1

1

Unfortunately the debug draw color for constraints doesnt work. https://github.com/viblo/pymunk/issues/160

But in general if you want special drawing its probably easiest to do it yourself. Its mainly meant for debugging and quick prototyping, so if you need more than whats included try drawing it yourself instead. There are some examples that does custom drawing and does not depend on the debug draw code.

viblo
  • 4,159
  • 4
  • 20
  • 28