create static method
Implementation
static TerrainSpriteSheet create({
required String path,
required Vector2 tileSize,
Vector2? position,
}) {
return TerrainSpriteSheet(
left: TileModelSprite(
path: path,
size: tileSize,
position: Vector2(0, 1) + (position ?? Vector2.zero()),
),
topLeft: TileModelSprite(
path: path,
size: tileSize,
position: Vector2(0, 0) + (position ?? Vector2.zero()),
),
bottomLeft: TileModelSprite(
path: path,
size: tileSize,
position: Vector2(0, 2) + (position ?? Vector2.zero()),
),
right: TileModelSprite(
path: path,
size: tileSize,
position: Vector2(2, 1) + (position ?? Vector2.zero()),
),
topRight: TileModelSprite(
path: path,
size: tileSize,
position: Vector2(2, 0) + (position ?? Vector2.zero()),
),
bottomRight: TileModelSprite(
path: path,
size: tileSize,
position: Vector2(2, 2) + (position ?? Vector2.zero()),
),
top: TileModelSprite(
path: path,
size: tileSize,
position: Vector2(1, 0) + (position ?? Vector2.zero()),
),
bottom: TileModelSprite(
path: path,
size: tileSize,
position: Vector2(1, 2) + (position ?? Vector2.zero()),
),
invertedTopLeft: TileModelSprite(
path: path,
size: tileSize,
position: Vector2(3, 0) + (position ?? Vector2.zero()),
),
invertedTopRight: TileModelSprite(
path: path,
size: tileSize,
position: Vector2(4, 0) + (position ?? Vector2.zero()),
),
invertedBottomRight: TileModelSprite(
path: path,
size: tileSize,
position: Vector2(4, 1) + (position ?? Vector2.zero()),
),
invertedBottomLeft: TileModelSprite(
path: path,
size: tileSize,
position: Vector2(3, 1) + (position ?? Vector2.zero()),
),
);
}