Skip to content
Untitled Sandbox - Developer Documentation
docs/types/UiElement

UiElement

One piece of a user interface screen, such as a panel, text, button or list, written as a table that you pass to ui.mount.

Fields

kind
string?
What kind of element it is, and hovering a choice tells you what it looks like.
framedefaultpaneltextimagebuttontext_boxlistprogress
id
string?
A name of up to 40 letters, digits and underscores, unique in the screen, which buttons and text boxes need so clicked and submitted can tell you which one was used.
children
The elements placed inside a frame, panel or list.
anchor
string?
Where the element sits in a free layout, where fill covers its parent and a root frame without an anchor fills the screen.
top_leftdefaulttoptop_rightleftcenterrightbottom_leftbottombottom_rightfill
x
number?
How many pixels to the right of its anchor the element sits, from -4096 to 4096.
y
number?
How many pixels below its anchor the element sits, from -4096 to 4096.
width
number?
The element's width in pixels from 0 to 4096, and leaving it out makes it fit the content.
height
number?
The element's height in pixels from 0 to 4096, and leaving it out makes it fit the content.
layout
string?
How a frame or panel arranges its children, where free places them by their anchors, and a list is always a column.
freedefaultcolumnrowgrid
gap
number?
The space in pixels between the children of a column, row, grid or list, from 0 to 256.
columns
number?
How many columns a grid has, from 1 to 32.
padding
number?
The space in pixels between the edge of a frame, panel or list and its children, from 0 to 256.
align
string?
How text lines up, or where a column or row places its children, which is start when you leave it out.
startdefaultcenterend
text
string?
What a text, button or text box shows, cut off after 1000 characters, and a text element keeps [b], [i] and [color=#RRGGBB] tags.
text_size
number?
The font size in pixels, from 8 to 96.
color
The color of text, the tint of an image or the fill of a progress bar, depending on the kind.
background
The background color of a panel, button, text box or progress bar.
corner
number?
How rounded the background's corners are, as a radius from 0 to 64 pixels.
opacity
number?
How visible the element and everything inside it are, from 0 for invisible to 1 for fully shown, which is the default.
visible
boolean?
Set it to false to hide the element and everything inside it once its exit transition has played.
enabled
boolean?
Set it to false to grey out a button or text box, which then sends nothing when players use it.
image
string?
The PNG an image element shows, given by its route on the USBX asset CDN, where an empty string shows nothing.
value
number?
How full a progress bar is, from 0 up to its max.
max
number?
The value that fills a progress bar completely, which must be above 0.
default 100
placeholder
string?
The hint an empty text box shows, which is cut off after 100 characters.
max_length
number?
The most characters a player can type into a text box, from 1 to 1000.
default 100
The animation used when the element appears, whether the screen mounts, it is added or it becomes visible.
The animation used when the element goes away, whether the screen unmounts, it is removed or it becomes hidden.
↑ ↓ moveEnter openEsc close