createAnimation method

SpriteAnimation createAnimation({
  1. required int row,
  2. required double stepTime,
  3. bool loop = true,
  4. int from = 0,
  5. int? to,
})

Creates a SpriteAnimation from this SpriteSheet, using the sequence of sprites on a given row.

from and to can be specified to create an animation from a subset of the columns on the row

Implementation

SpriteAnimation createAnimation({
  required int row,
  required double stepTime,
  bool loop = true,
  int from = 0,
  int? to,
}) {
  final spriteList = _generateSpriteList(
    row: row,
    to: to,
    from: from,
  );

  return SpriteAnimation.spriteList(
    spriteList,
    stepTime: stepTime,
    loop: loop,
  );
}