![]() |
Dragonfly 2.2
A text-based game engine
|
00001 /// 00002 /// The sprite 00003 /// 00004 00005 #ifndef __SPRITE_H__ 00006 #define __SPRITE_H__ 00007 00008 #include <string> 00009 #include "Frame.h" 00010 00011 using namespace std; 00012 00013 class Sprite { 00014 00015 protected: 00016 int width; ///< Sprite width. 00017 int height; ///< Sprite height. 00018 int max_frame_count; ///< Maximum number of frames sprite can have. 00019 int frame_count; ///< Actual number of frames sprite has. 00020 int color; ///< Optional color for entire sprite. 00021 Frame *frame; ///< Array of frames. 00022 string label; ///< Text label to identify sprite. 00023 Sprite(); ///< Sprite constructor always has one arg. 00024 00025 public: 00026 ~Sprite(); 00027 Sprite(int max_frames); ///< Max frame count fixed upon creation. 00028 int getWidth(); 00029 void setWidth(int new_width); 00030 int getHeight(); 00031 void setHeight(int new_height); 00032 string getLabel(); 00033 void setLabel(string new_label); 00034 int getColor(); 00035 void setColor(int new_color); 00036 int getFrameCount(); 00037 Frame getFrame(int frame_number); 00038 int addFrame(Frame new_frame); 00039 }; 00040 00041 #endif // __SPRITE_H__