« Go back


class Sprite: Dgame.Graphic.Transformable.Transformable, Dgame.Graphic.Drawable.Drawable;
Sprite represents a drawable object and maintains a Texture

Randy Schuett (rswhite4@googlemail.com)

final pure nothrow @nogc this(ref Texture tex);

pure nothrow @nogc this()(ref Texture tex, auto ref const Vector2f pos);

final pure nothrow @nogc void setTexture(ref Texture tex);
Reset the Texture

final inout pure nothrow @nogc inout(Texture*) getTexture();
Returns a pointer to the current Texture

pure nothrow @nogc void setColor()(auto ref const Color4b col);
Set a Color for the Sprite which is painted over the displayed Texture.

@nogc void setTextureRect()(auto ref 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.

final const pure nothrow @nogc ref const(Rect) getTextureRect();
Returns the current Texture Rect

final const pure nothrow @nogc 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

Page generated by Ddoc.

» Dgame.Graphic.Sprite on Github


« Go back