![]() |
Xors3d Engine
|
Functions | |
int | xFontHeight () |
Returns the height, in pixels, of the currently selected font. | |
int | xFontWidth () |
Returns the width, in pixels, of the currently selected font. | |
void | xFreeFont (Font *font) |
Frees up a font. | |
Font * | 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. | |
void | xSetFont (Font *font) |
Activates a font previously loaded into memory (though the xLoadFont() command) for future use with printing commands such as xText(). | |
int | xStringHeight (const char *textString) |
Returns the size, in pixels, the height of the indicated string. | |
int | xStringWidth (const char *textString) |
Returns the size, in pixels, the width of the indicated string. | |
void | xText (float x, float y, const char *textString, bool centerx=false, bool centery=false) |
Prints a string at the designated screen coordinates. |
Font* 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. |
void 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 |
void xSetFont | ( | Font * | font | ) |
Activates a font previously loaded into memory (though the xLoadFont() command) for future use with printing commands such as xText().
If font handle is zero, the default engine font (Tahoma, 10) will be set.
font | Font handle |
void xFreeFont | ( | Font * | font | ) |
Frees up a font.
font | Font handle |
int xFontWidth | ( | ) |
Returns the width, in pixels, of the currently selected font.
Use currently setted font by xSetFont() command.
int xFontHeight | ( | ) |
Returns the height, in pixels, of the currently selected font.
Use currently setted font by xSetFont() command.
int 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 |
int 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 |