Wax

Controls

Every control you can add to a window, a page, a section, a row or an overlay.

The Explorer searches everything on this page, and the classes of the game too.

WaxContainer

Something controls can be added to: a window, a page, a section, a row or an overlay.

You get one from game.Containers:Around. Below, container stands for one of these.

Open in the Explorer

container:Label(content, options?)

Adds text. It wraps to the container's width. In a row it does not wrap: each line of the text is one line in the label's share of the row, cut short with "..." when it is too long, and shown whole as a tip.

container:Label(content: any, options?: WaxLabelOptions): WaxLabel
ParameterType
contentany
options (optional)WaxLabelOptions

Returns WaxLabel

Open in the Explorer

container:Heading(content)

Adds a bold title line.

container:Heading(content: any): WaxHeading
ParameterType
contentany

Returns WaxHeading

Open in the Explorer

container:Separator()

Adds a thin dividing line.

container:Separator(): WaxControl

Returns WaxControl

Open in the Explorer

container:Spacer(height?)

Adds an empty gap, as tall as the theme's spacing when no height is given.

container:Spacer(height?: number): WaxControl
ParameterType
height (optional)number

Returns WaxControl

Open in the Explorer

container:Button(caption?, on_click?, options?)

Adds a button. on_click runs on each click. With an icon and no caption it is an icon button.

container:Button(caption?: string, on_click?: fun(), options?: WaxButtonOptions): WaxButton
ParameterType
caption (optional)string
on_click (optional)fun()
options (optional)WaxButtonOptions

Returns WaxButton

Open in the Explorer

container:Picture(file, options?)

Adds a picture from a .png or .jpg file, in the shape the picture has. With nil for the file it shows nothing until Set is called.

container:Picture(file: string?, options?: WaxPictureOptions): WaxPicture
ParameterTypeDescription
filestring?The whole path of the file, such as mod.dir .. "/logo.png".
options (optional)WaxPictureOptions

Returns WaxPicture

Open in the Explorer

container:Tile(options)

Adds a card to press: a title, a line of text, small counts and a badge, over a faded picture when it has one.

container:Tile(options: WaxTileOptions): WaxTile
ParameterType
optionsWaxTileOptions

Returns WaxTile

Open in the Explorer

container:Badge(text, options?)

Adds a word or two in a small pill, such as "New" or a tag.

container:Badge(text: string, options?: WaxBadgeOptions): WaxControl
ParameterType
textstring
options (optional)WaxBadgeOptions

Returns WaxControl

Open in the Explorer

container:Stat(caption, value)

Adds a caption with its value under it. Several in a Flow make a line of facts.

container:Stat(caption: string, value: any): WaxStat
ParameterType
captionstring
valueany

Returns WaxStat

Open in the Explorer

container:Count(icon, value, options?)

Adds an icon with a number or a word beside it, such as a count of downloads.

container:Count(icon: string, value: any, options?: WaxCountOptions): WaxCount
ParameterTypeDescription
iconstringThe icon's name. The menu's Icons page lists the names.
valueany
options (optional)WaxCountOptions

Returns WaxCount

Open in the Explorer

container:Icon(name, options?)

Adds an icon on its own, by name. The menu's Icons page lists the names.

container:Icon(name: string, options?: WaxIconOptions): WaxIcon
ParameterType
namestring
options (optional)WaxIconOptions

Returns WaxIcon

Open in the Explorer

container:Toggle(caption, initial?, on_change?)

Adds a switch. on_change(on) runs when the user flips it.

container:Toggle(caption: string, initial?: boolean, on_change?: fun(on: boolean)): WaxToggle
ParameterType
captionstring
initial (optional)boolean
on_change (optional)fun(on: boolean)

Returns WaxToggle

Open in the Explorer

container:Slider(caption, options?, on_change?)

Adds a slider with a read-out. on_change(value) runs while the user drags it.

container:Slider(caption: string, options?: WaxSliderOptions, on_change?: fun(value: number)): WaxSlider
ParameterType
captionstring
options (optional)WaxSliderOptions
on_change (optional)fun(value: number)

Returns WaxSlider

Open in the Explorer

container:Input(caption?, options?, on_commit?)

Adds a text box. on_commit(text) runs when Enter is pressed or the box loses focus.

container:Input(caption?: string, options?: WaxInputOptions, on_commit?: fun(text: string)): WaxInput
ParameterType
caption (optional)string
options (optional)WaxInputOptions
on_commit (optional)fun(text: string)

Returns WaxInput

Open in the Explorer

container:Dropdown(caption, choices, selected?, on_change?)

Adds a dropdown that opens in place. on_change(choice) runs when the user picks one. With nil for the caption the dropdown takes the whole width, or its whole share of a row.

container:Dropdown<T>(caption: string?, choices: T[], selected?: T, on_change?: fun(choice: T)): WaxDropdown
ParameterTypeDescription
captionstring?
choicesT[]
selected (optional)TThe first choice when omitted.
on_change (optional)fun(choice: T)

Returns WaxDropdown

Open in the Explorer

container:Section(title, options?)

Adds a collapsible card and returns it as a container: section:Button(...), section:Toggle(...) and so on.

container:Section(title: string, options?: WaxSectionOptions): WaxSection
ParameterType
titlestring
options (optional)WaxSectionOptions

Returns WaxSection

Open in the Explorer

container:Title(content, description?)

