-# def update(self, elapsedTime, centerPosition):
-# '''
-# Update the cursor's look and position
-#
-# elapsedTime:
-# The time passed since the previous update
-# centerPosition:
-# the new position of the creep
-# '''
-# self._updateImage(elapsedTime)
-# self.centerPosition = centerPosition
-# if self.flashing :
-# self._flashTimer += elapsedTime
-# if self._flashTimer > self.flashLength:
-# self.flashing = False
-
- def _updateImage(self, elapsedTime):
- '''
- Update the cursor's image
-
- elapsedTime:
- The time passed since the previous update
- '''
- self._animationOffset += elapsedTime
-
- if self._animationOffset > self.duration :
- #New animation offset is computed first, before updating the pointer
- self._animationOffset -= self.duration
- #point to the next image (restarts from the beginning when it reaches the end)
- self._imagePointer = (self._imagePointer + 1) % len(self.images)
-
- if self.flashing:
- self.image = pygame.image.load(self.flashImagePath).convert_alpha()
+ @event_handler(pygame.MOUSEBUTTONDOWN)
+ def flashOn(self, event) :
+ self.dirty = 1
+ self._blinking = False
+ self.image = self.flashImage
+
+ @event_handler(pygame.MOUSEBUTTONUP)
+ def flashOff(self, event) :
+ self.dirty = 1
+ if self.blinkMode :
+ self._blinking = True
+ self.loadNext(event)