Mercurial > pyntnclick
comparison gamelib/cursor.py @ 106:da547e148532
Some (slightly) better cursor handling.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Tue, 24 Aug 2010 13:53:49 +0200 |
parents | c76f2fad2af5 |
children | ab11689aec36 |
comparison
equal
deleted
inserted
replaced
105:65976205fc2d | 106:da547e148532 |
---|---|
26 def __init__(self, *args, **kwargs): | 26 def __init__(self, *args, **kwargs): |
27 Widget.__init__(self, *args, **kwargs) | 27 Widget.__init__(self, *args, **kwargs) |
28 self._cursor_group = RenderUpdates() | 28 self._cursor_group = RenderUpdates() |
29 self._cursor_name = '' | 29 self._cursor_name = '' |
30 | 30 |
31 def draw(self, surface): | 31 def draw(self, _surface): |
32 surface = self.get_root().surface | |
32 if self.rect.collidepoint(mouse.get_pos()): | 33 if self.rect.collidepoint(mouse.get_pos()): |
33 cursor = self.get_sprite_cursor() | 34 cursor = self.get_sprite_cursor() |
34 if cursor != self._cursor_name: | 35 if cursor != self._cursor_name: |
35 if self.get_sprite_cursor() is None: | 36 if self.get_sprite_cursor() is None: |
36 pygame.mouse.set_visible(1) | 37 pygame.mouse.set_visible(1) |