home *** CD-ROM | disk | FTP | other *** search
/ Game.EXE 2002 April / Game.EXE_04_2002.iso / Alawar / FontObject2D.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-03-02  |  751 b   |  41 lines

  1. #ifndef FONTOBJECT2D_H
  2. #define FONTOBJECT2D_H
  3.  
  4. #include "Object2D.h"
  5. #include "String.h"
  6. class Sequences;
  7. class Scene2D;
  8.  
  9. #include <map>
  10.  
  11. class FontObject2D : public Object2D
  12. {
  13. public:
  14.     FontObject2D(Scene2D * scene, int layer, const String & name);
  15.     virtual ~FontObject2D();
  16.  
  17.     virtual void render();
  18.  
  19.     void set_transparency(unsigned alpha);
  20.     void change_text(const String & text);
  21. private:
  22.     struct SeqFr
  23.     {
  24.         unsigned seq;
  25.         unsigned fr;
  26.         SeqFr()
  27.             :    seq( 0 ),
  28.                 fr( 0 )
  29.         {}
  30.         SeqFr( unsigned seq, unsigned fr )
  31.             :    seq( seq ),
  32.                 fr( fr )
  33.         {}
  34.     };
  35.     typedef std::map<wchar_t, SeqFr> FontTable;
  36.     FontTable font_table;
  37.     String text;
  38.     unsigned alpha;
  39.     const Sequences * sequences;
  40. };
  41. #endif //FONTOBJECT2D_H