Adds a title for a page or a group of controls: large text, an optional explanation, and a rule under it.

container:Title(content: string, description?: string): WaxTitle
ParameterType
contentstring
description (optional)string

Returns WaxTitle

Open in the Explorer

container:Row(options?)

Adds a row. Controls added to the returned container sit side by side and share the width.

container:Row(options?: WaxRowOptions): WaxRow
ParameterType
options (optional)WaxRowOptions

Returns WaxRow

Open in the Explorer

container:Color(caption, color?, on_change?)

A colour the user can change.

container:Color(caption: string, color?: string, on_change?: fun(color: string)): WaxColorControl
ParameterTypeDescription
captionstring
color (optional)string"#rrggbb". White when omitted.
on_change (optional)fun(color: string)

Returns WaxColorControl

Open in the Explorer

container:Grid(options)

Adds a grid for any number of items. It builds only the cells in view, with the make and show functions in options.

container:Grid(options: WaxGridOptions): WaxGrid
ParameterType
optionsWaxGridOptions

Returns WaxGrid

Open in the Explorer

container:Flow(options?)

Adds an area where controls keep their own size and wrap onto new lines. Add them to the returned container.

container:Flow(options?: WaxFlowOptions): WaxRow
ParameterType
options (optional)WaxFlowOptions

Returns WaxRow

Open in the Explorer

container:Item(options?, on_click?, on_arrow?)

Adds one line of a list or a tree: an arrow, an icon, a name, a note and a value. In a grid it makes a list of any length.

container:Item(options?: WaxItemOptions, on_click?: fun(), on_arrow?: fun()): WaxItem
ParameterTypeDescription
options (optional)WaxItemOptions
on_click (optional)fun()Runs when the line is pressed.
on_arrow (optional)fun()Runs when its arrow is pressed.

Returns WaxItem

Open in the Explorer

container:Split(options?)

Adds two areas side by side. Add controls to its Left and Right.

container:Split(options?: WaxSplitOptions): WaxSplit
ParameterType
options (optional)WaxSplitOptions

Returns WaxSplit

Open in the Explorer

container:Slots(options?)

Adds a block of square cells for pictures, such as items. Give it looks with Set.

container:Slots(options?: WaxSlotsOptions): WaxSlots
ParameterType
options (optional)WaxSlotsOptions

Returns WaxSlots

Open in the Explorer

container:Model(options?)

Adds a box that shows a creature or any other skeletal mesh of the game in 3D. Give it what game.Creatures:GetModel gives, or a mesh by its path.

container:Model(options?: WaxModelOptions): WaxModel
ParameterType
options (optional)WaxModelOptions

Returns WaxModel

Open in the Explorer

container:Progress(caption, value?, options?)

Adds a progress bar. value is 0..1.

container:Progress(caption: string, value?: number, options?: WaxProgressOptions): WaxProgress
ParameterType
captionstring
value (optional)number
options (optional)WaxProgressOptions

Returns WaxProgress

Open in the Explorer

container:Field(name, value?, options?)

Adds a name with a value on the right, for read-outs.

container:Field(name: string, value?: any, options?: WaxFieldOptions): WaxField
ParameterType
namestring
value (optional)any
options (optional)WaxFieldOptions

Returns WaxField

Open in the Explorer

container:Keybind(caption, key?, on_change?)

Adds a key the user can rebind by clicking it and pressing a key. on_change(key) gets the engine's key name.

container:Keybind(caption: string, key?: string, on_change?: fun(key: string)): WaxKeybind
ParameterType
captionstring
key (optional)string
on_change (optional)fun(key: string)

Returns WaxKeybind

Open in the Explorer

container:Console(options?)

Adds a scrolling list of text lines, such as a log.

container:Console(options?: WaxConsoleOptions): WaxConsole
ParameterType
options (optional)WaxConsoleOptions

Returns WaxConsole

Open in the Explorer

WaxControl

What every control has.

You get one from ui.NeedsHost, container:Separator, container:Spacer, container:Badge. Below, control stands for one of these.

Open in the Explorer

SignalHandler receivesDescription
Changeddepends on the controlFires when the user changes the control's value.

control:Destroy()

Removes the control.

control:Destroy()

Returns nothing.

Open in the Explorer

control:SetVisible(shown)

Shows or hides the control. A hidden control takes no room.

control:SetVisible(shown: boolean)
ParameterType
shownboolean

Returns nothing.

Open in the Explorer

control:SetEnabled(enabled)

Greys the control out and stops it reacting, or makes it usable again.

control:SetEnabled(enabled: boolean)
ParameterType
enabledboolean

Returns nothing.

Open in the Explorer

control:SetTip(text)

Help shown while the mouse rests on the control. It needs a part that reports the mouse, which buttons, toggles, sections and key boxes have: for a control without one it answers false and shows nothing. nil or "" takes the tip away.

control:SetTip(text: string?): boolean
ParameterType
textstring?

Returns boolean (shown)

Open in the Explorer

WaxLabel

A piece of text. It wraps to the width of its container. In a row it is one line: text too long for its share is cut short with "..." and shown whole as a tip while the mouse rests on it.

It can also do everything WaxControl can. You get one from container:Label. Below, label stands for one of these.

Open in the Explorer

label:Set(value)

Replaces the text.

label:Set(value: any)
ParameterType
valueany

Returns nothing.

Open in the Explorer

