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)
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))
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)
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))
def paint_pixel(self, pos, color=Color(0, 0, 0)): x, y = self._map_point(*pos) self._screen.set_at(x, y, rgb(color))
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))