Sprite

Sprite represents a drawable object and maintains a texture and his position.

Constructors

this
this()

CTor

this
this(Texture tex)

CTor

Members

Functions

_getTextureCoordinates
float[8] _getTextureCoordinates()
Undocumented in source. Be warned that the author may not have intended to support it.
_render
void _render()
Undocumented in source.
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

getBlend
inout(Blend) getBlend()

Returns the current Blend instance, or null.

getClipRect
ShortRect getClipRect()

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

getTexture
inout(Texture) getTexture()

Returns the current Texture or null if there is none.

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.

setBlend
void setBlend(Blend blend)

Set (or reset) the current Blend instance.

setTexture
void setTexture(Texture tex)

Set or replace the current Texture.

Properties

height
ushort height [@property getter]

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

width
ushort width [@property getter]

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

Variables

_blend
Blend _blend;
Undocumented in source.
_tex
Texture _tex;
Undocumented in source.

Inherited Members

From Transformable

_applyTranslation
void _applyTranslation()

Apply translation to the object.

calculateCenter
const(Vector2s) calculateCenter()

Calculate, store and return the center point.

resetTranslation
void resetTranslation()

Reset the translation.

setCenter
void setCenter(Vector2s center)

Set the rotation center.

setCenter
void setCenter(short x, short y)

Set the rotation center.

getCenter
const(Vector2s) getCenter()

Returns the rotation center.

setRotation
void setRotation(short rotAngle)

Set a (new) rotation.

rotate
void rotate(short rotAngle)

Increase/Decrease the rotation.

getRotation
short getRotation()

Returns the current rotation.

setScale
void setScale(float zoom)

Set a new scale.

scale
void scale(float zoom)

Increase/Decrease the scale/zoom.

getScale
float getScale()

Returns the current scale/zoom.

From Drawable

_render
void _render()
Undocumented in source.
render
void render()

Render method

From Blendable

setBlend
void setBlend(Blend blend)

Set (or reset) the current Blend instance.

getBlend
inout(Blend) getBlend()

Returns the current Blend instance, or null.

Meta

Authors

rschuett