loadSpriteBatch method

Future<SpriteBatch> loadSpriteBatch(
  1. String path, {
  2. Color? defaultColor,
  3. BlendMode? defaultBlendMode,
  4. RSTransform? defaultTransform,
  5. Images? imageCache,
  6. bool useAtlas = true,
})

Utility method to load and cache the image for a SpriteBatch based on its options.

Implementation

Future<SpriteBatch> loadSpriteBatch(
  String path, {
  Color? defaultColor,
  BlendMode? defaultBlendMode,
  RSTransform? defaultTransform,
  Images? imageCache,
  bool useAtlas = true,
}) {
  return SpriteBatch.load(
    path,
    defaultColor: defaultColor,
    defaultBlendMode: defaultBlendMode,
    defaultTransform: defaultTransform,
    images: imageCache ?? images,
    useAtlas: useAtlas,
  );
}