Mercurial > boomslang
comparison pyntnclick/endscreen.py @ 586:cf65e91b30b1 pyntnclick
Use load_image where possible
author | Stefano Rivera <stefano@rivera.za.net> |
---|---|
date | Sat, 11 Feb 2012 16:56:01 +0200 |
parents | 7e4a20eb78b8 |
children | f20d211d2c91 |
comparison
equal
deleted
inserted
replaced
585:ec13a5a0b213 | 586:cf65e91b30b1 |
---|---|
1 # endscreen.py | 1 # endscreen.py |
2 # Copyright Boomslang team, 2010 (see COPYING File) | 2 # Copyright Boomslang team, 2010 (see COPYING File) |
3 # Victory screen for the game | 3 # Victory screen for the game |
4 | 4 |
5 from albow.screen import Screen | 5 from albow.screen import Screen |
6 from albow.resource import get_image | |
7 | 6 |
8 from pyntnclick.widgets import BoomImageButton | 7 from pyntnclick.widgets import BoomImageButton |
9 | 8 |
10 | 9 |
11 class EndImageButton(BoomImageButton): | 10 class EndImageButton(BoomImageButton): |
14 | 13 |
15 | 14 |
16 class EndScreen(Screen): | 15 class EndScreen(Screen): |
17 def __init__(self, shell, game_description): | 16 def __init__(self, shell, game_description): |
18 Screen.__init__(self, shell) | 17 Screen.__init__(self, shell) |
19 self.background = get_image('won', 'won.png') | 18 self.background = game_description.resource.load_image( |
19 ('won', 'won.png')) | |
20 self._menu_button = EndImageButton('menu.png', 26, 500, | 20 self._menu_button = EndImageButton('menu.png', 26, 500, |
21 action=self.main_menu) | 21 action=self.main_menu) |
22 self._quit_button = EndImageButton('quit.png', 250, 500, | 22 self._quit_button = EndImageButton('quit.png', 250, 500, |
23 action=shell.quit) | 23 action=shell.quit) |
24 self.add(self._menu_button) | 24 self.add(self._menu_button) |