on_draw(function)

creates a tab in scripting with lua name.

menu.on_draw(function()
    if ImGui.BeginTabBar("my_tabs") then   -- starts tab bar

        -- Tab 1
        if ImGui.BeginTabItem("Tab 1") then
            ImGui.Text("This is inside Tab 1")

            -- Open a header block
            ImGui.ListHeader("Quick Actions", 180)
            for i = 1, 10 do
                if ImGui.Button("Button " .. i) then
                    log.info("Clicked Button " .. i)
                end
            end
            ImGui.EndListHeader()         -- close header block

            ImGui.EndTabItem()            -- close Tab 1
        end

    end
end)

Last updated