comparison gamelib/mainmenu.py @ 124:69fd96eafde8

Display splash screen and replace window title.
author Jeremy Thurgood <firxen@gmail.com>
date Wed, 02 Sep 2009 21:14:05 +0000
parents 5d58a5b13731
children 1d73de63bd71
comparison
equal deleted inserted replaced
123:a7d803275a23 124:69fd96eafde8
2 2
3 from pgu import gui 3 from pgu import gui
4 import pygame 4 import pygame
5 import constants 5 import constants
6 import engine 6 import engine
7 import imagecache
8
9 class MenuContainer(gui.Container):
10 def paint(self, s):
11 pygame.display.set_caption(constants.NAME)
12 splash = imagecache.load_image("images/splash.png")
13 pygame.display.get_surface().blit(splash, (0, 0))
14 gui.Container.paint(self, s)
7 15
8 class MainMenu(gui.Table): 16 class MainMenu(gui.Table):
9 def __init__(self, **params): 17 def __init__(self, **params):
10 gui.Table.__init__(self, **params) 18 gui.Table.__init__(self, **params)
11 19
34 "align": 0, 42 "align": 0,
35 "style": style, 43 "style": style,
36 } 44 }
37 45
38 self.tr() 46 self.tr()
39 self.td(gui.Label(constants.NAME, color=constants.FG_COLOR), **td_kwargs)
40
41 self.tr()
42 self.td(start_button, **td_kwargs) 47 self.td(start_button, **td_kwargs)
43 48
44 self.tr() 49 self.tr()
45 self.td(fullscreen_toggle, **td_kwargs) 50 self.td(fullscreen_toggle, **td_kwargs)
46 51