Gamedev Framework (gf)  0.3.0
A C++11 framework for 2D games
Public Member Functions | List of all members
gf::AnimatedSprite Class Reference

An animated sprite. More...

#include <gf/AnimatedSprite.h>

Inheritance diagram for gf::AnimatedSprite:
Inheritance graph
[legend]

Public Member Functions

 AnimatedSprite ()
 Constructor. More...
 
void setAnimation (Animation &animation)
 Set the current animation of the sprite. More...
 
void update (float dt)
 Update the state of the animation. More...
 
- Public Member Functions inherited from gf::Sprite
 Sprite ()
 Default constructor. More...
 
 Sprite (const Texture &texture)
 Construct the sprite from a source texture. More...
 
 Sprite (const Texture &texture, const RectF &textureRect)
 Construct the sprite from a sub-rectangle of a source texture. More...
 
void setTexture (const Texture &texture, bool resetRect=false)
 Change the source texture of the sprite. More...
 
const TexturegetTexture () const
 Get the source texture of the sprite. More...
 
void unsetTexture ()
 Unset the source texture of the sprite. More...
 
void setTextureRect (const RectF &rect)
 Set the sub-rectangle of the texture that the sprite will display. More...
 
const RectFgetTextureRect () const
 Get the sub-rectangle of the texture displayed by the sprite. More...
 
void setColor (const Color4f &color)
 Set the global color of the sprite. More...
 
const Color4fgetColor () const
 Get the global color of the sprite. More...
 
RectF getLocalBounds () const
 Get the local bounding rectangle of the entity. More...
 
void setAnchor (Anchor anchor)
 Set the anchor origin of the entity. More...
 
VertexBuffer commitGeometry () const
 Create a buffer with the current geometry. More...
 
virtual void draw (RenderTarget &target, RenderStates states) override
 Draw the object to a render target. More...
 
- Public Member Functions inherited from gf::Transformable
 Transformable ()
 Default constructor. More...
 
void setOrigin (Vector2f origin)
 Set the local origin of the object. More...
 
Vector2f getOrigin () const
 Get the local origin of the object. More...
 
void setPosition (Vector2f position)
 Set the position of the object. More...
 
Vector2f getPosition () const
 Get the position of the object. More...
 
void move (Vector2f offset)
 Move the object by a given offset. More...
 
void setRotation (float angle)
 Set the orientation of the object. More...
 
float getRotation () const
 Get the orientation of the object. More...
 
void rotate (float angle)
 Rotate the object. More...
 
void setScale (Vector2f factors)
 Set the scale factors of the object. More...
 
void setScale (float factor)
 Set the scale factor of the object. More...
 
Vector2f getScale () const
 Get the current scale of the object. More...
 
void scale (Vector2f factors)
 Scale the object. More...
 
void scale (float factor)
 Scale the object. More...
 
Matrix3f getTransform () const
 Get the combined transform of the object. More...
 
Matrix3f getInverseTransform () const
 Get the inverse of the combined transform of the object. More...
 
- Public Member Functions inherited from gf::Drawable
virtual ~Drawable ()
 Virtual desctructor. More...
 

Additional Inherited Members

- Protected Member Functions inherited from gf::Transformable
void setOriginFromAnchorAndBounds (Anchor anchor, const RectF &bounds)
 Set the origin from an anchor and bounds. More...
 

Detailed Description

An animated sprite.

An animated sprite is a sprite that can display an animation.

See also
gf::Sprite, gf::Animation

Constructor & Destructor Documentation

gf::AnimatedSprite::AnimatedSprite ( )

Constructor.

Member Function Documentation

void gf::AnimatedSprite::setAnimation ( Animation animation)

Set the current animation of the sprite.

Parameters
animationThe animation
void gf::AnimatedSprite::update ( float  dt)

Update the state of the animation.

Parameters
dtThe time (in seconds) since the last update