VERGELua API

ImGui

Immediate-mode GUI windows for your scripts. Each script's Begin opens its own real window, with native tabs.

ImGui.Begin(title:string, open:boolean?):boolean

Begin this script's own window; returns the master menu switch. Each script's Begin opens a separate window.

ImGui.End()

End the current window.

ImGui.BeginFrame(align:number?)

Start a bordered child frame inside a window; the align argument is unused.

ImGui.EndFrame()

End a layout frame.

ImGui.TabBar(label:string):boolean

Begin a native tab strip; always returns true. Add TabItem blocks inside.

ImGui.EndTabBar()

End the current tab strip.

ImGui.TabItem(label:string):boolean

A tab in the current strip; its body renders only while the tab is active.

ImGui.EndTabItem()

End the current tab.

ImGui.Text(fmt:string, ...)

Draw printf-style text; supports %d, %f, %s and %g specifiers.

ImGui.Button(label:string):boolean

Draw a button; returns true when clicked.

ImGui.Checkbox(label:string, value:boolean|number):boolean|number

Draw a checkbox; returns the new value in the input's type.

ImGui.Slider(label:string, value:number, min:number, max:number, step:number?, readOnly:boolean?):number

Draw a slider; returns the new value. Whole-number inputs render as int; step snaps to a grid.

ImGui.SliderFloat(label:string, value:number, min:number, max:number):number

Draw a float slider; returns the new value.

ImGui.SliderInt(label:string, value:number, min:number, max:number):number

Draw an integer slider; returns the new value.

ImGui.Progress(label:string, value:number, min:number, max:number):number

Draw a read-only progress bar showing value between min and max.

ImGui.Combo(label:string, current:number, items:table|string):number

Draw a dropdown from a 1-based array table (or NUL-joined string); returns the selected index.

ImGui.InputText(label:string, value:string):string

Draw a text input; returns the new text.

ImGui.ColorEdit4(label:string, r:number, g:number, b:number, a:number?):boolean, number, number, number, number

Draw a color picker; returns pressed and the new RGBA.

ImGui.CheckboxFlags(label:string, flags:number, flagBit:number):boolean, number

Toggle a bit flag; returns pressed and the new flags.

ImGui.Selectable(label:string, selected:boolean?):boolean, boolean

Draw a selectable row; returns pressed and the new state.

ImGui.RadioButton(label:string, active:boolean?):boolean

Draw a radio button; returns true when clicked.

ImGui.SetItemTooltip(text:string)

Show a hover tooltip on the previous widget.

ImGui.SameLine(offset:number?, spacing:number?)

Place the next widget on the same line.

ImGui.Separator()

Draw a horizontal separator line.

ImGui.NewLine()

Advance to the next line.

ImGui.Space(size:number)

Add vertical space of the given size.

ImGui.Dummy(x:number, y:number)

Add an invisible box to reserve layout space.

ImGui.GetCursorPos():number, number

Cursor position within the current window; returns the previous frame's value.

ImGui.GetContentRegionAvail():number, number

Available content-region size of the current window.

ImGui.GetWindowSize():number, number

Size of the current window.

ImGui.GetWindowPos():number, number

Position of the current window.

ImGui.SetCursorPos(x:number, y:number)

Move the cursor to a position in the window.

ImGui.GetVersion():number

Return the menu API version (0.66).

Examples

Settings menu with tabs

A working menu: tabs, checkboxes, sliders and a dropdown, wired to live state.

local cfg = {
    enabled = true,
    fov = 60,
    smooth = 1.0,
    boxes = true,
    target = 1,
}

callbacks.Register("Draw", function()
    if not ImGui.Begin("Verge example") then
        return
    end

    if ImGui.TabBar("main") then
        if ImGui.TabItem("Aimbot") then
            cfg.enabled = ImGui.Checkbox("Enabled", cfg.enabled)
            if cfg.enabled then
                cfg.fov = ImGui.Slider("FOV", cfg.fov, 0, 180)
                cfg.smooth = ImGui.SliderFloat("Smoothing", cfg.smooth, 0.1, 5.0)
            end
            ImGui.EndTabItem()
        end
        if ImGui.TabItem("Visuals") then
            cfg.boxes = ImGui.Checkbox("ESP boxes", cfg.boxes)
            cfg.target = ImGui.Combo("Targets", cfg.target, { "Enemies", "Everyone" })
            ImGui.EndTabItem()
        end
        if ImGui.TabItem("About") then
            ImGui.Text("Settings above are live.")
            if ImGui.Button("Reset") then
                cfg.fov = 60
                cfg.smooth = 1.0
            end
            ImGui.EndTabItem()
        end
        ImGui.EndTabBar()
    end

    ImGui.End()
end)