Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

CUI_FixedBMFont Class Reference

Implementation of IUI_FONT. More...

#include <CUI_FixedBMFont.h>

Inheritance diagram for CUI_FixedBMFont:

IUI_Font CUI_Resource List of all members.

Public Member Functions

 CUI_FixedBMFont (IUI_Shader *shader=NULL, int charx=16, int chary=24, int xres=256, int yres=256, int startoffset=0)
 Constructor.

virtual ~CUI_FixedBMFont ()
 Destructor - deletes the temporary texcoord lookup table.

virtual bool CalculateLookupTable ()
 (Re)Calculate the texture table

virtual bool RenderText (double dtime, IUI_Renderer *renderer, char *text)
 Base implementation.

virtual bool RenderText (double dtime, IUI_Renderer *renderer, char *text, unsigned int columns, unsigned int rows, unsigned int startColumn, unsigned int startRow, bool wrap, unsigned int &textColumns, unsigned int &textRows, bool invert=false, unsigned int cursorPosition=0, unsigned short cursorType=UI_CURSOR_NONE)
 Render specifying number of rows & columns and where to start.

virtual bool Count (char *text, unsigned int columns, unsigned int rows, bool wrap, unsigned int &textColumns, unsigned int &textRows)
 Count the number of columns and rows without rendering.

virtual bool SetShader (IUI_Shader *shader)
 Set the shader to use for this font.

virtual bool SetCharSize (int charx, int chary)
 Set the width and height (in pixels) of each character in the bitmap.

virtual bool SetBitmapResolution (int resx, int resy)
 Set resolution (in pixels) of the bitmap.

virtual bool SetCharPerRow (int charperrow)
 Set the number of characters per row in the bitmap.

virtual bool SetOffset (int offset)
 Set the offset from '!' of the first character in the font.


Protected Attributes

IUI_Shaderm_shader
 the shader to use for the bitmapped font.

int m_charx
 Fixed width of characters (in pixels).

int m_chary
 Fixed height of characters (in pixels).

int m_resx
 X resolution of the bitmap (in pixels).

int m_resy
 Y resolution of the bitmap (in pixels).

int m_charperrow
 Characters per row.

int m_startoffset
 offset from '!' that the font starts at

v4_fm_textureTable
 Texture coordinate lookup table.


Detailed Description

Implementation of IUI_FONT.

A bitmapped front with fixed-width characters.

Uses a texture coordinate lookup table (generated in the constructor) to speed up rendering.


Constructor & Destructor Documentation

CUI_FixedBMFont::CUI_FixedBMFont IUI_Shader shader = NULL,
int  charx = 16,
int  chary = 24,
int  xres = 256,
int  yres = 256,
int  startoffset = 0
 

Constructor.

Create a specific font

Parameters:
shader Shader to use as the bitmap
charx Fixed width of characters (in pixels)
chary Fixed height of characters (in pixels)
xres X resolution of the bitmap (in pixels)
yres Y resolution of the bitmap (in pixels)
startoffset Offset from '!' that the font starts with


Member Function Documentation

bool CUI_FixedBMFont::RenderText double  dtime,
IUI_Renderer renderer,
char *  text,
unsigned int  columns,
unsigned int  rows,
unsigned int  startColumn,
unsigned int  startRow,
bool  wrap,
unsigned int &  textColumns,
unsigned int &  textRows,
bool  invert = false,
unsigned int  cursorPosition = 0,
unsigned short  cursorType = UI_CURSOR_NONE
[virtual]
 

Render specifying number of rows & columns and where to start.

Used by CUI_TextBox

Much more useful for multiline text chunks

Implements IUI_Font.

bool CUI_FixedBMFont::RenderText double  dtime,
IUI_Renderer renderer,
char *  text
[virtual]
 

Base implementation.

Default text renderer. Everything must fit into [0,1] unit square.

Useful for buttons and simple labels

Implements IUI_Font.


The documentation for this class was generated from the following files:
Generated on Mon Sep 29 23:07:03 2003 for glGUI by doxygen 1.3.4