Sprite
Represents a sprite in the Kray game engine. Either 2D or 3D.
Parameters
The type of the sprite (e.g., Image for 2D sprites, Model for 3D sprites).
Inheritors
Properties
Whether the sprite can collide with other sprites. False means it cannot.
A list of all costumes associated with this sprite.
The current costume that the sprite is wearing.
The index of the current costume being used by this sprite.
The friction coefficient of the Positionable object. This is used in physics calculations to determine the frictional force acting on the object. The default value is defaultFrictionCoefficient.
The mass multiplier of the Positionable object. This is used in physics calculations to determine the effective mass of the object. The default value is 1.0.
The restitution coefficient of the Positionable object. This is used in physics calculations to determine how bouncy the object is after collisions. The default value is defaultRestitutionCoefficient.
The spin factor of the Positionable object.
Functions
Adds a costume to this sprite.
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.
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.
Removes the specified costume from this sprite.
Removes the costume at the specified index from this sprite.
Sets the costume at the specified index for this sprite.
Sets the costumes for this sprite.
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.