Syntax
| draw.ID.text.ex.getWidth(NULL, NULL, Text, FontName, Size, NULL, Bold, FontWeight, Orientation, Italic) |
Parameters
| NULL | NULL, NULL | Set to NULL
| | STRING | Text | Text to render.
| | STRING | FontName | Name of the font to be used.
| | INT | Size | Size of the text.
| | NULL | NULL | Set to NULL.
| | BOOL | Bold | Optional. Set to true for bold.
| | INT | FontWeight | Optional. Weight of the font.
| | INT | Orientation | Optional. Orientation of the text, in degres.
| | BOOL | Italic | Optional. Set to true for italic. |
Return value
Description
| Returns the size of the text after rendering (text is not rendered). |
MioScript Sample Code
&twidth=draw.main.text.ex.getWidth(
NULL,NULL,
"Hello, World",
"Arial", 12,
NULL,
true
)
// Center the text in the main window
draw.main.text.ex(
window.main.width()/2-&twidth/2,100,
"Hello, World",
"Arial", 12,
num.rgb(255,0,0),
true
)
draw.main.paint()
|
|