Xors3d Engine
Text drawing

Functions

BBDECL int BBCALL xFontHeight ()
 Returns the height, in pixels, of the currently selected font.
BBDECL int BBCALL xFontWidth ()
 Returns the width, in pixels, of the currently selected font.
BBDECL void BBCALL xFreeFont (Font *font)
 Frees up a font.
BBDECL Font *BBCALL xLoadFont (const char *name, int height, bool bold=false, bool italic=false, bool underline=false, const char *fontface="")
 Loads a font and returns a font handle.
BBDECL void BBCALL xSetFont (Font *font)
 Activates a font previously loaded into memory (though the xLoadFont() command) for future use with printing commands such as xText().
BBDECL int BBCALL xStringHeight (const char *textString)
 Returns the size, in pixels, the height of the indicated string.
BBDECL int BBCALL xStringWidth (const char *textString)
 Returns the size, in pixels, the width of the indicated string.
BBDECL void BBCALL xText (float x, float y, const char *textString, bool centerx=false, bool centery=false)
 Prints a string at the designated screen coordinates.

Function Documentation

BBDECL Font* BBCALL xLoadFont ( const char *  name,
int  height,
bool  bold = false,
bool  italic = false,
bool  underline = false,
const char *  fontface = "" 
)

Loads a font and returns a font handle.

Parameters:
nameName of font to be loaded, e.g. "arial" or a path to the font file.
heightHeight of font in points
boldTrue to load bold version of font, false not to
italicTrue to load italic version of font, false not to
underlineTrue to load underlined version of font, false not to
fontfaceSpecify an exact name of the fontface if the engine fails to load the font using only the file name.
BBDECL void BBCALL xText ( float  x,
float  y,
const char *  textString,
bool  centerx = false,
bool  centery = false 
)

Prints a string at the designated screen coordinates.

Parameters:
xStarting x coordinate to print text
yStarting y coordinate to print text
textStringText to print
centerxTrue to center horizontally
centeryTrue to center vertically
BBDECL void BBCALL xSetFont ( Font *  font)

Activates a font previously loaded into memory (though the xLoadFont() command) for future use with printing commands such as xText().

Parameters:
fontFont handle
BBDECL void BBCALL xFreeFont ( Font *  font)

Frees up a font.

Parameters:
fontFont handle
BBDECL int BBCALL xFontWidth ( )

Returns the width, in pixels, of the currently selected font.

Use currently setted font by xSetFont() command.

BBDECL int BBCALL xFontHeight ( )

Returns the height, in pixels, of the currently selected font.

Use currently setted font by xSetFont() command.

BBDECL int BBCALL xStringWidth ( const char *  textString)

Returns the size, in pixels, the width of the indicated string.

This is useful for determining screen layout, scrolling of text, and more. This is calculated based on the size of the currently loaded font.

Parameters:
textStringAny valid string
BBDECL int BBCALL xStringHeight ( const char *  textString)

Returns the size, in pixels, the height of the indicated string.

This is useful for determining screen layout, scrolling of text, and more. This is calculated based on the size of the currently loaded font.

Parameters:
textStringAny valid string