#include <Sprite.h>
Inheritance diagram for Yukino::Sprite:
Public Member Functions | |
Sprite () | |
Constructor of the Sprite class. | |
Sprite (int w, int h, int bpp, dword fps, int cols, int rows=1) | |
Constructor of the Sprite class. | |
Sprite (int w, int h, int bpp, dword fps, vector< RectAux > &frames) | |
Constructor of the Sprite class. | |
Sprite (const string &file) | |
Constructor of the Sprite class. | |
Sprite (const char *file) | |
Constructor of the Sprite class. | |
Sprite (const Sprite &obj) | |
Copy constructor of the Sprite class. | |
virtual Sprite & | operator= (Sprite &obj) |
Operator = of the Sprite class. | |
~Sprite () | |
Destructor of the Sprite class. | |
UINT | Create (int w, int h, int bpp, dword fps, int cols, int rows=1) |
Function to create a blank sprite in the Sprite. | |
UINT | Create (int w, int h, int bpp, dword fps, vector< RectAux > &frames) |
Function to create a blank sprite in the Sprite. | |
virtual UINT | Load (const char *file) |
Function to load a sprite from a file. | |
virtual UINT | Load (const string &file) |
Function to load a sprite from a file. | |
virtual UINT | Save (const char *file, const char *texture) |
Function to save a sprite in a file. | |
virtual UINT | Save (const string &file, const string &texture) |
Function to save a sprite in a file. | |
virtual void | Free (void) |
Function to release the data of the Sprite object. | |
dword | GetFPS (void) |
Function to obtain the number of frames per second. | |
void | SetFPS (dword fps) |
Function to change the number of frames per second. | |
bool | SetNumFrames (int cols, int rows) |
Function to change the number of frames of the animation. | |
bool | SetNumFrames (int numframes) |
Function to change the number of frames of the animation. | |
int | GetNumFrames (void) const |
Function to obtain the number of frames of the animation. | |
void | SetFrames (vector< RectAux > &frames) |
Function to change the frames of the animation. | |
void | SetFrame (word i, sword x, sword y, word w, word h) |
Function to change one frame of the animation. | |
void | SetFrame (word i, const Rect *frame) |
Function to change one frame of the animation. | |
void | GetFrame (word i, Rect *frame) const |
Function to obtain one frame of the animation. | |
void | SetActFrame (dword frame) |
Function to change the actual frame of the animation. | |
dword | GetActFrame (void) const |
Function to obtain the actual frame of the animation. | |
void | NextActFrame (void) |
Function to pass to the next frame of the animation. | |
void | Update (dword time) |
Function to update the actual frame of the animation. | |
void | ResetTime (void) |
Function to reset the passed time. |
The Sprite class serves to store in memory sprite animated, contained the information of this in two files. One of specification of frames of the animation, and another one with the image where they are frames.
Yukino::Sprite::Sprite | ( | ) |
Constructor of the Sprite class.
Constructor by defect of the Sprite class.
Yukino::Sprite::Sprite | ( | int | w, | |
int | h, | |||
int | bpp, | |||
dword | fps, | |||
int | cols, | |||
int | rows = 1 | |||
) |
Constructor of the Sprite class.
Constructor of the Sprite class, that creates a blank sprite.
w | Width of the sprite. | |
h | Height of the sprite. | |
bpp | Depth of color of the sprite. | |
fps | Frames per second of the sprite. | |
cols | Columns of the sprite. | |
rows | Rows of the sprite. |
Yukino::Sprite::Sprite | ( | int | w, | |
int | h, | |||
int | bpp, | |||
dword | fps, | |||
vector< RectAux > & | frames | |||
) |
Constructor of the Sprite class.
Constructor of the Sprite class, that creates a blank sprite.
w | Width of the sprite. | |
h | Height of the sprite. | |
bpp | Depth of color of the sprite. | |
fps | Frames per second of the sprite. | |
frames | Specification of the frames. |
Yukino::Sprite::Sprite | ( | const string & | file | ) |
Constructor of the Sprite class.
Constructor of the Sprite class, that loads a file.
file | Path of the file. |
Yukino::Sprite::Sprite | ( | const char * | file | ) |
Constructor of the Sprite class.
Constructor of the Sprite class, that loads a file.
file | Path of the file. |
Yukino::Sprite::Sprite | ( | const Sprite & | obj | ) |
Copy constructor of the Sprite class.
obj | Sprite object to copy. |
Yukino::Sprite::~Sprite | ( | ) |
UINT Yukino::Sprite::Create | ( | int | w, | |
int | h, | |||
int | bpp, | |||
dword | fps, | |||
vector< RectAux > & | frames | |||
) |
Function to create a blank sprite in the Sprite.
This function serves to create a blank sprite in the Sprite.
w | Width of the sprite. | |
h | Height of the sprite. | |
bpp | Depth of color of the sprite. | |
fps | Frames per second of the sprite. | |
frames | Specification of the frames. |
UINT Yukino::Sprite::Create | ( | int | w, | |
int | h, | |||
int | bpp, | |||
dword | fps, | |||
int | cols, | |||
int | rows = 1 | |||
) |
Function to create a blank sprite in the Sprite.
This function serves to create a blank sprite in the Sprite.
w | Width of the image. | |
h | Height of the image. | |
bpp | Depth of color of the image. | |
fps | Frames per second of the sprite. | |
cols | Columns of the sprite. | |
rows | Rows of the sprite. |
void Yukino::Sprite::Free | ( | void | ) | [virtual] |
dword Yukino::Sprite::GetActFrame | ( | void | ) | const [inline] |
Function to obtain the actual frame of the animation.
This function serves to obtain the actual frame of the animation.
dword Yukino::Sprite::GetFPS | ( | void | ) | [inline] |
Function to obtain the number of frames per second.
This function serves to obtain the speed of the animation.
Function to obtain one frame of the animation.
This function serves to obtain one frame of the animation.
i | Number of the frame. | |
frame | Properties of the frame. |
int Yukino::Sprite::GetNumFrames | ( | void | ) | const [inline] |
Function to obtain the number of frames of the animation.
This function serves to obtain the number of frames of the animation.
virtual UINT Yukino::Sprite::Load | ( | const string & | file | ) | [inline, virtual] |
Function to load a sprite from a file.
This function serves to load a sprite from a file.
file | Path of the file. |
Reimplemented from Yukino::Surface.
UINT Yukino::Sprite::Load | ( | const char * | file | ) | [virtual] |
Function to load a sprite from a file.
This function serves to load a sprite from a file.
file | Path of the file. |
Reimplemented from Yukino::Surface.
void Yukino::Sprite::NextActFrame | ( | void | ) | [inline] |
Function to pass to the next frame of the animation.
This function serves to pass to the next frame of the animation.
void Yukino::Sprite::ResetTime | ( | void | ) | [inline] |
Function to reset the passed time.
This function serves to reset the passed time.
virtual UINT Yukino::Sprite::Save | ( | const string & | file, | |
const string & | texture | |||
) | [inline, virtual] |
Function to save a sprite in a file.
This function serves to save a sprite in a file.
file | Path of the file. | |
texture | Path of the image file. |
UINT Yukino::Sprite::Save | ( | const char * | file, | |
const char * | texture | |||
) | [virtual] |
Function to save a sprite in a file.
This function serves to save a sprite in a file.
file | Path of the file. | |
texture | Path of the image file. |
void Yukino::Sprite::SetActFrame | ( | dword | frame | ) | [inline] |
Function to change the actual frame of the animation.
This function serves to change the actual frame of the animation.
frame | Actual frame. |
void Yukino::Sprite::SetFPS | ( | dword | fps | ) | [inline] |
Function to change the number of frames per second.
This function serves to change the speed of the animation.
fps | Frames per second of the sprite. |
Function to change one frame of the animation.
This function serves to change one frame of the animation.
i | Number of the frame. | |
frame | Properties of the frame. |
Function to change one frame of the animation.
This function serves to change one frame of the animation.
i | Number of the frame. | |
x | Coordinate x of the frame. | |
y | Coordinate y of the frame. | |
w | Width of the frame. | |
h | Height of the frame. |
void Yukino::Sprite::SetFrames | ( | vector< RectAux > & | frames | ) | [inline] |
Function to change the frames of the animation.
This function serves to change the frames of the animation.
frames | Frames of the animation. |
bool Yukino::Sprite::SetNumFrames | ( | int | numframes | ) | [inline] |
Function to change the number of frames of the animation.
This function serves to change the number of frames of the animation.
numframes | Number of frames. |
bool Yukino::Sprite::SetNumFrames | ( | int | cols, | |
int | rows | |||
) | [inline] |
Function to change the number of frames of the animation.
This function serves to change the number of frames of the animation.
cols | Columns of the sprite. | |
rows | Rows of the sprite. |
void Yukino::Sprite::Update | ( | dword | time | ) | [inline] |
Function to update the actual frame of the animation.
This function serves to update the actual frame of the animation.
time | Passed time. |