NineTileBox constructor
Creates a nine-box instance.
sprite is the 3x3 grid and tileSize
is the size of each tile.
The src sprite must a square of size 3*tileSize
.
If tileSize
is not provided, the width of the sprite is assumed as the size.
Otherwise the width and height properties of the sprite are ignored.
If destTileSize
is not provided, the evaluated tileSize
is used instead
(so no scaling happens).
Implementation
NineTileBox(this.sprite, {int? tileSize, int? destTileSize})
: tileSize = tileSize ?? sprite.src.width.toInt() {
this.destTileSize = destTileSize ?? this.tileSize;
}