Shows a Popup and yields until the player answers. Gives nil when the player leaves, it times out, ui.close_popup or a newer Popup closes it, the script stops, or the answer does not fit the input.
Shows a screen built from UI elements: panels, text, images, buttons, text boxes, lists and bars. With the name of a UI Screen designed in Studio, the screen is built from the design and the values.
local shop = ui.mount(player, { kind = "panel", anchor = "center", children = { { kind = "button", id = "buy", text = "Buy" } } })
Use it forshops, inventories, menus or your own HUD, built from panels, text and buttons.
targetoptionalOne player, a list of players, or nil for everyone.
rootThe element at the top of the screen, with its children; or the name of a UI Screen designed in Studio, such as "Shop".
valuesoptionalFor a UI Screen: the values of its Bindings by name, such as { coins = 120 }. A Binding left out shows empty, or the value of the State it follows. An unknown name is an error.
Build a mount callkind · id · children · anchor · x · y · 22 more
kind
What kind of element it is, and hovering a choice tells you what it looks like.
id
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
Where the element sits in a free layout, where fill covers its parent and a root frame without an anchor fills the screen.
x
How many pixels to the right of its anchor the element sits, from -4096 to 4096.
y
How many pixels below its anchor the element sits, from -4096 to 4096.
width
The element's width in pixels from 0 to 4096, and leaving it out makes it fit the content.
height
The element's height in pixels from 0 to 4096, and leaving it out makes it fit the content.
layout
How a frame or panel arranges its children, where free places them by their anchors, and a list is always a column.
gap
The space in pixels between the children of a column, row, grid or list, from 0 to 256.
columns
How many columns a grid has, from 1 to 32.
padding
The space in pixels between the edge of a frame, panel or list and its children, from 0 to 256.
align
How text lines up, or where a column or row places its children, which is start when you leave it out.
text
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
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
How rounded the background's corners are, as a radius from 0 to 64 pixels.
opacity
How visible the element and everything inside it are, from 0 for invisible to 1 for fully shown, which is the default.
visible
Set it to false to hide the element and everything inside it once its exit transition has played.
enabled
Set it to false to grey out a button or text box, which then sends nothing when players use it.
image
The PNG an image element shows, given by its route on the USBX asset CDN, where an empty string shows nothing.
value
How full a progress bar is, from 0 up to its max.
maxdefault 100
The value that fills a progress bar completely, which must be above 0.
placeholder
The hint an empty text box shows, which is cut off after 100 characters.
max_lengthdefault 100
The most characters a player can type into a text box, from 1 to 1000.
enter
The animation used when the element appears, whether the screen mounts, it is added or it becomes visible.
Inside it: effect, duration, delay, easing
exit
The animation used when the element goes away, whether the screen unmounts, it is removed or it becomes hidden.