X-Git-Url: https://svn.cri.ensmp.fr/git/minwii.git/blobdiff_plain/f331b0da5cf221056181123e11fb50e5192b8cb9..d2d0e07ee1695d69a6954133c7997974b55c62c8:/src/app/widgets/cursors.py?ds=inline diff --git a/src/app/widgets/cursors.py b/src/app/widgets/cursors.py index 041c0fb..1e3fc4e 100755 --- a/src/app/widgets/cursors.py +++ b/src/app/widgets/cursors.py @@ -20,7 +20,7 @@ class WarpingCursor(pygame.sprite.DirtySprite, EventHandlerMixin): @staticmethod def _get_theme_images(name) : basePath = os.path.abspath(__file__).split(os.path.sep)[:-1] - basePath.append('data') + basePath.extend(['data', 'cursor']) basePath.append(name) basePath = os.path.sep.join(basePath) images = [f for f in os.listdir(basePath) if os.path.splitext(f)[1] == '.png'] @@ -99,3 +99,9 @@ class WarpingCursor(pygame.sprite.DirtySprite, EventHandlerMixin): def move(self, event) : self.dirty = 1 self.rect.move_ip(event.rel) + + def setPosition(self, pos) : + self.dirty = 1 + x, y = pos + rx, ry = self.rect.centerx, self.rect.centery + self.rect.move_ip(x-rx, y-ry)