From: Simon Cross Date: Thu, 15 May 2014 16:08:08 +0000 (+0200) Subject: Treat tile_selected as an overlay that applies to the base tile image. X-Git-Tag: 0.1~284^2 X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=1fd94d28fdfa2331a025ce3b0d0f6fecb5af3324;p=naja.git Treat tile_selected as an overlay that applies to the base tile image. --- diff --git a/naja/widgets/tile.py b/naja/widgets/tile.py index 85f9005..8b71d1f 100644 --- a/naja/widgets/tile.py +++ b/naja/widgets/tile.py @@ -40,11 +40,14 @@ class TileWidget(Widget): else: bg = resources.get_image('board/tile_1.png', transforms=(EIGHT_BIT,)) + overlay = None if self.highlighted: - bg = resources.get_image('board/tile_selected.png', - transforms=(EIGHT_BIT,)) + overlay = resources.get_image('board/tile_selected.png', + transforms=(EIGHT_BIT,)) self.surface = pygame.surface.Surface(TILE_SIZE) self.surface.blit(bg, (0, 0)) + if overlay is not None: + self.surface.blit(overlay, (0, 0)) # Look up the required bits on the board location card = self.state.board_locations[self.board_pos] player_pos = self.state.player.position