comparison pyntnclick/gamescreen.py @ 600:fabce47e542f pyntnclick

Stop using albow (at least for the menu). Breaks the world. Please fix it, kthx
author Stefano Rivera <stefano@rivera.za.net>
date Sat, 11 Feb 2012 19:56:30 +0200
parents 2d2ea51b73ad
children 3ce19d33b51f
comparison
equal deleted inserted replaced
599:2d2ea51b73ad 600:fabce47e542f
3 # Main menu for the game 3 # Main menu for the game
4 4
5 from albow.controls import Widget 5 from albow.controls import Widget
6 from albow.layout import Row 6 from albow.layout import Row
7 from albow.palette_view import PaletteView 7 from albow.palette_view import PaletteView
8 from albow.screen import Screen
9 from pygame import Rect, mouse 8 from pygame import Rect, mouse
10 from pygame.color import Color 9 from pygame.color import Color
11 10
12 from pyntnclick.cursor import CursorWidget 11 from pyntnclick.cursor import CursorWidget
12 from pyntnclick.engine import Screen
13 from pyntnclick.state import handle_result 13 from pyntnclick.state import handle_result
14 from pyntnclick.widgets import ( 14 from pyntnclick.widgets import (
15 MessageDialog, BoomButton, HandButton, PopupMenu, PopupMenuButton) 15 MessageDialog, BoomButton, HandButton, PopupMenu, PopupMenuButton)
16 16
17 # XXX: Need a way to get at the constants. 17 # XXX: Need a way to get at the constants.
270 270
271 271
272 class DefEndScreen(Screen): 272 class DefEndScreen(Screen):
273 """A placeholder 'Game Over' screen so people can get started easily""" 273 """A placeholder 'Game Over' screen so people can get started easily"""
274 274
275 def __init__(self, shell, game_description): 275 def setup(self):
276 Screen.__init__(self, shell) 276 self.background = self.resource.get_image(('pyntnclick', 'end.png'))
277
278 self.background = game_description.resource.get_image(
279 ('pyntnclick', 'end.png'))
280 277
281 def draw(self, surface): 278 def draw(self, surface):
282 surface.blit(self.background, (0, 0)) 279 surface.blit(self.background, (0, 0))
283 280
284 281
285 class DefMenuScreen(Screen): 282 class DefMenuScreen(Screen):
286 """A placeholder Start screen so people can get started easily""" 283 """A placeholder Start screen so people can get started easily"""
287 284
288 def __init__(self, shell, game_description): 285 def setup(self):
289 Screen.__init__(self, shell) 286 self.background = self.resource.get_image(('pyntnclick', 'start.png'))
290
291 self.background = game_description.resource.get_image(
292 ('pyntnclick', 'start.png'))
293 287
294 def draw(self, surface): 288 def draw(self, surface):
295 surface.blit(self.background, (0, 0)) 289 surface.blit(self.background, (0, 0))