NinePatch

class NinePatch(val image: Image, val edges: Edges)

Draws a rectangular region using 9 'patches' the four corner patches are drawn 1:1 (unscaled). The top and bottom patches are stretched (or shrunk) horizontally to fit between the corners. The left and right patches are similarly stretched (or shrunk) vertically. The center path is stretch (or shrunk) in both directions.

Typically used to give pictorial backgrounds to buttons. Each state of the button( hover, armed, selected etc. ) will typically have their own NinePatch.

The center patch may optionally be omitted (e.g. if the center is fully transparent, or the if it already contains the appropriate flat color).

See also : NinePatchBackground and NinePatchBorder, NinePatchImages.

Constructors

Link copied to clipboard
constructor(image: Image, edges: Edges)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun draw(x: Float, y: Float, width: Float, height: Float, drawCenter: Boolean = true, tint: Color? = null)