Exemplo n.º 1
0
 def _draw_image(self):
     self.image.fill(pygame.color.Color(0, 0, 0, 0))
     irect = self.image.get_rect()
     col = Graphics.hue_shift("#EE5400", self.hshift)
     for y in xrange(0, self.image.get_rect().height, Tile.SIZE):
         for x in xrange(0, self.image.get_rect().width, Tile.SIZE):
             pygame.draw.rect(self.image, col, (x, y, x + Tile.SIZE, y + Tile.SIZE), 1)
             pygame.draw.line(self.image, col, (x, y), (x + Tile.SIZE, y + Tile.SIZE), 1)
             pygame.draw.line(self.image, col, (x, y + Tile.SIZE), (x + Tile.SIZE, y), 1)
Exemplo n.º 2
0
 def _draw_image(self):
     self.image.fill(pygame.color.Color(0, 0, 0, 0))
     irect = self.image.get_rect()
     self.col = col = Graphics.hue_shift("#EE5400", self.hshift)
     for y in xrange(0, self.image.get_rect().height, Tile.SIZE):
         for x in xrange(0, self.image.get_rect().width, Tile.SIZE):
             points = ((x + Tile.SIZE // 2, y),  # Top
                       (x + Tile.SIZE, y + Tile.SIZE // 2),  # Right
                       (x + Tile.SIZE // 2, y + Tile.SIZE),  # Bottom
                       (x, y + Tile.SIZE // 2))  # Left
             pygame.draw.polygon(self.image, col, points, 1)
Exemplo n.º 3
0
 def __draw_image(self):
     self.image.fill(pygame.color.Color(0, 0, 0, 0))
     irect = self.image.get_rect()
     col = Graphics.hue_shift("#EE5400", 100)
     ashift = 255.0 / (irect.width * 0.125)
     a = col.a
     i = 0
     while a > 0:
         pygame.draw.rect(self.image, col, (i, i, irect.width - 2 * i, irect.height - 2 * i), 2)
         i += 1
         a = Arithmetic.clamp(0, 255, a - ashift)
         col.a = int(a)
Exemplo n.º 4
0
    def __init__(self, x, y, hueShift=0):
        pygame.sprite.Sprite.__init__(self)

        self.image = pygame.Surface((Tile.SIZE, Tile.SIZE), pygame.SRCALPHA)
        self.rect = self.image.get_rect()
        self.rect.x = x
        self.rect.y = y

        irect = self.image.get_rect()
        col = Graphics.hue_shift("#EE5400", hueShift)
        pygame.draw.rect(self.image, col, (0, 0, irect.width, irect.height), 1)
        pygame.draw.line(self.image, col, (irect.width // 2, 0), (irect.width // 2, irect.height), 1)
        pygame.draw.line(self.image, col, (0, irect.height // 2), (irect.width, irect.height // 2), 1)