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 SDL Game Development.
00003                       Copyright (C) 2002 ConceptOfZero.net
00004 
00005              Licensed under the BSD License, see licensing.txt.
00006 
00007     The maintainer of this library is James Turk (jturk@conceptofzero.net) 
00008          and the home of this Library is http://www.conceptofzero.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);
00109 
00117         void DrawShadedText(string text, ZImage &image);
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();
00168 
00175         bool IsBold();
00176 
00183         bool IsItalic();
00184 
00191         bool IsUnderlined();
00192 
00199         int Height();
00200 
00207         int LineSkip();
00208 
00216         int StringWidth(string text);
00217 
00225         int StringHeight(string text);
00226 };
00227 
00228 }
00229 
00230 #endif //USE_SDL_TTF
00231 
00232 #endif //__ze_zfont_h__

Generated on Sun Dec 1 02:44:14 2002 for ZEngine by doxygen1.2.18