SpriteAnimation.variableSpriteList constructor
SpriteAnimation.variableSpriteList(})
Implementation
SpriteAnimation.variableSpriteList(
List<Sprite> sprites, {
required List<double> stepTimes,
this.loop = true,
}) {
if (sprites.isEmpty) {
throw Exception('You must have at least one frame!');
}
if (stepTimes.length != sprites.length) {
throw Exception('The length of stepTimes and sprites must be the same!');
}
frames = List.generate(
sprites.length,
(i) => SpriteAnimationFrame(sprites[i], stepTimes[i]),
growable: false,
);
}