loadJson static method

Future<AnimatedSprite> loadJson(
  1. String name,
  2. JsonAssetCache jsonAssetCache,
  3. ImageAssetCache imageAssetCache
)

load animation from json asset and load frame images

Implementation

static Future<AnimatedSprite> loadJson(
  String name,
  JsonAssetCache jsonAssetCache,
  ImageAssetCache imageAssetCache,
) async {
  final jsonAsset = await jsonAssetCache.load(name);
  return await AnimatedSprite.fromJson(jsonAsset).loadImages(imageAssetCache);
}