#include <video_sprites.h>
Public Member Functions | |
NGT_Sprite () | |
~NGT_Sprite () | |
int | init (NGT_SpriteBase *base, SDL_Surface *screen) |
Initialize the sprite. | |
void | draw () |
Draw the sprite. | |
void | clearBG () |
void | updateBG () |
void | setFrame (int nr) |
Set the number of the current frame. | |
int | getFrame () |
Get the number of the current frame. | |
void | setSpeed (float nr) |
Set the speed value for the animation. | |
float | getSpeed () |
Get the current speed of the animation. | |
void | toggleAnim () |
Toggle between Stop or Play the animation. | |
void | startAnim () |
Start playing the animation. | |
void | stopAnim () |
Stop playing tha animation. | |
void | rewind () |
Go to the first frame of the animation. | |
void | xadd (int nr) |
Increment the 'x' coordinate of the sprite. | |
void | yadd (int nr) |
Increment the 'y' coordinate of the sprite. | |
void | xset (int nr) |
Set the 'x' coordinate of the sprite. | |
void | yset (int nr) |
Set the 'y' coordinate of the sprite. | |
void | set (int xx, int yy) |
Set both the 'x' and 'y' coordinates of the sprite. | |
float | getx () |
Get the 'x' coordinate of the sprite. | |
float | gety () |
Get the 'y' coordinate of the sprite. | |
int | getw () |
Get the width of the sprite. | |
int | geth () |
Get the height of the sprite. |
This class provides basic functions and objects to manage and draw a sprite.
Definition at line 48 of file video_sprites.h.
|
Definition at line 51 of file video_sprites.h. |
|
Definition at line 52 of file video_sprites.h. |
|
Definition at line 90 of file video_sprites.cpp. References NGT_SpriteBase::mH, and NGT_SpriteBase::mW. |
|
Draw the sprite.
Definition at line 114 of file video_sprites.cpp. References NGT_SpriteBase::mAnim, NGT_SpriteBase::mNumframes, and NGT_SpriteFrame::pause. |
|
Get the number of the current frame.
Definition at line 62 of file video_sprites.h. |
|
Get the height of the sprite.
Definition at line 96 of file video_sprites.h. References NGT_SpriteFrame::image, and NGT_SpriteBase::mAnim. Referenced by Sprite_Collide(). |
|
Get the current speed of the animation.
Definition at line 67 of file video_sprites.h. |
|
Get the width of the sprite.
Definition at line 94 of file video_sprites.h. References NGT_SpriteFrame::image, and NGT_SpriteBase::mAnim. Referenced by Sprite_Collide(). |
|
Get the 'x' coordinate of the sprite.
Definition at line 90 of file video_sprites.h. Referenced by Sprite_Collide(). |
|
Get the 'y' coordinate of the sprite.
Definition at line 92 of file video_sprites.h. Referenced by Sprite_Collide(). |
|
Initialize the sprite.
Definition at line 78 of file video_sprites.cpp. References NGT_SpriteFrame::image, NGT_SpriteBase::mAnim, NGT_SpriteBase::mBuilt, and NGT_SpriteBase::mNumframes. |
|
Go to the first frame of the animation.
Definition at line 76 of file video_sprites.h. |
|
Set both the 'x' and 'y' coordinates of the sprite.
Definition at line 87 of file video_sprites.h. |
|
Set the number of the current frame.
Definition at line 60 of file video_sprites.h. |
|
Set the speed value for the animation.
Definition at line 65 of file video_sprites.h. |
|
Start playing the animation.
Definition at line 72 of file video_sprites.h. |
|
Stop playing tha animation.
Definition at line 74 of file video_sprites.h. |
|
Toggle between Stop or Play the animation.
Definition at line 70 of file video_sprites.h. |
|
Definition at line 103 of file video_sprites.cpp. References NGT_SpriteBase::mH, and NGT_SpriteBase::mW. |
|
Increment the 'x' coordinate of the sprite.
Definition at line 79 of file video_sprites.h. |
|
Set the 'x' coordinate of the sprite.
Definition at line 83 of file video_sprites.h. |
|
Increment the 'y' coordinate of the sprite.
Definition at line 81 of file video_sprites.h. |
|
Set the 'y' coordinate of the sprite.
Definition at line 85 of file video_sprites.h. |