Text

From MegaZine3
Jump to: navigation, search
ASUL Component
Tag name text
Extends Box

This component represents a text box, either to be used for input or just as a label.

Contents

Attributes

align

Determines the text alignment.

autosize

Determines whether to automatically adjust the element's size based on its text contents.

bold

Determines whether to display text as bold.

color

The text color to use.

font

The font to use for the displayed text. Note that only common fonts and system fonts (e.g. _sans) should be used here, unless the font is somehow embedded in the Flash file. Otherwise the visible result may differ based on the fonts installed on the user's computer.

input

Determines whether this is an input field, i.e. if the user can write text into this field, or not, i.e. to behave like a label.

italic

Determines whether to display the text in italics.

maxchars

The maximum number of characters this text field may display. Primarily meant to be used for input text.

multiline

Determines whether to allow the text to flow over multiple lines, or ignore linebreaks and display all text in one single line.

password

Determines whether the text field is a password field, i.e. if plain text should be displayed (false) or *s for each character (true).

restrict

Restrict the allowed input characters to the characters in this list. Per default, all characters are allowed.

selectable

Determines whether to allow users to select text in this text field or not.

size

The font size to use.

underline

Determines whether to underline the displayed text.

value

The text to display if a string is given. If a definition is given, it is checked if it's a valid localization definition of the format: localize(LNG_ID, Default string)

If it is, and a localization is known, this will display the correct localization, and the default string per default. If the definition is somehow invalid, it is treated like a normal string.

wordwrap

Indicates whether the text field has word wrap, i.e. if a new line should start when the text cannot be fit in one single line.

Examples

<text
    restrict="0123456789"
    maxchars="10"
    selectable="true"
    input="true"
    font="_sans"
    size="20"
    value="123"
    anchors="0,0,pw,ph"
/>
Results in the following:
ASUL-related articles
Components Box · Button · ProgressBar · ScrollBar · ScrollPane · Text · ToggleButton · Window
Layouts Horizontal Flow Layout · Vertical Flow Layout
ASUL Articles ASUL Document · Editing the GUI · Layouting · ASUL scripting
Personal tools
Namespaces
Variants
Actions
Navigation
documentation
miscellaneous
Toolbox