From 1fd94d28fdfa2331a025ce3b0d0f6fecb5af3324 Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Thu, 15 May 2014 18:08:08 +0200 Subject: [PATCH] Treat tile_selected as an overlay that applies to the base tile image. --- naja/widgets/tile.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 -- 2.34.1