< GeeXLab Reference Guide />

> Back to Reference Guide Index


gh_imgui library

Description

gh_imgui is the module that manages the ImGui library and allows to draw widgets. Available in GeeXLab 0.17+.


Number of functions: 99

  1. gh_imgui.button (Lua - Python)
  2. gh_imgui.button_arrow (Lua - Python)
  3. gh_imgui.begin_child (Lua - Python)
  4. gh_imgui.end_child (Lua - Python)
  5. gh_imgui.calc_text_size (Lua - Python)
  6. gh_imgui.checkbox (Lua - Python)
  7. gh_imgui.collapsing_header (Lua - Python)
  8. gh_imgui.color_edit_rgba (Lua - Python)
  9. gh_imgui.color_edit_rgba_v2 (Lua - Python)
  10. gh_imgui.color_picker_rgba (Lua - Python)
  11. gh_imgui.color_picker_rgba_v2 (Lua - Python)
  12. gh_imgui.columns (Lua - Python)
  13. gh_imgui.column_get_width (Lua - Python)
  14. gh_imgui.column_set_width (Lua - Python)
  15. gh_imgui.column_get_offset (Lua - Python)
  16. gh_imgui.column_set_offset (Lua - Python)
  17. gh_imgui.column_next (Lua - Python)
  18. gh_imgui.combo_box_create (Lua - Python)
  19. gh_imgui.combo_box_add_item (Lua - Python)
  20. gh_imgui.combo_box_draw (Lua - Python)
  21. gh_imgui.list_box_draw (Lua - Python)
  22. gh_imgui.frame_begin (Lua - Python)
  23. gh_imgui.frame_begin_v2 (Lua - Python)
  24. gh_imgui.frame_end (Lua - Python)
  25. gh_imgui.dummy (Lua - Python)
  26. gh_imgui.add_font_from_file (Lua - Python)
  27. gh_imgui.add_font_from_zip_file (Lua - Python)
  28. gh_imgui.add_font_from_buffer (Lua - Python)
  29. gh_imgui.rebuild_all_fonts (Lua - Python)
  30. gh_imgui.push_font (Lua - Python)
  31. gh_imgui.pop_font (Lua - Python)
  32. gh_imgui.set_default_font (Lua - Python)
  33. gh_imgui.reset_default_font (Lua - Python)
  34. gh_imgui.add_line_to_drawlist (Lua - Python)
  35. gh_imgui.add_bezier_curve_to_drawlist (Lua - Python)
  36. gh_imgui.add_circle_to_drawlist (Lua - Python)
  37. gh_imgui.add_quad_to_drawlist (Lua - Python)
  38. gh_imgui.show_demo_window (Lua - Python)
  39. gh_imgui.show_metrics_window (Lua - Python)
  40. gh_imgui.get_content_region_available_width (Lua - Python)
  41. gh_imgui.get_font_size (Lua - Python)
  42. gh_imgui.get_version (Lua - Python)
  43. gh_imgui.get_window_pos_size (Lua - Python)
  44. gh_imgui.get_window_size (Lua - Python)
  45. gh_imgui.gizmo_begin_frame (Lua - Python)
  46. gh_imgui.gizmo_set_rect (Lua - Python)
  47. gh_imgui.gizmo_manipulate (Lua - Python)
  48. gh_imgui.gizmo_decompose_matrix_to_components (Lua - Python)
  49. gh_imgui.gizmo_enable (Lua - Python)
  50. gh_imgui.gizmo_is_over (Lua - Python)
  51. gh_imgui.gizmo_is_using (Lua - Python)
  52. gh_imgui.group_begin (Lua - Python)
  53. gh_imgui.group_end (Lua - Python)
  54. gh_imgui.image (Lua - Python)
  55. gh_imgui.image_button (Lua - Python)
  56. gh_imgui.init (Lua - Python)
  57. gh_imgui.is_item_clicked (Lua - Python)
  58. gh_imgui.is_any_item_hovered (Lua - Python)
  59. gh_imgui.is_item_hovered (Lua - Python)
  60. gh_imgui.is_window_hovered (Lua - Python)
  61. gh_imgui.is_any_window_hovered (Lua - Python)
  62. gh_imgui.list_clipping_begin (Lua - Python)
  63. gh_imgui.list_clipping_end (Lua - Python)
  64. gh_imgui.menu_begin_main_bar (Lua - Python)
  65. gh_imgui.menu_end_main_bar (Lua - Python)
  66. gh_imgui.menu_begin_bar (Lua - Python)
  67. gh_imgui.menu_end_bar (Lua - Python)
  68. gh_imgui.menu_begin (Lua - Python)
  69. gh_imgui.menu_end (Lua - Python)
  70. gh_imgui.menu_item (Lua - Python)
  71. gh_imgui.progress_bar (Lua - Python)
  72. gh_imgui.pop_item_width (Lua - Python)
  73. gh_imgui.push_item_width (Lua - Python)
  74. gh_imgui.radio_button (Lua - Python)
  75. gh_imgui.set_color (Lua - Python)
  76. gh_imgui.get_color (Lua - Python)
  77. gh_imgui.set_style_colors (Lua - Python)
  78. gh_imgui.set_tooltip (Lua - Python)
  79. gh_imgui.show_test_window (Lua - Python)
  80. gh_imgui.set_cur_font_display_offset (Lua - Python)
  81. gh_imgui.get_cur_font_display_offset (Lua - Python)
  82. gh_imgui.selectable (Lua - Python)
  83. gh_imgui.set_frame_border_size (Lua - Python)
  84. gh_imgui.set_frame_rounding (Lua - Python)
  85. gh_imgui.set_next_window_content_size (Lua - Python)
  86. gh_imgui.set_window_border_size (Lua - Python)
  87. gh_imgui.set_window_rounding (Lua - Python)
  88. gh_imgui.slider_1f (Lua - Python)
  89. gh_imgui.slider_1i (Lua - Python)
  90. gh_imgui.slider_4f (Lua - Python)
  91. gh_imgui.terminate (Lua - Python)
  92. gh_imgui.text (Lua - Python)
  93. gh_imgui.text_rgba (Lua - Python)
  94. gh_imgui.text_wrapped (Lua - Python)
  95. gh_imgui.vslider_1f (Lua - Python)
  96. gh_imgui.vslider_1i (Lua - Python)
  97. gh_imgui.window_begin (Lua - Python)
  98. gh_imgui.window_begin_v2 (Lua - Python)
  99. gh_imgui.window_end (Lua - Python)



