- 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()
- else :
- self.image = pygame.image.load(self.images[self._imagePointer]).convert_alpha()
+ @event_handler(TIMEOUT)
+ def loadNext(self, event) :
+ if self._blinking :
+ self.image = self.iterator.next()