00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef FONT_H
00019 #define FONT_H
00020
00021
00026 #include "game.h"
00027 #include "texture.h"
00028
00029 class Game;
00030
00031 class BFont {
00032 public:
00033 BFont( Game *pgame, const char *fontbitmapfile );
00034 ~BFont();
00035
00037 bool loadFontMetrics( const char *filename );
00038 int getLineHeight();
00039 int getCharWidth( unsigned char ch );
00040 int getCharXPos( unsigned char ch );
00041 int getCharYPos( unsigned char ch );
00043 int getTextureID() { return texture->getTextureID(); }
00045 Texture* getTexture() { return texture; }
00047 int getBlockWidth();
00049 void getRGBA( float &fr, float &fg, float &fb, float &fa );
00051 void getHotkeyRGBA( float &fr, float &fg, float &fb, float &fa );
00053 void setRGBA( float fr, float fg, float fb, float fa );
00055 void setHotkeyRGBA( float fr, float fg, float fb, float fa );
00056 private:
00057 float r,g,b,a, hr, hg, hb, ha;
00058 Game *game;
00059 bool metricsloaded;
00060 Texture *texture;
00061 int widths[256];
00062 int stretching;
00063 };
00064
00065 #endif