Phone API Reference - UI Classes (Widgets) - Text - align

align

Description

Controls the placement of the text display.

Basic Example: 

textObj.align(alignment_constant);

Parameters

Name

Required

Type

Default

Description

Name

Required

Type

Default

Description

alignment_constant

Yes

string

 

Alignment constant. Use one or more separated by the "|" character of the following:

  • Widget.BOTTOM

  • Widget.TOP

  • Widget.LEFT

  • Widget.RIGHT

  • Widget.WRAP

  • Widget.CLIP

  • Widget.CENTER (vertical and horizontal)

Examples

align a text widget at center top

var textObj = new Text(0, 0, 100, Text.LINE_HEIGHT, 'Test Text'); textObj.align(Widget.CENTER | Widget.TOP);

 

Return to Documentation Home I Return to Sangoma Support