# `pymunk.pyglet_util` Module

This submodule contains helper functions to help with quick prototyping using pymunk together with pyglet.

Intended to help with debugging and prototyping, not for actual production use in a full application. The methods contained in this module is opinionated about your coordinate system and not very optimized (they use batched drawing, but there is probably room for optimizations still).

class `pymunk.pyglet_util.``DrawOptions`(**kwargs)

  Bases: `pymunk.space_debug_draw_options.SpaceDebugDrawOptions`

  `DRAW_COLLISION_POINTS`

    alias of `CP_SPACE_DEBUG_DRAW_COLLISION_POINTS`

  `DRAW_CONSTRAINTS`

    alias of `CP_SPACE_DEBUG_DRAW_CONSTRAINTS`

  `DRAW_SHAPES`

    alias of `CP_SPACE_DEBUG_DRAW_SHAPES`

  `__init__`(**kwargs)

    Draw a pymunk.Space.

    Typical usage:

        >>> options = pyglet_util.DrawOptions()
        >>> myspace.debug_draw(options)

    You can control the color of a Shape by setting shape.color to the color you want it drawn in.

        >>> my_shape.color = (255, 0, 0, 255) # will draw my_shape in red

    You can optionally pass in a batch to use for drawing. Just remember that you need to call draw yourself.

        >>> options = pyglet_util.DrawOptions(batch=my_batch)
        >>> myspace.debug_draw(options)
        >>> my_batch.draw()

    See pyglet_util.demo.py for a full example

    Param: | kwargs : You can optionally pass in a pyglet.graphics.Batch If a batch is given all drawing will use this batch to draw on. If no batch is given a a new batch will be used for the drawing. Remember that if you pass in your own batch you need to call draw on it yourself.

  `collision_point_color`
  `color_for_shape`(shape)
  `constraint_color`
  `draw_circle`(pos, angle, radius, outline_color, fill_color)
  `draw_dot`(size, pos, color)
  `draw_fat_segment`(a, b, radius, outline_color, fill_color)
  `draw_polygon`(verts, radius, outline_color, fill_color)
  `draw_segment`(a, b, color)
  `flags`
  `shape_dynamic_color` = SpaceDebugColor(r=52, g=152, b=219, a=255)
  `shape_kinematic_color` = SpaceDebugColor(r=39, g=174, b=96, a=255)
  `shape_outline_color`
  `shape_sleeping_color` = SpaceDebugColor(r=114, g=148, b=168, a=255)
  `shape_static_color` = SpaceDebugColor(r=149, g=165, b=166, a=255)