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

SFont.h

Go to the documentation of this file.
00001 /************************************************************************ 
00002 *    SFONT - SDL Font Library by Karl Bartel <karlb@gmx.net>            *
00003 *                                                                       *
00004 *  All functions are explained below. There are two versions of each    *
00005 *  funtction. The first is the normal one, the function with the        *
00006 *  2 at the end can be used when you want to handle more than one font  *
00007 *  in your program.                                                     *
00008 *                                                                       *
00009 ************************************************************************/
00010 
00011 #ifdef __cplusplus 
00012 extern "C" {
00013 #endif
00014 
00015 // Delcare one variable of this type for each font you are using.
00016 // To load the fonts, load the font image into YourFont->Surface
00017 // and call InitFont( YourFont );
00018 typedef struct {
00019         SDL_Surface *Surface;   
00020         int CharPos[512];
00021         int h;
00022 } SFont_FontInfo;
00023 
00024 // Initializes the font
00025 // Font: this contains the suface with the font.
00026 //       The font must be loaded before using this function.
00027 void InitFont (SDL_Surface *Font);
00028 void InitFont2(SFont_FontInfo *Font);
00029 
00030 // Blits a string to a surface
00031 // Destination: the suface you want to blit to
00032 // text: a string containing the text you want to blit.
00033 void PutString (SDL_Surface *Surface, int x, int y, char *text);
00034 void PutString2(SDL_Surface *Surface, SFont_FontInfo *Font, int x, int y, char *text);
00035 
00036 // Returns the width of "text" in pixels
00037 int TextWidth(char *text);
00038 int TextWidth2(SFont_FontInfo *Font, char *text);
00039 
00040 // Blits a string to with centered x position
00041 void XCenteredString (SDL_Surface *Surface, int y, char *text);
00042 void XCenteredString2(SDL_Surface *Surface, SFont_FontInfo *Font, int y, char *text);
00043 
00044 // Allows the user to enter text
00045 // Width: What is the maximum width of the text (in pixels)
00046 // text: This string contains the text which was entered by the user
00047 void SFont_Input ( SDL_Surface *Destination, int x, int y, int Width, char *text);
00048 void SFont_Input2( SDL_Surface *Destination, SFont_FontInfo *Font, int x, int y, int Width, char *text);
00049 
00050 #ifdef __cplusplus
00051 }
00052 #endif

Generated on Sun Mar 2 18:50:27 2003 for eounicorn by doxygen1.3-rc3