π»ui
Example available!
βοΈUI InteractionElements:
add_checkbox
ui.add_checkbox(name: string):
MenuItem
name
string
Item name
Creates and returns a menu item object, or throws an error on failure.
add_combobox
ui.add_combobox(name: string, items: {, ...}):
MenuItem
name
string
Item name
items
string
Items
Creates and returns a menu item object, or throws an error on failure.
add_sliderint
ui.add_sliderint(name: string, min: number, max: number):
MenuItem
name
string
Item name
min
number
Minimum value
max
number
Maximum value
Creates and returns a menu item object, or throws an error on failure.
add_sliderfloat
ui.add_sliderfloat(name: string, min: number, max: number):
MenuItem
name
string
Item name
min
number
Minimum value
max
number
Maximum value
Creates and returns a menu item object, or throws an error on failure.
add_button
ui.add_button(name: string):
MenuItem
name
string
Item name
Creates and returns a menu item object, or throws an error on failure.
add_colorpicker
ui.add_colorpicker(name: string):
MenuItem
name
string
Item name
Creates and returns a menu item object, or throws an error on failure.
add_label
ui.add_label(name: string):
MenuItem
name
string
Item name
Creates and returns a menu item object, or throws an error on failure.
add_hotkey
ui.add_hotkey(name: string):
MenuItem
name
string
Item name
Creates and returns a menu item object, or throws an error on failure.
add_input
ui.add_input(name: string):
MenuItem
name
string
Item name
Creates and returns a menu item object, or throws an error on failure.
get_keybind_state
ui.get_keybind_state(name: string)
name
string
Item name
Returns true
, if keybind is active.
get_keybind_mode
ui.get_keybind_mode(name: string)
name
string
Item name
Returns the keybind mode.
set_keybind_state
ui.set_keybind_state(name: string, var: boolean)
name
string
Item name
var
boolean
Item var
Sets the keybind boolean value.
Functions:
:get
<element>:get():
any
Returns the value of the menu item.
:set
<element>:set(value: any)
value
any
The value to which the menu item will be set
Sets the value of the menu item.
:set_visible
<element>:set_visible(state: boolean)
state
boolean
New visibility state
Shows or hides the menu item depending on the value of state
.
:set_callback
Works only in callbacks.
<element>:set_callback(callback: function)
callback
function
Function that will be called when the menu item is interacted with
Sets the callback to the specified menu item.
:set_group
<element>:set_group(group: number)
group
number
1
- Left group
2
- Right group
Sets the group to the specified menu item.
Combobox additive functions:
:set_items
<element>:set_items(items: {, ...})
items
string
Table with string values
Sets a table with items. ui.add_combobox
menu item objects only.
:get_items
<element>:get_items():
table
Returns the table of items. ui.add_combobox
menu item objects only.
Hotkey additive functions:
:get_mode
<element>:get_mode():
number
Returns the current keybind mode. ui.add_hotkey
menu item objects only.
Find menu items:
ui.find_menu_int(item_name: string):
MenuItem
item_name
string
-
Returns the MenuItem
object that corresponds to the specified name.
Last updated