fromJSONAtlas method

Future<List<Sprite>> fromJSONAtlas(
  1. String imagePath,
  2. String dataPath
)

Implementation

Future<List<Sprite>> fromJSONAtlas(String imagePath, String dataPath) async {
  final jsonFrames = await _loadJsonFrames(dataPath);
  final image = await Flame.images.load(imagePath);

  final sprites = jsonFrames.values.map((value) {
    return _createSprite(value, image);
  });

  return sprites.toList();
}