Spritesheet

SpriteSheet extends Sprite and act like a Texture Atlas.

Constructors

this
this(Texture tex)

CTor

this
this(Texture tex, 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

_execCount
uint _execCount;
Undocumented in source.
_lastUpdate
uint _lastUpdate;
Undocumented in source.
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

_texture
Texture* _texture;
Undocumented in source.
_texRect
Rect _texRect;
Undocumented in source.
_vertices
Vertex[4] _vertices;
Undocumented in source.
draw
void draw(Window wnd)
Undocumented in source. Be warned that the author may not have intended to support it.
_updateVertices
void _updateVertices()
Undocumented in source. Be warned that the author may not have intended to support it.
_adjustTextureRect
void _adjustTextureRect()
Undocumented in source. Be warned that the author may not have intended to support it.
setTexture
void setTexture(Texture tex)

Reset the Texture

getTexture
inout(Texture*) getTexture()

Returns a pointer to the current Texture

setColor
void setColor(Color4b col)

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

setTextureRect
void setTextureRect(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)