fromJSONAtlasAsMap method
Implementation
Future<Map<String, Sprite>> fromJSONAtlasAsMap(
String imagePath, String dataPath) async {
final jsonFrames = await _loadJsonFrames(dataPath);
final image = await Flame.images.load(imagePath);
final Map<String, Sprite> map = {};
jsonFrames.forEach((filename, value) {
final id = _filenameWithoutExtension(filename);
map[id] = _createSprite(value, image);
});
return map;
}