Widget used for drawing text on the screen.
Class Constructor
new Text()
Creates a new Text Object.
Initialization Parameters
Name | Required | Type | Default | Description |
---|---|---|---|---|
x | Yes | integer | x coordinate value for top left corner. | |
y | Yes | integer | y coordinate value for top left corner. | |
width | Yes | integer | Width in pixels. | |
height | Yes | integer | Height in pixels. | |
label | No | string | Text to display |
Class Constants
Title | Description |
---|---|
Text.LINE_HEIGHT
D6X Only Text.LINE_HEIGHT_2 Text.ROW_HEIGHT Text.TITLE_HEIGHT | Recommended number of pixels to use for the height of a line of text. You can put another line at y+Text.LINE_HEIGHT, and it will render correctly. This property is dependent on the model of phone the app is running on. For the D6X models three more height definitions are specified. They are Text.LINE_HEIGHT_2, Text.ROW_HEIGHT, and Text.TITLE_HEIGHT.
Basic Example: |
Methods
Properties
Name | Description |
---|---|
label | The string to display. Change the string of a Text object without having to re instantiate one. Basic Example: |
labelColor | Color of the text. Can be white or black for D40, D50, and D70, or any of the colors specified in the Base Class color properties for the D6X models. Basic Example: |
labelSize | The font size of the label. The default value differs based on phone model, so it is best to make changes relative to the current size instead of specifying a specific size. For example, if you have some bit of text you want a bit larger in your app then create a Text object and multiple it's current label size by 1.2. Basic Example: |