SpriteImage.of constructor

SpriteImage.of(
  1. SpriteRegion region
)

Draws region, which holds one frame.

Implementation

SpriteImage.of(this.region)
  : assert(region.frames == 1, 'An image draws one frame.'),
    entries = [
      SpriteEntry(
        index: 0,
        key: 0,
        image: region.image,
        size: region.cell,
        loops: false,
        rects: region.cut(),
        durations: const [double.infinity],
      ),
    ];