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

/include/ZE_ZFont.h

Go to the documentation of this file.
00001 /*******************************************************************************
00002         This file is Part of the ZEngine Library for 2D game development.
00003                    Copyright (C) 2002, 2003 James Turk
00004 
00005                      Licensed under a BSD-style license.
00006 
00007     The maintainer of this library is James Turk (james@conceptofzero.net) 
00008      and the home of this Library is http://www.zengine.sourceforge.net
00009 *******************************************************************************/
00010 
00024 #ifndef __ze_zfont_h__
00025 #define __ze_zfont_h__
00026 
00027 #include "ZE_ZObject.h"
00028 #include "ZE_ZImage.h"
00029 
00030 #ifdef USE_SDL_TTF
00031 
00032 namespace ZE
00033 {
00034 
00040 class ZFont : public ZObject
00041 {
00042     protected:
00044         TTF_Font *rFont;
00046         string rFilename;
00048         SDL_Color rColor;
00050         SDL_Color rBGColor;
00051 
00052     public:
00053 
00055         //Opening and Closing//
00057 
00063         ZFont();
00064 
00072         ZFont(string filename, int size);
00073 
00079         ~ZFont();
00080 
00088         void Open(string filename, int size);
00089 
00095         void Release();
00096 
00098         //Settings and Drawing//
00100 
00108         void DrawText(string text, ZImage &image) const;
00109 
00117         void DrawShadedText(string text, ZImage &image) const;
00118 
00127         void SetColor(Uint8 r, Uint8 g, Uint8 b);
00128 
00137         void SetBGColor(Uint8 r, Uint8 g, Uint8 b);
00138 
00147         void SetStyle(bool bold, bool italic, bool underline);
00148 
00155         void Resize(int size);
00156 
00158         //Accessors//
00160 
00167         bool IsLoaded() const;
00168 
00175         bool IsBold() const;
00176 
00183         bool IsItalic() const;
00184 
00191         bool IsUnderlined() const;
00192 
00199         int Height() const;
00200 
00207         int LineSkip() const;
00208 
00216         int StringWidth(string text) const;
00217 
00225         int StringHeight(string text) const;
00226 };
00227 
00228 }
00229 
00230 #endif //USE_SDL_TTF
00231 
00232 #endif //__ze_zfont_h__

Generated on Sat Jan 18 17:53:20 2003 for ZEngine by doxygen1.3-rc2