pygame.event.set_allowed(pygame.MOUSEMOTION)
# ---
x, y = pygame.mouse.get_pos()
- print 'mouse pos :', x, y
left = x - self.width / 2
top = y - self.height / 2
self.rect = pygame.Rect((left, top), (self.width, self.height))
self.blinkMode = blinkMode
self._startBlink()
- def _stopBlink(self) :
- if self.blinkMode :
- pygame.time.set_timer(TIMEOUT, 0)
-
def _startBlink(self) :
if self.blinkMode :
self._blinking = True
pygame.time.set_timer(TIMEOUT, self.duration)
self.iterator = self.iterImages()
+ def _stopBlink(self) :
+ if self.blinkMode :
+ pygame.time.set_timer(TIMEOUT, 0)
+
def iterImages(self) :
for img in cycle(self.images) :
yield img