local menu = MenuV:CreateMenu('MenuV', 'Welcome to MenuV', 'topleft', 255, 0, 0)
Now you can start adding options to your menu by using the following functions: AddButton, AddCheckbox, AddSlider, AddRange and AddConfirm.
local button = menu:AddButton({ icon = '😃', label = 'Simple Button', value = 'YEA', description = 'Simple Button Description' })
local checkbox = menu:AddCheckbox({ icon = '😃', label = 'Simple Checkbox', value = false, description = 'Simple Checkbox Description' })
local slider = menu:AddCheckbox({ icon = '😃', label = 'Simple Slider', value = 1, description = 'Simple Slider Description', values = {
{ label ='Option #1', value =1 }, { label ='Option #2', value =2 }, { label ='Option #3', value =3 }}})local range = menu:AddRange({ icon = '😃', label = 'Simple Range', value = 0, description = 'Simple Range Description', min = 0, max = 10 })
local checkbox = menu:AddConfirm({ icon = '😃', label = 'Simple Confirm', value = false, description = 'Simple Confirm Description' })
local menu_button = menu:AddButton({ icon = '😃', label = 'Simple Menu Button', value = menu, description = 'Simple Menu Button Description' })
You can bind events by adding the name of events in the table while creating the item or after the item has been created and using the On function.
--- Bind event on item create functionlocal button = menu:AddButton({ icon = '😃', label = 'Simple Button', value = 'YEA', description = 'Simple Button Description', select = function(btn)
print('YOU PRESSED THE BUTTON WITH VALUE ' .. btn.Value)end})--- Bind event after item has been createdlocal button = menu:AddButton({ icon = '😃', label = 'Simple Button', value = 'YEA', description = 'Simple Button Description' })
--- When user pressed `ENTER` on the buttonbutton:On('select', function(btn)print('YOU PRESSED THE BUTTON WITH VALUE ' .. btn.Value)end)