1 from naja.constants import TILE_SIZE
2 from naja.resources import resources
4 from .base import Widget
6 # These will probably need to go away when we have images
8 import pygame.locals as pgl
11 class TileWidget(Widget):
12 """Widget which holds a tile on the game board."""
13 def __init__(self, pos, image=None):
14 super(TileWidget, self).__init__(pos, TILE_SIZE)
18 # Placeholder logic - just draw the outline of a square
19 self.surface = pygame.surface.Surface(TILE_SIZE)
20 pygame.draw.lines(self.surface, pgl.color.THECOLORS['yellow'],
21 True, [(1, 1), (1, 95), (95, 95), (95, 1)], 2)
22 self.surface.convert_alpha(pygame.display.get_surface())
23 self.size = self.surface.get_rect().size
25 def draw(self, surface):
26 surface.blit(self.surface, self.rect)