sftools
2.0 dev
Bunch of tools for SFML application development
|
Drawable capable of rendering an animation based on a stream of frames. More...
#include <Animation.hpp>
Public Member Functions | |
Animation (FrameStream const &stream, sf::Time initialTime=sf::Time::Zero) | |
Constructor. | |
void | setFrameStream (FrameStream const &stream) |
Change the animation stream. | |
void | restart (sf::Time initialTime=sf::Time::Zero) |
Restart the animation. | |
void | update (sf::Time dt) |
Update the animation frame. | |
virtual void | draw (sf::RenderTarget &target, sf::RenderStates states) const |
Implement sf::Drawable::draw() method. | |
Drawable capable of rendering an animation based on a stream of frames.
All sf::Transformable and sf::Drawable methods are publicly available.
Definition at line 54 of file Animation/Animation.hpp.
|
inline |
Constructor.
stream | frame stream |
initialTime | by default the animation start a time zero but an offset can bet given |
Definition at line 64 of file Animation/Animation.hpp.
References restart(), and setFrameStream().
|
inlinevirtual |
Implement sf::Drawable::draw() method.
Look at SFML's documentation of sf::Drawable.
Definition at line 116 of file Animation/Animation.hpp.
|
inline |
Restart the animation.
initialTime | optional time offset |
Definition at line 88 of file Animation/Animation.hpp.
Referenced by Animation().
|
inline |
Change the animation stream.
stream | the new stream to use |
Definition at line 76 of file Animation/Animation.hpp.
Referenced by Animation().
|
inline |
Update the animation frame.
dt | time elapsed since the last update |
Definition at line 104 of file Animation/Animation.hpp.