Adds a g:text element to the g:background element.
Syntax
g:background.addTextObject(strText, strFont, intFontSize, strColor, intXOffset, intYOffset)
Parameters
| strText |
Required.
A string that specifies the text to be added.
|
| strFont |
Required.
A string that specifies the font name in which to render the text.
|
| intFontSize |
Required.
An integer that specifies the absolute value for the point-size in which to render the text. This value is limited to an integer; there are no overload methods that allow the use of alternate HTML-standard values such as absolute sizes (xx-small | x-small | small | medium | large | x-large | xx-large), relative sizes (larger | smaller), percentages, or other length specifications (cm, mm, in, pc, px, em, or ex).
|
| strColor |
Required.
A string that specifies the color of the text.
|
| intXOffset |
Required.
An integer specifying the horizontal position of the text relative to the top-left corner of the background.
|
| intYOffset |
Required.
An integer specifying the vertical position of the image relative to the top-left corner of the background.
|
Return Value
No return value.
Remarks
The default font and size is 12-point Times New Roman if the specified font and size are not available on the system.
Example
The following example demonstrates how to add text to a gadget background.
\\ imgBackground is the value of the 'id' attribute for the g:background element.
var txtShadow = imgBackground.addTextObject("test", "Verdana", 25, "Red", 50, 50);
Applies To
See Also