Main Page | Namespace List | Class List | File List | Class Members | File Members

NGT_Sprite Class Reference

NGT Sprite class. More...

#include <video_sprites.h>

List of all members.

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.


Detailed Description

NGT Sprite class.

This class provides basic functions and objects to manage and draw a sprite.

Definition at line 48 of file video_sprites.h.


Constructor & Destructor Documentation

NGT_Sprite::NGT_Sprite  )  [inline]
 

Definition at line 51 of file video_sprites.h.

NGT_Sprite::~NGT_Sprite  )  [inline]
 

Definition at line 52 of file video_sprites.h.


Member Function Documentation

void NGT_Sprite::clearBG  ) 
 

Definition at line 90 of file video_sprites.cpp.

References NGT_SpriteBase::mH, and NGT_SpriteBase::mW.

void NGT_Sprite::draw  ) 
 

Draw the sprite.

Definition at line 114 of file video_sprites.cpp.

References NGT_SpriteBase::mAnim, NGT_SpriteBase::mNumframes, and NGT_SpriteFrame::pause.

int NGT_Sprite::getFrame  )  [inline]
 

Get the number of the current frame.

Definition at line 62 of file video_sprites.h.

int NGT_Sprite::geth  )  [inline]
 

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().

float NGT_Sprite::getSpeed  )  [inline]
 

Get the current speed of the animation.

Definition at line 67 of file video_sprites.h.

int NGT_Sprite::getw  )  [inline]
 

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().

float NGT_Sprite::getx  )  [inline]
 

Get the 'x' coordinate of the sprite.

Definition at line 90 of file video_sprites.h.

Referenced by Sprite_Collide().

float NGT_Sprite::gety  )  [inline]
 

Get the 'y' coordinate of the sprite.

Definition at line 92 of file video_sprites.h.

Referenced by Sprite_Collide().

int NGT_Sprite::init NGT_SpriteBase base,
SDL_Surface *  screen
 

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.

void NGT_Sprite::rewind  )  [inline]
 

Go to the first frame of the animation.

Definition at line 76 of file video_sprites.h.

void NGT_Sprite::set int  xx,
int  yy
[inline]
 

Set both the 'x' and 'y' coordinates of the sprite.

Definition at line 87 of file video_sprites.h.

void NGT_Sprite::setFrame int  nr  )  [inline]
 

Set the number of the current frame.

Definition at line 60 of file video_sprites.h.

void NGT_Sprite::setSpeed float  nr  )  [inline]
 

Set the speed value for the animation.

Definition at line 65 of file video_sprites.h.

void NGT_Sprite::startAnim  )  [inline]
 

Start playing the animation.

Definition at line 72 of file video_sprites.h.

void NGT_Sprite::stopAnim  )  [inline]
 

Stop playing tha animation.

Definition at line 74 of file video_sprites.h.

void NGT_Sprite::toggleAnim  )  [inline]
 

Toggle between Stop or Play the animation.

Definition at line 70 of file video_sprites.h.

void NGT_Sprite::updateBG  ) 
 

Definition at line 103 of file video_sprites.cpp.

References NGT_SpriteBase::mH, and NGT_SpriteBase::mW.

void NGT_Sprite::xadd int  nr  )  [inline]
 

Increment the 'x' coordinate of the sprite.

Definition at line 79 of file video_sprites.h.

void NGT_Sprite::xset int  nr  )  [inline]
 

Set the 'x' coordinate of the sprite.

Definition at line 83 of file video_sprites.h.

void NGT_Sprite::yadd int  nr  )  [inline]
 

Increment the 'y' coordinate of the sprite.

Definition at line 81 of file video_sprites.h.

void NGT_Sprite::yset int  nr  )  [inline]
 

Set the 'y' coordinate of the sprite.

Definition at line 85 of file video_sprites.h.


The documentation for this class was generated from the following files:
Generated on Wed Feb 1 00:07:08 2006 for Neopntec Gaming Toolkit - API reference by  doxygen 1.4.4