label:SetColor(color)

Changes the text colour.

label:SetColor(color: WaxColor)
ParameterType
colorWaxColor

Returns nothing.

Open in the Explorer

WaxHeading

A bold line of text above a group of controls. It is smaller than a Title and has no rule under it.

It can also do everything WaxControl can. You get one from container:Heading. Below, heading stands for one of these.

Open in the Explorer

heading:Set(value)

Replaces the text.

heading:Set(value: any)
ParameterType
valueany

Returns nothing.

Open in the Explorer

WaxButton

A button with a caption, an icon, or both. Made with tab = true it is one of a row of tabs.

It can also do everything WaxControl can. You get one from container:Button. Below, button stands for one of these.

Open in the Explorer

SignalHandler receivesDescription
ActivatednothingFires on each click, after on_click.
ChangednothingThe same signal as Activated.

button:SetIcon(name)

Shows another icon on a button that was made with one.

button:SetIcon(name: string)
ParameterType
namestring

Returns nothing.

Open in the Explorer

button:Spin()

Turns the icon round once.

button:Spin()

Returns nothing.

Open in the Explorer

button:SetCaption(text)

Replaces the caption of a button that was made with one.

button:SetCaption(text: any)
ParameterType
textany

Returns nothing.

Open in the Explorer

button:SetActive(on)

Shows the button as the chosen one, or not. A tab shows its line. A button with an icon is drawn in its active_color, or in the accent colour when it has none. A button with neither raises an error.

button:SetActive(on: boolean)
ParameterType
onboolean

Returns nothing.

Open in the Explorer

button:SetTip(tip)

Changes the help shown while the mouse rests on the button, for a button whose meaning changes. nil takes it away.

button:SetTip(tip: string|table|nil)
ParameterType
tipstring | table | nil

Returns nothing.

Open in the Explorer

WaxIcon

One icon on its own, shown by its name.

It can also do everything WaxControl can. You get one from container:Icon. Below, icon stands for one of these.

Open in the Explorer

icon:Set(name)

Shows another icon.

icon:Set(name: string)
ParameterType
namestring

Returns nothing.

Open in the Explorer

WaxToggle

A switch that is on or off, with a caption beside it.

It can also do everything WaxControl can. You get one from container:Toggle. Below, toggle stands for one of these.

Open in the Explorer

SignalHandler receivesDescription
Changedon: booleanFires when the user flips the switch.

toggle:Get()

True while the switch is on.

toggle:Get(): boolean

Returns boolean

Open in the Explorer

toggle:Set(on, instant?)

Turns the switch on or off without firing Changed.

toggle:Set(on: boolean, instant?: boolean)
ParameterTypeDescription
onboolean
instant (optional) booleanTrue skips the sliding animation, for a switch that is being reused for another row.

Returns nothing.

Open in the Explorer

toggle:SetCaption(text)

Changes the text beside the switch.

toggle:SetCaption(text: string)
ParameterType
textstring

Returns nothing.

Open in the Explorer

toggle:Get()

Whether the switch is on.

toggle:Get(): boolean

Returns boolean

Open in the Explorer

toggle:Set(on)

Flips the switch from code. Changed does not fire.

toggle:Set(on: boolean)
ParameterType
onboolean

Returns nothing.

Open in the Explorer

toggle:SetCaption(text)

toggle:SetCaption(text: string)
ParameterType
textstring

Returns nothing.

Open in the Explorer

WaxColorControl

A colour selector. It opens a panel with a shade box, a hue bar and the colour as text that can be typed, pasted or copied.

It can also do everything WaxControl can. You get one from container:Color. Below, colorControl stands for one of these.

Open in the Explorer

SignalHandler receivesDescription
Changedcolor: stringFires with "#rrggbb" on every change, also while the mouse is held.
Releasedcolor: stringFires once when the user lets go, or commits a typed colour. Use it for saving.

colorControl:Get()

The colour as "#rrggbb".

colorControl:Get(): string

Returns string

Open in the Explorer

colorControl:Set(color)

Sets the colour without firing Changed.

colorControl:Set(color: string)
ParameterTypeDescription
colorstring"#rrggbb"

Returns nothing.

Open in the Explorer

WaxTitle

A page or group title: large text, an optional line under it, and a rule.

It can also do everything WaxControl can. You get one from container:Title. Below, title stands for one of these.

Open in the Explorer

title:Set(content)

Changes the title text.

title:Set(content: any)
ParameterType
contentany

Returns nothing.

Open in the Explorer

title:SetDescription(description)

Changes the line under the title (only if the title was made with one).

title:SetDescription(description: any)
ParameterType
descriptionany

Returns nothing.

Open in the Explorer

WaxSlider

A slider. The number beside it can be clicked and typed into.

It can also do everything WaxControl can. You get one from container:Slider. Below, slider stands for one of these.

Open in the Explorer

SignalHandler receivesDescription
Changedvalue: numberFires with each new value while the user drags (once, on letting go, with live = false), and when a number is typed.
Releasedvalue: numberFires once when the user lets go, for changes too heavy to apply during the drag.

slider:Get()

The current value.

slider:Get(): number

Returns number

Open in the Explorer

slider:Set(value)

Moves the slider (snapped and kept within its range) without firing Changed.

slider:Set(value: number)
ParameterType
valuenumber

Returns nothing.

Open in the Explorer

slider:Get()

