Ejemplo n.º 1
0
 def paint_line(self, pt1, pt2, color=Color(0, 0, 0), width=1):
     pt1 = self._map_point(pt1)
     pt2 = self._map_point(pt2)
     pygame.draw.line(self._screen, rgb(color), pt1, pt2, width=width)
Ejemplo n.º 2
0
 def paint_pixel(self, pos, color=Color(0, 0, 0)):
     x, y = self._map_point(*pos)
     # TODO: talvez use pygame.display.get_surface() para obter a tela
     # correta
     # http://stackoverflow.com/questions/10354638/pygame-draw-single-pixel
     self._screen.set_at(x, y, rgb(color))
Ejemplo n.º 3
0
 def paint_poly(self, points, color=Color(0, 0, 0), solid=True):
     points = [self._map_point(pt) for pt in points]
     pygame.draw.polygon(self._screen, rgb(color), points)
Ejemplo n.º 4
0
 def paint_rect(self, rect, color=Color(0, 0, 0), solid=True):
     x, y, dx, dy = rect
     x, y = self._map_point((x, y + dy))
     pygame.draw.rect(self._screen, rgb(color), (x, y, dx, dy))
Ejemplo n.º 5
0
 def paint_pixel(self, pos, color=Color(0, 0, 0)):
     x, y = self._map_point(*pos)
     self._screen.set_at(x, y, rgb(color))
Ejemplo n.º 6
0
 def paint_pixel(self, pos, color=Color(0, 0, 0)):
     x, y = self._map_point(*pos)
     self._screen.set_at(x, y, rgb(color))
Ejemplo n.º 7
0
 def paint_circle(self, radius, pos, color=Color(0, 0, 0), solid=True):
     x, y = pos.trunc()
     self._circle(self._screen, rgb(color),
                  (x, self.height - y), int(radius))
Ejemplo n.º 8
0
 def paint_pixel(self, pos, color=Color(0, 0, 0)):
     x, y = self._map_point(*pos)
     # TODO: talvez use pygame.display.get_surface() para obter a tela
     # correta
     # http://stackoverflow.com/questions/10354638/pygame-draw-single-pixel
     self._screen.set_at(x, y, rgb(color))
Ejemplo n.º 9
0
 def paint_rect(self, rect, color=Color(0, 0, 0), solid=True):
     x, y, dx, dy = rect
     x, y = self._map_point((x, y + dy))
     pygame.draw.rect(self._screen, rgb(color), (x, y, dx, dy))
Ejemplo n.º 10
0
 def paint_poly(self, points, color=Color(0, 0, 0), solid=True):
     points = [self._map_point(pt) for pt in points]
     pygame.draw.polygon(self._screen, rgb(color), points)
Ejemplo n.º 11
0
 def paint_circle(self, radius, pos, color=Color(0, 0, 0), solid=True):
     x, y = pos.trunc()
     self._circle(self._screen, rgb(color), (x, self.height - y),
                  int(radius))