Description[edit | edit source]

UIText is an element of the NWN2's GUI which displays text. It can be used for display-only text or for text input fields.

Attributes[edit | edit source]

Attribute Type Default value Predefined constants Description
name string none none The name of the element, used to reference it in scripts.
x int 0 ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT Horizontal coordinates in the parent element.
y int 0 ALIGN_TOP, ALIGN_CENTER, ALIGN_BOTTOM Vertical coordinates in the parent element.
width int untested PARENT_WIDTH, SCREEN_WIDTH Width of the element.
height int untested PARENT_HEIGHT, SCREEN_HEIGHT, DYNAMIC Height of the element.
strref int none none Which string ref should show up in the text field. It is overridden by text.
text string none none A string which should show up in the text field.
fontfamily string "Default" See FontFamilies The font used by the text.
nextcontrol string none none Which control (a UIText field) should have focus if the user hits tab while editing this UIText field.
prevcontrol string none none Which control (a UIText field) should have focus if the user hits shift-tab while editing this UIText field.
filter string none

alpha - letters only

numberic - numbers only

alphanumberic - letters and numbers only

signed_numeric - numbers only, except the "-" character which may only be entered at the start of the string

This attribute can be used to limit what text the user can enter into this text field when editing it.

maxnumber int none none This number limits the max number that a user can enter when editing this text field. It only means anything if the text field's filter is set to numeric or signed_numeric.
allowspace boolean false true/false If this attribute is false, then any space characters will not be allowed in this field, including tabs or newlines.
allowpunc boolean false true/false Whether graphical punctuation characters can be entered in the text field. This attribute only means anything if the filter type is set to alpha or alphanumeric.
password boolean false true/false If set to true, then the characters in this string will be replaced with * marks when this text field gets rendered.
sanitized boolean false true/false If this attribute is set to true, then any string entered in this text field will be run through the built in swear-filter.
style string or int 1

"normal" or 1

"bold" or 2

"italic" or 3

"bolditalic" or 4

See FontFamilies

indent int 0 none This is the number of pixels to indent the first line of any text.
hangingindent int 0 none This is the number of pixels to indent all lines besides the first line in a multi-line text field.
Community content is available under CC-BY-SA unless otherwise noted.