addSprite

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.

Parameters

sprite

The sprite to add.

x

The x-coordinate to add the sprite at. Defaults to the sprite's current x position.

y

The y-coordinate to add the sprite at. Defaults to the sprite's current y position.