Sprite Class
A component class that holds the graphical representation of the entity.
Constructor
Sprite
(
-
spriteSheetHandle
-
spriteIndex
-
zIndex
Parameters:
-
spriteSheetHandle
AssetHandleHandle to the sprite sheet asset which has this entity's sprite.
-
spriteIndex
NumberThe sprite's index in the sprite sheet's array of sprites.
-
zIndex
NumberThe sprite's z-index describes the rendering order. Sprites with a higher z-index are rendered on top of sprites with a lower z-index.
Item Index
Methods
getSpriteIndex
()
Number
Returns:
Number:
Index of this sprite in the sprite sheet.
getSpriteSheetHandle
()
AssetHandle
Returns:
AssetHandle:
Direct reference to the asset handle to the sprite sheet this sprite is in.
getZIndex
()
Number
Returns:
Number:
The sprite's z-index, which describes the rendering order.
setSpriteIndex
(
-
spriteIndex
Parameters:
-
spriteIndex
NumberIndex of this sprite in the sprite sheet.
setSpriteSheetHandle
(
-
spriteSheetHandle
Parameters:
-
spriteSheetHandle
AssetHandleHandle to the sprite sheet this sprite is in.
setZIndex
(
-
zIndex
Parameters:
-
zIndex
NumberThe sprite's z-index, which describes the rendering order.