Content:
- Methods

If you want to display text in your app you can use the Text object.

txt = app.CreateText( text, width, height, options ) → app object: Text

You can use the “Multiline” option to allow multi-line text and the “Left” or “Right” options to align the text. The default is single line centered text.
Other options you will see used in the samples include “AutoScale”, “Bold”, “Html” and “FontAwesome”.
Use the SetText and GetText functions of the Text object to set and get it's text.

Example - Single line click to expand contents 

You can change the look of a Text using the SetBackColor and SetTextColor functions on the Text object.

Example - Multi line click to expand contents 

Text can be shortened using ellipsis (...) when the size of the control is too small to show all the text. Use the SetEllipsize to control where the ellipsis is placed. Available modes are “start”, “middle”, “end” and “marq”.

Example - Ellipsize click to expand contents 

You can also set a background image/pattern or background gradient for the Text using the SetBackground and SetBackGradient functions. See Layouts for examples of how to use these functions.

Methods

The following methods are available on the Text object:

Focus()
GetAbsHeight() → Number: integer
GetAbsWidth() → Number: integer
GetHeight( options ) → Number
GetHtml() → String: html code
GetLeft( options ) → Number
GetLineCount() → Number: integer
GetLineStart( line ) → Number: integer
GetLineTop( line ) → Number: fraction (0..1)
GetMaxLines() → Number: integer
GetParent() → app object
GetPosition( options ) → Object: { left, top, width, height }
GetText() → String
GetTextSize( mode ) → Number
GetTop( options ) → Number
GetType() → String: “Text”
GetVisibility() → String: “Show” or “Hide” or “Gone”
GetWidth( options ) → Number
Gone()
Hide()
IsEnabled() → Boolean
IsOverlap( obj, depth ) → Boolean
IsVisible() → Boolean
Method( name, types, p1, p2, p3, p4 ) → all types
SetScale( x, y )
Show()