π»ui
Example available!
βοΈpageUI InteractionElements:
add_checkbox
ui.add_checkbox(name: string):
MenuItem
Name | Type | Description |
---|---|---|
name |
| 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 | Type | Description |
---|---|---|
name |
| Item name |
items |
| 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 | Type | Description |
---|---|---|
name |
| Item name |
min |
| Minimum value |
max |
| 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 | Type | Description |
---|---|---|
name |
| Item name |
min |
| Minimum value |
max |
| Maximum value |
Creates and returns a menu item object, or throws an error on failure.
add_button
ui.add_button(name: string):
MenuItem
Name | Type | Description |
---|---|---|
name |
| Item name |
Creates and returns a menu item object, or throws an error on failure.
add_colorpicker
ui.add_colorpicker(name: string):
MenuItem
Name | Type | Description |
---|---|---|
name |
| Item name |
Creates and returns a menu item object, or throws an error on failure.
add_label
ui.add_label(name: string):
MenuItem
Name | Type | Description |
---|---|---|
name |
| Item name |
Creates and returns a menu item object, or throws an error on failure.
add_hotkey
ui.add_hotkey(name: string):
MenuItem
Name | Type | Description |
---|---|---|
name |
| Item name |
Creates and returns a menu item object, or throws an error on failure.
add_input
ui.add_input(name: string):
MenuItem
Name | Type | Description |
---|---|---|
name |
| 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 | Type | Description |
---|---|---|
name |
| Item name |
Returns true
, if keybind is active.
get_keybind_mode
ui.get_keybind_mode(name: string)
Name | Type | Description |
---|---|---|
name |
| Item name |
Returns the keybind mode.
set_keybind_state
ui.set_keybind_state(name: string, var: boolean)
Name | Type | Description |
---|---|---|
name |
| Item name |
var |
| Item var |
Sets the keybind boolean value.
Functions:
:get
<element>:get():
any
Returns the value of the menu item.
:set
<element>:set(value: any)
Name | Type | Description |
---|---|---|
value |
| The value to which the menu item will be set |
Sets the value of the menu item.
:set_visible
<element>:set_visible(state: boolean)
Name | Type | Description |
---|---|---|
state |
| 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)
Name | Type | Description |
---|---|---|
callback |
| 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)
Name | Type | Description |
---|---|---|
group |
|
|
Sets the group to the specified menu item.
Combobox additive functions:
:set_items
<element>:set_items(items: {, ...})
Name | Type | Description |
---|---|---|
items |
| 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
Name | Type | Description |
---|---|---|
item_name |
| - |
Returns the MenuItem
object that corresponds to the specified name.
Last updated