load static method
Takes the full path of an image, and optional arguments for the SpriteBatch.
The path is the full path of the asset, as declared in the
pubspec.yaml, for example assets/images/tiles.png.
When the images is omitted, the global Flame.images is used.
Implementation
static Future<SpriteBatch> load(
String path, {
RSTransform? defaultTransform,
Images? images,
Color? defaultColor,
BlendMode? defaultBlendMode,
bool useAtlas = true,
String? package,
}) async {
final imagesCache = images ?? Flame.images;
return SpriteBatch(
await imagesCache.load(path, package: package),
defaultTransform: defaultTransform ?? RSTransform(1, 0, 0, 0),
defaultColor: defaultColor,
defaultBlendMode: defaultBlendMode,
useAtlas: useAtlas,
imageCache: imagesCache,
imageKey: path,
);
}