Struct Sprite3D

2D sprite node in a 3D world.

struct Sprite3D ;

A node that displays a 2D texture in a 3D environment. The texture displayed can be a region from a larger atlas texture, or a frame from a sprite sheet animation.

Properties

NameTypeDescription
frame[get, set] longCurrent frame to display from sprite sheet. vframes or hframes must be greater than 1.
frameCoords[get, set] Vector2Coordinates of the frame to display from sprite sheet. This is as an alias for the frame property. vframes or hframes must be greater than 1.
hframes[get, set] longThe number of columns in the sprite sheet.
regionEnabled[get, set] boolIf true, texture will be cut from a larger atlas texture. See regionRect.
regionRect[get, set] Rect2The region of the atlas texture to display. regionEnabled must be true.
texture[get, set] TextureTexture object to draw.
vframes[get, set] longThe number of rows in the sprite sheet.

Methods

NameDescription
getFrame
getFrameCoords
getHframes
getRegionRect
getTexture
getVframes
isRegion
setFrame
setFrameCoords
setHframes
setRegion
setRegionRect
setTexture
setVframes