menu

get_size

Returns size of menu as a vec2_t

vec2_t get_size()

Example

print(menu.get_size())

get_pos

Returns screen position of the menu as a vec2_t

vec2_t get_pos()

Example

print(menu.get_pos())

is_open

Returns if the menu is open

bool is_open()

Example

print("menu open:",menu.is_open())

find

Returns a control object or an array depending on the elements can return any of the menu controls

Note: When getting the value of an element inside any of these types of controls make sure to suffix it with "#" and the tab name

any find(<string> tab, <string> sub_tab, <string> group_name, <string> element_name)
FieldsDescription

tab string

tab name

sub_tab string

sub tab name

group_name string

group tab name

element_name string

element name

Example

local find_lock_layout = menu.find("misc","main","config","lock menu layout")
find_lock_layout:set(true)

-- when referencing a control that has sub-controls (like a colorpicker or keybinds) it will return an indexed table instead
local accent_color = menu.find("misc", "main", "config", "accent color")
-- accent_color[1] is the text
-- accent_color[2] is the color picker

-- or, alternatively...

local accent_color_text, accent_color_color = unpack(menu.find("misc", "main", "config", "accent color"))
--
local glow_enabled,glow_color = unpack(menu.find("visuals", "esp", "models","glow#enemy"))

set_group_column

places the target group in a column

text_t set_group_column(<string> group, int column)
FieldsDescription

group string

group which will be moved to the target column

column int

Example

menu.set_group_column("group", 1) -- place in left column

set_group_visibility

toggles visiblity for a group

text_t set_group_column(<string> group, bool visible)
FieldsDescription

group string

group which will be made visible or not

visible bool

Example

menu.set_group_visibility("group", false) -- hide group

Controls should only be created OUTSIDE of callbacks to avoid infinite controls being spawned

add_text

Creates a text control and returns it

text_t add_text(<string> group, <string> text)
FieldsDescription

group string

group in which the control will be placed (will be created if it doesnt already exist)

text string

text

Example

local text_item = menu.add_text("group", "test")

add_checkbox

Creates a checkbox control and returns it

checkbox_t add_checkbox(<string> group, <string> name, [optional] <bool> default_value)
FieldsDescription

group string

group in which the control will be placed (will be created if it doesnt already exist)

name string

checkbox name

checkbox_state bool

[optional] default value

Example

local checkbox_item = menu.add_checkbox("group", "checkyboxy", true)

add_selection

Creates a selection control and returns it

void add_selection(<string> group, <string> name, <table> items, [optional] <int> visible_items = 6)
FieldsDescription

group string

group name

name string

selection name

items bool

array of items

visible_items bool

[optional] items to show before showing a scrollbar

Example

local selection_item = menu.add_selection("group", "selecty", {"element1", "element2", "element3"})

add_slider

Creates a slider control and returns it

slider_t add_slider(<string> group, <string> name, <float> min, <float> max, [optional] <float> step = 1.0, [optional] <int> precision = 0, [optional] <string> suffix )
FieldsDescription

group string

group name

name string

name

min float

minimum slider value

max float

maximum slider value

step float

[optional]

precision int

[optional]

suffix string

[optional]

Example

local slider_item = menu.add_slider("group", "slidy", 1, 10)

add_button

Creates a button control and returns it

button_t button(<string> group, <string> name, <function> callback )
FieldsDescription

group string

group name

name string

button name

callback function

function executed on click

Example

menu.add_button("group", "text", function()
    print("hi")
end)

add_separator

Creates a separator control and returns it

void menu.add_separator(<string> group)
FieldsDescription

group string

group name

Example

menu.add_separator("group")

add_list

Creates a list control and returns it

list_t add_list(<string> group, <string> name, <table> items, [optional] <int> visible_items = 8)
FieldsDescription

group string

group name

name string

list name

items table

array of items

visible_items table

[optional] items to show

Example

local list_item = menu.add_list("group", "name", {"element1", "element2", "element3"})

add_text_input

Creates a text input control and returns it

text_input_t add_text_input(<string> group, <string> name)
FieldsDescription

group string

group name

name string

text input name

Example

local text_input_item = menu.add_text_input("group", "texty inputty")

add_multi_selection

Creates a multi selection control and returns it

multi_selection_t add_multi_selection(<string> group, <string> name, <table> items, [optional] <int> visible_items = 6)
FieldsDescription

group string

group name

name string

control name

items string

array of items

visible_items string

[optional]

Example

menu.add_multi_selection("test","test2",{"hi","test","prim","cool"})

Last updated