ui
Windows, overlays, notifications, hotkeys, themes and icons: everything under ui.
The Explorer searches everything on this page, and the classes of the game too.
ui
The GUI library: the menu (windows you click), overlays (panels you only read) and notifications.
Type name: WaxUI.
| Member | Type | Description |
|---|---|---|
Icons | WaxIcons | Icon names: the bundled Lucide set ("shield", "wrench", "map-pin" ...) plus images that mods register. |
Notifications | WaxNotifications | What all notifications share: the corner they show in and how many show at once. It also counts them and closes them all. |
Debug | WaxDebugPanel | The in-game debug panel. |
Pictures | WaxPictures | The game's own pictures, such as item icons, which a cell of a Slots control shows by their path. Loading them is given a few milliseconds a frame, so a picture can show a moment after it was asked for. |
Keys | WaxKeys | The keys that show and hide windows. Wax's own panel has one, and so has every mod that made a window: a key shows and hides its owner's windows and nobody else's. A mod's key is the one the player chose on the mod's card of the Mods page, else the one the mod asked for with ui.Window({ key = "F6" }), else a key Wax gives it once and remembers: one that no window and no hotkey of any mod uses. A press that your mod's own ui.Hotkey takes is not also taken as the key of its windows. |
| Signal | Handler receives | Description |
|---|---|---|
Opened | nothing | Fires when the menu opens: somebody's windows come up and the mouse is freed. |
Closed | nothing | Fires when the menu closes: nobody's windows are up any more and the game has the mouse back. A mod that opened the menu with windows = false also hears it when its own ui.Close() leaves the menu open for others. |
KeyChanged | key: string? | Fires with the new key of Wax's own panel. For any owner's key, use ui.Keys.Changed. |
ThemeChanged | name: string | Fires with the theme's name after SetTheme or ResetTheme. |
ScreenChanged | width: number, height: number | Fires once with the new size when ScreenSize gives another answer: after the game's window or the interface size has stopped changing for a moment, never while it is still being resized. |
GameScreenChanged | name: string?, tab: integer? | Fires with what GameScreen answers, in the frame the game shows another of its menu screens, another tab of its main menu, or none any more (nil). Connect to it in place of asking GameScreen every frame: the game is only looked at while somebody listens. |
ui.Open(options?)
Shows your mod's windows and frees the mouse to use them. Other mods' windows and the Wax panel stay as they are. In the command bar it is the Wax panel that comes up.
ui.Open(options?: { windows: boolean? })| Parameter | Type | Description |
|---|---|---|
options (optional) | { windows: boolean? } | windows = false frees the mouse for panels only and brings no window up. |
Returns nothing.
ui.Close()
Hides your mod's windows again. The menu closes, and the game has the mouse back, once nobody's windows are up.
ui.Close()Returns nothing.
ui.Toggle()
Shows your mod's windows when they are away, and hides them when they are up.
ui.Toggle()Returns nothing.
ui.Copy(text)
Puts text on the clipboard, for pasting anywhere.
ui.Copy(text: any)| Parameter | Type |
|---|---|
text | any |
Returns nothing.
ui.TextWidth(text, options?)
How wide a line of text is drawn, in the units controls and panels are sized in. It is worked out from the letters, to within a few percent.
ui.TextWidth(text: any, options?: WaxTextOptions): number| Parameter | Type |
|---|---|
text | any |
options (optional) | WaxTextOptions |
Returns number (width)
ui.Shorten(text, width, options?)
The text if it fits in a width, else its start with "..." after it. A little room is kept spare, as the library does for its own text.
ui.Shorten(text: any, width: number, options?: WaxTextOptions): string, boolean| Parameter | Type |
|---|---|
text | any |
width | number |
options (optional) | WaxTextOptions |
Returns
string(shown)boolean(cut) True when the text did not fit.
ui.IsOpen()
True while the menu is open: the mouse is free, because somebody's windows are up.
ui.IsOpen(): booleanReturns boolean
ui.SetPreview(on)
Shows every window without taking the mouse (for screenshots and for looking while you play).
ui.SetPreview(on: boolean)| Parameter | Type |
|---|---|
on | boolean |
Returns nothing.
ui.IsPreview()
True while the windows are shown in preview.
ui.IsPreview(): booleanReturns boolean
ui.SetToggleKey(key)
Sets the key that shows and hides Wax's own panel, by the engine's key name ("F8"). nil leaves the panel without a key. A key that somebody has is given all the same, with a notice, as with ui.Keys.Set. Every mod has a key of its own: see ui.Keys.
ui.SetToggleKey(key: string?): boolean, string?| Parameter | Type |
|---|---|
key | string? |
Returns
boolean(changed)string?(taken_by)
ui.GetToggleKey()
The key that shows and hides Wax's own panel.
ui.GetToggleKey(): string?Returns string?
ui.Window(options?)
Creates a window in the menu. It is removed again when the mod reloads.
ui.Window(options?: WaxWindowOptions): WaxWindow| Parameter | Type |
|---|---|
options (optional) | WaxWindowOptions |
Returns WaxWindow
ui.Overlay(options?)
Creates a panel pinned to the screen that stays up during play and lets clicks through.
ui.Overlay(options?: WaxOverlayOptions): WaxOverlay| Parameter | Type |
|---|---|
options (optional) | WaxOverlayOptions |
Returns WaxOverlay
ui.Panel(options?)
Creates a panel whose controls take the mouse. It has no title bar and shows beside the game's own screens.
ui.Panel(options?: WaxPanelOptions): WaxOverlay| Parameter | Type |
|---|---|
options (optional) | WaxPanelOptions |
Returns WaxOverlay
ui.Hovered()
The value of the slot under the mouse, then its look and its Slots control. Nothing when no slot is under it.
ui.Hovered(): any, WaxSlotLook?, WaxSlots?Returns
any(value)WaxSlotLook?(look)WaxSlots?(control)
ui.IsTyping()
True while a text box of Wax has the keyboard.
ui.IsTyping(): booleanReturns boolean
ui.ScreenSize()
The size of the screen in the units windows and panels are laid out in. It changes with the shape of the game's window and with the interface size. While the game is starting and has no screen yet, the answer is 1920 by 1080; ScreenChanged fires if the real one turns out different.
ui.ScreenSize(): number, numberReturns
number(width)number(height)
ui.FitGame(options?)
Draws the game's own menus (inventory, crafting, benches) smaller, which leaves room beside them for panels. They keep working as before. The request ends when the mod reloads.
ui.FitGame(options?: WaxFitOptions): WaxFit| Parameter | Type |
|---|---|
options (optional) | WaxFitOptions |
Returns WaxFit
ui.GameScreen()
The game's own menu screen that is showing now: "UMG_MainMenu", "UMG_EscapeMenu", or a bench or container such as "UMG_Processor_C". For the main menu the second value is its tab: 0 inventory, 1 crafting, 2 tech tree, 3 talents, 4 map. Nothing when none shows.
ui.GameScreen(): string?, integer?Returns
string?(name)integer?(tab)
ui.Tag(target, options?)
Puts a line of text over an actor, over one part of an actor, or on a spot in the world. It follows what it is on, shows through walls, and tags that would cover each other pile up. The tag goes away by itself when the actor does.
ui.Tag(target: WaxInstance|{ X: number, Y: number, Z: number }, options?: WaxTagOptions): WaxTag| Parameter | Type |
|---|---|
target | WaxInstance | { X: number, Y: number, Z: number } |
options (optional) | WaxTagOptions |
Returns WaxTag
ui.Notify(text, options?)
Shows a short message in a corner of the screen. Sending the same message again restarts the one already showing.
ui.Notify(text: any, options?: WaxNotifyOptions): WaxNotification| Parameter | Type |
|---|---|
text | any |
options (optional) | WaxNotifyOptions |
Returns WaxNotification
ui.Windows()
A list of every window.
ui.Windows(): WaxWindow[]Returns WaxWindow[]
ui.GameButton(spec, on_click?)
A button inside one of the game's own screens, in the game's style. Find the screen's parts from the player's UserInterface.Menus; the inventory card's Sort control is UMG_MainInventory.UMG_Sort, whose SortButton is the model and whose row holds the Type box and Sort.
ui.GameButton(spec: WaxGameButtonSpec, on_click?: fun()): WaxGameButton| Parameter | Type | Description |
|---|---|---|
spec | WaxGameButtonSpec | |
on_click (optional) | fun() | Runs on a click, as a task. |
Returns WaxGameButton
ui.NeedsHost(control, text?)
Greys a control that cannot work on this game and says why while the mouse rests on it: by default that the host or the server has to run it. The control still takes clicks, so nothing is refused; what it does goes to the game, which answers. Pair it with mod.Side: if not mod.Side("host") then ui.NeedsHost(button) end.
ui.NeedsHost(control: WaxControl, text?: string): WaxControl| Parameter | Type | Description |
|---|---|---|
control | WaxControl | |
text (optional) | string | What the tip says instead. |
Returns WaxControl (control) The same control.
ui.Hotkey(key, callback, options?)
Runs callback when the key is pressed during play. The hotkey is removed when the mod reloads.
ui.Hotkey(key: string, callback: fun(), options?: WaxHotkeyOptions): WaxHotkey| Parameter | Type | Description |
|---|---|---|
key | string | An engine key name such as "F6", "K" or "MiddleMouseButton" (a Keybind control gives you these). It can be held with Ctrl, Shift or Alt: "Ctrl+Three", "Ctrl+Shift+K". |
callback | fun() | |
options (optional) | WaxHotkeyOptions |
Returns WaxHotkey
ui.Bind(name, key, callback, options?)
A hotkey with a name. It runs callback when its key is pressed, like ui.Hotkey, and it is listed on your mod's card of the Mods page, where the player can give it another key. The player's choice is remembered and used the next time, so key is only where it starts. When two mods act on one key both still run, and the Mods page says which keys clash. Use it for every key a player might want to change.
ui.Bind(name: string, key: string?, callback: fun(), options?: WaxBindOptions): WaxBind| Parameter | Type | Description |
|---|---|---|
name | string | A name for the key that stays the same between versions, such as "Open". One mod cannot have two of one name. |
key | string? | The key it starts with, such as "F10" or "Ctrl+K". nil takes the key mod.lua names for it in keys, or none until the player gives one. |
callback | fun() | |
options (optional) | WaxBindOptions |
Returns WaxBind
ui.IsKeyDown(key)
True while the key is held down, as the game's own input reports it for the local player. It takes the key names ui.Hotkey takes. A name with Ctrl, Shift or Alt ("Ctrl+K") is true only while the key is down with exactly those held; a plain name is true whatever else is held. It is false while the game has no local player, and for a name the game does not know. It does not look at whether the menu is open or a text box has the keyboard (see ui.IsTyping). Every call asks the game, so use it in a loop that runs while something is held, such as one a ui.Hotkey started, and not in every frame of the game. It raises an error for a key that is not text, for empty text, and for a word before the key that is not Ctrl, Shift or Alt.
ui.IsKeyDown(key: string): boolean| Parameter | Type | Description |
|---|---|---|
key | string | An engine key name such as "A", "LeftShift" or "MiddleMouseButton". |
Returns boolean
ui.MinScale()
The smallest interface size that still draws text at a readable size on this screen. It follows the size of the game's window.
ui.MinScale(): numberReturns number
ui.SetScale(scale)
Sets the interface size, where 1 is normal. The size is kept between ui.MinScale() and 2, and the size applied is returned.
ui.SetScale(scale: number): number| Parameter | Type |
|---|---|
scale | number |
Returns number (applied)
ui.GetScale()
The interface size in use.
ui.GetScale(): numberReturns number
ui.SetTheme(theme)
Switches to a named theme, or changes single settings from a table. Everything on screen takes the new colours in place, so no window is rebuilt and no mod is reloaded. Sizes and shapes apply to what is built afterwards.
ui.SetTheme(theme: WaxThemeName|WaxThemeSettings)| Parameter | Type |
|---|---|
theme | WaxThemeName | WaxThemeSettings |
Returns nothing.
ui.ResetTheme()
Puts every theme setting back to the "Midnight" defaults.
ui.ResetTheme()Returns nothing.
ui.Themes()
The names of the built-in themes, then of the ones added with AddTheme.
ui.Themes(): string[]Returns string[]
ui.AddTheme(name, colors)
Adds a theme: a table with any of the colour settings (window, panel, raised, text, accent ...) as "#RRGGBB".
ui.AddTheme(name: string, colors: WaxThemeSettings)| Parameter | Type |
|---|---|
name | string |
colors | WaxThemeSettings |
Returns nothing.
ui.ThemeName()
The name of the theme in use.
ui.ThemeName(): stringReturns string
ui.Color(hex, alpha?)
Makes a colour from "#RRGGBB" or 0xRRGGBB, with an optional alpha of 0..1.
ui.Color(hex: string|integer, alpha?: number): WaxColor| Parameter | Type |
|---|---|
hex | string | integer |
alpha (optional) | number |
Returns WaxColor
ui.Theme()
The table of the theme in use. Its colours follow the theme, so pass them as they are (color = ui.Theme().accent).
ui.Theme(): WaxThemeReturns WaxTheme
ui.AddSettings(container)
Adds Wax's own settings (the key of its panel, theme, accent, animation, size) to a container, such as a "Settings" page.
ui.AddSettings(container: WaxContainer)| Parameter | Type |
|---|---|
container | WaxContainer |
Returns nothing.
ui.Settings(spec)
A settings window in one call: a window with a control for each field, values that are saved under your mod's name and come back the next time the game starts, presets, a Defaults button, and a signal that says when a value moves. lua local settings = ui.Settings({ title = "Bigger Stacks", icon = "layers", presets = { { "Balanced", { multiplier = 2 } }, { "Lots", { multiplier = 10 } } }, fields = { { "multiplier", "Stack multiplier", slider = { min = 1, max = 50, step = 1 }, default = 2 }, { "ammo", "Ammo too", toggle = true, default = false }, }, }) local function apply() ... end apply() settings.Changed:Connect(apply)
ui.Settings(spec: WaxSettingsSpec): WaxSettings| Parameter | Type |
|---|---|
spec | WaxSettingsSpec |
Returns WaxSettings
ui.Pictures
The game's own pictures, such as item icons, which a cell of a Slots control shows by their path. Loading them is given a few milliseconds a frame, so a picture can show a moment after it was asked for.
Type name: WaxPictures.
ui.Pictures.Check(path)
The game path of a picture as it can be shown ("/Game/.../ITEM_Wood.ITEM_Wood"), or nil when the text is not one.
ui.Pictures.Check(path: string): string?| Parameter | Type |
|---|---|
path | string |
Returns string?
ui.Pictures.Stats()
How many game pictures were loaded, failed, are waiting and are kept in memory.
ui.Pictures.Stats(): { loaded: integer, failed: integer, waiting: integer, pinned: integer, worst_ms: number }Returns { loaded: integer, failed: integer, waiting: integer, pinned: integer, worst_ms: number }
ui.Notifications
What all notifications share: the corner they show in and how many show at once. It also counts them and closes them all.
Type name: WaxNotifications.
ui.Notifications.SetCorner(name)
Moves notifications to another corner of the screen, closing the ones showing.
ui.Notifications.SetCorner(name: WaxCorner)| Parameter | Type |
|---|---|
name | WaxCorner |
Returns nothing.
ui.Notifications.SetLimit(count)
Sets how many notifications show at once (at least 1).
ui.Notifications.SetLimit(count: number)| Parameter | Type |
|---|---|
count | number |
Returns nothing.
ui.Notifications.Clear()
Closes every notification.
ui.Notifications.Clear()Returns nothing.
ui.Notifications.Count()
How many notifications are showing.
ui.Notifications.Count(): integerReturns integer
ui.Icons
Icon names: the bundled Lucide set ("shield", "wrench", "map-pin" ...) plus images that mods register.
Type name: WaxIcons.
ui.Icons.Names()
Every icon name, sorted. The menu's Icons page shows them.
ui.Icons.Names(): string[]Returns string[]
ui.Icons.Has(name)
True when there is an icon with this name.
ui.Icons.Has(name: string): boolean| Parameter | Type |
|---|---|
name | string |
Returns boolean
ui.Icons.Find(text?, limit?)
Names containing the text, at most limit of them (every name when the text is empty).
ui.Icons.Find(text?: string, limit?: integer): string[]| Parameter | Type |
|---|---|
text (optional) | string |
limit (optional) | integer |
Returns string[]
ui.Icons.Register(name, file)
Adds an icon from a PNG file. White on transparent works best, because the icon is tinted when drawn.
ui.Icons.Register(name: string, file: string)| Parameter | Type |
|---|---|
name | string |
file | string |
Returns nothing.
ui.Debug
The in-game debug panel.
Type name: WaxDebugPanel.
ui.Debug.Page(name, options?)
Adds a page to the debug panel for the calling mod. The page is removed when the mod reloads.
ui.Debug.Page(name: string, options?: WaxPageOptions): WaxPage| Parameter | Type |
|---|---|
name | string |
options (optional) | WaxPageOptions |
Returns WaxPage
ui.Debug.Window()
The debug panel's window, or nil while the panel is not running.
ui.Debug.Window(): WaxWindow?Returns WaxWindow?
ui.Debug.Show()
Shows the Wax panel and frees the mouse, whichever mod calls it. Your own windows stay as they are.
ui.Debug.Show()Returns nothing.
ui.Keys
The keys that show and hide windows. Wax's own panel has one, and so has every mod that made a window: a key shows and hides its owner's windows and nobody else's. A mod's key is the one the player chose on the mod's card of the Mods page, else the one the mod asked for with ui.Window({ key = "F6" }), else a key Wax gives it once and remembers: one that no window and no hotkey of any mod uses. A press that your mod's own ui.Hotkey takes is not also taken as the key of its windows.
Type name: WaxKeys.
| Signal | Handler receives | Description |
|---|---|---|
Changed | owner: string, key: string? | Fires with the owner and its new key when a key is changed. |
BindChanged | owner: string, name: string, key: string? | Fires when a named key of a mod is given another key. |
ui.Keys.Get(owner?)
The key of an owner: "Wax" or a mod's id. Left out, it is the mod that asks.
ui.Keys.Get(owner?: string): string?| Parameter | Type |
|---|---|
owner (optional) | string |
Returns string?
ui.Keys.Set(owner, key)
Gives an owner another key, or none with nil. A key that another owner has, or that another mod uses as a hotkey, is given all the same: a notification says who else has it, the Mods page shows the clash, and the second value is that name.
ui.Keys.Set(owner: string, key: string?): boolean, string?| Parameter | Type | Description |
|---|---|---|
owner | string | "Wax" or a mod's id. |
key | string? | An engine key name such as "F6". It can be held with Ctrl, Shift or Alt: "Ctrl+K". |
Returns
boolean(changed)string?(taken_by)
ui.Keys.Named(owner)
The key a mod's mod.lua names for its windows (key = "F6"), as the player has it now. nil when mod.lua names none. It is known while the mod is not running.
ui.Keys.Named(owner: string): string?| Parameter | Type | Description |
|---|---|---|
owner | string | A mod's id. |
Returns string?
ui.Keys.Owners()
Every owner that has a window, Wax first.
ui.Keys.Owners(): WaxKeyOwner[]Returns WaxKeyOwner[]
ui.Keys.Binds(owner?)
The named keys mods made with ui.Bind. With a mod's id, only that mod's, and for a mod that is not running the keys its mod.lua names.
ui.Keys.Binds(owner?: string): WaxKeyBind[]| Parameter | Type |
|---|---|
owner (optional) | string |
Returns WaxKeyBind[]
ui.Keys.SetBind(owner, name, key)
Gives a named key of a mod another key, or none with nil, and remembers it for that player. A key somebody else uses is taken all the same: a notification says who else has it, and ui.Keys.Clashes lists it.
ui.Keys.SetBind(owner: string, name: string, key: string?): boolean| Parameter | Type | Description |
|---|---|---|
owner | string | A mod's id. |
name | string | The name the mod gave the key. |
key | string? | An engine key name such as "F10" or "Ctrl+K". |
Returns boolean (changed)
ui.Keys.Clashes(owner?)
The keys that more than one owner acts on, one line of text for each: the Wax panel's key, the key of each mod's windows, every named key and every plain hotkey of a mod. With an owner, only the clashes that owner is part of, said from its side. An empty list when nothing clashes.
ui.Keys.Clashes(owner?: string): string[]| Parameter | Type | Description |
|---|---|---|
owner (optional) | string | "Wax" or a mod's id. |
Returns string[]
WaxPage
A page of a window that has navigation. It is a container for controls.
It can also do everything WaxContainer can. You get one from window:Page, ui.Debug.Page.
| Signal | Handler receives | Description |
|---|---|---|
PressedAgain | nothing | Fires when the page's own name is pressed while the page is already showing. Use it to go back to the start of a page that has several views. |
NearEnd | nothing | Fires while the end of the page is in view: when the user scrolls close to the bottom, and a few times a second while the page is not full. Add more content in the handler, or do nothing when there is no more. |
WaxWindow
A window in the menu. Controls added to it go into its body, or into a first page called "Main" when it has pages. The player moves it by its title bar and resizes it by any edge or corner; the bottom right corner shows a grip. Resizing stops at the window's minimum size and at the edges of the screen. A mod's windows come up together, with that mod's key (see ui.Keys), and other mods' windows stay as they are.
It can also do everything WaxContainer can. You get one from ui.Debug.Window, ui.Window, ui.Windows. Below, window stands for one of these.
| Signal | Handler receives | Description |
|---|---|---|
Opened | nothing | Fires when the window is shown. |
Closed | nothing | Fires when the window is hidden. |
PageChanged | name: string | Fires with the name of the page that was selected. |
window:SetTitle(title)
Changes the text in the title bar.
window:SetTitle(title: string)| Parameter | Type |
|---|---|
title | string |
Returns nothing.
window:SetPosition(x, y)
Moves the window, keeping it on the screen.
window:SetPosition(x: number, y: number)| Parameter | Type |
|---|---|
x | number |
y | number |
Returns nothing.
window:SetSize(width, height)
Resizes the window, no smaller than its minimum size.
window:SetSize(width: number, height: number)| Parameter | Type |
|---|---|
width | number |
height | number |
Returns nothing.
window:SetNavWidth(width)
Sets the width of the navigation column of a window made with nav = "side".
window:SetNavWidth(width: number)| Parameter | Type |
|---|---|
width | number |
Returns nothing.
window:Show()
Shows the window, in front of the others. While the menu is open it comes up at once, with your mod's other windows. While the menu is closed it waits for your mod's key or for ui.Open().
window:Show()Returns nothing.
window:Hide()
Hides the window. Hiding the last window that is up closes the menu.
window:Hide()Returns nothing.
window:SetVisible(shown)
Shows or hides the window.
window:SetVisible(shown: boolean)| Parameter | Type |
|---|---|
shown | boolean |
Returns nothing.
window:IsVisible()
True while the window is shown. A shown window is on screen only while its mod's windows are up: IsShowing tells you that.
window:IsVisible(): booleanReturns boolean
window:IsShowing()
True while the window is really on screen: it is shown, and its mod's windows are up (or every window is, in preview).
window:IsShowing(): booleanReturns boolean
window:SetMinimized(minimized)
Minimises the window to its title bar, or restores it.
window:SetMinimized(minimized: boolean)| Parameter | Type |
|---|---|
minimized | boolean |
Returns nothing.
window:IsMinimized()
True while the window is minimised.
window:IsMinimized(): booleanReturns boolean
window:StatusBar(text?)
Adds a status line along the bottom of the window, or returns the one the window already has. text sets its message.
window:StatusBar(text?: any): WaxStatusBar| Parameter | Type |
|---|---|
text (optional) | any |
Returns WaxStatusBar
window:Destroy()
Removes the window and everything on it.
window:Destroy()Returns nothing.
window:Page(name, options?)
Adds a page to a window made with nav = "side" or "top". The first page added is selected.
window:Page(name: string, options?: WaxPageOptions): WaxPage| Parameter | Type |
|---|---|
name | string |
options (optional) | WaxPageOptions |
Returns WaxPage
window:RemovePage(page)
Removes a page made with Page, with everything on it.
window:RemovePage(page: WaxPage)| Parameter | Type |
|---|---|
page | WaxPage |
Returns nothing.
window:SelectPage(name)
Switches to the page with this name.
window:SelectPage(name: string)| Parameter | Type |
|---|---|
name | string |
Returns nothing.
WaxStatusBar
The line along the bottom of a window that Window:StatusBar returns.
You get one from window:StatusBar. Below, statusBar stands for one of these.
statusBar:Set(message?, options?)
Shows a message and removes the busy indicator.
statusBar:Set(message?: any, options?: WaxStatusOptions)| Parameter | Type |
|---|---|
message (optional) | any |
options (optional) | WaxStatusOptions |
Returns nothing.
statusBar:Busy(message?)
Shows a message with a turning indicator beside it, until the next Set.
statusBar:Busy(message?: any)| Parameter | Type |
|---|---|
message (optional) | any |
Returns nothing.
statusBar:Progress(amount?)
Shows a thin progress line across the top of the bar. amount is 0..1, and nil hides the line.
statusBar:Progress(amount?: number)| Parameter | Type |
|---|---|
amount (optional) | number |
Returns nothing.
statusBar:Right(message?)
Shows text at the right-hand end of the bar.
statusBar:Right(message?: any)| Parameter | Type |
|---|---|
message (optional) | any |
Returns nothing.
statusBar:Clear()
Empties the message and hides the progress line.
statusBar:Clear()Returns nothing.
WaxOverlay
A panel pinned to the screen that stays up during play and never takes the mouse.
It can also do everything WaxContainer can. You get one from ui.Overlay, ui.Panel. Below, overlay stands for one of these.
| Signal | Handler receives | Description |
|---|---|---|
Scrolled | steps: integer | On a panel made with ui.Panel: the wheel was turned over it, 1 for down and -1 for up. The game does not see the wheel while the mouse is over a panel. |
Resized | width: number, height: number? | On a panel made with a place function: it was given another size, in its own units. Fires in the frame the screen changed. |
overlay:SetVisible(shown)
Shows or hides the overlay.
overlay:SetVisible(shown: boolean)| Parameter | Type |
|---|---|
shown | boolean |
Returns nothing.
overlay:IsVisible()
True while the overlay is shown.
overlay:IsVisible(): booleanReturns boolean
overlay:SetAnchor(anchor, x?, y?)
Pins the overlay somewhere else. x and y keep their values when omitted.
overlay:SetAnchor(anchor: WaxAnchor, x?: number, y?: number)| Parameter | Type |
|---|---|
anchor | WaxAnchor |
x (optional) | number |
y (optional) | number |
Returns nothing.
overlay:Destroy()
Removes the overlay and everything on it.
overlay:Destroy()Returns nothing.
overlay:SetOffset(x?, y?)
Moves it without changing its anchor. x and y keep their values when omitted.
overlay:SetOffset(x?: number, y?: number)| Parameter | Type |
|---|---|
x (optional) | number |
y (optional) | number |
Returns nothing.
overlay:IsShowing()
True while it is really on screen: switched on, and what it waits for (the menu, the mouse) is there.
overlay:IsShowing(): booleanReturns boolean
WaxFit
A request to draw the game's own menus smaller.
You get one from ui.FitGame. Below, fit stands for one of these.
fit:Set(scale, x?, y?)
Changes how large the game's menus are drawn, and how far they are moved when x or y is given. The numbers mean what the scale, x and y options mean.
fit:Set(scale: number, x?: number, y?: number)| Parameter | Type | Description |
|---|---|---|
scale | number | |
x (optional) | number | Keeps its value when omitted. |
y (optional) | number | Keeps its value when omitted. |
Returns nothing.
fit:SetEnabled(on)
Switches the request on or off. While it is off the game's menus have their own size, unless another request is on.
fit:SetEnabled(on: boolean)| Parameter | Type |
|---|---|
on | boolean |
Returns nothing.
fit:Remove()
Gives the game's menus their own size back.
fit:Remove()Returns nothing.
WaxNotification
One message in a corner of the screen, as ui.Notify returns it. Once it has closed, its functions do nothing.
You get one from ui.Notify. Below, notification stands for one of these.
notification:SetText(text)
Replaces the text.
notification:SetText(text: any)| Parameter | Type |
|---|---|
text | any |
Returns nothing.
notification:SetTitle(title)
Replaces the title. Does nothing on a notification made without one.
notification:SetTitle(title: string)| Parameter | Type |
|---|---|
title | string |
Returns nothing.
notification:SetProgress(amount)
Shows how far a task is, 0..1, in place of the countdown. The notification then stays until closed.
notification:SetProgress(amount: number)| Parameter | Type |
|---|---|
amount | number |
Returns nothing.
notification:Close()
Closes the notification.
notification:Close()Returns nothing.
WaxTag
A line of text that stays over something in the world.
You get one from ui.Tag. Below, tag stands for one of these.
| Property | Type | Description |
|---|---|---|
Instance | WaxInstance? | What the tag is on. nil for a tag on a spot. |
tag:Set(text)
Replaces the text.
tag:Set(text: string)| Parameter | Type |
|---|---|
text | string |
Returns nothing.
tag:SetColor(color)
Changes the colour of the text.
tag:SetColor(color: WaxColor|string)| Parameter | Type |
|---|---|
color | WaxColor | string |
Returns nothing.
tag:SetRange(metres)
Sets how near the thing has to be for the tag to show, in metres. "outline" makes it show as far as outlines do.
tag:SetRange(metres: number|"outline")| Parameter | Type |
|---|---|
metres | number | "outline" |
Returns nothing.
tag:GetRange()
How near the thing has to be for the tag to show, in metres.
tag:GetRange(): numberReturns number
tag:Remove()
Takes the tag off. Safe to call twice, and after the thing it was on is gone.
tag:Remove()Returns nothing.
WaxGameButton
A button inside one of the game's own screens, built from the same parts as the game's buttons, with the game's fill, font and colours. It can never widen the game's header: the row's size is read before and after, and when it would change, everything is undone and an error says how much width the room entries still have to give up. The button is removed when your mod unloads, and a mod that loads again first clears what an earlier life left behind.
You get one from ui.GameButton. Below, gameButton stands for one of these.
| Signal | Handler receives | Description |
|---|---|---|
Clicked | nothing | Fires on a click: the button pressed and released under the mouse. |
gameButton:SetCaption(caption)
Changes the words.
gameButton:SetCaption(caption: string)| Parameter | Type |
|---|---|
caption | string |
Returns nothing.
gameButton:Remove()
Takes it out of the game's screen and gives the room back.
gameButton:Remove()Returns nothing.
gameButton:Exists()
False once it was removed, or the game threw its screen away.
gameButton:Exists(): booleanReturns boolean
WaxHotkey
A key that runs a function when it is pressed, as ui.Hotkey returns it.
You get one from ui.Hotkey. Below, hotkey stands for one of these.
hotkey.Disconnect()
Stops the hotkey.
hotkey.Disconnect()Returns nothing.
hotkey:SetKey(key)
Changes the key it reacts to.
hotkey:SetKey(key: string)| Parameter | Type |
|---|---|
key | string |
Returns nothing.
WaxBind
A named key of your mod, as ui.Bind returns it.
You get one from ui.Bind. Below, bind stands for one of these.
| Signal | Handler receives | Description |
|---|---|---|
Changed | key: string? | Fires with the new key when the player, or your mod, changes it. |
bind:Get()
The key it has now. nil when the player left it without one.
bind:Get(): string?Returns string?
bind:Set(key)
Gives it another key, or none with nil, as the player does on the mod's card.
bind:Set(key: string?): boolean| Parameter | Type |
|---|---|
key | string? |
Returns boolean (changed)
bind:Disconnect()
Takes the key away from your mod. It also goes when the mod unloads.
bind:Disconnect()Returns nothing.
WaxSettings
A settings window and its values.
You get one from ui.Settings. Below, settings stands for one of these.
| Property | Type | Description |
|---|---|---|
values | table<string, any> | The values by key. Read them whenever you need them; they are kept up to date. |
window | WaxWindow | The window, for SetVisible, SetPosition and anything else of a window. |
section | WaxSection | The card the controls are in, to add controls of your own after them. |
controls | table<string, WaxControl> | The control of each key. |
| Signal | Handler receives | Description |
|---|---|---|
Changed | key: string, value: any | Fires with the key and the new value when the player, a preset, Set or Reset changes a setting. Handlers run as tasks and may pause. |
settings:Get(key)
The value of one setting. An unknown key is an error.
settings:Get(key: string): any| Parameter | Type |
|---|---|
key | string |
Returns any
settings:Set(key, value)
Sets one value: the control follows, the value is saved and Changed fires. A number outside a slider's range is kept inside it; a value the field cannot hold is an error. False when nothing moved.
settings:Set(key: string, value: any): boolean| Parameter | Type |
|---|---|
key | string |
value | any |
Returns boolean
settings:UsePreset(name)
Sets every value of a preset. False when the values already matched it.
settings:UsePreset(name: string): boolean| Parameter | Type |
|---|---|
name | string |
Returns boolean
settings:Preset()
The name of the preset the values match, or "Custom".
settings:Preset(): stringReturns string
settings:Reset()
Puts every default back.
settings:Reset(): booleanReturns boolean
WaxModel
A creature or any other skeletal mesh of the game, drawn in 3D. It turns slowly by itself until the player touches it. The model follows the mouse when dragged: to the right its near side goes right, and down it is seen more from above. The wheel moves the camera nearer and further while the mouse is over the view, and the page does not scroll then. Two presses in a row put the view back. Nothing is drawn while the view is not on screen.
It can also do everything WaxControl can. You get one from container:Model. Below, model stands for one of these.
| Signal | Handler receives | Description |
|---|---|---|
Loaded | nothing | The model given at the start or to Show is in the picture. |
Failed | reason: string | The mesh could not be loaded or is not a skeletal mesh, or the game could not make the view. |
Turned | yaw: number, pitch: number, distance: number | The player let go after a drag, turned the wheel or put the view back. |
Clicked | nothing | The player pressed the view and let go without turning it. |
model:Show(look)
Shows another model in the same box. The view goes back to where it starts, unless the first mesh is the one that shows already: the same body with other parts or other fur is seen from where the player left it.
model:Show(look: WaxModelLook)| Parameter | Type |
|---|---|
look | WaxModelLook |
Returns nothing.
model:Clear()
Empties the box.
model:Clear()Returns nothing.
model:GetView()
Where the camera is: degrees round the model (0 looks at its front, 90 at its right side), degrees above it (negative is below), and how far away (1 fits the model in the box).
model:GetView(): number, number, numberReturns
number(yaw)number(pitch)number(distance)
model:SetView(yaw?, pitch?, distance?)
Puts the camera somewhere. What is left out stays as it is. The slow turn stops.
model:SetView(yaw?: number, pitch?: number, distance?: number)| Parameter | Type | Description |
|---|---|---|
yaw (optional) | number | |
pitch (optional) | number | Kept between -20 and 75. |
distance (optional) | number | Kept between 0.45 and 1.6. |
Returns nothing.
model:Reset()
Puts the view back where it started, and starts the slow turn again.
model:Reset()Returns nothing.
model:SetAnimation(animation, speed?)
Changes what plays: "walk", "idle", "blueprint", the game path of an animation, or false to stand still.
model:SetAnimation(animation: "walk"|"idle"|"blueprint"|string|false, speed?: number)| Parameter | Type | Description |
|---|---|---|
animation | "walk" | "idle" | "blueprint" | string | false | |
speed (optional) | number | For "blueprint": what the creature is said to move at. 0 stands, 150 walks. |
Returns nothing.
model:Attach(shape, options?)
Puts a shape from game.Assets:Mesh or game.Assets:Model on a socket or a bone of the model that shows: a tool in a hand, a hat on a head. The model has to be in the picture: wait for Loaded. It goes when another model is shown.
model:Attach(shape: WaxMesh, options?: { socket?: string, at?: table, turn?: table, scale?: number, material?: any })| Parameter | Type |
|---|---|
shape | WaxMesh |
options (optional) | { socket?: string, at?: table, turn?: table, scale?: number, material?: any } |
Returns nothing.
model:Play(animation, options?)
Plays an animation from game.Animations:Define on the model that shows, so it can be looked at from every side before it is used in the world. The model has to be in the picture: wait for Loaded. Give the look facing = 0 for a mesh that faces along its own X, as the player's body does.
model:Play(animation: WaxAnimation, options?: WaxAnimationPlayOptions): WaxAnimationPlay| Parameter | Type |
|---|---|
animation | WaxAnimation |
options (optional) | WaxAnimationPlayOptions |
Returns WaxAnimationPlay
model:IsLoaded()
True once the model given at the start or to Show is in the picture.
model:IsLoaded(): booleanReturns boolean
WaxUnknownOption
Stands for any key an options table does not list, so that the editor reports a misspelt option.
WaxOptions
The base of every options table.
| Option | Type | Description |
|---|---|---|
any other key ([string]) | WaxUnknownOption | Stands for any key an options table does not list, so that the editor reports a misspelt option. |
WaxColor
A colour in the linear form the engine uses. Make one with ui.Color.
Returned by ui.Color. Used by tag:SetColor, label:SetColor, progress:SetColor, field:SetColor.
| Field | Type |
|---|---|
R | number |
G | number |
B | number |
A | number |
WaxTheme
The theme in use. Its colours change in place when the theme changes, so a colour taken from here (ui.Theme().good) follows the theme wherever you used it. Change the theme with ui.SetTheme, not by writing to this table.
Returned by ui.Theme.
| Field | Type | Description |
|---|---|---|
window | WaxColor | Window background. |
outline | WaxColor | Window outline. |
panel | WaxColor | Text boxes, dropdown lists and consoles. |
card | WaxColor | Section background. |
card_line | WaxColor | Section outline. |
raised | WaxColor | Buttons and tracks. |
hover | WaxColor | A colour in the linear form the engine uses. Make one with ui.Color. |
press | WaxColor | A colour in the linear form the engine uses. Make one with ui.Color. |
line | WaxColor | Separators. |
text | WaxColor | A colour in the linear form the engine uses. Make one with ui.Color. |
dim | WaxColor | Secondary text. |
accent | WaxColor | A colour in the linear form the engine uses. Make one with ui.Color. |
accent_hover | WaxColor | A colour in the linear form the engine uses. Make one with ui.Color. |
good | WaxColor | A colour in the linear form the engine uses. Make one with ui.Color. |
warn | WaxColor | A colour in the linear form the engine uses. Make one with ui.Color. |
bad | WaxColor | A colour in the linear form the engine uses. Make one with ui.Color. |
clear | WaxColor | Fully transparent. |
on_accent | WaxColor | Text and knobs drawn on top of the accent colour. |
font_size | number | |
title_size | number | |
small_size | number | |
spacing | number | Gap between controls. |
padding | number | |
row_height | number | |
bar_height | number | Height of a window's title bar. |
nav_width | number | Default width of a side navigation column. |
window_shape | WaxShape | |
control_shape | WaxShape | |
animation | number | Seconds for open, close and expand animations. 0 turns animation off. |
WaxThemeSettings
Theme settings to change. Colours may be given as "#RRGGBB" or 0xRRGGBB.
Used by ui.SetTheme, ui.AddTheme.
| Option | Type |
|---|---|
window | WaxColor | string | integer |
outline | WaxColor | string | integer |
panel | WaxColor | string | integer |
card | WaxColor | string | integer |
card_line | WaxColor | string | integer |
raised | WaxColor | string | integer |
hover | WaxColor | string | integer |
press | WaxColor | string | integer |
line | WaxColor | string | integer |
text | WaxColor | string | integer |
dim | WaxColor | string | integer |
accent | WaxColor | string | integer |
accent_hover | WaxColor | string | integer |
good | WaxColor | string | integer |
warn | WaxColor | string | integer |
bad | WaxColor | string | integer |
clear | WaxColor | string | integer |
on_accent | WaxColor | string | integer |
font_size | number |
title_size | number |
small_size | number |
spacing | number |
padding | number |
row_height | number |
bar_height | number |
nav_width | number |
window_shape | WaxShape |
control_shape | WaxShape |
animation | number |
WaxWindowOptions
Used by ui.Window.
| Option | Type | Description |
|---|---|---|
title | string | "Window" when omitted. |
icon | string | Icon name shown before the title. The menu's Icons page lists the names. |
width | number | Default 340, or 520 with side navigation. |
height | number | Default 420, or 380 with pages. |
x | number | |
y | number | |
closable | boolean | False leaves out the close button. |
resizable | boolean | False makes a window the player cannot resize: it has no grip, its edges and corners do nothing, and it is always the size your mod gives it. SetSize still works. |
visible | boolean | False creates the window hidden. |
nav | WaxNav | Gives the window pages, listed down the side or along the top. |
nav_width | number | Width of the side navigation column. |
remember | boolean | False stops Wax remembering the window's position and size between sessions. |
pinned | boolean | True keeps the window on the screen while the player plays, with the menu closed. It takes no clicks then, so the mouse stays with the game. With a menu open it is a window like any other. |
key | string | The key that shows and hides your mod's windows, such as "F6" or "Ctrl+K". The first window a mod makes decides. Without it Wax gives the mod a key, and the player can choose another on the mod's card of the Mods page. |
WaxPageOptions
Used by window:Page, ui.Debug.Page.
| Option | Type | Description |
|---|---|---|
icon | string | Icon name shown before the page's name. The menu's Icons page lists the names. |
bottom | boolean | Lists the page at the bottom of a side navigation column. |
scroll | boolean | False makes a page that does not scroll. Its controls stack from the top, and a Grid or Console with no height takes the space left. |
WaxStatusOptions
Used by statusBar:Set.
| Option | Type | Description |
|---|---|---|
kind | WaxKind | Sets the colour of the text and the icon. "info" when omitted. |
icon | string | Icon name shown before the text. The menu's Icons page lists the names. |
WaxOverlayOptions
Used by ui.Overlay.
| Option | Type | Description |
|---|---|---|
anchor | WaxAnchor | Where on the screen the panel is pinned. "top-right" when omitted. |
x | number | Distance in from the anchor's edge. Default 16. |
y | number | Distance in from the anchor's edge. Default 16. |
width | number | Default 240. |
title | string | Adds a heading. |
background | boolean | False leaves out the panel behind the controls. |
movable | boolean | False stops the player dragging it while the menu is open. Where it was dragged to is remembered. |
WaxPanelOptions
Extends WaxOverlayOptions. Used by ui.Panel.
| Option | Type | Description |
|---|---|---|
when | "cursor" | "menu" | "always" | When it shows: "cursor" (the default) while the Wax menu is open or one of the game's own screens has the mouse, "menu" only with the Wax menu, "always" whenever it is switched on. |
padding | number | Space between its edge and its controls. |
height | number | A fixed height. As tall as its controls when omitted. |
zoom | number | Draws everything in it this much larger (1.25 is a quarter larger). Text stays sharp. |
opacity | number | How solid its background is, 0 to 1. 0.96 when omitted. |
visible | boolean | False makes it hidden until SetVisible(true). |
on_press | fun() | Runs when the panel is pressed where it has no control. |
place | fun(screen_width: number, screen_height: number): WaxPanelPlace | Where the panel goes on a screen of this size. It is asked when the panel is made and again, in the same frame, whenever the game's window changes size: the panel that exists is moved, sized and zoomed, and nothing is built again. The size is the real screen in the units the game lays its own menus out in, and the zoom is used as it is, so such a panel keeps its size beside the game's menus whatever the interface size is. |
WaxPanelPlace
What a panel's place function answers. What is left out stays as it is.
| Field | Type |
|---|---|
x (optional) | number |
y (optional) | number |
width (optional) | number |
height (optional) | number |
zoom (optional) | number |
WaxFitOptions
Used by ui.FitGame.
| Option | Type | Description |
|---|---|---|
scale | number | How large the game's menus are drawn, 0.5 to 1. 0.85 when omitted. |
corner | WaxAnchor | The corner they shrink towards. "bottom-left" when omitted, which frees the right and the top. |
x | number | Moves them sideways after they are made smaller, as a share of the screen. Right is positive. |
y | number | Moves them up or down after they are made smaller, as a share of the screen. Down is positive. |
enabled | boolean | False makes the request wait for SetEnabled(true). |
WaxNotifyOptions
Used by ui.Notify.
| Option | Type | Description |
|---|---|---|
title | string | A bold line above the text. |
kind | WaxKind | Sets the colour and the icon. "info" when omitted. |
icon | string | Icon name used in place of the kind's own. The menu's Icons page lists the names. |
seconds | number | Time on screen. Default 4, and 0 keeps it until closed. |
progress | number | 0..1. Shows progress in place of the countdown and keeps the notification until closed. |
WaxKeyOwner
One owner of windows, as ui.Keys.Owners lists it.
Returned by ui.Keys.Owners.
| Field | Type | Description |
|---|---|---|
id | string | "Wax" for Wax's own panel, else the id of a mod. |
name | string | The name to show: "Wax", or the mod's name. |
key | string? | Its key, or nil when it has none. |
open | boolean | True while its windows are up. |
WaxKeyBind
One named key of a mod, as ui.Keys.Binds lists it.
Returned by ui.Keys.Binds.
| Field | Type | Description |
|---|---|---|
Id | string | The mod's id. |
Name | string | The name the mod gave the key. |
Label | string | What the mod's card calls it. |
Key | string? | The key it has now. nil when the player left it without one. |
Default | string? | The key the mod asked for. |
Declared | boolean? | true when the mod is not running and the key is known from its mod.lua. |
WaxTextOptions
Used by ui.TextWidth, ui.Shorten.
| Option | Type | Description |
|---|---|---|
size | number | The font size. The interface's own when omitted. |
face | string | "Bold", "Book" or "Medium" (the default). |
family | string | "mono" for the fixed-width font. |
WaxTagOptions
Used by ui.Tag.
| Option | Type | Description |
|---|---|---|
text | string | |
color | WaxColor | string | |
size | number | |
within | number | Metres. Farther away than this the tag is not shown. Default 100. |
outline | boolean | True shows the tag exactly as far as game.Highlight draws outlines (game.Highlight:GetRange()), in place of within. |
fade | boolean | The tag gets smaller with distance and fades out over the last fifth of its range. True when omitted. |
over_menus | boolean | True keeps the tag showing while one of the game's screens or the Wax menu is open. Otherwise it is hidden then and comes back after. |
lift | number | How far above the thing's middle the tag sits, in centimetres. Worked out from the thing when omitted. |
WaxGameButtonRoom
| Field | Type | Description |
|---|---|---|
box | any | A SizeBox of the row (one of the game's), such as the Type box beside Sort. |
width | number | The width it gets instead of its own, in the game's units. |
WaxGameButtonSpec
Used by ui.GameButton.
| Field | Type | Description |
|---|---|---|
like | any | One of the game's own text buttons (a UMG_BasicButton_2_C, such as a Sort control's SortButton): its fill, font and colours are copied. |
row | any | The HorizontalBox of the game's screen the button goes into, such as the row that holds Type and Sort. |
caption | string | The words on it, such as "STASH". The game's font draws them in capitals. |
width (optional) | number | Its width in the game's units. 130 when omitted. |
room (optional) | WaxGameButtonRoom[] | Boxes of the row that give up width, so the row keeps its size. |
grow (optional) | boolean | True for a row of your own that may grow: the size check is skipped. |
WaxHotkeyOptions
Used by ui.Hotkey.
| Option | Type | Description |
|---|---|---|
in_menu | boolean | Also reacts while the menu is open (off by default, so that typing in a box does not trigger it). |
typing | boolean | Also reacts while a text box has the keyboard (for a key meant for the box, such as Tab). |
hover | boolean | Makes it a key for the slot under the mouse: it only reacts while a slot is under it. |
WaxBindOptions
The options of ui.Bind.
Used by ui.Bind.
| Option | Type | Description |
|---|---|---|
label | string | What the mod's card calls the key. The name when omitted. |
in_menu | boolean | true lets it run while the menu is open as well. |
typing | boolean | true lets it run while a text box has the keyboard. |
WaxSettingsField
One setting of a settings window. Its first entry is the key, its second the caption. Exactly one of slider, toggle, choices and text says what it is. A table with only heading draws a heading between fields instead.
| Field | Type | Description |
|---|---|---|
any other key ([1]) | string | The key the value is kept under, such as "multiplier". |
any other key ([2]) | string | The caption shown beside the control. |
default | any | What the setting is until the player changes it. A number for a slider, a boolean for a toggle, one of the choices, or a string. |
slider (optional) | { min: number, max: number, step?: number, format?: string, live?: boolean } | A number between min and max. The value is reported when the mouse lets go, unless live is true. |
toggle (optional) | boolean | True for a switch. |
choices (optional) | any[] | The choices of a dropdown. |
text (optional) | boolean | { hint?: string } | True for a text box, or a table with the greyed text shown while it is empty. |
help (optional) | string | A dim line of explanation under the control. |
heading (optional) | string | A heading between fields, on a table of its own. |
WaxSettingsSpec
Used by ui.Settings.
| Field | Type | Description |
|---|---|---|
title | string | The window's title. |
fields | WaxSettingsField[] | The settings, in the order they are shown. |
presets (optional) | { [1]: string, [2]: table<string, any> }[] | Named sets of values, each { "Balanced", { multiplier = 2, weight = 0.5 } }. A Preset dropdown goes at the top; it reads "Custom" while the values match none. |
icon (optional) | string | The window's icon. |
name (optional) | string | The storage name the values are saved under. "settings" when omitted. |
section (optional) | string | The title of the card the fields sit in. "Settings" when omitted. |
key (optional) | string | The key that shows and hides the window, as ui.Window takes it. |
width (optional) | number | |
height (optional) | number | |
x (optional) | number | |
y (optional) | number |
WaxModelFur
The fur of a model: a second mesh that hair grows from. game.Creatures:GetModel fills it in from the creature's own data.
| Field | Type | Description |
|---|---|---|
mesh | string | The game path of the mesh the fur grows from. |
splines (optional) | string | The game path of the fur's splines. |
layers (optional) | integer | How many layers the fur is drawn in, 1 to 64. |
length (optional) | number | |
min_length (optional) | number | |
bias (optional) | number | |
noise (optional) | number | |
hair_bias (optional) | number | |
uniformity (optional) | number | |
bare (optional) | boolean | True leaves out the faces that have no splines. |
materials (optional) | table<integer, string> | Game paths of materials by slot, 1 first. |
mask (optional) | string | The game path of a texture that says where no fur grows, as the game puts one on a mount's fur under some saddles. It goes on a copy of the fur's first material, so it only works when materials names that one. |
WaxModelPart
One more mesh of a model, such as a piece of armour or a saddle. With nothing but a mesh it takes the pose of the first mesh, bone by bone. With a blueprint or a socket it is put on as the game puts a saddle on its mount: attached to the first mesh, and posed by its own blueprint.
| Field | Type | Description |
|---|---|---|
mesh | string | The game path of a skeletal mesh. |
materials (optional) | table<integer, string> | Game paths of materials by slot, 1 first. |
blueprint (optional) | string | The game path of the part's own animation blueprint, one that copies the pose of another mesh, as every saddle of the game has. The part is attached to the first mesh and the blueprint is given that mesh to copy. When it cannot be loaded the part takes the first mesh's pose bone by bone instead. |
socket (optional) | string | A socket or a bone of the first mesh the part sits on, such as "RaptorSaddle". Left out, it sits on the mesh itself. A part on a socket is not counted when the model is fitted to its box. |
WaxModelLook
What a Model control shows. Every path is a game path such as "/Game/ASS/CRE/Deer/SK_CRE_PAS_Deer"; a path with no dot gets its last part again. game.Creatures:GetModel gives one of these for a creature.
Used by model:Show.
| Field | Type | Description |
|---|---|---|
mesh | string | The game path of a skeletal mesh. |
materials (optional) | table<integer, string> | Game paths of materials to put on the mesh, by slot, 1 first. |
parts (optional) | WaxModelPart[] | More meshes that move with the first: pieces on the same skeleton, or what the model wears. |
fur (optional) | WaxModelFur | WaxModelFur[] | |
walk (optional) | string | The game path of the animation "walk" plays. |
idle (optional) | string | The game path of the animation "idle" plays. |
loop (optional) | string | The game path of an animation for a model with no walk and no idle, such as flying. |
animation (optional) | "walk" | "idle" | "blueprint" | string | false | What plays, in a loop. "walk" (the default) plays walk, or idle or loop when there is none. "idle" plays idle, or loop when there is no walk either. "blueprint" runs the mesh's own animation blueprint. A game path plays that animation. false stands still. |
blueprint (optional) | string | The game path of the mesh's own animation blueprint. Only used with animation = "blueprint". |
speed (optional) | number | What an animation blueprint is told the creature moves at: 0 stands, 150 (the default) walks. Only blueprints of the game's creature kind listen to it. |
facing (optional) | number | The way the mesh faces as its creature's class turns it, in degrees. Default -90. The view starts in front of the model by it. |
scale (optional) | number | How much larger the game draws the creature than its mesh. The view fits every model to its box, so it changes nothing there. |
walks (optional) | boolean | True when there is a walk to play. game.Creatures:GetModel sets it; the view does not read it. |
against (optional) | WaxModelLook | Another model to be seen beside, such as a young animal's adult. This one is then as much smaller in its box as it is smaller than that one in the game, by the two meshes' sizes and their scale. It never fills less than four tenths of the box, and a model larger than the other fills the box as it would alone. Only mesh and scale of the other are read. |
WaxModelOptions
Extends WaxModelLook. Used by container:Model.
| Option | Type | Description |
|---|---|---|
mesh | string | Nothing shows until Show is called when this is left out. |
width | number | Default 240. |
height | number | As tall as it is wide when left out. |
size | number | The side of a square view, in place of width and height. |
align | "left" | "center" | "right" | Where the view sits in its line. Default "center". |
backdrop | WaxColor | boolean | A colour behind the model, or true for the theme's card colour. See-through when left out. |
spin | number | false | Degrees a second it turns by itself until the player touches it. Default 12. |
turn | boolean | False: the player cannot turn it. |
zoom | boolean | False: the wheel is left to the page. |
reset | boolean | False leaves out the small button that puts the view back. |
light | number | How bright the three lights are: 1 as designed, up to 4. At 0 the model is a dark shape. |
yaw | number | Where the view starts, in degrees round the model: 0 looks at its front, 90 at its right side. Default -40. |
pitch | number | How many degrees above the model the view starts. Default 10. Kept between -20 and 75. |
distance | number | How far away the view starts: 1 fits the model in the box. Default 1. Kept between 0.45 and 1.6. |
Named values
Short names for a fixed set of values. Where a function asks for one of these, pass one of the values listed.
WaxKind
One of "info", "good", "warn", "bad".
WaxCorner
One of "top-left", "top-right", "bottom-left", "bottom-right".
WaxAnchor
One of "top-left", "top", "top-right", "left", "center", "right", "bottom-left", "bottom", "bottom-right".
WaxNav
One of "side", "top".
WaxFontFamily
One of "ui", "mono", "plain".
WaxThemeName
One of "Midnight", "Graphite", "Abyss", "Dune", "Prospector", "Ember", "Aurora", "Nebula", "Rosewood", "Terminal", "Daylight", "Glacier", "Sandstone", or any other string.
WaxShape
One of "frame6", "frame8", "frame12", "top8", "glow12", "glow12_soft", "round2", "round3", "round4", "round5", "round6", "round7", "round8", "round9", "round10", "round12".