Script UI
Menu controls and HUD windows.
Controls
Section titled Controls-- The script's sidebar tab: a title and an iconui.sidebar("Radar", "crosshairs")
local enabled = ui.toggle("enabled", "Enabled", true)local size = ui.slider_int("size", "Size", 100, 400, 200)local mode = ui.combo("mode", "Mode", { "Dots", "Names" }, 1)local tint = ui.color("tint", "Colour", color(150, 120, 255))
-- Hide the size slider while the toggle is offenabled:on_change(function(on) size:visible(on)end)-- on_change only runs on a menu edit, so set it once for the saved valuesize:visible(enabled:get())
print(size:get(), mode:get(), tint:get())Controls show on the script's own tab in the sidebar, in the order you create them. All of them are on the ui page.
- The first argument is the control's id: 1 to 32 letters, digits,
_or-. - Values are saved in the active config.
ui.sidebartakes a Font Awesome Free solid icon name. An unknown name falls back tofile-code.
Windows
Section titled Windowslocal window = ui.window("info", "Info", vector.create(200, 60, 0))local font = render.font("ui", 15)
window:on_paint(function(r) -- r works like render, relative to the window's top-left r.text(font, vector.create(8, 8, 0), color(255, 255, 255), game.map())end)Nyx draws the window's frame. Open the menu to drag it. Its position is saved. The render.*_3d functions don't work in a window.
Limits
Section titled LimitsA script can have 128 controls and 8 windows. The rest are on the Limits page.
Nyx Lua API v1 · release commit-4b659d9c3810 · d0f772c99281