30 #ifndef __SFTOOLS_ANIMATION_HPP__
31 #define __SFTOOLS_ANIMATION_HPP__
33 #include <SFML/Graphics/Drawable.hpp>
34 #include <SFML/Graphics/Transformable.hpp>
54 class Animation :
public sf::Drawable,
public sf::Transformable
88 void restart(sf::Time initialTime = sf::Time::Zero)
90 m_timeElapsed = initialTime;
116 virtual void draw(sf::RenderTarget& target, sf::RenderStates states)
const
120 states.transform *= getTransform();
121 target.draw(m_sprite, states);
137 m_sprite.setTextureRect(frame.
area);
138 m_sprite.setColor(frame.
color);
143 FrameStream
const* m_stream;
144 sf::Time m_timeElapsed;
150 #endif // __SFTOOLS_ANIMATION_HPP__