getFutureSpriteAnimation static method

Future<SpriteAnimation> getFutureSpriteAnimation(
  1. List<TileModelSprite> frames,
  2. double stepTime
)

Implementation

static Future<SpriteAnimation> getFutureSpriteAnimation(
  List<TileModelSprite> frames,
  double stepTime,
) async {
  List<Sprite> spriteList = [];

  for (var frame in frames) {
    Sprite sprite = await MapAssetsManager.getFutureSprite(
      frame.path,
      position: frame.position,
      size: frame.size,
    );
    spriteList.add(sprite);
  }

  return Future.value(SpriteAnimation.spriteList(
    spriteList,
    stepTime: stepTime,
  ));
}