SpriteSheet<T>.single constructor
Cuts an image that holds one animation, under the name key.
For art that ships a file per animation, where the row is the whole sheet and there is nothing to number.
Implementation
factory SpriteSheet.single(
String asset,
Vector2 size, {
required num fps,
T? key,
bool? loop,
}) {
final sheet = SpriteSheet<T>(
asset,
size,
fps: fps,
loop: loop,
rows: [SheetRow<T>(key: key)],
);
if (sheet.rows != 1) {
throw ArgumentError.value(
size,
'size',
'Cuts ${sheet.rows} rows out of this image, not one.',
);
}
return sheet;
}