draw

fun draw(x: Int, y: Int, color: Color): Image

Draws a pixel on the current image.

Return

A new Image object with the drawn pixel on the image

Parameters

x

The X coordinate of the pixel

y

The Y coordinate of the pixel


fun draw(src: Image, sx: Int, sy: Int, sw: Int, sh: Int, dx: Int, dy: Int, dw: Int, dh: Int, tint: Color = Color.WHITE): Image

Draws a source image onto this image at the specified destination rectangle, using the specified source rectangle and tint color.

Return

A new Image object with the source image drawn onto it.

Parameters

src

The source image to draw from.

sx

The x-coordinate of the source rectangle's top-left corner.

sy

The y-coordinate of the source rectangle's top-left corner.

sw

The width of the source rectangle.

sh

The height of the source rectangle.

dx

The x-coordinate of the destination rectangle's top-left corner.

dy

The y-coordinate of the destination rectangle's top-left corner.

dw

The width of the destination rectangle.

dh

The height of the destination rectangle.

tint

The color to tint the drawn image. Default is white (no tint).


fun draw(src: Image, x: Int, y: Int, tint: Color = Color.WHITE): Image

Draws the entire source image onto this image, scaling it to fit the dimensions of this image, using the specified tint color.

Return

A new Image object with the source image drawn onto it.

Parameters

src

The source image to draw from.

x

The x-coordinate of the destination rectangle's top-left corner.

y

The y-coordinate of the destination rectangle's top-left corner.

tint

The color to tint the drawn image. Default is white (no tint).