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).
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sprite ↔ Sprite
-
The sprite used to render the box, must be a 3x3 grid of square tiles.
getter/setter pair
- tileSize ↔ int
-
The size of each tile in the source sprite image.
getter/setter pair
Methods
-
draw(
Canvas c, Vector2 position, Vector2 size) → void -
Renders this nine box as a rectangle at
position
with sizesize
. -
drawRect(
Canvas c, Rect rect) → void -
Renders this nine box with the dimensions provided by
rect
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited