Screen:set
method#Changes the props of one element on the screen, found by its id.
shop:set("gold", { text = "120 gold" })Use it forupdating a token counter, or changing the label on a shop button.
idThe id of the element to change.propsThe props to change; kind, id and children cannot change.Build a set callkind · id · children · anchor · x · y · 22 more
kindWhat kind of element it is, and hovering a choice tells you what it looks like.
idA name of up to 40 letters, digits and underscores, unique in the screen, which buttons and text boxes need so
clickedandsubmittedcan tell you which one was used.childrenThe elements placed inside a frame, panel or list.
anchorWhere the element sits in a free layout, where
fillcovers its parent and a root frame without an anchor fills the screen.xHow many pixels to the right of its anchor the element sits, from -4096 to 4096.
yHow many pixels below its anchor the element sits, from -4096 to 4096.
widthThe element's width in pixels from 0 to 4096, and leaving it out makes it fit the content.
heightThe element's height in pixels from 0 to 4096, and leaving it out makes it fit the content.
layoutHow a frame or panel arranges its children, where free places them by their anchors, and a list is always a column.
gapThe space in pixels between the children of a column, row, grid or list, from 0 to 256.
columnsHow many columns a grid has, from 1 to 32.
paddingThe space in pixels between the edge of a frame, panel or list and its children, from 0 to 256.
alignHow text lines up, or where a column or row places its children, which is start when you leave it out.
textWhat a text, button or text box shows, cut off after 1000 characters, and a text element keeps
[b],[i]and[color=#RRGGBB]tags.text_sizeThe font size in pixels, from 8 to 96.
colorThe color of text, the tint of an image or the fill of a progress bar, depending on the kind.
backgroundThe background color of a panel, button, text box or progress bar.
cornerHow rounded the background's corners are, as a radius from 0 to 64 pixels.
opacityHow visible the element and everything inside it are, from 0 for invisible to 1 for fully shown, which is the default.
visibleSet it to
falseto hide the element and everything inside it once its exit transition has played.enabledSet it to
falseto grey out a button or text box, which then sends nothing when players use it.imageThe PNG an image element shows, given by its route on the USBX asset CDN, where an empty string shows nothing.
valueHow full a progress bar is, from 0 up to its
max.maxdefault 100The value that fills a progress bar completely, which must be above 0.
placeholderThe hint an empty text box shows, which is cut off after 100 characters.
max_lengthdefault 100The most characters a player can type into a text box, from 1 to 1000.
enterThe animation used when the element appears, whether the screen mounts, it is added or it becomes visible.
Inside it:
effect,duration,delay,easingexitThe animation used when the element goes away, whether the screen unmounts, it is removed or it becomes hidden.
Inside it:
effect,duration,delay,easing