The value shown.

slider:Get(): number

Returns number

Open in the Explorer

slider:Set(value)

Moves the slider from code, snapped to its step and kept inside its range. Changed does not fire.

slider:Set(value: number)
ParameterType
valuenumber

Returns nothing.

Open in the Explorer

WaxInput

A box the user types text into, with or without a caption.

It can also do everything WaxControl can. You get one from container:Input. Below, input stands for one of these.

Open in the Explorer

SignalHandler receivesDescription
Changedtext: stringFires when the text is committed (Enter, or the box losing focus).
Enteredtext: stringFires only when Enter is pressed, even when the text is the same as last time (for a command line).
Typedtext: stringFires on every change to the text while typing.

input:Get()

The text in the box.

input:Get(): string

Returns string

Open in the Explorer

input:Focus()

Gives the box the keyboard, so the user can type without clicking it.

input:Focus()

Returns nothing.

Open in the Explorer

input:HasFocus()

True while the box has the keyboard.

input:HasFocus(): boolean

Returns boolean

Open in the Explorer

input:SetGhost(text)

Shows greyed text after what is typed, such as the rest of a suggested word. Only a box made with mono = true shows it.

input:SetGhost(text: string)
ParameterTypeDescription
textstringEmpty to show nothing.

Returns nothing.

Open in the Explorer

input:Set(text)

Replaces the text without firing Changed.

input:Set(text: any)
ParameterType
textany

Returns nothing.

Open in the Explorer

input:SetHint(hint)

Changes the greyed text shown while the box is empty.

input:SetHint(hint: string)
ParameterType
hintstring

Returns nothing.

Open in the Explorer

input:Get()

The text in the box.

input:Get(): string

Returns string

Open in the Explorer

input:Set(text)

Puts text in the box from code. Changed does not fire.

input:Set(text: string)
ParameterType
textstring

Returns nothing.

Open in the Explorer

WaxDropdown

A dropdown opens in place under its header. The chosen row is highlighted, and only one list is open at a time. The header is always one line: a choice too long for it ends in "..." there and is whole in the list.

It can also do everything WaxControl can. You get one from container:Dropdown. Below, dropdown stands for one of these.

Open in the Explorer

SignalHandler receivesDescription
Changedchoice: anyFires when the user picks a choice.

The selected choice.

dropdown:Get(): any

Returns any

Open in the Explorer

Selects a choice without firing Changed.

dropdown:Set(choice: any)
ParameterType
choiceany

Returns nothing.

Open in the Explorer

The chosen entry.

dropdown:Get(): any

Returns any

Open in the Explorer

Chooses an entry from code. Changed does not fire.

dropdown:Set(choice: any)
ParameterType
choiceany

Returns nothing.

Open in the Explorer

WaxSection

A collapsible card. It is a container for controls.

It can also do everything WaxContainer can. You get one from container:Section. Below, section stands for one of these.

Open in the Explorer

PropertyTypeDescription
controlWaxControlThe card itself, for Destroy, SetVisible and SetEnabled.

section:SetOpen(open)

Expands or collapses the section.

section:SetOpen(open: boolean)
ParameterType
openboolean

Returns nothing.

Open in the Explorer

section:IsOpen()

True while the section is expanded.

section:IsOpen(): boolean

Returns boolean

Open in the Explorer

WaxRow

A container whose controls sit side by side.

It can also do everything WaxContainer can. You get one from container:Row, container:Flow.

Open in the Explorer

PropertyTypeDescription
controlWaxControlThe row itself, for Destroy, SetVisible and SetEnabled.

WaxProgress

A progress bar, with its caption and the value as a percentage on a line above it.

It can also do everything WaxControl can. You get one from container:Progress. Below, progress stands for one of these.

Open in the Explorer

progress:Get()

The current value, 0..1.

progress:Get(): number

Returns number

Open in the Explorer

progress:Set(value)

Moves the bar to a value of 0..1.

progress:Set(value: number)
ParameterType
valuenumber

Returns nothing.

Open in the Explorer

progress:SetColor(color)

Changes the colour of the filled part.

progress:SetColor(color: WaxColor)
ParameterType
colorWaxColor

Returns nothing.

Open in the Explorer

WaxField

A name with a value at the right, for read-outs. The user cannot change it.

It can also do everything WaxControl can. You get one from container:Field. Below, field stands for one of these.

Open in the Explorer

field:Set(value)

Replaces the value.

field:Set(value: any)
ParameterType
valueany

Returns nothing.

Open in the Explorer

field:SetColor(color)

Changes the colour of the value.

field:SetColor(color: WaxColor)
ParameterType
colorWaxColor

Returns nothing.

Open in the Explorer

WaxKeybind

A key the user can change: after a click on it, the next key pressed becomes the key. Escape leaves it as it was.

It can also do everything WaxControl can. You get one from container:Keybind. Below, keybind stands for one of these.

Open in the Explorer

SignalHandler receivesDescription
Changedkey: stringFires with the engine's name of the key the user pressed.

keybind:Get()

The key's engine name, or nil when none is set.

keybind:Get(): string?

Returns string?

Open in the Explorer

keybind:Set(key)

Sets the key without firing Changed.

keybind:Set(key: string?)
ParameterType
keystring?

Returns nothing.

Open in the Explorer

keybind:Get()

The key shown, or nil for none.

keybind:Get(): string?

Returns string?

Open in the Explorer

keybind:Set(key)

Shows another key from code. Changed does not fire.

keybind:Set(key: string?)
ParameterType
keystring?

Returns nothing.

Open in the Explorer

WaxConsole

A log: coloured lines the user can select across (drag, Ctrl+A) and copy (Ctrl+C).

It can also do everything WaxControl can. You get one from container:Console. Below, console stands for one of these.

Open in the Explorer

console:GetText()

Everything being shown, as one text (for ui.Copy).

console:GetText(): string

Returns string

Open in the Explorer

console:SetLines(lines)

Shows these lines, or the last max of them.

console:SetLines(lines: WaxConsoleLine[])
ParameterType
linesWaxConsoleLine[]

Returns nothing.

Open in the Explorer

console:SetFollow(on)

Turns scrolling to the newest line on every SetLines on or off. It starts on.

console:SetFollow(on: boolean)
ParameterType
onboolean

Returns nothing.

Open in the Explorer

WaxPicture

A picture from a file.

It can also do everything WaxControl can. You get one from container:Picture. Below, picture stands for one of these.

Open in the Explorer

picture:Set(file)

Shows another picture file. Returns false and the reason when the file is not a PNG or JPG picture the game can read.

picture:Set(file: string): boolean, string?
ParameterTypeDescription
filestringThe whole path of a .png or .jpg file.

Returns

  • boolean (shown)
  • string? (why)

Open in the Explorer

picture:SetSelected(on)

Draws or removes the line around a picture that was made with on_click.

picture:SetSelected(on: boolean)
ParameterType
onboolean

Returns nothing.

Open in the Explorer

WaxTile

A card to press.

It can also do everything WaxControl can. You get one from container:Tile. Below, tile stands for one of these.

Open in the Explorer

tile:SetPicture(file)

Puts a picture behind the card, faded and cut to the card's shape. Returns false and the reason when the file cannot be read.

tile:SetPicture(file: string): boolean, string?
ParameterTypeDescription
filestringThe whole path of a .png or .jpg file.

Returns

  • boolean (shown)
  • string? (why)

Open in the Explorer

WaxStat

A caption with its value under it.

It can also do everything WaxControl can. You get one from container:Stat. Below, stat stands for one of these.

Open in the Explorer

stat:Set(value)

Changes the value.

stat:Set(value: any)
ParameterType
valueany

Returns nothing.

Open in the Explorer

WaxCount

An icon with a number or a word beside it.

It can also do everything WaxControl can. You get one from container:Count. Below, count stands for one of these.

Open in the Explorer

count:Set(value)

Changes the value.

count:Set(value: any)
ParameterType
valueany

Returns nothing.

Open in the Explorer

WaxGrid

A grid for any number of items: only the cells in view exist, and they are reused as it scrolls. It follows its scrolling while the menu is open, so it belongs in a window, not in an overlay.

It can also do everything WaxControl can. You get one from container:Grid. Below, grid stands for one of these.

Open in the Explorer

grid:SetItems(items, keep?)

Shows another list, from the top. With keep it stays where it is scrolled to.

grid:SetItems(items: any[], keep?: boolean)
ParameterType
itemsany[]
keep (optional)boolean

Returns nothing.

Open in the Explorer

grid:Refresh()

Shows every cell again, after the items themselves changed.

grid:Refresh()

Returns nothing.

Open in the Explorer

grid:Count()

How many items the grid has.

grid:Count(): integer

Returns integer

Open in the Explorer

WaxItem

One line of a list or a tree.

It can also do everything WaxControl can. You get one from container:Item. Below, item stands for one of these.

Open in the Explorer

SignalHandler receivesDescription
ActivatednothingFires when the line is pressed.
TogglednothingFires when its arrow is pressed.

item:Set(look)

Describes the whole line again. Only what changed is redrawn, so it is cheap to call for a line that is reused.

item:Set(look: WaxItemLook)
ParameterType
lookWaxItemLook

Returns nothing.

Open in the Explorer

item:SetSelected(selected)

Marks the line as the picked one, or takes the mark off. Nothing else of the line changes.

item:SetSelected(selected: boolean)
ParameterType
selectedboolean

Returns nothing.

Open in the Explorer

item:Get()

What the line is showing.

item:Get(): WaxItemLook

Returns WaxItemLook

Open in the Explorer

WaxSplit

Two areas side by side with a divider the user can drag. With too little room for both, one shows at a time.

It can also do everything WaxControl can. You get one from container:Split. Below, split stands for one of these.

Open in the Explorer

PropertyTypeDescription
LeftWaxContainerSomething controls can be added to: a window, a page, a section, a row or an overlay.
RightWaxContainerSomething controls can be added to: a window, a page, a section, a row or an overlay.
SignalHandler receivesDescription
Changedsingle: booleanFires when it goes from two areas to one, or back.

split:IsSingle()

True while there is only room for one area.

split:IsSingle(): boolean

Returns boolean

Open in the Explorer

split:Show(which)

Which area shows while there is only room for one.

split:Show(which: "left"|"right")
ParameterType
which"left" | "right"

Returns nothing.

Open in the Explorer

split:Shown()

The area that shows while there is only room for one. It is "left" until Show picks the other.

split:Shown(): "left"|"right"

Returns "left" | "right"

Open in the Explorer

split:SetShare(share)

Sets the left area's part of the width, from 0.05 to 0.95. Neither area is drawn narrower than least.

split:SetShare(share: number)
ParameterType
sharenumber

Returns nothing.

Open in the Explorer

split:GetShare()

The left area's part of the width, as SetShare or the user's drag of the divider last left it.

split:GetShare(): number

Returns number

Open in the Explorer

WaxSlots

A block of square cells that each show a picture, a count and a mark. Switched off with SetEnabled(false), its cells take no click, are not under the mouse for ui.Hovered, and show the arrow in place of the hand.

It can also do everything WaxControl can. You get one from ui.Hovered, container:Slots. Below, slots stands for one of these.

Open in the Explorer

SignalHandler receivesDescription
Activatedvalue: any, index: integer, look: WaxSlotLookA cell was clicked.
RightClickedvalue: any, index: integer, look: WaxSlotLook
MiddleClickedvalue: any, index: integer, look: WaxSlotLook
Hoveredvalue: any, index: integer, look: WaxSlotLook?The mouse came over a cell.

slots:Set(looks)

Shows these looks, the first in the first cell. Cells past the end of the list are empty.

slots:Set(looks: WaxSlotLook[])
ParameterType
looksWaxSlotLook[]

Returns nothing.

Open in the Explorer

slots:SetLook(index, look)

Changes one cell.

slots:SetLook(index: integer, look: WaxSlotLook?)
ParameterType
indexinteger
lookWaxSlotLook?

Returns nothing.

Open in the Explorer

slots:GetLook(index)

The look a cell was last given, or nil for an empty cell.

slots:GetLook(index: integer): WaxSlotLook?
ParameterType
indexinteger

Returns WaxSlotLook?

Open in the Explorer

slots:Capacity()

How many cells it has.

slots:Capacity(): integer

Returns integer

Open in the Explorer

slots:SetLayout(columns, size?)

Changes how many cells stand in a row and how large a cell is. The cells that exist are kept and put in their new rows, and missing ones are made over the next frames. What a cell shows stays; set the looks again if fewer fit.

slots:SetLayout(columns: integer, size?: number)
ParameterTypeDescription
columnsinteger
size (optional)numberThe side of one cell. As it was when left out.

Returns nothing.

Open in the Explorer

slots:Ready()

True once every cell exists. Cells are made a few a frame.

slots:Ready(): boolean

Returns boolean

Open in the Explorer

WaxLabelOptions

Used by container:Label.

Open in the Explorer

OptionTypeDescription
dimbooleanUses the theme's secondary text colour.
colorWaxColorA colour in the linear form the engine uses. Make one with ui.Color.
sizenumber
facestringTypeface of the "ui" family: "Book", "Medium", "Bold" ...
familyWaxFontFamily"ui" (the game's own interface font) when omitted.
align"center" | "right"Where the text sits in its line. Left when omitted.
weightnumberIn a row: its share of the width beside the other controls. 1 when omitted.

WaxButtonOptions

Used by container:Button.

Open in the Explorer

OptionTypeDescription
active_colortableA theme colour the icon and the caption are drawn in while SetActive(true) holds.
barebooleanDraws no box behind the button, only its icon and caption, with a faint box while the mouse is on it.
primarybooleanDraws the button in the accent colour.
stretchbooleanA button with a caption is as wide as its container. False keeps it as wide as its caption. An icon-only button is small unless this is true.
iconstringIcon name shown before the caption. The menu's Icons page lists the names.
spinbooleanThe icon turns round once on every click, to show that something has started.
tabbooleanMakes it one of a row of tabs: SetActive marks the chosen one.
tipstring | tableA line of help shown beside the mouse once it has rested on the button. Give one to every button that is only an icon. A table is { title = "...", lines = { "more" } }.
sizenumberFor a button that is an icon only: the side of the square it is drawn as. Left out, it is as tall as the other buttons.

WaxIconOptions

Used by container:Icon.

Open in the Explorer

OptionTypeDescription
sizenumberDefault 20.
colorWaxColorThe theme's text colour when omitted.

WaxSliderOptions

Used by container:Slider.

Open in the Explorer

OptionTypeDescription
minnumberDefault 0.
maxnumberDefault 1.
valuenumberThe starting value. min when omitted.
stepnumberValues snap to this step, counted from min.
formatstringstring.format pattern for the read-out. "%.2f" when omitted, or "%d" with a step of 1 or more.
stackedbooleanTrue puts the caption above the track, false beside it. When omitted, the room available decides.
livebooleanFalse reports the value once, when the mouse lets go, for changes too heavy to make while dragging. True when omitted.

WaxInputOptions

Used by container:Input.

Open in the Explorer

OptionTypeDescription
textstringThe starting text.
hintstringGreyed text shown while the box is empty.
stackedbooleanTrue puts the caption above the box, false beside it. When omitted, the room available decides.
monobooleanA fixed-width font, for code.
clearbooleanPuts a small cross at the right end of the box while it holds text. One press empties the box, fires Typed with "" and leaves the keyboard in the box. For a search box.

WaxSectionOptions

Used by container:Section.

Open in the Explorer

OptionTypeDescription
openbooleanFalse starts the section collapsed.
collapsiblebooleanFalse makes a plain titled group that is always open.
badgestringA word or two shown in a small pill at the right end of the title, such as "New" or "Off".
badge_colortableThe colour of the badge: a theme colour. The muted text colour when omitted.
marks{ icon: string, text: any }[]Small counts at the right end of the title, each an icon with a number or a word.
fitbooleanKeeps the title on one line. A title too long for the card is cut short with "..." and shown whole as a tip while the mouse rests on it, and it is cut again when the card gets another width. Without it a long title wraps.

WaxRowOptions

Used by container:Row.

Open in the Explorer

OptionTypeDescription
heightnumberThe least height of the row. Give two rows the same one and they are equally tall whatever is in them.

WaxProgressOptions

Used by container:Progress.

Open in the Explorer

OptionTypeDescription
colorWaxColor | string | integerThe accent colour when omitted. "#RRGGBB" works too.

WaxFieldOptions

Used by container:Field.

Open in the Explorer

OptionTypeDescription
monobooleanShows the value in the small fixed-width font, for numbers that keep changing.

WaxConsoleOptions

Used by container:Console.

Open in the Explorer

OptionTypeDescription
heightnumberDefault 220. On a page made with scroll = false it takes the space left when omitted.
maxintegerThe most lines shown. Default 150.

WaxPictureOptions

What Container:Picture takes besides the file.

Used by container:Picture.

Open in the Explorer

OptionTypeDescription
heightnumberHow tall the picture is drawn. 160 when omitted. It is drawn less tall when that would make it wider than the room it has.
on_clickfun()Makes the picture something to press, and runs this when it is pressed.
selectedbooleanDraws a line around the picture, for the chosen one of several. Only with on_click.

WaxTileOptions

What a Tile shows.

Used by container:Tile.

Open in the Explorer

OptionTypeDescription
title (required)stringThe name, in bold, kept to one line.
notestringA few muted words after the title, such as a version.
textstringA line or two under the title. Longer text is cut short.
badgestringA word or two in a small pill at the right end.
badge_colortableThe colour of the badge: a theme colour.
marks{ icon: string, text: any, on_click?: fun(), active?: boolean, color?: table }[]Small counts before the badge, each an icon with a number or a word. One with on_click is a small button of its own, pressed without pressing the card, and is drawn in its color while active is true.
picturestringThe whole path of a .png or .jpg file, drawn faded behind the card.
on_clickfun()Runs when the card is pressed.

WaxBadgeOptions

What Container:Badge takes besides the text.

Used by container:Badge.

Open in the Explorer

OptionTypeDescription
colortableA theme colour. The muted text colour when omitted.

WaxCountOptions

What Container:Count takes besides the icon and the value.

Used by container:Count.

Open in the Explorer

OptionTypeDescription
colortableA theme colour for the icon and the value. The usual colours when omitted.

WaxGridOptions

Used by container:Grid.

Open in the Explorer

OptionTypeDescription
make (required)fun(cell: WaxContainer): anyCalled once for each cell that is needed: add one control to cell and return whatever show needs.
show (required)fun(made: any, item: any, index: integer)Called whenever a cell is to show another item.
itemsany[]The list to show, of any length.
cellnumberLeast width of a cell. Default 38. As many columns as fit share the width.
cell_heightnumberDefault: the same as cell.
gapnumberThe space between cells. Default: the theme's spacing.
batchintegerHow many cells are made in one frame. Default 24. Use fewer for cells with a lot in them.
heightnumberDefault 300. On a page made with scroll = false the grid takes the space left when omitted.
spareintegerRows kept ready above and below the ones that show, so a fast scroll does not show empty space. Default: half of what shows, between 2 and 6.
warmbooleanMakes the cells one a frame from the moment the grid exists, also while the menu is closed, so the list is there the first time it is shown.
viewnumberWith warm: the height in pixels the list is expected to show. Default: the window's height.

WaxFlowOptions

Used by container:Flow.

Open in the Explorer

OptionTypeDescription
cellnumberMakes it a grid: every control gets the same width, at least this, and each line is full.

WaxItemLook

What one line of a list or a tree shows. What is left out is not shown.

Returned by item:Get. Used by item:Set.

Open in the Explorer

FieldTypeDescription
text (optional)stringThe name.
note (optional)stringDimmer text after the name.
value (optional)stringText at the right, in a fixed-width font.
icon (optional)stringAn icon name.
indent (optional)integerHow many steps the line is moved in, for a tree.
arrow (optional)booleantrue shows an arrow that is open, false one that is closed. Leave it out for no arrow.
selected (optional)booleanMarks the line as the picked one.
tone (optional)"text" | "dim" | "accent" | "accent_hover" | "good" | "warn" | "bad"The colour of the value.
faint (optional)booleanDraws the name dimmer.
name_width (optional)numberFor a line made with columns: how wide the name is, so values line up from line to line.
width (optional)numberFor a line made with fit that is narrower than its container: how wide it is.

WaxItemOptions

Extends WaxItemLook. Used by container:Item.

Open in the Explorer

OptionTypeDescription
weightnumberIn a row, its share of the width.
columnsbooleanMakes it a line of a table: the name, then the value where the name ends, then the note at the right edge.
dividerbooleanDraws a thin line under it.
fitbooleanCuts a name, note or value that is too long for the line short with "..." and shows the whole of it as a tip while the mouse rests on the line.

WaxSplitOptions

Used by container:Split.

Open in the Explorer

OptionTypeDescription
sharenumberThe left area's part of the width, 0 to 1. Default 0.42.
leastnumberThe narrowest an area may be. Default 240. With less room than two of these, one area shows at a time.
heightnumberDefault 300. On a page made with scroll = false the split takes the space left when omitted.

WaxSlotLook

What one cell of a Slots control shows. A cell with no look is empty and takes no clicks.

Returned by ui.Hovered, slots:GetLook. Used by slots:Set, slots:SetLook.

Open in the Explorer

FieldTypeDescription
image (optional)stringA picture of the game by its path, such as an item's icon.
icon (optional)stringAn icon by name, for a cell with no picture.
count (optional)string | numberSmall text in the lower right corner.
mark (optional)stringA small icon in the upper left corner.
value (optional)anyWhat the signals and ui.Hovered give for this cell.
tip (optional)string | table | fun(): anyThe tooltip: a text, { title = "...", lines = { "text" or { "text", "warn" } } }, or a function that returns one.
dim (optional)booleanDraws the picture faint, or the icon of a cell that has no picture.
selected (optional)booleanMarks the cell as the chosen one.
tone (optional)"good" | "warn" | "bad" | "accent"A short line of that colour under the picture.
plain (optional)booleanA picture only: no box, and the mouse passes over it.

WaxSlotsOptions

Used by container:Slots.

Open in the Explorer

OptionTypeDescription
columnsintegerDefault 9.
rowsintegerDefault 1.
sizenumberThe side of a cell. Default 36.
gapnumberSpace between cells. Default 2.
backingbooleanFalse leaves out the box behind each cell.
align"left" | "center" | "right"Where the block sits in its line.
belownumberSpace under the block. The theme's spacing when omitted.
looksWaxSlotLook[]What to show at the start.

Named values

Short names for a fixed set of values. Where a function asks for one of these, pass one of the values listed.

WaxConsoleLine

One console line: the text, then an optional colour.

The same as { [1]: any, [2]: WaxColor? }.

Open in the Explorer

On this page

WaxContainercontainer:Label(content, options?)container:Heading(content)container:Separator()container:Spacer(height?)container:Button(caption?, on_click?, options?)container:Picture(file, options?)container:Tile(options)container:Badge(text, options?)container:Stat(caption, value)container:Count(icon, value, options?)container:Icon(name, options?)container:Toggle(caption, initial?, on_change?)container:Slider(caption, options?, on_change?)container:Input(caption?, options?, on_commit?)container:Dropdown(caption, choices, selected?, on_change?)container:Section(title, options?)container:Title(content, description?)container:Row(options?)container:Color(caption, color?, on_change?)container:Grid(options)container:Flow(options?)container:Item(options?, on_click?, on_arrow?)container:Split(options?)container:Slots(options?)container:Model(options?)container:Progress(caption, value?, options?)container:Field(name, value?, options?)container:Keybind(caption, key?, on_change?)container:Console(options?)WaxControlcontrol:Destroy()control:SetVisible(shown)control:SetEnabled(enabled)control:SetTip(text)WaxLabellabel:Set(value)label:SetColor(color)WaxHeadingheading:Set(value)WaxButtonbutton:SetIcon(name)button:Spin()button:SetCaption(text)button:SetActive(on)button:SetTip(tip)WaxIconicon:Set(name)WaxToggletoggle:Get()toggle:Set(on, instant?)toggle:SetCaption(text)toggle:Get()toggle:Set(on)toggle:SetCaption(text)WaxColorControlcolorControl:Get()colorControl:Set(color)WaxTitletitle:Set(content)title:SetDescription(description)WaxSliderslider:Get()slider:Set(value)slider:Get()slider:Set(value)WaxInputinput:Get()input:Focus()input:HasFocus()input:SetGhost(text)input:Set(text)input:SetHint(hint)input:Get()input:Set(text)WaxDropdowndropdown:Get()dropdown:Set(choice)dropdown:Get()dropdown:Set(choice)WaxSectionsection:SetOpen(open)section:IsOpen()WaxRowWaxProgressprogress:Get()progress:Set(value)progress:SetColor(color)WaxFieldfield:Set(value)field:SetColor(color)WaxKeybindkeybind:Get()keybind:Set(key)keybind:Get()keybind:Set(key)WaxConsoleconsole:GetText()console:SetLines(lines)console:SetFollow(on)WaxPicturepicture:Set(file)picture:SetSelected(on)WaxTiletile:SetPicture(file)WaxStatstat:Set(value)WaxCountcount:Set(value)WaxGridgrid:SetItems(items, keep?)grid:Refresh()grid:Count()WaxItemitem:Set(look)item:SetSelected(selected)item:Get()WaxSplitsplit:IsSingle()split:Show(which)split:Shown()split:SetShare(share)split:GetShare()WaxSlotsslots:Set(looks)slots:SetLook(index, look)slots:GetLook(index)slots:Capacity()slots:SetLayout(columns, size?)slots:Ready()WaxLabelOptionsWaxButtonOptionsWaxIconOptionsWaxSliderOptionsWaxInputOptionsWaxSectionOptionsWaxRowOptionsWaxProgressOptionsWaxFieldOptionsWaxConsoleOptionsWaxPictureOptionsWaxTileOptionsWaxBadgeOptionsWaxCountOptionsWaxGridOptionsWaxFlowOptionsWaxItemLookWaxItemOptionsWaxSplitOptionsWaxSlotLookWaxSlotsOptionsNamed valuesWaxConsoleLine