Text.Size
static Vec2 Size(string text, TextStyle style)
Sometimes you just need to know how much room some text takes up! This finds the size of the text in meters when using the indicated style!
string text | Text you want to find the size of. |
TextStyle style | The visual style of the text, see Text.MakeStyle or the TextStyle object for more details. |
RETURNS: Vec2 | The width and height of the text in meters. |
static Vec2 Size(string text)
Sometimes you just need to know how much room some text takes up! This finds the size of the text in meters when using the default style!
string text | Text you want to find the size of. |
RETURNS: Vec2 | The width and height of the text in meters. |
static Vec2 Size(string text, float maxWidth)
Need to know how much space text will take when constrained to a certain width? This will find it using the default text style!
string text | Text to measure the size of. |
float maxWidth | Width of the available space in meters. |
RETURNS: Vec2 | The size that this text will take up, in meters! Width will be the same as maxWidth as long as the text takes more than one line, and height will be the total height of the text. |
static Vec2 Size(string text, TextStyle style, float maxWidth)
Need to know how much space text will take when constrained to a certain width? This will find it using the indicated text style!
string text | Text to measure the size of. |
float maxWidth | Width of the available space in meters. |
RETURNS: Vec2 | The size that this text will take up, in meters! Width will be the same as maxWidth as long as the text takes more than one line, and height will be the total height of the text. |
Found an issue with these docs, or have some additional questions? Create an Issue on Github!