Introduction
Downloads
Documentation
Tutorials
Pixie Lite
Forum

Home

DebugFont Class Reference
[Core]

Debug font rendering. More...

List of all members.


Public Member Functions

void Blit (Bitmap &bitmap, int x, int y, const char *text, unsigned short color=0xffff)
void Blit (unsigned char *colorData, int hPitch, int vPitch, int x, int y, const char *text, unsigned char color=0xff)
void Blit (unsigned short *colorData, int hPitch, int vPitch, int x, int y, const char *text, unsigned short color=0xffff)
void Blit (unsigned int *colorData, int hPitch, int vPitch, int x, int y, const char *text, unsigned int color=0xffffffff)

Detailed Description

Debug font rendering.

Author:
Mattias Gustavsson
It is sometimes useful to be able to display text on the screen for debugging purposes. This class provides very basic functionality for writing text, and is completely self-contained - it even includes the font data. It can be used to draw onto any type of bitmap, and handles clipping of any part of the text that would end up outside of the bitmap.

Definition at line 23 of file DebugFont.h.


Member Function Documentation

void DebugFont::Blit ( Bitmap bitmap,
int  x,
int  y,
const char *  text,
unsigned short  color = 0xffff 
)

Render text onto a bitmap

Parameters:
bitmap Bitmap to render onto
x X-position of text
y Y-position of text
text Zero-terminated string to render
color 16-bit color to use for drawing the text. Defaults to white

Definition at line 12 of file DebugFont.cpp.

void DebugFont::Blit ( unsigned char *  colorData,
int  hPitch,
int  vPitch,
int  x,
int  y,
const char *  text,
unsigned char  color = 0xff 
)

Render text onto a 8-bit bitmap buffer

Parameters:
colorData Pointer to the pixel data of the target bitmap
hPitch Width of the bitmap, in pixels
vPitch Height of the bitmap, in pixels
x X-position of text
y Y-position of text
text Zero-terminated string to render
color Color to use for rendering font

Definition at line 20 of file DebugFont.cpp.

void DebugFont::Blit ( unsigned short *  colorData,
int  hPitch,
int  vPitch,
int  x,
int  y,
const char *  text,
unsigned short  color = 0xffff 
)

Render text onto a 16-bit bitmap buffer

Parameters:
colorData Pointer to the pixel data of the target bitmap
hPitch Width of the bitmap, in pixels
vPitch Height of the bitmap, in pixels
x X-position of text
y Y-position of text
text Zero-terminated string to render
color Color to use for rendering font

Definition at line 28 of file DebugFont.cpp.

void DebugFont::Blit ( unsigned int *  colorData,
int  hPitch,
int  vPitch,
int  x,
int  y,
const char *  text,
unsigned int  color = 0xffffffff 
)

Render text onto a 32-bit bitmap buffer

Parameters:
colorData Pointer to the pixel data of the target bitmap
hPitch Width of the bitmap, in pixels
vPitch Height of the bitmap, in pixels
x X-position of text
y Y-position of text
text Zero-terminated string to render
color Color to use for rendering font

Definition at line 36 of file DebugFont.cpp.



Pixie University and the Pixie Game Engine is created and managed by Mattias Gustavsson.
Reproduction/republishing of any material on this site without permission is strictly prohibited.