Mercurial > boomslang
view pyntnclick/endscreen.py @ 584:96ff2d8a8a9a pyntnclick
Allow list of image name fragments in load_image. Also, some docs.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Sat, 11 Feb 2012 16:45:07 +0200 |
parents | 7e4a20eb78b8 |
children | cf65e91b30b1 |
line wrap: on
line source
# endscreen.py # Copyright Boomslang team, 2010 (see COPYING File) # Victory screen for the game from albow.screen import Screen from albow.resource import get_image from pyntnclick.widgets import BoomImageButton class EndImageButton(BoomImageButton): FOLDER = 'won' class EndScreen(Screen): def __init__(self, shell, game_description): Screen.__init__(self, shell) self.background = get_image('won', 'won.png') self._menu_button = EndImageButton('menu.png', 26, 500, action=self.main_menu) self._quit_button = EndImageButton('quit.png', 250, 500, action=shell.quit) self.add(self._menu_button) self.add(self._quit_button) def draw(self, surface): surface.blit(self.background, (0, 0)) self._menu_button.draw(surface) self._quit_button.draw(surface) def main_menu(self): self.shell.show_screen(self.shell.menu_screen)