loadSprite method

Future<Sprite> loadSprite(
  1. String path, {
  2. Vector2? srcSize,
  3. Vector2? srcPosition,
})

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

Implementation

Future<Sprite> loadSprite(
  String path, {
  Vector2? srcSize,
  Vector2? srcPosition,
}) {
  return Sprite.load(
    path,
    srcPosition: srcPosition,
    srcSize: srcSize,
    images: images,
  );
}