NineTileBox class

This allows you to create a rectangle textured with a 9-sliced image.

How it works is that you have a template image in a 3x3 grid, made up of 9 tiles, and a new rectangle can be draw by keeping the 4 corners, expanding the 4 sides only in the direction in which they are located and expanding the center in both directions. That allows you to have non distorted borders.

Constructors

NineTileBox(Sprite sprite, {int tileSize, int destTileSize})
Creates a nine-box instance. [...]

Properties

destTileSize int
The size each tile becomes when rendered (optionally used to scale the src image).
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
sprite Sprite
The sprite used to render the box, must be a 3x3 grid of square tiles.
read / write
tileSize int
The size of each tile in the source sprite image.
read / write

Methods

draw(Canvas c, double x, double y, double width, double height) → void
Renders this nine box as a rectangle of coordinates (x, y) and size (width, height).
drawRect(Canvas c, Rect rect) → void
Renders this nine box with the dimensions provided by rect.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited