SpriteAnimationData.sequenced constructor

SpriteAnimationData.sequenced({
  1. required int amount,
  2. required double stepTime,
  3. required Vector2 textureSize,
  4. int? amountPerRow,
  5. Vector2? texturePosition,
  6. bool loop = true,
})

Works just like SpriteAnimationData.variable but uses the same stepTime for all frames.

Implementation

factory SpriteAnimationData.sequenced({
  required int amount,
  required double stepTime,
  required Vector2 textureSize,
  int? amountPerRow,
  Vector2? texturePosition,
  bool loop = true,
}) {
  return SpriteAnimationData.variable(
    amount: amount,
    amountPerRow: amountPerRow,
    texturePosition: texturePosition,
    textureSize: textureSize,
    loop: loop,
    stepTimes: List.filled(amount, stepTime),
  );
}