A texture split into equal frames, read left to right then top to bottom.
More...
#include <sprite_sheet.h>
A texture split into equal frames, read left to right then top to bottom.
Definition at line 20 of file sprite_sheet.h.
◆ SpriteSheet() [1/2]
| asw::SpriteSheet::SpriteSheet |
( |
| ) |
|
|
default |
Create an empty sprite sheet.
◆ SpriteSheet() [2/2]
| asw::SpriteSheet::SpriteSheet |
( |
const Texture & | texture, |
|
|
const Vec2< float > & | frame_size, |
|
|
int | frame_count = 0 ) |
Create a sprite sheet.
- Parameters
-
| texture | The texture holding the frames. |
| frame_size | The size of one frame in pixels. |
| frame_count | The number of frames, 0 to use every frame that fits in the texture. |
Definition at line 19 of file sprite_sheet.cpp.
◆ draw_frame()
| void asw::SpriteSheet::draw_frame |
( |
int | index, |
|
|
const Quad< float > & | dest ) const |
Draw a frame stretched to an area of the screen.
- Parameters
-
| index | The frame, wraps around past the last frame. |
| dest | The area to draw to. |
Definition at line 64 of file sprite_sheet.cpp.
◆ get_frame()
| Quad< float > asw::SpriteSheet::get_frame |
( |
int | index | ) |
const |
Get the area of the texture a frame covers.
- Parameters
-
| index | The frame, wraps around past the last frame. |
- Returns
- The source area in pixels.
Definition at line 50 of file sprite_sheet.cpp.
◆ get_frame_count()
| int asw::SpriteSheet::get_frame_count |
( |
| ) |
const |
Get the number of frames.
- Returns
- The frame count.
Definition at line 45 of file sprite_sheet.cpp.
◆ get_frame_size()
| Vec2< float > asw::SpriteSheet::get_frame_size |
( |
| ) |
const |
Get the size of one frame.
- Returns
- The frame size in pixels.
Definition at line 40 of file sprite_sheet.cpp.
◆ get_texture()
| const Texture & asw::SpriteSheet::get_texture |
( |
| ) |
const |
◆ columns
| int asw::SpriteSheet::columns { 0 } |
|
private |
◆ frame_count
| int asw::SpriteSheet::frame_count { 0 } |
|
private |
◆ frame_size
| Vec2<float> asw::SpriteSheet::frame_size |
|
private |
◆ texture
The documentation for this class was generated from the following files: