load static method
Takes a path of an image, a srcPosition
and srcSize
and loads the
sprite animation.
When the images
is omitted, the global Flame.images is used.
Implementation
static Future<Sprite> load(
String src, {
Vector2? srcPosition,
Vector2? srcSize,
Images? images,
}) async {
final imagesCache = images ?? Flame.images;
final image = await imagesCache.load(src);
return Sprite(image, srcPosition: srcPosition, srcSize: srcSize);
}