Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

text Object

Specifies a text element to display in a gadget.

Members

The text object defines the following members:

Methods

The text object defines the following methods.

MethodDescription
addGlow

Adds a glow effect to a g:text element.

addShadow

Adds a shadow effect to a g:text element.

 

Properties

The text object defines the following properties.

PropertyAccess typeDescription

align

Read/write

Gets or sets the text alignment.

blur

Read/write

Gets or sets the level of blur applied to the g:text element.

brightness

Read/write

Gets or sets the brightness of the g:text element.

color

Read/write

Gets or sets the text color.

font

Read/write

Gets or sets the font name.

fontsize

Read/write

Gets or sets the font size.

height

Read/write

Gets or sets the height of the g:text element.

left

Read/write

Gets or sets the number of pixels from the left edge of the gadget to position the g:text element.

opacity

Read/write

Gets or sets the opacity of the g:text element.

rotation

Read/write

Gets or sets the degree of rotation applied to the g:text element.

top

Read/write

Gets or sets the number of pixels from the top edge of the gadget to position the g:text element.

value

Read/write

Gets or sets the value of the g:text element.

width

Read/write

Gets or sets the width of the g:text element.

 

Remarks

This element can be declared in the gadget HTML file or created with the addImageObject method from a script file. However, if the element is declared in the HTML file, it will not be accessible from script and will affect the gadget element layout rather than being part of the background.

Important  For Windows 7, when the new <autoscaleDPI> element of the gadget manifest is set to true (for high-DPI support) gadgets should explicitly specify a text size.

This element is not rendered.

This element requires a closing tag.

Examples

This example shows how to declare a g:text element in the gadget HTML file.

<g:text id="txtTest">test</g:text>

This example shows how to create a g:text element in a gadget script file.

\\ imgBackground is the value of the 'id' attribute for the g:background element.
var txtShadow = imgBackground.addTextObject("test", "Verdana", 25, "Red", 50, 50);

 

 

Send comments about this topic to Microsoft

Build date: 2/24/2010

Build type: SDK

Community Additions

Show:
© 2015 Microsoft