Spritesheet

SpriteSheet extends Sprite and act like a Texture Atlas.

Constructors

this
this(ref Texture tex)

CTor

this
this(ref Texture tex, const Rect texRect)

CTor

Members

Functions

executionCounter
uint executionCounter()

Returns the current execution count

isCompleted
bool isCompleted()

Returns if the execution is completed

lastUpdate
uint lastUpdate()

Returns the last update which means the last happened slide

numOfFrames
uint numOfFrames()

Returns how many frames this Spritesheet has. The width / height of the current Texture is divided through the corresponding width / height of the current Texture-Rect and both values are being multiplied.

selectFrame
void selectFrame(ubyte index)

Selects a specific frame and adapts the position of the texture rect. The index starts at 0 and line by line.

slideTextureRect
void slideTextureRect()

Slide / move the current view of the Texture, so that the next view of the Texture will be drawn. This happens by moving the Texture Rect.

Variables

numOfExecutions
int numOfExecutions;

The amount of executions of the <b>whole</b> slide -1 or less means infinite sliding

timeout
uint timeout;

The timeout between the slides

Inherited Members

From Sprite

setTexture
void setTexture(ref Texture tex)

Reset the Texture

getTexture
inout(Texture*) getTexture()

Returns a pointer to the current Texture

setColor
void setColor(const Color4b col)

Set a Color for the Sprite which is painted over the displayed Texture.

setTextureRect
void setTextureRect(const Rect texRect)

Set the Texture Rect. With this you can define a specific view of the Texture, so that only this specific view will be drawn.

getTextureRect
const(Rect) getTextureRect()

Returns the current Texture Rect

getClipRect
Rect getClipRect()

Returns the Clip Rect. The Sprite will notice if a Texture Rect is used or not and will therefore adapt the size of the view automatically

Meta

Authors

Randy Schuett (rswhite4@googlemail.com)