Create a text field with a drop-down autocompletion list.
an array of items that the field will use to offer autocompletion choices
an optional flag indicating that the item list should be sorted, which allows faster autocompletion
an editable combo box with autocompletion support
Returns a new button.
an optional text label for the button
an optional icon for the button
an optional function that will be called when the button is pressed
the new button
Returns a new button group for a group of buttons. Button groups are used
to link together a set of related toggle buttons or radio buttons so that
only one button in the group can be selected at a time. The optional
settingValues
argument is a list of setting values to associate with
the buttons in the group. If it is supplied, then the returned button group
can be bound using a Bindings instance, and selecting a button
in the group will change the bound setting to the corresponding element
in settingValues
. If the settingValues
argument is not
supplied, then a plain button group that does not support binding is returned.
an array of buttons to be grouped together for mutually exclusive selection
an optional array of setting values (strings) to map the buttons to
the button group
Returns a new check box.
an optional text label for the button
if true, the box is initially checked
an optional function that will be called when the box is checked or unchecked
the new check box
Returns a new script editor control.
optional initial text for the code area
an optional preferred pixel width for the control (default is 400)
an optional preferred pixel height for the control (default is 300)
Returns a new combo box containing the given list of items.
an array of items for the user to choose from (default is an empty list)
an optional listener that is called when the selected item changes
the new combo box
Returns a new cycle button that will rotate through the specified labels when pressed. Cycle buttons are suitable for use with a very small number of options, preferably 2, when the user can easily guess what the other options in the set are. An example of this is a button to select a gender. If the optional setting values are provided, they will be used to map the selected label to and from a setting value when the control is bound using a Bindings instance.
an array of labels for the button to rotate through when pressed
an optional array of setting values (strings) to map the labels to
the cycle button
Returns a new help button. A help button displays as a small purple help icon. When clicked on, it opens a help page in the user's default browser. If the URL appears to be a Web page, that Web page is opened. Otherwise, it opens the documentation page with the same file name.
the URL or page file name to open when the button is clicked
the new help button
Returns a new hyperlink label, a label with underlined blue text that opens a URL in the user's default browser when clicked.
an optional text label (default is to use url
)
the URL to visit when the label is clicked
the new hyperlink label
Returns a new label.
initial label text (default is an empty string)
the control that this label is a label for; determines which control to activate if the label has a mnemonic key set
the new label
Returns a new list box containing the given list of items.
an array of items for the user to choose from (default is an empty list)
an optional listener that is called when the selected item changes
if true, a scroll pane will be wrapped around the list control and returned
the list, or the scroll pane that wraps it
Calling this function on a UI control will prevent that control from
becoming a target for the Markup menu or displaying a context bar.
The function returns the same control that is passed to it,
so it can be wrapped transparently around the function used to create
the control: let field = noMarkup(textField("42", 4));
.
control : the UI control to prevent from accepting markup
Returns a new note label, a label with a smaller than usual font size that can be used to add remarks, tips, or other secondary information.
initial label text (default is an empty string)
the new label
Creates a new portrait panel that allows the user to choose and adjust a portrait image. For DIY components, note that if you use the standard simple method of adding a portrait, the portrait panel will be created and linked up for you. If you use the custom portrait handling option, you'll need to create and add portrait panels yourself.
the PortraitProvider (usually a game component, such as a DIY) that provides the portrait model
the index of the portrait controlled by this panel (for components with multiple portraits; default is 0)
an optional title for the panel; if not specified, a localized default title will be provided
the portrait editing panel
Returns a new radio button. Radio buttons are use to represent
a group of options of which only one can be selected at a time.
To define the members of such a group, first create the buttons and then
call buttonGroup(arrayOfRadioButtonsToGroup)
to create the group.
an optional text label for the button
if true, the button will initially be selected (default is false)
an optional function that will be called when the button is pressed
the new button
Returns a new button that continues to notify listeners at intervals as long as it is pressed down. The rate of listener notifications increases the longer the button is held down.
an optional text label for the button
an optional icon for the button
an optional function that will be called when the button is pressed
the new button
Returns a new separator, a dividing line that can be used to visually separate groups of controls.
if true, the separator has a vertical orientation (the default is horizontal)
the new separator
Creates a new slider control that can be set to one of
a range of integer values between min
and max
, inclusive.
If valueLabelPairs
is supplied, it must be an array where the
even indices are slider positions and the odd indices are labels.
The control will display the requested labels at the indicated positions.
For example: [1, "Low", 6, "Medium", 10, "High"]
would display the
labels Low, Medium, and High at positions 1, 6, and 10 on the slider,
respectively.
the minimum value that the slider will allow (default is 1)
the maximum value that the slider will allow (default is 10)
the initial value of the slider (default is min
)
an array of alternating numbers and strings; each number is a value to be labelled, while the corresponding string is the label text to display
an optional change listener that will be called when the value changes
the new slider
Creates a new spinner control that can be set to one of
a range of integer values between min
and max
, inclusive.
Each click of a spinner arrow will add or subtract stepSize
from the current value.
the minimum value that the spinner will allow (default is 1)
the maximum value that the spinner will allow (default is 10)
the amount added to the current value by clicking an arrow button (default is 1)
the initial value stored in the spinner (default is min
)
an optional change listener that will be called when the value changes
the new spinner control
Returns a new multiline text area.
optional initial text for the text area (default is an empty string)
an optional number of rows for the width of the text area
an optional number of columns for the width of the field
if true, the text area will be wrapped in a scroll pane
if true the contents will be checked for spelling if supported (default is true)
Returns a new text field control.
optional initial text for the field (default is an empty string)
an optional number of columns for the width of the field
an optional function that will be called when enter is pressed in ... the field (default is no listener)
if true the contents will be checked for spelling if supported (default is true)
Creates a new control panel for adjusting tints.
the new tint adjustment panel
Returns a new tip button. A tip button displays as a small information icon. When the pointer is moved over the icon or the icon is clicked, a small pop-up window displays the tip text.
the text to display when the pointer is moved over the tip icon
the new tip control
Returns a new toggle button.
an optional text label for the button
an optional icon for the button
if true, the button will initially be selected (default is false)
an optional function that will be called when the button is pressed
the new button
uicontrols library
Functions that create user interface controls that can be organized into layouts with the uilayout library and bound to game components with uibindings.
Include this library by adding
useLibrary("uicontrols")
(or ui) to your script. See the plug-in authoring kit for examples that use this library.