SpriteAnimation.spriteList constructor

SpriteAnimation.spriteList(
  1. List<Sprite> sprites, {
  2. required double stepTime,
  3. bool loop = true,
})

Creates an animation based on the parameters.

All frames have the same stepTime.

Implementation

SpriteAnimation.spriteList(
  List<Sprite> sprites, {
  required double stepTime,
  this.loop = true,
}) {
  if (sprites.isEmpty) {
    throw Exception('You must have at least one frame!');
  }
  frames = sprites.map((s) => SpriteAnimationFrame(s, stepTime)).toList();
}