Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/blocku.py
diff options
context:
space:
mode:
authorcoolestdude1 <arielzamparini@gmail.com>2010-02-06 21:38:03 (GMT)
committer coolestdude1 <arielzamparini@gmail.com>2010-02-06 21:38:03 (GMT)
commitb05d392cadd323cb6e8e3b481c28d80e56d5d30b (patch)
tree8246b562888cdfe030de051af1cc860fa4d0073a /blocku.py
parent5ced05b4f3a3f2dea6b3b2029268bc5fe7d58fe6 (diff)
the background is not displaying, fix?
Diffstat (limited to 'blocku.py')
-rw-r--r--blocku.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/blocku.py b/blocku.py
index 43c5102..ee90a5b 100644
--- a/blocku.py
+++ b/blocku.py
@@ -76,11 +76,19 @@ class Game:
screen = pygame.display.set_mode(SCREENRECT.size, winstyle, bestdepth)
- #load images here
- #img = load_image('filename.gif')
+ # load images here
+ # for gifs img = load_image('filename.gif')
+ # for bmps img = pygame.image.load('filename.bmp') but our function handles that for us
# a note for graphics blit means copy pixels from screen.blit()
iconImg = load_image('Blocku_Icon.gif')
- background = load_image('background.gif')
+ #background = load_image('background.gif')
+ background = load_image('background.bmp')
+
+ #get the image and screen in the same format
+ if background.get_bitsize() == 8:
+ screen.set_palette(background.get_palette())
+ else:
+ background = background.convert()
#to set the icon up and to decorate the game window
icon = pygame.transform.scale(iconImg, (32, 32))