load static method
Takes a path of an image, and optional arguments for the SpriteBatch.
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,
}) async {
final imagesCache = images ?? Flame.images;
return SpriteBatch(
await imagesCache.load(path),
defaultTransform: defaultTransform ?? RSTransform(1, 0, 0, 0),
defaultColor: defaultColor,
defaultBlendMode: defaultBlendMode,
useAtlas: useAtlas,
imageCache: imagesCache,
imageKey: path,
);
}