Main Page   Packages   Class Hierarchy   Alphabetical List   Data Structures   File List   Namespace Members   Data Fields   Globals  

Font.h

Go to the documentation of this file.
00001 /*
00002  * $Id: Font.h,v 1.9 2002/08/05 15:14:01 virtualcasino Exp $
00003  */
00004 #ifndef __VCASINO_FONT_H__
00005 #define __VCASINO_FONT_H__
00006 #include<clawsoft.h>
00007 #include<gui.h>
00008 #include<SDL_ttf.h>
00009 
00010 /*
00011  * RENDER_UTF8
00012  * TTF_STYLE_NORMAL
00013  * solid = 1
00014  */
00015 
00016 namespace clawsoft{
00017         enum Alignment{
00018                 LEFT,
00019                 CENTER,
00020                 RIGHT
00021         };
00022 
00023         class Font:public GUIObject{
00024                 protected:
00025                         TTF_Font *thefont;
00026                         SDL_Color currentcolor;
00027                         SDL_Color bgcolor;
00028                         int siz;
00029                         void destroy();
00030                         void size(int s);
00031                 public:
00032                         Font();
00033                         Font(const char *fname, int s = 10);
00034                         Font(String fname, int s = 10);
00035                         Font(TTF_Font *f, int s = 10);
00036                         virtual ~Font(){
00037                                 destroy();
00038                         }
00039                         void load(const char *fname, int s = 10);
00040                         void load(String fname, int s = 10);
00041                         void setStyle(int);
00042                         void setColor(int r, int g, int b);
00043                         void setColor(int rgb[]);
00044                         void setColor(SDL_Color rgb);
00045                         void setBGColor(int r, int g, int b);
00046                         void setBGColor(int rgb[]);
00047                         void setBGColor(SDL_Color rgb);
00048                         SDL_Surface *render(const char *str);
00049                         SDL_Surface *render(String str);
00050                         SDL_Surface *renderText(const char *s);
00051                         const int size();
00053                         void draw();
00054         };
00055 
00056 
00057 }
00058 
00059 #endif

Powered by:

SourceForge Logo