NinePatch

class NinePatch(slice: TextureSlice, val left: Int, val right: Int, val top: Int, val bottom: Int)

Creates a ninepatch by slicing up the TextureSlice into nine patches which produces clean panels of any size, based on a small texture by splitting it into a 3x3 grid. The drawn, the texture tiles the textures sides horizontally or vertically and the center on both axes but doesn't scale or tile the corners.

Author

Colton Daily

Parameters

slice

the slice to convert into a nine patch

left

amount of pixels from the left edge

right

amount of pixels from the right edge

top

amount of pixels from the top edge

bottom

amount of pixels from the bottom edge

Constructors

Link copied to clipboard
fun NinePatch(texture: Texture, left: Int, right: Int, top: Int, bottom: Int)
Link copied to clipboard
fun NinePatch(slice: TextureSlice, left: Int, right: Int, top: Int, bottom: Int)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun draw(batch: Batch, x: Float, y: Float, width: Float, height: Float, originX: Float = 0.0f, originY: Float = 0.0f, scaleX: Float = 1.0f, scaleY: Float = 1.0f, rotation: Angle = Angle.ZERO, color: Color = Color.WHITE, srcX: Float = 0.0f, srcY: Float = 0.0f, srcWidth: Float = width, srcHeight: Float = height)

Properties

Link copied to clipboard
val bottom: Int
Link copied to clipboard
val left: Int
Link copied to clipboard
val right: Int
Link copied to clipboard
val top: Int
Link copied to clipboard
Link copied to clipboard

Extensions

Link copied to clipboard