Spritesheet

SpriteSheet extends Sprite and has, besides the texture, even a viewport and acts as a Texture Atlas. With slideViewport the viewport slides over the current row of the texture atlas. With setRow the current row can be changed (increased, decreased).

Constructors

this
this(Texture tex, short lc)

CTor

this
this(Texture tex, ShortRect texView, short lc)

CTor

this
this(Texture tex, ShortRect texView, short lc)

CTor

Members

Enums

Grid
enum Grid

The Grid

Functions

_getTextureCoordinates
float[8] _getTextureCoordinates()
Undocumented in source. Be warned that the author may not have intended to support it.
execute
bool execute(Grid grid)

Execute the animation N times where N is the number of the current loop count. If N is < 0, the animation runs infinite.

fetchTextureRect
inout(ShortRect)* fetchTextureRect()

Fetch the current Texture Rect, so that you can modify it, if you want to.

getClipRect
ShortRect getClipRect()

Returns the current Clip Rect

setLoopCount
void setLoopCount(short loopCount)

Set the current loop count. This specif how often the whole Animation is played. A value of < 0 means: infinite playing.

setTextureRect
void setTextureRect(ShortRect texView)

Set a Texture Rect. This indicates which area of the Texture is drawn.

setTextureRect
void setTextureRect(ShortRect texView)

Rvalue version

setTickOffset
void setTickOffset(ushort offset)

Set the current tick offset. This is the offset between each animation / slide. Default is 0.

slideTextureRect
void slideTextureRect(Grid grid)

Slide/move the current Viewport of the Texture. So the next area of the Texture atlas will be drawn. With grid you can decide if both, x and y, or only one of them are updated. Default both are updated.

Variables

row
ubyte row;

Set or get the current row. This only matters, if you slide without Grid.Column.

Inherited Members

From Sprite

_tex
Texture _tex;
Undocumented in source.
_blend
Blend _blend;
Undocumented in source.
_render
void _render()
Undocumented in source.
_getTextureCoordinates
float[8] _getTextureCoordinates()
Undocumented in source. Be warned that the author may not have intended to support it.
calculateCenter
const(Vector2s) calculateCenter()

Calculate, store and return the center point. Usefull for e.g. rotate.

collideWith
bool collideWith(Sprite rhs)

Check whether the bounding box of this Sprite collide with the bounding box of another Sprite

collideWith
bool collideWith(ShortRect rect)

Check whether the bounding box of this Sprite collide with the given Rect

collideWith
bool collideWith(ShortRect rect)

Rvalue version

getClipRect
ShortRect getClipRect()

Returns the current Clip Rect, the area, where the Sprite lies with the same size as the Sprite.

setBlend
void setBlend(Blend blend)

Set (or reset) the current Blend instance.

getBlend
inout(Blend) getBlend()

Returns the current Blend instance, or null.

width
ushort width [@property getter]

Returns the current width (the width of the current texture).

height
ushort height [@property getter]

Returns the current height (the height of the current texture).

hasTexture
bool hasTexture()

Check if the current Sprite has already a Texture/Image. If not, nothing can be drawn. But it does not check if the current Texture is valid.

setTexture
void setTexture(Texture tex)

Set or replace the current Texture.

getTexture
inout(Texture) getTexture()

Returns the current Texture or null if there is none.

Meta

Authors

rschuett