9#ifndef ASW_SPRITE_SHEET_H
10#define ASW_SPRITE_SHEET_H
Steps through frames over time, to use with a SpriteSheet.
bool is_finished() const
Check if a non looping animation has reached its last frame.
void update(float dt)
Advance the animation.
int get_frame() const
Get the frame to draw.
void set_frame_duration(float frame_duration)
Set seconds each frame is shown.
Animation()=default
Create an animation with a single frame.
void reset()
Go back to the first frame.
A texture split into equal frames, read left to right then top to bottom.
int get_frame_count() const
Get the number of frames.
Quad< float > get_frame(int index) const
Get the area of the texture a frame covers.
SpriteSheet()=default
Create an empty sprite sheet.
Vec2< float > get_frame_size() const
Get the size of one frame.
const Texture & get_texture() const
Get the texture.
void draw_frame(int index, const Quad< float > &dest) const
Draw a frame stretched to an area of the screen.
std::shared_ptr< SDL_Texture > Texture
Alias for a shared pointer to an SDL_Texture.
Types used throughout the ASW library.