Properties

Link copied to clipboard
abstract val imageHeight: Float
Link copied to clipboard
abstract val imageWidth: Float

Functions

Link copied to clipboard
Link copied to clipboard
open fun aspectRatio(): Float

The ratio of the imageWidth to the imageHeight.

Link copied to clipboard
abstract fun batch(tint: Color?, block: TextureBatch.() -> Unit)
Link copied to clipboard
abstract fun draw(x: Float, y: Float, tint: Color? = null)
Link copied to clipboard
abstract fun drawBatched(batch: TextureBatch, x: Float, y: Float)
Link copied to clipboard
abstract fun drawTo(x: Float, y: Float, destWidth: Float, destHeight: Float, tint: Color? = null)
Link copied to clipboard
abstract fun drawToBatched(batch: TextureBatch, x: Float, y: Float, destWidth: Float, destHeight: Float)

The same as the other drawTo, but using a TextureBatch for efficiency.

Link copied to clipboard
abstract fun partialImage(fromX: Float, fromY: Float, width: Float, height: Float): Image

Takes a rectangular region of this Image, and returns it as an Image. Note, the pixel data is NOT copied

Link copied to clipboard

Returns an ObservableOptionalImage whose value is a scaled version of this image, scaled such that width and height are at most sizeProperty.value.

Link copied to clipboard
abstract fun scaledBy(scaleX: Float, scaleY: Float = scaleX): Image

Returns an Image using the same pixel data as this image, but it lies about its actual size.

Link copied to clipboard
open fun scaleTo(size: Int): Image

Returns a scaled version of this image, scaled such that width and height are at most size. This is often used for square images, icons in particular.