@event_handler(pygame.MOUSEMOTION)
def move(self, event) :
self.dirty = 1
- self.rect.move_ip(event.rel)
+ x, y = pygame.mouse.get_pos()
+ rel = (x - self.rect.centerx, y - self.rect.centery)
+ self.rect.move_ip(rel)
def setPosition(self, pos) :
self.dirty = 1