changeset 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 a7d803275a23
children 2e3a05b9594d
files gamelib/gameboard.py gamelib/main.py gamelib/mainmenu.py
diffstat 3 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/gamelib/gameboard.py	Wed Sep 02 21:00:15 2009 +0000
+++ b/gamelib/gameboard.py	Wed Sep 02 21:14:05 2009 +0000
@@ -159,6 +159,7 @@
         self.disp.init(tbl)
 
     def paint(self, screen):
+        screen.fill(constants.BG_COLOR)
         self.disp.paint(screen)
 
     def update(self, screen):
--- a/gamelib/main.py	Wed Sep 02 21:00:15 2009 +0000
+++ b/gamelib/main.py	Wed Sep 02 21:14:05 2009 +0000
@@ -10,7 +10,7 @@
 from pgu import gui
 from pygame.locals import SWSURFACE
 
-from mainmenu import MainMenu
+from mainmenu import MenuContainer, MainMenu
 from engine import Engine, MainMenuState
 from sound import init_sound
 import constants
@@ -20,7 +20,7 @@
     app = gui.App()
     main_menu = MainMenu()
 
-    c = gui.Container(align=0, valign=0)
+    c = MenuContainer(align=0, valign=0)
     c.add(main_menu, 0, 0)
 
     app.init(c)
--- a/gamelib/mainmenu.py	Wed Sep 02 21:00:15 2009 +0000
+++ b/gamelib/mainmenu.py	Wed Sep 02 21:14:05 2009 +0000
@@ -4,6 +4,14 @@
 import pygame
 import constants
 import engine
+import imagecache
+
+class MenuContainer(gui.Container):
+    def paint(self, s):
+        pygame.display.set_caption(constants.NAME)
+        splash = imagecache.load_image("images/splash.png")
+        pygame.display.get_surface().blit(splash, (0, 0))
+        gui.Container.paint(self, s)
 
 class MainMenu(gui.Table):
     def __init__(self, **params):
@@ -36,9 +44,6 @@
         }
 
         self.tr()
-        self.td(gui.Label(constants.NAME, color=constants.FG_COLOR), **td_kwargs)
-
-        self.tr()
         self.td(start_button, **td_kwargs)
 
         self.tr()