|
VSGL2 - Very Simple Graphic Library 2
2.0
|
Functions | |
| string | load_font (string font, int dim) |
| void | draw_text (string font, int dim, string text, int x, int y, Color c) |
| Use this function to display a text on the screen with the desired font and dimension. More... | |
| int | text_width (string font, int dim, string text) |
| Use this function to retrieve the width of a string, given the font, the dimension and the text. It can be useful because each character has a different size in general, so it could be very tricky to calculate the actual width of a string. More... | |
| int | text_height (string font, int dim, string text) |
| Use this function to retrieve the height of a string, given the font, the dimension and the text. It can be useful because each character has a different size in general, so it could be very tricky to calculate the actual height of a string. More... | |
| void draw_text | ( | string | font, |
| int | dim, | ||
| string | text, | ||
| int | x, | ||
| int | y, | ||
| Color | c | ||
| ) |
Use this function to display a text on the screen with the desired font and dimension.
| font | The filename of the font. |
| dim | Font dimension |
| text | The text to be displayed |
| x | The x coordinate of the upper left corner of the text inside the window coordinates |
| y | The y coordinate of the upper left corner of the text inside the window coordinates |
| c | The color of the text |
| string vsgl2::ttf_fonts::load_font | ( | string | font, |
| int | dim | ||
| ) |
| int text_height | ( | string | font, |
| int | dim, | ||
| string | text | ||
| ) |
Use this function to retrieve the height of a string, given the font, the dimension and the text. It can be useful because each character has a different size in general, so it could be very tricky to calculate the actual height of a string.
| font | The filename of the font. |
| dim | Font dimension |
| text | The string to be displayed |
| int text_width | ( | string | font, |
| int | dim, | ||
| string | text | ||
| ) |
Use this function to retrieve the width of a string, given the font, the dimension and the text. It can be useful because each character has a different size in general, so it could be very tricky to calculate the actual width of a string.
| font | The filename of the font. |
| dim | Font dimension |
| text | The string to be displayed |
1.8.5