Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

font.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           font.h  -  description
00003                              -------------------
00004     begin                : Tue Sep 4 2001
00005     copyright            : (C) 2001 by T Kontkanen
00006     email                : tkontkanen@mail.com
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
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; //color
00058     Game *game;
00059     bool metricsloaded;
00060     Texture *texture;
00061     int widths[256];
00062     int stretching;
00063 };
00064 
00065 #endif

Generated at Fri Oct 5 20:23:52 2001 for Executor by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001