GLTexture

Constructors

Link copied to clipboard
constructor(name: String, width: Int, height: Int, color: Color)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val handle: Int
Link copied to clipboard
open override val height: Int
Link copied to clipboard
open override val imageHeight: Float
Link copied to clipboard
open override val imageWidth: Float
Link copied to clipboard
override var isLoaded: Boolean
Link copied to clipboard
open override val name: String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val width: Int

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
open override fun batch(tint: Color?, block: TextureBatch.() -> Unit)
Link copied to clipboard
open override fun bind()
Link copied to clipboard
open override fun draw(x: Float, y: Float, tint: Color?)
Link copied to clipboard
open override fun drawBatched(batch: TextureBatch, x: Float, y: Float)
Link copied to clipboard
open override fun drawTo(x: Float, y: Float, destWidth: Float, destHeight: Float, tint: Color?)
Link copied to clipboard
open override 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
fun dump()

This is used for debugging only. It dumps texture, showing values in the range 0..ff

Link copied to clipboard
fun load(pixels: IntArray)
Link copied to clipboard
fun onLoaded(handlerCombination: HandlerCombination = HandlerCombination.AFTER, block: (event: ActionEvent) -> Unit)
Link copied to clipboard
open override 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
open override fun scaledBy(scaleX: Float, scaleY: Float): 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.

Link copied to clipboard
open override fun setRepeating(x: Boolean, y: Boolean)
Link copied to clipboard

Transfers the texture from the GPU to main memory (which is SLOW). The result is a ByteArray of size width * height * 4, and the format is RGBA. i.e. to get the alpha value at x,y :

Link copied to clipboard
Link copied to clipboard
open override fun toString(): String