Mercurial > nagslang
comparison nagslang/render.py @ 647:aeb366d97774
Show splash image on startup
author | Stefano Rivera <stefano@rivera.za.net> |
---|---|
date | Sun, 08 Sep 2013 02:02:09 +0200 |
parents | 9ea26b835271 |
children |
comparison
equal
deleted
inserted
replaced
646:45dbbc4c1fd0 | 647:aeb366d97774 |
---|---|
240 else: | 240 else: |
241 self.widget.rect.topleft = (x, y) | 241 self.widget.rect.topleft = (x, y) |
242 self.widget.draw(surface) | 242 self.widget.draw(surface) |
243 | 243 |
244 | 244 |
245 class ImageOverlay(Overlay): | |
246 def __init__(self, image): | |
247 self.image = image | |
248 | |
249 def render(self, surface, display_offset, max_width): | |
250 x = (surface.get_width() - self.image.get_width()) / 2 | |
251 y = (surface.get_height() - self.image.get_height()) / 2 | |
252 surface.blit(self.image, (x, y)) | |
253 | |
254 | |
245 class TiledRenderer(Renderer): | 255 class TiledRenderer(Renderer): |
246 """Tile the given image to fit the given outline | 256 """Tile the given image to fit the given outline |
247 | 257 |
248 Outline is assumed to be in pymunk coordinates""" | 258 Outline is assumed to be in pymunk coordinates""" |
249 | 259 |