Treat tile_selected as an overlay that applies to the base tile image.
authorSimon Cross <hodgestar@gmail.com>
Thu, 15 May 2014 16:08:08 +0000 (18:08 +0200)
committerSimon Cross <hodgestar@gmail.com>
Thu, 15 May 2014 16:08:08 +0000 (18:08 +0200)
naja/widgets/tile.py

index 85f90057ecd35760aaaf858ddf6be72911ce757e..8b71d1fd016f0dca93d54aed89470209cc23ccd5 100644 (file)
@@ -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