diff gamelib/mainmenu.py @ 243:05afa7ae5df3

Standardise image loading to use data.load_image
author Neil Muller <drnlmuller@gmail.com>
date Sun, 13 May 2012 00:38:48 +0200
parents 745a6ee5f643
children
line wrap: on
line diff
--- a/gamelib/mainmenu.py	Sun May 13 00:35:49 2012 +0200
+++ b/gamelib/mainmenu.py	Sun May 13 00:38:48 2012 +0200
@@ -5,7 +5,6 @@
 
 import pygame
 import os
-from pygame import image
 
 try:
     import simplejson
@@ -25,8 +24,8 @@
 class MainMenuButton(BigButton):
     WIDTH = 276
     HEIGHT = 75
-    BG_IMAGE_NORMAL = image.load(data.filepath('images/main_normal.png'))
-    BG_IMAGE_DOWN = image.load(data.filepath('images/main_down.png'))
+    BG_IMAGE_NORMAL = data.load_image('images/main_normal.png')
+    BG_IMAGE_DOWN = data.load_image('images/main_down.png')
 
     def __init__(self, pos, text):
         super(MainMenuButton, self).__init__(pos, text, font_large)
@@ -70,8 +69,7 @@
         self.resume = None
         self.screen = screen
         self.background_colour = (0, 0, 0)
-        self.background_image = image.load(data.filepath(
-                'images/main_background.jpg'))
+        self.background_image = data.load_image('images/main_background.jpg')
         button1 = NewGameButton(self)
         self.add_child(button1)
         button2 = QuitButton()