Sprite3D

Represents a sprite in the Kray game engine.

Constructors

Link copied to clipboard
constructor(raw: Model)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override var collideable: Boolean

Whether the sprite can collide with other sprites. False means it cannot.

Link copied to clipboard
open override val costumes: ERROR CLASS: Unresolved name: mutableListOf

An immutable list of all costumes (models) associated with this sprite.

Link copied to clipboard

The current costume that the sprite is wearing.

Link copied to clipboard
open override var currentCostumeIndex: Int

The index of the current costume being used by this sprite.

Link copied to clipboard
open override val depth: Int

The depth of the object.

Link copied to clipboard
open override val height: Int

The height of the object.

Link copied to clipboard
open override var isDrawn: Boolean

Whether the sprite has been drawn to the canvas this frame.

Link copied to clipboard
open override var static: Boolean

Whether the sprite is affected by physics. False means it is not.

Link copied to clipboard
open val surfaceArea: Int

The surface area of the object's bounding box, based on its size parameters.

Link copied to clipboard
open val volume: Int

The volume of the object's bounding box, based on its size parameters.

Link copied to clipboard
open override val width: Int

The width of the object.

Link copied to clipboard
open override var x: Int

The x-coordinate of the object.

Link copied to clipboard
open override var y: Int

The y-coordinate of the object.

Link copied to clipboard
open override var z: Int

The z-coordinate of the object.

Link copied to clipboard
var zIndex: Int

The z-index of the sprite. Higher values are drawn on top of lower values.

Functions

Link copied to clipboard
open fun addCostume(costume: Model)

Adds a costume to this sprite.

Link copied to clipboard
open override fun changeTo(index: Int)

Changes the current costume of this sprite to the one at the specified index.

Link copied to clipboard
open fun moveBy(deltaX: Int, deltaY: Int, deltaZ: Int)

Moves the object by the specified deltaX, deltaY, and deltaZ offsets in place.

Link copied to clipboard
open fun moveTo(newX: Int, newY: Int, newZ: Int)

Moves the object to the specified newX, newY, and newZ coordinates in place.

Link copied to clipboard
open override fun nextCostume()

Changes the current costume of this sprite to the next one in the list. Loops back to the first costume if currently at the last one.

Link copied to clipboard
open override fun previousCostume()

Changes the current costume of this sprite to the previous one in the list. Loops back to the last costume if currently at the first one.

Link copied to clipboard
open fun removeCostume(costume: Model)

Removes the specified costume from this sprite.

Link copied to clipboard
open fun removeCostumeAt(index: Int)

Removes the costume at the specified index from this sprite.

Link copied to clipboard
open fun setCostume(index: Int, costume: Model)

Sets the costume at the specified index for this sprite.

Link copied to clipboard
open fun setCostumes(vararg list: Model)
open fun setCostumes(list: Iterable<Model>)

Sets the costumes for this sprite.

Link copied to clipboard
open override fun setCurrentCostume(costume: Model)

Sets the current costume of this sprite to the specified image. If the image is not already a costume of this sprite, it is added.

Link copied to clipboard
open override fun switchTo(costume: Model)

Changes the current costume of this sprite to the specified image. The costume must already be part of this sprite's costumes.