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

CUI_VarBMFont Class Reference

Implementation of IUI_FONT. More...

#include <CUI_VarBMFont.h>

Inheritance diagram for CUI_VarBMFont:

IUI_Font CUI_Resource List of all members.

Public Member Functions

 CUI_VarBMFont (IUI_Shader *shader=NULL, int xres=256, int yres=256, unsigned char *widths=NULL)
 Constructor.

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

virtual bool CalculateLookupTable (unsigned char *widths)
 (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 SetWidths (unsigned char *widths)
 New character widths.


Protected Attributes

IUI_Shaderm_shader
 the shader to use for the bitmapped font.

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

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

v4_f m_textureTable [256 *4]
 Texture coordinate lookup table.

float m_charwidth [256]
 array of widths in floats (1.0 is full character width)


Detailed Description

Implementation of IUI_FONT.

A bitmapped front with variable-width characters.

Uses texture and font width data generated by bitmap font builder: http://lmnopc.com/bitmapfontbuilder/ All fonts must be full 256 character ascii, 16 characters per row, 16 characters per column.


Constructor & Destructor Documentation

CUI_VarBMFont::CUI_VarBMFont IUI_Shader shader = NULL,
int  xres = 256,
int  yres = 256,
unsigned char *  widths = NULL
 

Constructor.

Create a specific font

Parameters:
shader Shader to use as the bitmap
xres X resolution of the bitmap (in pixels)
yres Y resolution of the bitmap (in pixels)
widths array of character widths


Member Function Documentation

bool CUI_VarBMFont::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_VarBMFont::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:04 2003 for glGUI by doxygen 1.3.4