Font.getStringHeight
From Spheriki
Get the pixel height of word-wrapped text that would be drawn with Font.drawTextBox().
Contents |
[edit]
Usage
number font.getStringHeight(text, width);
- font Sphere Font object. The font to use for gauging the height.
- text String. The text to calculate the word-wrapped height of.
- width Number, positive. The pixel width of the box in which word-wrapping occurs.
- number is returned, holding the total pixel height of the text when word-wrapped.
[edit]
Examples
The third example of Font.drawTextBox() contains a useful application of this function.
[edit]
Notes
- This function can be used to figure out the right number for the y_offset argument of the Font.drawTextBox() function.
[edit]
See also
- Sphere Font object

