Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | Related Pages

font.h

00001 #ifndef DEF_FONT_H 00002 #define DEF_FONT_H 1 00003 00004 /* 00005 Copyright (C) 2003 Matthias Braun 00006 00007 This program is free software; you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation; either version 2 of the License, or 00010 (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program; if not, write to the Free Software 00019 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 */ 00021 00025 typedef struct { 00026 SDL_Surface *surface; 00027 int charPos[512]; 00028 int maxPos; 00029 } SFont_Font; 00030 00035 class Font { 00036 public: 00037 Font(SDL_Surface* surface); 00038 ~Font(); 00039 int getHeight() const; 00040 int getTextWidth(std::string text) const; 00041 void write(SDL_Surface* surface, std::string text, int x, int y) const; 00042 void writeCenter(SDL_Surface* surface, std::string text, int y) const; 00043 void writeCenter(SDL_Surface* surface, std::string text, int x, int y) const; 00044 private: 00045 SFont_Font* initFont(SDL_Surface* Font); 00046 static Uint32 getPixel(SDL_Surface* surface, Sint32 X, Sint32 Y); 00047 SFont_Font* font; 00048 }; 00049 00050 #endif

Generated on Sun Feb 5 13:02:35 2006 for Lost Penguins by doxygen 1.3.8