The synq.UI:New() function creates a new UI instance and returns three important objects you'll use throughout your project.
Parameters:
Returns:
ui:Tab("Tabname")var option you set for each elementsynq.UI:New(name, config) : gui, settings, cmd
local Unlocker, synq, example = ...
local ui, settings, cmd = synq.UI:New("example", {
title = "BM Hunter Settings",
colors = {
title = {255, 215, 0, 1},
primary = {255, 255, 255, 1},
accent = {255, 191, 0, 1},
background = {15, 15, 20, 0.85},
}
})
example.settings = settings
-- Use settings from UI in your BM Hunter routine logic
if player.hp <= settings.exhilarationHP then
exhilaration()
end
-- Add custom slash commands to extend the UI command functionality
cmd:New(function(msg)
if msg == "burst" then
synq.burst = not synq.burst
synq.alert("Burst mode " .. (synq.burst and "enabled" or "disabled"), 19574)
-- Returning true officially registers this command handler
return true
end
end)
You can pass title as a string, or an array of strings for multi-colored titles:
title = {"example", "ui"},
For multi-colored titles, pass a matching array of RGBA colors:
local gold, amber = {255, 215, 0, 1}, {255, 191, 0, 1}
-- ...
colors = {
title = {gold, amber},
-- ...
}
SYNQ UI uses red, green, blue, alpha color format. r/g/b 0-255, alpha 0-1.
colors = {
primary = {255, 255, 255, 1}, -- general purpose text
accent = {255, 191, 0, 1}, -- checkboxes, sliders, scroll bars (amber)
background = {15, 15, 20, 0.85}, -- background color (dark with slight blue tint)
tertiary = {r, g, b, a}, -- sidebar and minor elements
}
UI:New('example', {
width = 350,
height = 225,
scale = 1.2
})
Defaults:
width = 325height = 195scale = 1true to open UI on each loadfalse to disable the sidebar under tabsNext: Learn how to create and manage Tabs & Groups.