advanceTime method

  1. @override
bool advanceTime(
  1. num time
)
override

This method is called by the Juggler with the time past since the last call.

Returns true as long as this Animatable is not completed; false if it is completed.

Implementation

@override
bool advanceTime(num time) {
  _time += time;

  var frameTime = _time % _duration;
  _frame = min(_frames * frameTime ~/ _duration, _frames - 1);

  for (var flumpMovieLayer in _flumpMovieLayers) {
    flumpMovieLayer.advanceTime(time);
    flumpMovieLayer.setFrame(_frame);
  }

  return true;
}