Mercurial > boomslang
comparison gamelib/cursor.py @ 124:97322b78d1c1
Minor style cleanups
author | Neil Muller <neil@dip.sun.ac.za> |
---|---|
date | Tue, 24 Aug 2010 17:55:47 +0200 |
parents | 5e704ee7b84b |
children | 4223d66d88b4 |
comparison
equal
deleted
inserted
replaced
123:3b293e3b8829 | 124:97322b78d1c1 |
---|---|
7 import pygame.mouse as mouse | 7 import pygame.mouse as mouse |
8 from pygame.sprite import Sprite, RenderUpdates | 8 from pygame.sprite import Sprite, RenderUpdates |
9 import pygame.cursors | 9 import pygame.cursors |
10 import pygame.mouse | 10 import pygame.mouse |
11 | 11 |
12 | |
12 class CursorSprite(Sprite): | 13 class CursorSprite(Sprite): |
13 "A Sprite that follows the Cursor" | 14 "A Sprite that follows the Cursor" |
14 | 15 |
15 def __init__(self, filename): | 16 def __init__(self, filename): |
16 Sprite.__init__(self) | 17 Sprite.__init__(self) |
17 self.image = get_image('items', filename + '.png') | 18 self.image = get_image('items', filename + '.png') |
18 self.rect = self.image.get_rect() | 19 self.rect = self.image.get_rect() |
19 | 20 |
20 def update(self): | 21 def update(self): |
21 self.rect.midtop = mouse.get_pos() | 22 self.rect.midtop = mouse.get_pos() |
23 | |
22 | 24 |
23 class CursorWidget(Widget): | 25 class CursorWidget(Widget): |
24 """Mix-in widget to ensure that mouse_move is propogated to parents""" | 26 """Mix-in widget to ensure that mouse_move is propogated to parents""" |
25 | 27 |
26 def __init__(self, *args, **kwargs): | 28 def __init__(self, *args, **kwargs): |