diff options
author | coolestdude1 <arielzamparini@gmail.com> | 2010-02-06 21:38:03 (GMT) |
---|---|---|
committer | coolestdude1 <arielzamparini@gmail.com> | 2010-02-06 21:38:03 (GMT) |
commit | b05d392cadd323cb6e8e3b481c28d80e56d5d30b (patch) | |
tree | 8246b562888cdfe030de051af1cc860fa4d0073a /blocku.py | |
parent | 5ced05b4f3a3f2dea6b3b2029268bc5fe7d58fe6 (diff) |
the background is not displaying, fix?
Diffstat (limited to 'blocku.py')
-rw-r--r-- | blocku.py | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -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)) |