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