ImGui class
ImGui.Begin
function ImGui.Begin(name) endWe recommend you refer to ImGuis docs regarding flags.
Begins a new ImGui window.
Parameters
name: string: The window name.
Returns
- nil:
ImGui.End
function ImGui.End() endEnds the current ImGui window.
Returns
- nil:
ImGui.BeginChild
function ImGui.BeginChild(name, size, child_flags, window_flags) endBegins a child window.
Parameters
name: string: The child window name.size: table: The size of the child window, in pixels. Format:child_flags: boolean|nil: ImGuiChildFlags.window_flags: number|nil: ImGuiWindowFlags.
Returns
- nil:
ImGui.BeginChildID
function ImGui.BeginChildID(id, size, child_flags, window_flags) endBegins a child window using an ID.
Parameters
id: number: The ImGui ID.size: table: The size of the child window, in pixels. Format:child_flags: number|nil: ImGuiChildFlags.window_flags: number|nil: ImGuiWindowFlags.
Returns
- nil:
ImGui.BeginChildFrame
function ImGui.BeginChildFrame(id, size, flags) endBegins a child frame.
Parameters
id: number: The ImGui ID.size: table: The size of the frame, in pixels. Format:flags: number|nil: ImGuiWindowFlags.
Returns
- nil:
ImGui.BeginCombo
function ImGui.BeginCombo(name, previewValue, flags) endBegins a combo box.
Parameters
name: string: The combo box name.previewValue: string: The preview value to display.flags: number|nil: ImGuiComboFlags.
Returns
- boolean: True if the combo box is open.
ImGui.BeginDragDropSource
function ImGui.BeginDragDropSource(flags) endBegins a drag and drop source.
Parameters
flags: number|nil: ImGuiDragDropFlags.
Returns
- boolean: True if the drag and drop source has begun.
ImGui.BeginDragDropTarget
function ImGui.BeginDragDropTarget() endBegins a drag and drop target.
Returns
- boolean: True if a drag and drop target is available.
ImGui.BeginGroup
function ImGui.BeginGroup() endBegins an ImGui group.
Returns
- nil:
ImGui.BeginMainMenuBar
function ImGui.BeginMainMenuBar() endBegins the main menu bar.
Returns
- boolean: True if the main menu bar is active.
ImGui.BeginMenu
function ImGui.BeginMenu(name, enabled) endBegins a menu.
Parameters
name: string: The menu name.enabled: boolean|nil: Whether the menu is enabled.
Returns
- boolean: True if the menu is open.
ImGui.BeginMainMenuBar
function ImGui.BeginMainMenuBar() endBegins a main menu bar.
Returns
- boolean: True if the menu bar is open.
ImGui.BeginPopup
function ImGui.BeginPopup(name, flags) endBegins a popup window.
Parameters
name: string: The popup window name.flags: number|nil: ImGuiWindowFlags.
Returns
- boolean: True if the popup began.
ImGui.BeginPopupContextItem
function ImGui.BeginPopupContextItem(name, flags) endBegins a context popup for an item.
Parameters
name: string|nil: The context popup name.flags: number|nil: ImGuiPopupFlags.
Returns
- boolean: True if the context popup began.
ImGui.BeginPopupContextVoid
function ImGui.BeginPopupContextVoid(name, flags) endBegins a context popup for a void area.
Parameters
name: string|nil: The context popup name.flags: number|nil: ImGuiPopupFlags.
Returns
- boolean: True if the context popup began.
ImGui.BeginTabBar
function ImGui.BeginTabBar(name, flags) endBegins a tab bar.
Parameters
name: string: The tab bar name.flags: number|nil: ImGuiTabBarFlags.
Returns
- boolean: True if the tab bar began.
ImGui.BeginTable
function ImGui.BeginTable(name, column, outer_size, inner_width) endBegins a table.
Parameters
name: string: The table name.column: number: Number of columns.outer_size: table: The outer size, in pixels. Format:inner_width: number|nil: The inner width.
Returns
- boolean: True if the table began.
ImGui.BeginTooltip
function ImGui.BeginTooltip() endBegins a tooltip.
Returns
- nil:
ImGui.Bullet
function ImGui.Bullet() endDisplays a bullet point.
Returns
- nil:
ImGui.BulletText
function ImGui.BulletText(text) endDisplays bullet text.
Parameters
text: string: The text to display.
Returns
- nil:
ImGui.Button
function ImGui.Button(label, size) endCreates a button.
Parameters
label: string: The button label.size: table|nil: The size of the button, in pixels. Format:
Returns
- boolean: True if the button was pressed.
ImGui.CloseCurrentPopup
function ImGui.CloseCurrentPopup() endCloses the current popup.
Returns
- nil:
ImGui.CollapsingHeader
function ImGui.CollapsingHeader(label, flags) endCreates a collapsing header.
Parameters
label: string: The header label.flags: number|nil: ImGuiTreeNodeFlags.
Returns
- boolean: True if the header is open.
ImGui.ColorButton
function ImGui.ColorButton(desc_id, color, size) endCreates a color button.
Parameters
desc_id: string: The description ID.color: table: The color of the button, in RGBA. Format:size: table|nil: The size of the button, in pixels. Format:
Returns
- boolean: True if the color button was pressed.
ImGui.Text
function ImGui.Text(text) endDisplays text.
Parameters
text: string: The text to display.
Returns
- nil:
ImGui.InputText
function ImGui.InputText(label, text) endCreates an editable text input field.
Parameters
label: string: The label for the text input field.text: string: The current text (mutable reference recommended).
Returns
- string: The updated text after user input.
ImGui.GetBackgroundDrawList
function ImGui.GetBackgroundDrawList() endGets the background draw list.
Returns
- ImDrawList: The background draw list.
ImGui.GetForegroundDrawList
function ImGui.GetForegroundDrawList() endGets the foreground draw list.
Returns
- ImDrawList: The foreground draw list.
ImGui.GetWindowDrawList
function ImGui.GetWindowDrawList() endGets the window draw list.
Returns
- ImDrawList: The window draw list.
ImGui.SameLine
function ImGui.SameLine(offset, spacing) endContinues drawing on the same line instead of moving to a new line.
Parameters
offset: number|nil: X offset from the start of the line in pixels. Use0to place immediately after the previous widget.spacing: number|nil: Spacing between the previous item and the new item in pixels. Use-1for default spacing.
Returns
- nil:
ImGui.GetDrawData
function ImGui.GetDrawData() endGets the current draw data.
Returns
- any: The draw data.
ImGui.SetNextWindowSize
function ImGui.SetNextWindowSize(size, flags) endSets the next window size.
Parameters
size: table: The size of the next window, in pixels. Format:flags: number|nil: ImGuiCond.
Returns
- nil:
ImGui.SetNextWindowPos
function ImGui.SetNextWindowPos(pos, pivot) endSets the next window position.
Parameters
pos: table: The position of the new window, in pixels. Format:pivot: table|nil: The pivot of the new window, in pixels. Format:
Returns
- nil:
ImGui.SetNextWindowBgAlpha
function ImGui.SetNextWindowBgAlpha(alpha) endSets the next window background alpha.
Parameters
alpha: number: The background alpha value.
Returns
- nil:
ImGui.SetNextWindowCollapsed
function ImGui.SetNextWindowCollapsed(collapsed) endSets whether the next window is collapsed.
Parameters
collapsed: boolean: The collapsed state.
Returns
- nil:
ImGui.SetNextWindowFocus
function ImGui.SetNextWindowFocus() endSets focus to the next window.
Returns
- nil:
ImGui.SetNextWindowContentSize
function ImGui.SetNextWindowContentSize(size) endSets the next window content size.
Parameters
size: table: The size of the next content, in pixels. Format:
Returns
- nil:
ImGui.IsKeyDown
function ImGui.IsKeyDown(key) endChecks if a key is down.
Parameters
key: number: The key code.
Returns
- boolean: True if the key is down.
ImGui.IsKeyPressed
function ImGui.IsKeyPressed(key, key_repeat) endChecks if a key is pressed.
Parameters
key: number: The key code.key_repeat: boolean: If the key should repeat.
Returns
- boolean: True if the key is pressed.
ImGui.IsKeyPressed
function ImGui.IsKeyPressed(key) endChecks if a key is pressed.
Parameters
key: number: The key code.
Returns
- boolean: True if the key is pressed.
ImGui.IsKeyReleased
function ImGui.IsKeyReleased(key) endChecks if a key is released.
Parameters
key: number: The key code.
Returns
- boolean: True if the key is released.
ImGui.IsMouseDown
function ImGui.IsMouseDown(button) endChecks if a mouse button is down.
Parameters
button: number: The mouse button index.
Returns
- boolean: True if the mouse button is down.
ImGui.IsMouseClicked
function ImGui.IsMouseClicked(button, mouse_repeat) endChecks if a mouse button is clicked.
Parameters
button: number: The mouse button index.mouse_repeat: boolean: If the mouse click should repeat.
Returns
- boolean: True if the mouse button was clicked.
ImGui.IsMouseClicked
function ImGui.IsMouseClicked(button) endChecks if a mouse button is clicked.
Parameters
button: number: The mouse button index.
Returns
- boolean: True if the mouse button was clicked.
ImGui.IsMouseReleased
function ImGui.IsMouseReleased(button) endChecks if a mouse button is released.
Parameters
button: number: The mouse button index.
Returns
- boolean: True if the mouse button was released.
ImGui.GetMousePos
function ImGui.GetMousePos() endReturns the position of your mouse.
Returns
- Vector2: the position of your mouse.
ImGui.GetDisplaySize
function ImGui.GetDisplaySize() endReturns the size of the Minecraft window.
Returns
- Vector2: the width and height of the window in pixels.
ImGui.GetFrameRate
function ImGui.GetFrameRate() endReturns Minecraft's framerate in floating point numbers.
Returns
- number: the current framerate.
ImGui.GetDeltaTime
function ImGui.GetDeltaTime() endReturns the time taken to render one frame, in seconds.
Returns
- number: The delta time
Reference: imgui.lua