Pixmap

class Pixmap(val width: Int, val height: Int, val pixels: ByteBuffer = createByteBuffer(width * height * 4))

Author

Colton Daily

Constructors

Link copied to clipboard
fun Pixmap(width: Int, height: Int, pixels: ByteBuffer = createByteBuffer(width * height * 4))

Types

Link copied to clipboard

Functions

Link copied to clipboard
fun blend(src: Int, dst: Int): Int
Link copied to clipboard
fun contains(x: Int, y: Int): Boolean
Link copied to clipboard
fun copyTo(srcX: Int, srcY: Int, dst: Pixmap, dstX: Int, dstY: Int, width: Int, height: Int)
Link copied to clipboard
fun draw(pixmap: Pixmap, x: Int = 0, y: Int = 0, srcX: Int = 0, srcY: Int = 0, srcWidth: Int = pixmap.width, srcHeight: Int = pixmap.height, dstWidth: Int = srcWidth, dstHeight: Int = srcHeight, filtering: Boolean = false, blending: Boolean = false)
Link copied to clipboard
fun drawLine(x: Int, y: Int, x2: Int, y2: Int, color: Int)
Link copied to clipboard
fun drawSlice(x: Int, y: Int, slice: TextureSlice, border: Int = 0)
fun drawSlice(x: Int, y: Int, src: Pixmap, sliceX: Int, sliceY: Int, sliceWidth: Int, sliceHeight: Int, border: Int = 0)
Link copied to clipboard
fun fill(color: Color)
Link copied to clipboard
fun get(x: Int, y: Int, force: Boolean = false): Int
Link copied to clipboard
fun hline(x1: Int, x2: Int, y: Int, color: Int)
Link copied to clipboard
fun set(x: Int, y: Int, color: Int, force: Boolean = false)
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun vline(y1: Int, y2: Int, x: Int, color: Int)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val height: Int
Link copied to clipboard
Link copied to clipboard
val width: Int

Extensions

Link copied to clipboard
fun Pixmap.addBorderToSlices(context: Context, sliceWidth: Int, sliceHeight: Int, border: Int = 1, mipmaps: Boolean = false): Texture

Slice up the pixmap with the given size with an added border but returns the newly created Texture. This can be used to prevent atlas bleeding.

Link copied to clipboard
fun Pixmap.slice(sliceWidth: Int, sliceHeight: Int): Array<Array<PixmapSlice>>
Link copied to clipboard
fun Pixmap.sliceWithBorder(context: Context, sliceWidth: Int, sliceHeight: Int, border: Int = 1, mipmaps: Boolean = false): List<TextureSlice>

Slice up the texture in a list of TextureSlice with the given size with an added border. This can be used to prevent atlas bleeding.