![]() |
Xors3d Engine
|
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. |
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.
name | Name of font to be loaded, e.g. "arial" or a path to the font file. |
height | Height of font in points |
bold | True to load bold version of font, false not to |
italic | True to load italic version of font, false not to |
underline | True to load underlined version of font, false not to |
fontface | Specify 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.
x | Starting x coordinate to print text |
y | Starting y coordinate to print text |
textString | Text to print |
centerx | True to center horizontally |
centery | True 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().
font | Font handle |
BBDECL void BBCALL xFreeFont | ( | Font * | font | ) |
Frees up a font.
font | Font 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.
textString | Any 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.
textString | Any valid string |