Package-level declarations

Types

Link copied to clipboard
interface Sprite<T>

Represents a sprite in the Kray game engine. Either 2D or 3D.

Link copied to clipboard

Represents a sprite in the Kray game engine.

Link copied to clipboard

Represents a sprite in the Kray game engine.

Properties

Link copied to clipboard

Gets an immutable copy of all sprites drawn to the canvas so far.

Functions

Link copied to clipboard
fun Kray.addSprite(sprite: Sprite2D, x: Int = sprite.x, y: Int = sprite.y)

Adds the given sprite to the Kray canvas at its current position or at the specified x and y coordinates.

Link copied to clipboard
fun Canvas.drawSprite(sprite: Sprite2D, x: Int = sprite.x, y: Int = sprite.y)

Draws the given sprite to the canvas at its current position or at the specified x and y coordinates.

fun Canvas.drawSprite(sprite: Sprite3D, x: Int = sprite.x, y: Int = sprite.y, z: Int = sprite.z)

Draws the given sprite to the canvas at its current position or at the specified x, y, and z coordinates.

Link copied to clipboard
fun Kray.removeSprite(sprite: Sprite<*>)

Removes the given sprite from the Kray canvas.