def __init__(self, scene, camera, index, mid=False): self.cam = camera self.mid = mid self.index = index half = CORNER_SIZE / 2.0 Widget.__init__(self, scene, -half, -half, half, half) self.update() c = Color.distinct(self.index + 2) self.pen = wx.Pen(wx.Colour(c.red, c.green, c.blue))
def process_draw(self, gc): """ Draw all the registered reticles. """ context = self.scene.context try: if context.draw_mode & DRAW_MODE_RETICLE == 0: # Draw Reticles gc.SetBrush(wx.TRANSPARENT_BRUSH) for index, ret in enumerate(self.reticles): r = self.reticles[ret] self.pen.SetColour(Color.distinct(index + 2).hex) gc.SetPen(self.pen) x = r[0] y = r[1] if x is None or y is None: x = 0 y = 0 x, y = self.scene.convert_scene_to_window([x, y]) gc.DrawEllipse(x - 5, y - 5, 10, 10) except AttributeError: pass