button

Description

Create a button.


Syntax

pressed = gh_imgui.button(
 label,
 size_x, size_y
)

Languages

Lua - Python


Parameters


Return Values


Code sample


pressed = gh_imgui.button("Fire", 200, 20)
            


button_arrow

Description

Create a arrow shaped button.


Syntax

pressed = gh_imgui.button_arrow(
 label,
 direction
)

Languages

Lua - Python


Parameters


Return Values


Code sample


pressed = gh_imgui.button_arrow("Fire", 1)
            


begin_child

Description

Begins a scrolling region.


Syntax

gh_imgui.begin_child(
 label,
 w, h,
 border,
 flags
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.begin_child(label, w, h, border, flags)
            


end_child

Description

End a scrolling region.


Syntax

gh_imgui.end_child()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_imgui.end_child()
            


calc_text_size

Description

Returns the size (width and height) of a string.


Syntax

x, y = gh_imgui.calc_text_size(
 text
)

Languages

Lua - Python


Parameters


Return Values


Code sample


x, y = gh_imgui.calc_text_size("Hello")
            


checkbox

Description

Create a checkbox.


Syntax

checked = gh_imgui.checkbox(
 label,
 initial_state
)

Languages

Lua - Python


Parameters


Return Values


Code sample


checked = gh_imgui.checkbox("Wireframe", 0)
            


collapsing_header

Description

Creates an header that can be opened or closed.


Syntax

checked = gh_imgui.collapsing_header(
 label,
 flags
)

Languages

Lua - Python


Parameters


Return Values


Code sample


local flags = 0 -- default            
if (gh_imgui.collapsing_header(label, flags) == 1) then
  ...
end
            


color_edit_rgba

Description

Displays a 4D slider with color picker.


Syntax

r, g, b, a = gh_imgui.color_edit_rgba(
 label,
 r0, b0, g0, a0
)

Languages

Lua - Python


Parameters


Return Values


Code sample


r, g, b, a = gh_imgui.color_edit_rgba("coloredit01", r0, b0, g0, a0)
            


color_edit_rgba_v2

Description

Displays a 4D slider with color picker.


Syntax

r, g, b, a = gh_imgui.color_edit_rgba_v2(
 label,
 r0, b0, g0, a0,
 flags
)

Languages

Lua - Python


Parameters


Return Values


Code sample


ImGuiColorEditFlags_NoAlpha = 2 -- ColorEdit, ColorPicker, ColorButton: ignore Alpha component (read 3 components from the input pointer).
ImGuiColorEditFlags_NoPicker = 4 -- ColorEdit: disable picker when clicking on colored square.
ImGuiColorEditFlags_NoOptions = 8 -- ColorEdit: disable toggling options menu when right-clicking on inputs/small preview.
ImGuiColorEditFlags_NoSmallPreview = 16-- ColorEdit, ColorPicker: disable colored square preview next to the inputs. (e.g. to show only the inputs)
ImGuiColorEditFlags_NoInputs = 32 -- ColorEdit, ColorPicker: disable inputs sliders/text widgets (e.g. to show only the small preview colored square).
ImGuiColorEditFlags_NoTooltip = 64 -- ColorEdit, ColorPicker, ColorButton: disable tooltip when hovering the preview.
ImGuiColorEditFlags_NoLabel = 128 -- ColorEdit, ColorPicker: disable display of inline text label (the label is still forwarded to the tooltip and picker).
ImGuiColorEditFlags_NoSidePreview = 256 -- ColorPicker: disable bigger color preview on right side of the picker, use small colored square preview instead.
-- User Options (right-click on widget to change some of them). You can set application defaults using SetColorEditOptions(). The idea is that you probably don't want to override them in most of your calls, let the user choose and/or call SetColorEditOptions() during startup.
ImGuiColorEditFlags_AlphaBar = 512 -- ColorEdit, ColorPicker: show vertical alpha bar/gradient in picker.
ImGuiColorEditFlags_AlphaPreview = 1024 -- ColorEdit, ColorPicker, ColorButton: display preview as a transparent color over a checkerboard, instead of opaque.
ImGuiColorEditFlags_AlphaPreviewHalf = 2048 -- ColorEdit, ColorPicker, ColorButton: display half opaque / half checkerboard, instead of opaque.
ImGuiColorEditFlags_HDR = 4096 --  (WIP) ColorEdit: Currently only disable 0.0f..1.0f limits in RGBA edition (note: you probably want to use ImGuiColorEditFlags_Float flag as well).
ImGuiColorEditFlags_RGB = 8192 -- [Inputs] ColorEdit: choose one among RGB/HSV/HEX. ColorPicker: choose any combination using RGB/HSV/HEX.
ImGuiColorEditFlags_HSV = 16384 -- [Inputs]     
ImGuiColorEditFlags_HEX = 32768 -- [Inputs] 
ImGuiColorEditFlags_Uint8 = 65536 -- [DataType]   // ColorEdit, ColorPicker, ColorButton: _display_ values formatted as 0..255. 
ImGuiColorEditFlags_Float = 131072 --  [DataType]   // ColorEdit, ColorPicker, ColorButton: _display_ values formatted as 0.0f..1.0f floats instead of 0..255 integers. No round-trip of value via integers.
ImGuiColorEditFlags_PickerHueBar = 262144 -- [PickerMode] // ColorPicker: bar for Hue, rectangle for Sat/Value.
ImGuiColorEditFlags_PickerHueWheel = 524288 -- [PickerMode] // ColorPicker: wheel for Hue, triangle for Sat/Value.
            
flags = ImGuiColorEditFlags_NoInputs            
r, g, b, a = gh_imgui.color_edit_rgba_v2("coloredit01", r0, b0, g0, a0, flags)
            


color_picker_rgba

Description

Displays a color picker.


Syntax

r, g, b, a = gh_imgui.color_picker_rgba(
 label,
 r0, b0, g0, a0
)

Languages

Lua - Python


Parameters


Return Values


Code sample


r, g, b, a = gh_imgui.color_picker_rgba("coloredit01", r0, b0, g0, a0)
            


color_picker_rgba_v2

Description

Displays a color picker.


Syntax

r, g, b, a = gh_imgui.color_picker_rgba_v2(
 label,
 r0, b0, g0, a0,
 flags
)

Languages

Lua - Python


Parameters


Return Values


Code sample


ImGuiColorEditFlags_NoAlpha = 2 -- ColorEdit, ColorPicker, ColorButton: ignore Alpha component (read 3 components from the input pointer).
ImGuiColorEditFlags_NoPicker = 4 -- ColorEdit: disable picker when clicking on colored square.
ImGuiColorEditFlags_NoOptions = 8 -- ColorEdit: disable toggling options menu when right-clicking on inputs/small preview.
ImGuiColorEditFlags_NoSmallPreview = 16-- ColorEdit, ColorPicker: disable colored square preview next to the inputs. (e.g. to show only the inputs)
ImGuiColorEditFlags_NoInputs = 32 -- ColorEdit, ColorPicker: disable inputs sliders/text widgets (e.g. to show only the small preview colored square).
ImGuiColorEditFlags_NoTooltip = 64 -- ColorEdit, ColorPicker, ColorButton: disable tooltip when hovering the preview.
ImGuiColorEditFlags_NoLabel = 128 -- ColorEdit, ColorPicker: disable display of inline text label (the label is still forwarded to the tooltip and picker).
ImGuiColorEditFlags_NoSidePreview = 256 -- ColorPicker: disable bigger color preview on right side of the picker, use small colored square preview instead.
-- User Options (right-click on widget to change some of them). You can set application defaults using SetColorEditOptions(). The idea is that you probably don't want to override them in most of your calls, let the user choose and/or call SetColorEditOptions() during startup.
ImGuiColorEditFlags_AlphaBar = 512 -- ColorEdit, ColorPicker: show vertical alpha bar/gradient in picker.
ImGuiColorEditFlags_AlphaPreview = 1024 -- ColorEdit, ColorPicker, ColorButton: display preview as a transparent color over a checkerboard, instead of opaque.
ImGuiColorEditFlags_AlphaPreviewHalf = 2048 -- ColorEdit, ColorPicker, ColorButton: display half opaque / half checkerboard, instead of opaque.
ImGuiColorEditFlags_HDR = 4096 --  (WIP) ColorEdit: Currently only disable 0.0f..1.0f limits in RGBA edition (note: you probably want to use ImGuiColorEditFlags_Float flag as well).
ImGuiColorEditFlags_RGB = 8192 -- [Inputs] ColorEdit: choose one among RGB/HSV/HEX. ColorPicker: choose any combination using RGB/HSV/HEX.
ImGuiColorEditFlags_HSV = 16384 -- [Inputs]     
ImGuiColorEditFlags_HEX = 32768 -- [Inputs] 
ImGuiColorEditFlags_Uint8 = 65536 -- [DataType]   // ColorEdit, ColorPicker, ColorButton: _display_ values formatted as 0..255. 
ImGuiColorEditFlags_Float = 131072 --  [DataType]   // ColorEdit, ColorPicker, ColorButton: _display_ values formatted as 0.0f..1.0f floats instead of 0..255 integers. No round-trip of value via integers.
ImGuiColorEditFlags_PickerHueBar = 262144 -- [PickerMode] // ColorPicker: bar for Hue, rectangle for Sat/Value.
ImGuiColorEditFlags_PickerHueWheel = 524288 -- [PickerMode] // ColorPicker: wheel for Hue, triangle for Sat/Value.
            
flags = ImGuiColorEditFlags_NoInputs            
r, g, b, a = gh_imgui.color_picker_rgba_v2("coloredit01", r0, b0, g0, a0, flags)
            


columns

Description

Starts/ends a column layout.


Syntax

gh_imgui.columns(
 count,
 border
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.columns(2, 1)

-- display widgets
...

-- next column
gh_imgui.column_next()
-- display widgets
...


-- reset to default layout (one column)
gh_imgui.columns(1, 0)
            


column_get_width

Description

Gets the width of a particular column.


Syntax

width = gh_imgui.column_get_width(
 index
)

Languages

Lua - Python


Parameters


Return Values


Code sample


width = gh_imgui.column_get_width(index)
            


column_set_width

Description

Sets the width of a particular column.


Syntax

gh_imgui.column_set_width(
 index,
 width
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.column_set_width(index, width)
            


column_get_offset

Description

Gets the offset of a particular column.


Syntax

offset = gh_imgui.column_get_offset(
 index
)

Languages

Lua - Python


Parameters


Return Values


Code sample


offset = gh_imgui.column_get_offset(index)
            


column_set_offset

Description

Sets the offset of a particular column.


Syntax

gh_imgui.column_set_offset(
 index,
 offset
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.column_set_offset(index, width)
            


column_next

Description

Starts a new column.


Syntax

gh_imgui.column_next()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_imgui.columns(2, 1)

-- display widgets
...

-- next column
gh_imgui.column_next()
-- display widgets
...


-- reset to default layout (one column)
gh_imgui.columns(1, 0)
            


combo_box_create

Description

Creates a combo box. Must be called once (usually in an INIT script).


Syntax

id = gh_imgui.combo_box_create(
 label
)

Languages

Lua - Python


Parameters


Return Values


Code sample


cbid = gh_imgui.combo_box_create(label)
            


combo_box_add_item

Description

Adds an item to a combo box.


Syntax

gh_imgui.combo_box_add_item(
 cbid,
 item_label
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.combo_box_add_item(cbid, "Item1")
            


combo_box_draw

Description

Draws the combo box.


Syntax

selected_item = gh_imgui.combo_box_draw(
 cbid,
 initial_selected_item
)

Languages

Lua - Python


Parameters


Return Values


Code sample


selected_item = gh_imgui.combo_box_draw(cbid, 0)
            


list_box_draw

Description

Draws a combo box as a list box.


Syntax

selected_item = gh_imgui.list_box_draw(
 cbid,
 initial_selected_item
)

Languages

Lua - Python


Parameters


Return Values


Code sample


selected_item = gh_imgui.list_box_draw(cbid, 0)
            


frame_begin

Description

Begins ImGui rendering. This is the first function to call in a FRAME script before any other gh_imgui functions.


Syntax

gh_imgui.frame_begin(
 width, height,
 mouse_x, mouse_y,
 mouse_left_button, mouse_right_button,
 dt
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.frame_begin(winW, winH, mouse_x, mouse_y, mouse_left_button, mouse_right_button, dt)
            


frame_begin_v2

Description

Begins ImGui rendering. This is the first function to call in a FRAME script before any other gh_imgui functions.


Syntax

gh_imgui.frame_begin_v2(
 width, height,
 mouse_x, mouse_y,
 mouse_left_button, mouse_right_button,
 mouse_wheel,
 dt
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.frame_begin_v2(winW, winH, mouse_x, mouse_y, mouse_left_button, mouse_right_button, mouse_wheel, dt)
            


frame_end

Description

Ends ImGui rendering. This is the last function to call in a FRAME script after other gh_imgui functions.


Syntax

gh_imgui.frame_end()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_imgui.frame_end()
            


dummy

Description

Places an invisible widget (box). Useful for layout management.


Syntax

gh_imgui.dummy(
 width, height
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.dummy(10, 5)
            


add_font_from_file

Description

Adds a new font to the ImGui engine.


Syntax

fid = gh_imgui.add_font_from_file(
 font_filename,
 font_size
)

Languages

Lua - Python


Parameters


Return Values


Code sample


fontid = gh_imgui.add_font_from_file(font_filename, 24)
            


add_font_from_zip_file

Description

Adds a new font from a zip file to the ImGui engine.


Syntax

fid = gh_imgui.add_font_from_zip_file(
 zip_filename,
 font_filename,
 font_size
)

Languages

Lua - Python


Parameters


Return Values


Code sample


fontid = gh_imgui.add_font_from_zip_file(zip_filename, font_filename, 24)
            


add_font_from_buffer

Description

Adds a new font from a memory buffer.


Syntax

fid = gh_imgui.add_font_from_buffer(
 buffer_ptr,
 buffer_size,
 font_size
)

Languages

Lua - Python


Parameters


Return Values


Code sample


filename = demo_dir .. "assets/arial.ttf"
buffer, buffer_size = gh_utils.file_buffer_create(filename)
fontid = gh_imgui.add_font_from_buffer(buffer, buffer_size, 24)
gh_utils.file_buffer_kill(buffer)
            


rebuild_all_fonts

Description

Rebuild all fonts once all fonts have been added with add_font_from_file().


Syntax

gh_imgui.rebuild_all_fonts()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_imgui.rebuild_all_fonts()
            


push_font

Description

Saves the current font and makes a new font the current active font for next text rendering calls.


Syntax

gh_imgui.push_font(
 font_id
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.push_font(font_id)
            


pop_font

Description

Restores the font saved by push_font().


Syntax

gh_imgui.pop_font()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_imgui.pop_font()
            


set_default_font

Description

Sets the default font.


Syntax

gh_imgui.set_default_font(
 font_id
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.set_default_font(font_id)
            


reset_default_font

Description

Resets the default font used by ImGui.


Syntax

gh_imgui.reset_default_font()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_imgui.reset_default_font(font_id)
            


add_line_to_drawlist

Description

Adds a line to ImGui drawlist.


Syntax

gh_imgui.add_line_to_drawlist(
 start_x, start_y,
 end_x, end_y,
 r, g, b, a
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.add_line_to_drawlist(start_x, start_y, end_x, end_y, r, g, b, a)
            


add_bezier_curve_to_drawlist

Description

Adds a Bezier curve to ImGui drawlist.


Syntax

gh_imgui.add_bezier_curve_to_drawlist(
 p0_x, p0_y,
 ctrl0_x, ctrl0_y,
 ctrl1_x, ctrl1_y,
 p1_x, p1_y,
 r, g, b, a
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.add_bezier_curve_to_drawlist(p0_x, p0_y, ctrl0_x, ctrl0_y, ctrl1_x, ctrl1_y, p1_x, p1_y, r, g, b, a)
            


add_circle_to_drawlist

Description

Adds a circle to ImGui drawlist.


Syntax

gh_imgui.add_circle_to_drawlist(
 center_x, center_y,
 radius,
 r, g, b, a,
 line_thickness,
 num_segments,
 filled
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


local thickness = 2
local num_segments = 20
local filled = 1
gh_imgui.add_circle_to_drawlist(center_x, center_y, radius, r, g, b, a, thickness, num_segments, filled)
            


add_quad_to_drawlist

Description

Adds a quad to ImGui drawlist.


Syntax

gh_imgui.add_quad_to_drawlist(
 a_x, a_y,
 b_x, b_y,
 c_x, c_y,
 d_x, d_y,
 r, g, b, a,
 line_thickness,
 filled
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


local thickness = 2
local filled = 1
gh_imgui.add_quad_to_drawlist(a_x, a_y, b_x, b_y, c_x, c_y, d_x, d_y, r, g, b, a, thickness, filled)
            


show_demo_window

Description

Renders the ImGui demo window.


Syntax

gh_imgui.show_demo_window()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_imgui.show_demo_window()
            


show_metrics_window

Description

Display an ImGui built-in window that shows statistics about all windows. Call this function between frame_begin() and frame_end().


Syntax

gh_imgui.show_metrics_window()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_imgui.show_metrics_window()
            


get_content_region_available_width

Description

Returns the available width inside a window.


Syntax

width = gh_imgui.get_content_region_available_width()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values


Code sample


width = gh_imgui.get_content_region_available_width()
            


get_font_size

Description

Returns the size (height) of the font.


Syntax

size = gh_imgui.get_font_size()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values


Code sample


size = gh_imgui.get_font_size()
            


get_version

Description

Returns the version of ImGui.


Syntax

version = gh_imgui.get_version()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values


Code sample


version_str = gh_imgui.get_version()
            


get_window_pos_size

Description

Returns the position and size of the current window.


Syntax

x, y, width, height = gh_imgui.get_window_pos_size()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values


Code sample


x, y, width, height = gh_imgui.get_window_pos_size()
            


get_window_size

Description

Returns the size of the current window.


Syntax

width, height = gh_imgui.get_window_size()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values


Code sample


width, height = gh_imgui.get_window_size()
            


gizmo_begin_frame

Description

Begins the gizmo rendering. Must be called right after frame_begin().


Syntax

gh_imgui.gizmo_begin_frame()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_imgui.frame_begin(...)
gh_imgui.gizmo_begin_frame()
...
            


gizmo_set_rect

Description

Defines the gizmo viewport.


Syntax

gh_imgui.gizmo_set_rect(
 x, y width, height
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.gizmo_set_rect(0, 0, winW, winH)
            


gizmo_manipulate

Description

Applies the gizmo transformation to an object.


Syntax

gh_imgui.gizmo_manipulate(
 camera,
 object,
 operation,
 mode
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.gizmo_manipulate(camera, object, "rotate", "local")
            


gizmo_decompose_matrix_to_components

Description

Gets the transformation matrix.


Syntax

tx,ty,tz, rx,ry,rz, sx,sy,sz = gh_imgui.gizmo_decompose_matrix_to_components(
 object
)

Languages

Lua - Python


Parameters


Return Values


Code sample


tx,ty,tz,  rx,ry,rz,  sx,sy,sz = gh_imgui.gizmo_decompose_matrix_to_components(object)
            


gizmo_enable

Description

Enables or disables the gizmo.


Syntax

gh_imgui.gizmo_enable(
 state
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.gizmo_enable(1)
            


gizmo_is_over

Description

Is the mouse over the gizmo?


Syntax

state = gh_imgui.gizmo_is_over()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values


Code sample


is_over = gh_imgui.gizmo_is_over()
            


gizmo_is_using

Description

Is the mouse over the gizmo or is the gizmo in moving state?


Syntax

state = gh_imgui.gizmo_is_using()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values


Code sample


is_using = gh_imgui.gizmo_is_using()
            


group_begin

Description

Starts a new group. All widgets in a group are seen as a single widget.


Syntax

gh_imgui.group_begin()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_imgui.group_begin()

-- display widgets
...

gh_imgui.group_end()
            


group_end

Description

Ends a group.


Syntax

gh_imgui.group_end()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_imgui.group_begin()

-- display widgets
...

gh_imgui.group_end()
            


image

Description

Display a texture. Currently, this fontion works in OpenGL only.


Syntax

gh_imgui.image(
 texture_id,
 width, height
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.image(tex0, 200, 200)
            


image_button

Description

Display a button with a texture. Currently, this fontion works in OpenGL only.


Syntax

gh_imgui.image_button(
 texture_id,
 width, height,
 frame_padding
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.image_button(tex0, 200, 200, 1)
            


init

Description

Initialize the ImGui library. Must be called once in the INIT script.


Syntax

error = gh_imgui.init()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values


Code sample


ret = gh_imgui.init()
            


is_item_clicked

Description

Check if the current item has been clicked.


Syntax

clicked = gh_imgui.is_item_clicked(
 mouse_button
)

Languages

Lua - Python


Parameters


Return Values


Code sample


clicked = gh_imgui.is_item_clicked(0)
            


is_any_item_hovered

Description

Check if any item has been hovered by mouse.


Syntax

hovered = gh_imgui.is_any_item_hovered()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values


Code sample


hovered = gh_imgui.is_any_item_hovered()
            


is_item_hovered

Description

Check if the current item has been hovered by mouse.


Syntax

hovered = gh_imgui.is_item_hovered()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values


Code sample


hovered = gh_imgui.is_item_hovered()
            


is_window_hovered

Description

Check if the current window has been hovered by mouse.


Syntax

hovered = gh_imgui.is_window_hovered()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values


Code sample


hovered = gh_imgui.is_window_hovered()
            


is_any_window_hovered

Description

Check if any window hasn been hovered by mouse.


Syntax

hovered = gh_imgui.is_any_window_hovered()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values


Code sample


hovered = gh_imgui.is_any_window_hovered()
            


list_clipping_begin

Description

Starts the list clipping. Allows to speed up rendering of very big lists.


Syntax

start_item, end_item = gh_imgui.list_clipping_begin(
 num_items
)

Languages

Lua - Python


Parameters


Return Values


Code sample


start_item, end_item = gh_imgui.list_clipping_begin(num_items)
            


list_clipping_end

Description

Ends the list clipping.


Syntax

gh_imgui.list_clipping_end(
 num_items,
 start_item, end_item
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.list_clipping_end(num_items, start_item, end_item)
            


menu_begin_main_bar

Description

Begins the main menu bar (fullscreen menu bar).


Syntax

gh_imgui.menu_begin_main_bar()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_imgui.menu_begin_main_bar()
            


menu_end_main_bar

Description

Ends the main menu bar.


Syntax

gh_imgui.menu_end_main_bar()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_imgui.menu_end_main_bar()
            


menu_begin_bar

Description

Begins a window menu bar.


Syntax

gh_imgui.menu_begin_bar()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_imgui.menu_begin_bar()
            


menu_end_bar

Description

Ends a window menu bar.


Syntax

gh_imgui.menu_end_bar()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_imgui.menu_end_bar()
            


menu_begin

Description

Begins a window menu.


Syntax

gh_imgui.menu_begin(
 label,
 enabled
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.menu_begin("File", 1)
            


menu_end

Description

Ends a window menu.


Syntax

gh_imgui.menu_end()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_imgui.menu_end()
            


menu_item

Description

Adds an item to the current menu. Must be used between menu_begin() and menu_end().


Syntax

gh_imgui.menu_item(
 label,
 shortcut,
 selected,
 enabled
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


enabled = 1
gh_imgui.menu_item("Load a file", "", 0, enabled)
            


progress_bar

Description

Displays a progress bar.


Syntax

gh_imgui.progress_bar(
 fraction,
 width, height,
 overly
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.progress_bar(0.45, width, height, overlay_str)
            


pop_item_width

Description

Restore the width that has been changed by push_item_width().


Syntax

gh_imgui.pop_item_width()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


local width = gh_imgui.get_content_region_available_width()
gh_imgui.push_item_width(width * 0.8)

...

gh_imgui.pop_item_width()
            


push_item_width

Description

Sets the width of next items. This width is valid until a call to pop_item_width().


Syntax

gh_imgui.push_item_width(
 width
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


local width = gh_imgui.get_content_region_available_width()
gh_imgui.push_item_width(width * 0.8)

...

gh_imgui.pop_item_width()
            


radio_button

Description

Display a radio button.


Syntax

gh_imgui.radio_button(
 name,
 active
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.radio_button("radio button 1", 0)
gh_imgui.radio_button("radio button 2", 1)
gh_imgui.radio_button("radio button 3", 0)
            


set_color

Description

Sets the color of the next widget.


Syntax

gh_imgui.set_color(
 widget_type,
 r, g, b, a
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


IMGUI_WINDOW_BG_COLOR = 1
IMGUI_TITLE_BG_COLOR = 2
IMGUI_PLOTLINES_COLOR = 3
IMGUI_FRAME_BG_COLOR = 4
IMGUI_TITLE_BG_ACTIVE_COLOR = 5
IMGUI_TITLE_BG_COLLAPSED_COLOR = 6
IMGUI_PLOTHISTOGRAM_COLOR = 7
IMGUI_COMBO_BG_COLOR = 8
IMGUI_BUTTON_COLOR = 9
IMGUI_SEPARATOR_COLOR = 10
IMGUI_RESIZE_GRIP_COLOR = 11
IMGUI_PLOTLINE_HOVERED_COLOR = 12
IMGUI_PLOTHISTOGRAM_HOVERED_COLOR = 13
IMGUI_BUTTON_HOVERED_COLOR = 14
IMGUI_SEPARATOR_HOVERED_COLOR = 15
IMGUI_RESIZE_GRIP_HOVERED_COLOR = 16
IMGUI_HEADER_COLOR = 17
IMGUI_HEADER_HOVERED_COLOR = 18
IMGUI_SLIDER_GRAB_COLOR = 19
IMGUI_CHECK_MARK_COLOR = 20
IMGUI_SCROLLBAR_BG_COLOR = 21
IMGUI_SCROLLBAR_GRAB_COLOR = 22
IMGUI_SCROLLBAR_GRAB_HOVERED_COLOR = 23
IMGUI_TEXT_COLOR = 24
IMGUI_POPUP_BG_COLOR = 25
IMGUI_TEXT_DISABLED_COLOR = 26
IMGUI_CHILD_BG_COLOR = 27
IMGUI_BORDER_COLOR = 28
IMGUI_BORDER_SHADOW_COLOR = 29
IMGUI_FRAME_BG_HOVERED_COLOR = 30
IMGUI_FRAME_BG_ACTIVE_COLOR = 31
IMGUI_MENU_BAR_BG_COLOR = 32
IMGUI_SCROLLBAR_GRAB_ACTIVE_COLOR = 33
IMGUI_SLIDER_GRAB_ACTIVE_COLOR = 34
IMGUI_BUTTON_ACTIVE_COLOR = 35
IMGUI_HEADER_ACTIVE_COLOR = 36
IMGUI_SEPARATOR_ACTIVE_COLOR = 37
IMGUI_RESIZE_GRIP_ACTIVE_COLOR = 38
IMGUI_CLOSE_BUTTON_COLOR = 39
IMGUI_CLOSE_BUTTON_HOVERED_COLOR = 40 
IMGUI_CLOSE_BUTTON_ACTIVE_COLOR = 41
IMGUI_PLOTLINES_HOVERED_COLOR = 42
IMGUI_TEXT_SELECTED_BG_COLOR = 43
IMGUI_MODAL_WINDOW_DARKENING_COLOR = 44
IMGUI_DRAG_DROP_TARGET_COLOR = 45

widget_type = IMGUI_BUTTON_COLOR
gh_imgui.set_color(widget_type, r, g, b, a)
            


get_color

Description

Gets the current color value.


Syntax

gh_imgui.get_color(
 widget_type
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


widget_type = IMGUI_BUTTON_COLOR
r, g, b, a = gh_imgui.get_color(widget_type)
            


set_style_colors

Description

Sets a built-in color style.


Syntax

gh_imgui.set_style_colors(
 style_name
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


style_name = "classic"
--style_name = "dark"
--style_name = "light"
gh_imgui.set_style_colors(style_name)
            


set_tooltip

Description

Sets a tooltip.


Syntax

gh_imgui.set_tooltip(
 caption
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.set_tooltip("This is a tooltip!")
            


show_test_window

Description

Shows ImGui test window.


Syntax

gh_imgui.show_test_window()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_imgui.frame_begin(winW, winH, mouse_x, mouse_y, mouse_left_button, mouse_right_button)
gh_imgui.show_test_window()
gh_imgui.frame_end()
            


set_cur_font_display_offset

Description

Sets the x and y offset of the current font. Useful to adjust the vertical alignment of a text.


Syntax

gh_imgui.set_cur_font_display_offset(
 x, y
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.set_cur_font_display_offset(x, y)
            


get_cur_font_display_offset

Description

Gets the x and y offset of the current font.


Syntax

x, y = gh_imgui.get_cur_font_display_offset()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values


Code sample


x, y = gh_imgui.get_cur_font_display_offset()
            


selectable

Description

Allows to select texts in list / widgets.


Syntax

gh_imgui.selectable(
 text
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


selected = 0            

-- Possible flags
ImGuiSelectableFlags_DontClosePopups = 1 -- // Clicking this don't close parent popup window
ImGuiSelectableFlags_SpanAllColumns = 2 -- Selectable frame can span all columns (text will still fit in current column)
ImGuiSelectableFlags_AllowDoubleClick = 4 --  Generate press events on double clicks too
flags = ImGuiSelectableFlags_SpanAllColumns

ret = gh_imgui.selectable(text, selected, flags)
            


set_frame_border_size

Description

Sets the size of the frame border.


Syntax

gh_imgui.set_frame_border_size(
 x
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.set_frame_border_size(x)
            


set_frame_rounding

Description

Sets the frame corner rounding. A value of 0 means a squared corner.


Syntax

gh_imgui.set_frame_rounding(
 x
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.set_frame_rounding(x)
            


set_next_window_content_size

Description

Sets the size of the window content.


Syntax

gh_imgui.set_next_window_content_size(
 w, h
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.set_next_window_content_size(w, h)
            


set_window_border_size

Description

Sets the size of the window border.


Syntax

gh_imgui.set_window_border_size(
 x
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.set_window_border_size(x)
            


set_window_rounding

Description

Sets the window corner rounding.


Syntax

gh_imgui.set_window_rounding(
 x
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.set_window_rounding(x)
            


slider_1f

Description

Displays a 1D slider.


Syntax

value = gh_imgui.slider_1f(
 label,
 initial_value,
 v_min, v_max,
 power
)

Languages

Lua - Python


Parameters


Return Values


Code sample


v = gh_imgui.slider_1f("slider01", initial_value, v_min, v_max, 1.0)
            


slider_1i

Description

Displays a 1D slider with integer values.


Syntax

value = gh_imgui.slider_1i(
 label,
 initial_value,
 v_min, v_max
)

Languages

Lua - Python


Parameters


Return Values


Code sample


v = gh_imgui.slider_1i("slider01", initial_value, v_min, v_max)
            


slider_4f

Description

Displays a 4D slider.


Syntax

x, y, z, w = gh_imgui.slider_4f(
 label,
 x0, y0, z0, w0,
 v_min, v_max,
 power
)

Languages

Lua - Python


Parameters


Return Values


Code sample


x, y, z, w = gh_imgui.slider_4f("slider02", x0, y0, z0, w0, v_min, v_max, 1.0)
            


terminate

Description

Terminates the ImGui library. Must be called once in the TERMINATE script.


Syntax

gh_imgui.terminate()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_imgui.terminate()
            


text

Description

Displays a simple text.


Syntax

gh_imgui.text(
 text
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.text("GeeXLab is powerful!")
            


text_rgba

Description

Displays a colored text.


Syntax

gh_imgui.text_rgba(
 text,
 r, g, b, a
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.text_rgba("GeeXLab is powerful!", 1.0, 1.0, 0.0, 1.0)
            


text_wrapped

Description

Displays a wrapped text.


Syntax

gh_imgui.text_wrapped(
 text
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.text_wrapped("GeeXLab is powerful!")
            


vslider_1f

Description

Displays a 1D vertical slider.


Syntax

value = gh_imgui.vslider_1f(
 label,
 width, height,
 initial_value,
 v_min, v_max,
 power
)

Languages

Lua - Python


Parameters


Return Values


Code sample


v = gh_imgui.vslider_1f("vslider01", 20, 100, initial_value, v_min, v_max, 1.0)
            


vslider_1i

Description

Displays a 1D vertical slider with integer values.


Syntax

value = gh_imgui.vslider_1i(
 label,
 width, height,
 initial_value,
 v_min, v_max
)

Languages

Lua - Python


Parameters


Return Values


Code sample


v = gh_imgui.vslider_1i("slider01", 20, 100, initial_value, v_min, v_max)
            


window_begin

Description

Starts the rendering of a window.


Syntax

is_open = gh_imgui.window_begin(
 name,
 width, height,
 pos_x, pos_y,
 window_flags,
 position_flags,
 size_flags
)

Languages

Lua - Python


Parameters


Return Values


Code sample


-- Window options
local window_default = 0
local window_no_resize = 2
local window_no_move = 4
local window_no_collapse = 32
local window_show_border = 128
local window_no_save_settings = 256

-- Position or size options
local pos_size_flag_always = 1 -- Always set the pos and/or size
local pos_size_flag_once = 2 -- Set the pos and/or size once per runtime session (only the first call with succeed)
local pos_size_flag_first_use_ever = 4  -- Set the pos and/or size if the window has no saved data (if doesn't exist in the .ini file)
local pos_size_flag_appearing = 8  -- Set the pos and/or size if the window is appearing after being hidden/inactive (or the first time)


-- window_flags = window_no_move | window_no_save_settings
window_flags = 0              
pos_flags = pos_size_flag_first_use_ever
size_flags = pos_size_flag_first_use_ever
is_open = gh_imgui.window_begin("GeeXLab ImGui demo", 300, 200, 20, 20, window_flags, pos_flags, size_flags)
if (is_open == 1) then
  gh_imgui.text("GeeXLab is powerful!")
end  
gh_imgui.window_end()
            


window_begin_v2

Description

Starts the rendering of a window. This window has a close button.


Syntax

is_open, show_window = gh_imgui.window_begin_v2(
 name,
 width, height,
 pos_x, pos_y,
 flags,
 position_flags,
 size_flags,
 show_window
)

Languages

Lua - Python


Parameters


Return Values


Code sample


-- Window options
local window_default = 0
local window_no_resize = 2
local window_no_move = 4
local window_no_collapse = 32
local window_show_border = 128
local window_no_save_settings = 256

-- Position or size options
local pos_size_flag_always = 1 -- Always set the pos and/or size
local pos_size_flag_once = 2 -- Set the pos and/or size once per runtime session (only the first call with succeed)
local pos_size_flag_first_use_ever = 4  -- Set the pos and/or size if the window has no saved data (if doesn't exist in the .ini file)
local pos_size_flag_appearing = 8  -- Set the pos and/or size if the window is appearing after being hidden/inactive (or the first time)


-- window_flags = window_no_move | window_no_save_settings
window_flags = 0              
pos_flags = pos_size_flag_first_use_ever
size_flags = pos_size_flag_first_use_ever

if (show_window == 1) then
  window_flags = 0              
  show = show_window              
  is_open, show_window = gh_imgui.window_begin_v2("GeeXLab information", 300, 200, 20, 20, window_flags, pos_flags, size_flags, show)
  if (is_open == 1) then
    gh_imgui.text("GeeXLab is powerful!")
  end  
  gh_imgui.window_end()
end
            


window_end

Description

Stops the rendering of a window.


Syntax

gh_imgui.window_end()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


window_flags = 0              
gh_imgui.window_begin("GeeXLab information", 300, 200, 20, 20, window_flags)
gh_imgui.text("GeeXLab is powerful!")
gh_imgui.window_end()
            






GeeXLab Rootard Guide | Downloads | Contact | Newsletter