custom static method

Future<SpriteBatch> custom({
  1. required Image image,
  2. required Map<String, Rect> textures,
  3. required Map<String, List<Rect>> frames,
  4. bool flippable = false,
  5. bool maskable = false,
  6. bool disposeOriginal = false,
})

Implementation

static Future<SpriteBatch> custom({
  required Image image,
  required Map<String, Rect> textures,
  required Map<String, List<Rect>> frames,
  bool flippable = false,
  bool maskable = false,
  bool disposeOriginal = false,
}) async {
  final newImage = await transformSheetImage(
    image,
    flippable: flippable,
    maskable: maskable,
    disposeOriginal: disposeOriginal,
  );

  return SpriteBatch._(
    image: newImage,
    textures: textures,
    frames: frames,
  );
}