Main Page | Namespace List | Class List | File List | Class Members | File Members

NGT_Font Class Reference

NGT Font class. More...

#include <video_fonts.h>

List of all members.

Public Member Functions

void draw (string text, SDL_Surface *screen, int draw_x, int draw_y)
 Draws a text into screen, specifying all the parametres.
void draw (string text, SDL_Surface *scr)
 Draws a text into screen, using the object attributes.
void free ()
 Frees memory closing the loaded font.
 NGT_Font ()
 NGT_Font (string filename, int size)
 Constructor, with two attributes to initialize.
int LoadTTF (string filename, int size)
 Loads a font, passing the path to the file, and the size for drawing.
int LoadTTF ()
 Loads the font. Uses the public attributes of the class.

Public Attributes

string filename
 Path (relative or absolute) to the ttf font file.
int size
 Size of the font.
int mode
 'Drawing mode.
int x
 X coordinate for drawing.
int y
 Y coordinate for drawing.
SDL_Color color
 Color of the font.


Detailed Description

NGT Font class.

This class provides basic functions and objects to manage and draw fonts.

Definition at line 26 of file video_fonts.h.


Constructor & Destructor Documentation

NGT_Font::NGT_Font  )  [inline]
 

Definition at line 53 of file video_fonts.h.

NGT_Font::NGT_Font string  filename,
int  size
 

Constructor, with two attributes to initialize.


Member Function Documentation

void NGT_Font::draw string  text,
SDL_Surface *  scr
 

Draws a text into screen, using the object attributes.

Definition at line 34 of file video_fonts.cpp.

References color, NGT_Surface::draw(), NGT_Surface::free(), mode, NGT_Surface::surface, TEXT_BLENDED, TEXT_NONE, x, NGT_Surface::x, y, and NGT_Surface::y.

void NGT_Font::draw string  text,
SDL_Surface *  screen,
int  draw_x,
int  draw_y
 

Draws a text into screen, specifying all the parametres.

Definition at line 11 of file video_fonts.cpp.

References color, NGT_Surface::draw(), NGT_Surface::free(), mode, NGT_Surface::surface, TEXT_BLENDED, TEXT_NONE, NGT_Surface::x, and NGT_Surface::y.

void NGT_Font::free  )  [inline]
 

Frees memory closing the loaded font.

Definition at line 51 of file video_fonts.h.

int NGT_Font::LoadTTF  ) 
 

Loads the font. Uses the public attributes of the class.

Definition at line 60 of file video_fonts.cpp.

References filename, and size.

int NGT_Font::LoadTTF string  filename,
int  size
 

Loads a font, passing the path to the file, and the size for drawing.

Definition at line 66 of file video_fonts.cpp.


Member Data Documentation

SDL_Color NGT_Font::color
 

Color of the font.

Definition at line 45 of file video_fonts.h.

Referenced by draw().

string NGT_Font::filename
 

Path (relative or absolute) to the ttf font file.

Definition at line 29 of file video_fonts.h.

Referenced by LoadTTF().

int NGT_Font::mode
 

'Drawing mode.

Available modes:

TEXT_NONE = Draw the text as a solid, without any filter.
TEXT_BLENDED = Draw the text with a blend effect. Removes aliasing. May be slow.

Definition at line 39 of file video_fonts.h.

Referenced by draw().

int NGT_Font::size
 

Size of the font.

Definition at line 31 of file video_fonts.h.

Referenced by LoadTTF().

int NGT_Font::x
 

X coordinate for drawing.

Definition at line 41 of file video_fonts.h.

Referenced by draw().

int NGT_Font::y
 

Y coordinate for drawing.

Definition at line 43 of file video_fonts.h.

Referenced by draw().


The documentation for this class was generated from the following files:
Generated on Wed Feb 1 00:07:08 2006 for Neopntec Gaming Toolkit - API reference by  doxygen 1.4.4