< 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+. All possible constants are defined in {GeeXLab folder}/libs/lua/imgui.lua or in {GeeXLab folder}/libs/python/imgui.py


Number of functions: 156

  1. gh_imgui.add_bezier_curve_to_drawlist ()
  2. gh_imgui.add_circle_to_drawlist ()
  3. gh_imgui.add_font_from_buffer ()
  4. gh_imgui.add_font_from_file ()
  5. gh_imgui.add_font_from_zip_file ()
  6. gh_imgui.add_line_to_drawlist ()
  7. gh_imgui.add_quad_to_drawlist ()
  8. gh_imgui.begin_child ()
  9. gh_imgui.button ()
  10. gh_imgui.button_arrow ()
  11. gh_imgui.calc_text_size ()
  12. gh_imgui.checkbox ()
  13. gh_imgui.collapsing_header ()
  14. gh_imgui.color_edit_rgba ()
  15. gh_imgui.color_edit_rgba_v2 ()
  16. gh_imgui.color_picker_rgba ()
  17. gh_imgui.color_picker_rgba_v2 ()
  18. gh_imgui.column_get_offset ()
  19. gh_imgui.column_get_width ()
  20. gh_imgui.column_next ()
  21. gh_imgui.column_set_offset ()
  22. gh_imgui.column_set_width ()
  23. gh_imgui.columns ()
  24. gh_imgui.combo_box_add_item ()
  25. gh_imgui.combo_box_create ()
  26. gh_imgui.combo_box_draw ()
  27. gh_imgui.dummy ()
  28. gh_imgui.end_child ()
  29. gh_imgui.frame_begin ()
  30. gh_imgui.frame_begin_v2 ()
  31. gh_imgui.frame_end ()
  32. gh_imgui.get_color ()
  33. gh_imgui.get_content_region_available_width ()
  34. gh_imgui.get_cur_font_display_offset ()
  35. gh_imgui.get_cursor_pos ()
  36. gh_imgui.get_cursor_screen_pos ()
  37. gh_imgui.get_cursor_start_pos ()
  38. gh_imgui.get_font_size ()
  39. gh_imgui.get_item_rect ()
  40. gh_imgui.get_scroll ()
  41. gh_imgui.get_scroll_max ()
  42. gh_imgui.get_text_line_heigh_with_spacing ()
  43. gh_imgui.get_version ()
  44. gh_imgui.get_window_pos ()
  45. gh_imgui.get_window_pos_size ()
  46. gh_imgui.get_window_size ()
  47. gh_imgui.gizmo_begin_frame ()
  48. gh_imgui.gizmo_decompose_matrix_to_components ()
  49. gh_imgui.gizmo_enable ()
  50. gh_imgui.gizmo_is_over ()
  51. gh_imgui.gizmo_is_using ()
  52. gh_imgui.gizmo_manipulate ()
  53. gh_imgui.gizmo_set_rect ()
  54. gh_imgui.group_begin ()
  55. gh_imgui.group_end ()
  56. gh_imgui.image ()
  57. gh_imgui.image_button ()
  58. gh_imgui.indent ()
  59. gh_imgui.init ()
  60. gh_imgui.input_text ()
  61. gh_imgui.is_any_item_hovered ()
  62. gh_imgui.is_any_window_hovered ()
  63. gh_imgui.is_item_clicked ()
  64. gh_imgui.is_item_hovered ()
  65. gh_imgui.is_mouse_clicked ()
  66. gh_imgui.is_window_hovered ()
  67. gh_imgui.list_box_begin ()
  68. gh_imgui.list_box_draw ()
  69. gh_imgui.list_box_draw_v2 ()
  70. gh_imgui.list_box_end ()
  71. gh_imgui.list_clipping_begin ()
  72. gh_imgui.list_clipping_end ()
  73. gh_imgui.menu_begin ()
  74. gh_imgui.menu_begin_bar ()
  75. gh_imgui.menu_begin_main_bar ()
  76. gh_imgui.menu_end ()
  77. gh_imgui.menu_end_bar ()
  78. gh_imgui.menu_end_main_bar ()
  79. gh_imgui.menu_item ()
  80. gh_imgui.plotline_create ()
  81. gh_imgui.plotline_draw ()
  82. gh_imgui.plotline_draw_v2 ()
  83. gh_imgui.plotline_get_value1f ()
  84. gh_imgui.plotline_set_value1f ()
  85. gh_imgui.pop_font ()
  86. gh_imgui.pop_item_width ()
  87. gh_imgui.pop_style_color ()
  88. gh_imgui.popup_begin ()
  89. gh_imgui.popup_begin_context ()
  90. gh_imgui.popup_end ()
  91. gh_imgui.popup_open ()
  92. gh_imgui.progress_bar ()
  93. gh_imgui.push_font ()
  94. gh_imgui.push_item_width ()
  95. gh_imgui.push_style_color ()
  96. gh_imgui.radio_button ()
  97. gh_imgui.rebuild_all_fonts ()
  98. gh_imgui.reset_default_font ()
  99. gh_imgui.same_line ()
  100. gh_imgui.select_draw_list ()
  101. gh_imgui.selectable ()
  102. gh_imgui.separator ()
  103. gh_imgui.set_color ()
  104. gh_imgui.set_cur_font_display_offset ()
  105. gh_imgui.set_default_font ()
  106. gh_imgui.set_frame_border_size ()
  107. gh_imgui.set_frame_rounding ()
  108. gh_imgui.set_indent_spacing ()
  109. gh_imgui.set_item_default_focus ()
  110. gh_imgui.set_keyboard_focus_here ()
  111. gh_imgui.set_next_item_width ()
  112. gh_imgui.set_next_window_content_size ()
  113. gh_imgui.set_scroll ()
  114. gh_imgui.set_scroll_from_pos_y ()
  115. gh_imgui.set_scroll_here_y ()
  116. gh_imgui.set_style_colors ()
  117. gh_imgui.set_tooltip ()
  118. gh_imgui.set_window_border_size ()
  119. gh_imgui.set_window_focus ()
  120. gh_imgui.set_window_rounding ()
  121. gh_imgui.show_demo_window ()
  122. gh_imgui.show_metrics_window ()
  123. gh_imgui.show_test_window ()
  124. gh_imgui.slider_1f ()
  125. gh_imgui.slider_1i ()
  126. gh_imgui.slider_4f ()
  127. gh_imgui.spacing ()
  128. gh_imgui.tab_bar_begin ()
  129. gh_imgui.tab_bar_begin_v2 ()
  130. gh_imgui.tab_bar_end ()
  131. gh_imgui.tab_item_begin ()
  132. gh_imgui.tab_item_begin_v2 ()
  133. gh_imgui.tab_item_end ()
  134. gh_imgui.terminate ()
  135. gh_imgui.text ()
  136. gh_imgui.text_rgba ()
  137. gh_imgui.text_unformatted_v1 ()
  138. gh_imgui.text_unformatted_v2 ()
  139. gh_imgui.text_wrapped ()
  140. gh_imgui.tree_node ()
  141. gh_imgui.tree_node_ex ()
  142. gh_imgui.tree_node_leaf ()
  143. gh_imgui.tree_node_leaf_v2 ()
  144. gh_imgui.tree_pop ()
  145. gh_imgui.underline ()
  146. gh_imgui.unindent ()
  147. gh_imgui.url ()
  148. gh_imgui.vslider_1f ()
  149. gh_imgui.vslider_1i ()
  150. gh_imgui.widget ()
  151. gh_imgui.window_begin ()
  152. gh_imgui.window_begin_v2 ()
  153. gh_imgui.window_end ()
  154. gh_imgui.imguizmoquat_gizmo3d_v1 ()
  155. gh_imgui.imguizmoquat_gizmo3d_v2 ()
  156. gh_imgui.imguizmoquat_gizmo3d_v3 ()



add_bezier_curve_to_drawlist

Description

Adds a Bezier curve to the ImGui drawlist.


Syntax

gh_imgui.add_bezier_curve_to_drawlist(
 x0, y0,
 cp0x, cp0y,
 cp1x, cp1y,
 x1, y1,
 r, g, b, a
)

Languages


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 the ImGui drawlist.


Syntax

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

Languages


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_font_from_buffer

Description

Adds a new font from a memory buffer.


Syntax

font_id = gh_imgui.add_font_from_buffer(
 buff_ptr,
 buff_size,
 font_size
)

Languages


Parameters


Return Values


Code sample


filename = demo_dir .. "assets/arial.ttf"

buffer, buffer_size = gh_utils.file_buffer_create(filename)

font_id = gh_imgui.add_font_from_buffer(buffer, buffer_size, 24)

gh_utils.file_buffer_kill(buffer)
			


add_font_from_file

Description

Adds a new font to the ImGui engine.


Syntax

font_id = gh_imgui.add_font_from_file(
 font_filename,
 font_size
)

Languages


Parameters


Return Values


Code sample


font_id = 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

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

Languages


Parameters


Return Values


Code sample


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


add_line_to_drawlist

Description

Adds a line to the ImGui drawlist.


Syntax

gh_imgui.add_line_to_drawlist(
 x0, y0,
 x1, y1,
 r, g, b, a
)

Languages


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_quad_to_drawlist

Description

Adds a quad to the ImGui drawlist.


Syntax

gh_imgui.add_quad_to_drawlist(
 ax, ay,
 bx, by,
 cx, cy,
 dx, dy,
 r, g, b, a,
 thickness,
 filled
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


local thickness = 2
local filled = 1

gh_imgui.add_quad_to_drawlist(ax, ay, bx, by, cx, cy, dx, dy, r, g, b, a, thickness, filled)
			


begin_child

Description

Begins a scrolling region.


Syntax

gh_imgui.begin_child(
 label,
 width, height,
 border,
 flags
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


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


button

Description

Create a button.


Syntax

pressed = gh_imgui.button(
 label,
 width, height
)

Languages


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


Parameters


Return Values


Code sample


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


calc_text_size

Description

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


Syntax

x, y = gh_imgui.calc_text_size(
 text
)

Languages


Parameters


Return Values


Code sample


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


checkbox

Description

Create a checkbox.


Syntax

checked = gh_imgui.checkbox(
 label,
 current_state
)

Languages


Parameters


Return Values


Code sample


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


collapsing_header

Description

Creates an header that can be opened or closed.


Syntax

opened = gh_imgui.collapsing_header(
 label,
 flags
)

Languages


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


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


Parameters


Return Values


Code sample


flags = ImGuiColorEditFlags_None

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


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


Parameters


Return Values


Code sample


flags = ImGuiColorEditFlags_None

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


column_get_offset

Description

Gets the offset of a particular column.


Syntax

offset = gh_imgui.column_get_offset(
 index
)

Languages


Parameters


Return Values


Code sample


offset = gh_imgui.column_get_offset(index)
			


column_get_width

Description

Gets the width of a particular column.


Syntax

width = gh_imgui.column_get_width(
 index
)

Languages


Parameters


Return Values


Code sample


width = gh_imgui.column_get_width(index)
			


column_next

Description

Starts a new column.


Syntax

gh_imgui.column_next()

Languages


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)
			


column_set_offset

Description

Sets the offset of a particular column.


Syntax

gh_imgui.column_set_offset(
 index,
 offset
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.column_set_offset(index, width)
			


column_set_width

Description

Sets the width of a particular column.


Syntax

gh_imgui.column_set_width(
 index,
 width
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.column_set_width(index, width)
			


columns

Description

Starts/ends a column layout.


Syntax

gh_imgui.columns(
 num_columns,
 border
)

Languages


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)
			


combo_box_add_item

Description

Adds an item to a combo box.


Syntax

gh_imgui.combo_box_add_item(
 cb_id,
 item_label
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.combo_box_add_item(cb_id, "Item1")
			


combo_box_create

Description

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


Syntax

cb_id = gh_imgui.combo_box_create(
 label
)

Languages


Parameters


Return Values


Code sample


cb_id = gh_imgui.combo_box_create(label)
			


combo_box_draw

Description

Draws the combo box.


Syntax

selected_item = gh_imgui.combo_box_draw(
 cb_id,
 initial_selected_item
)

Languages


Parameters


Return Values


Code sample


selected_item = gh_imgui.combo_box_draw(cb_id, 0)
			


dummy

Description

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


Syntax

gh_imgui.dummy(
 width, height
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.dummy(10, 5)
			


end_child

Description

End a scrolling region.


Syntax

gh_imgui.end_child()

Languages


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_imgui.end_child()
			


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


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


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


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_imgui.frame_end()
			


get_color

Description

Gets the current color value.


Syntax

r, g, b, a = gh_imgui.get_color(
 item_type
)

Languages


Parameters


Return Values


Code sample


widget_type = IMGUI_BUTTON_COLOR

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


get_content_region_available_width

Description

Returns the available width inside a window.


Syntax

width = gh_imgui.get_content_region_available_width()

Languages


Parameters

This function has no input parameter(s).


Return Values


Code sample


width = gh_imgui.get_content_region_available_width()
			


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


Parameters

This function has no input parameter(s).


Return Values


Code sample


x, y = gh_imgui.get_cur_font_display_offset()
			


get_cursor_pos

Description

Returns the position of the mouse cursor (cursor position in window coordinates, relative to window position).


Syntax

x, y = gh_imgui.get_cursor_pos()

Languages


Parameters

This function has no input parameter(s).


Return Values


Code sample


x, y = gh_imgui.get_cursor_pos()
			


get_cursor_screen_pos

Description

Returns the position of the mouse cursor (cursor position in absolute screen coordinates [0 ; DisplaySize], useful for working with DrawList API).


Syntax

x, y = gh_imgui.get_cursor_screen_pos()

Languages


Parameters

This function has no input parameter(s).


Return Values


Code sample


x, y = gh_imgui.get_cursor_screen_pos()
			


get_cursor_start_pos

Description

Gets the initial cursor position in window coordinates.


Syntax

x, y = gh_imgui.get_cursor_start_pos()

Languages


Parameters

This function has no input parameter(s).


Return Values


Code sample


x, y = gh_imgui.get_cursor_start_pos()
			


get_font_size

Description

Returns the size (height) of the font.


Syntax

size = gh_imgui.get_font_size()

Languages


Parameters

This function has no input parameter(s).


Return Values


Code sample


size = gh_imgui.get_font_size()
			


get_item_rect

Description

Gets the size (bounding rectangle) of the current item.


Syntax

x, y, z, w = gh_imgui.get_item_rect()

Languages


Parameters

This function has no input parameter(s).


Return Values


Code sample


x, y, z, w = gh_imgui.get_item_rect()
			


get_scroll

Description

Gets the scrolling amount in X and Y [0..get_scroll_max()].


Syntax

scroll_x, scroll_y = gh_imgui.get_scroll()

Languages


Parameters

This function has no input parameter(s).


Return Values


Code sample


scroll_x, scroll_y = gh_imgui.get_scroll()
			


get_scroll_max

Description

Gets the maximum scrolling amount in X and Y - X => ContentSize.X - WindowSize.X, Y => ContentSize.Y - WindowSize.Y


Syntax

scroll_x, scroll_y = gh_imgui.get_scroll_max()

Languages


Parameters

This function has no input parameter(s).


Return Values


Code sample


scroll_x, scroll_y = gh_imgui.get_scroll_max()
			


get_text_line_heigh_with_spacing

Description

Distance in pixels between 2 consecutive lines of text


Syntax

h = gh_imgui.get_text_line_heigh_with_spacing()

Languages


Parameters

This function has no input parameter(s).


Return Values


Code sample


h = gh_imgui.get_text_line_heigh_with_spacing()
			


get_version

Description

Returns the version of ImGui.


Syntax

version = gh_imgui.get_version()

Languages


Parameters

This function has no input parameter(s).


Return Values


Code sample


version_str = gh_imgui.get_version()
			


get_window_pos

Description

Returns the position of the current window.


Syntax

x, y = gh_imgui.get_window_pos()

Languages


Parameters

This function has no input parameter(s).


Return Values


Code sample


x, y = gh_imgui.get_window_pos()
			


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


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


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


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_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(
 obj_id
)

Languages


Parameters


Return Values


Code sample


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


gizmo_enable

Description

Enables or disables the gizmo.


Syntax

gh_imgui.gizmo_enable(
 state
)

Languages


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


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


Parameters

This function has no input parameter(s).


Return Values


Code sample


is_using = gh_imgui.gizmo_is_using()
			


gizmo_manipulate

Description

Applies the gizmo transformation to an object.


Syntax

gh_imgui.gizmo_manipulate(
 cam_id,
 obj_id,
 oper_type,
 trans_mode
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.gizmo_manipulate(cam_id, obj_id, "rotate", "local")
			


gizmo_set_rect

Description

Defines the gizmo viewport.


Syntax

gh_imgui.gizmo_set_rect(
 x, y, width, height
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


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


group_begin

Description

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


Syntax

gh_imgui.group_begin()

Languages


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


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 fonction works in OpenGL only.


Syntax

gh_imgui.image(
 tex_id,
 width, height
)

Languages


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 fonction works in OpenGL only.


Syntax

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

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


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


indent

Description

Sets indent spacing.


Syntax

gh_imgui.indent(
 indent_w
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


indent_w = 10.0
gh_imgui.indent(indent_w)
			


init

Description

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


Syntax

error = gh_imgui.init()

Languages


Parameters

This function has no input parameter(s).


Return Values


Code sample


ret = gh_imgui.init()
			


input_text

Description

Allows to type a text.


Syntax

state, text = gh_imgui.input_text(
 label,
 max_text_len,
 initial_text,
 flags
)

Languages


Parameters


Return Values


Code sample


flags = ImGuiInputTextFlags_None

text, state = gh_imgui.input_text("User name", 128, "", flags)
			


is_any_item_hovered

Description

Check if any item has been hovered by mouse.


Syntax

hovered = gh_imgui.is_any_item_hovered()

Languages


Parameters

This function has no input parameter(s).


Return Values


Code sample


hovered = gh_imgui.is_any_item_hovered()
			


is_any_window_hovered

Description

Check if any window has been hovered by mouse.


Syntax

hovered = gh_imgui.is_any_window_hovered()

Languages


Parameters

This function has no input parameter(s).


Return Values


Code sample


hovered = gh_imgui.is_any_window_hovered()
			


is_item_clicked

Description

Check if the current item has been clicked.


Syntax

clicked = gh_imgui.is_item_clicked(
 mouse_button
)

Languages


Parameters


Return Values


Code sample


clicked = gh_imgui.is_item_clicked(0)
			


is_item_hovered

Description

Check if the current item has been hovered by mouse.


Syntax

hovered = gh_imgui.is_item_hovered()

Languages


Parameters

This function has no input parameter(s).


Return Values


Code sample


hovered = gh_imgui.is_item_hovered()
			


is_mouse_clicked

Description

Check if any window has been hovered by mouse.


Syntax

state = gh_imgui.is_mouse_clicked(
 button
)

Languages


Parameters


Return Values


Code sample


state = gh_imgui.is_mouse_clicked(button)
			


is_window_hovered

Description

Check if the current window has been hovered by mouse.


Syntax

hovered = gh_imgui.is_window_hovered()

Languages


Parameters

This function has no input parameter(s).


Return Values


Code sample


hovered = gh_imgui.is_window_hovered()
			


list_box_begin

Description

Defines a list box header.


Syntax

ret = gh_imgui.list_box_begin(
 cb_index,
 w, h
)

Languages


Parameters


Return Values


Code sample


ret = gh_imgui.list_box_begin(cb_index, 0)
			


list_box_draw

Description

Draws a combo box as a list box.


Syntax

selected_item = gh_imgui.list_box_draw(
 cb_id,
 initial_selected_item
)

Languages


Parameters


Return Values


Code sample


selected_item = gh_imgui.list_box_draw(cb_id, 0)
			


list_box_draw_v2

Description

Draws a combo box as a list box.


Syntax

selected_item = gh_imgui.list_box_draw_v2(
 cb_id,
 initial_selected_item,
 height_in_items
)

Languages


Parameters


Return Values


Code sample


selected_item = gh_imgui.list_box_draw_v2(cb_id, 0, 20)
			


list_box_end

Description

Ends a list box header.


Syntax

gh_imgui.list_box_end()

Languages


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_imgui.list_box_end()
			


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


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


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

Description

Begins a window menu.


Syntax

state = gh_imgui.menu_begin(
 label,
 enabled
)

Languages


Parameters


Return Values


Code sample


gh_imgui.menu_begin("File", 1)
			


menu_begin_bar

Description

Begins a window menu bar.


Syntax

state = gh_imgui.menu_begin_bar()

Languages


Parameters

This function has no input parameter(s).


Return Values


Code sample


gh_imgui.menu_begin_bar()
			


menu_begin_main_bar

Description

Begins the main menu bar (fullscreen menu bar).


Syntax

state = gh_imgui.menu_begin_main_bar()

Languages


Parameters

This function has no input parameter(s).


Return Values


Code sample


gh_imgui.menu_begin_main_bar()
			


menu_end

Description

Ends a window menu.


Syntax

gh_imgui.menu_end()

Languages


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_imgui.menu_end()
			


menu_end_bar

Description

Ends a window menu bar.


Syntax

gh_imgui.menu_end_bar()

Languages


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_end_main_bar

Description

Ends the main menu bar.


Syntax

gh_imgui.menu_end_main_bar()

Languages


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_item

Description

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


Syntax

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

Languages


Parameters


Return Values


Code sample


enabled = 1

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


plotline_create

Description

Creates a plotline.


Syntax

index = gh_imgui.plotline_create(
 label,
 num_points
)

Languages


Parameters


Return Values


Code sample


plotline_index = gh_imgui.plotline_create("Curve", 1000)
			


plotline_draw

Description

Draws a plotline.


Syntax

gh_imgui.plotline_draw(
 index,
 type,
 overlay,
 values_offset,
 scale_min, scale_max,
 graph_size_x, graph_size_y
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


values_offset = 0
scale_min = 0
scale_max = 100
graph_size_x = 400
graph_size_y = 200

gh_imgui.plotline_draw(plotline_index, type, "overlay!", values_offset, scale_min, scale_max, graph_size_x, graph_size_y)
			


plotline_draw_v2

Description

Draws a plotline.


Syntax

gh_imgui.plotline_draw_v2(
 index,
 type,
 overlay,
 num_values,
 values_offset,
 scale_min, scale_max,
 graph_size_x, graph_size_y
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


values_offset = 0
values_count = 1000
scale_min = 0
scale_max = 100
graph_size_x = 400
graph_size_y = 200

gh_imgui.plotline_draw_v2(plotline_index, type, "overlay!", values_count, values_offset, scale_min, scale_max, graph_size_x, graph_size_y)
			


plotline_get_value1f

Description

Gets a value from the plotline.


Syntax

x = gh_imgui.plotline_get_value1f(
 index,
 value_index
)

Languages


Parameters


Return Values


Code sample


x = gh_imgui.plotline_get_value1f(plotline_index, value_index)
			


plotline_set_value1f

Description

Sets a value in the plotline.


Syntax

gh_imgui.plotline_set_value1f(
 index,
 value_index,
 x
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.plotline_set_value1f(plotline_index, value_index, x)
			


pop_font

Description

Restores the font saved by push_font().


Syntax

gh_imgui.pop_font()

Languages


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_imgui.pop_font()
			


pop_item_width

Description

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


Syntax

gh_imgui.pop_item_width()

Languages


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()
			


pop_style_color

Description

Restores a color saved with push_style_color().


Syntax

gh_imgui.pop_style_color()

Languages


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_imgui.pop_style_color()
			


popup_begin

Description

Begins a popup window. Click outside the popup to close it.


Syntax

ret = gh_imgui.popup_begin(
 label
)

Languages


Parameters


Return Values


Code sample


ret = gh_imgui.popup_begin("blabla")
			


popup_begin_context

Description

Begins a popup window.


Syntax

ret = gh_imgui.popup_begin_context(
 label
)

Languages


Parameters


Return Values


Code sample


ret = gh_imgui.popup_begin_context("blabla")
			


popup_end

Description

Ends a popup window. Call this function only if popup_begin_xxx() return 1 (the popup is opened).


Syntax

gh_imgui.popup_end()

Languages


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_imgui.popup_end()
			


popup_open

Description

Call to mark popup as open (don't call every frame!)


Syntax

gh_imgui.popup_open(
 label
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.popup_open("blabla")
			


progress_bar

Description

Displays a progress bar.


Syntax

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

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


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


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


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.push_font(font_id)
			


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


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()
			


push_style_color

Description

Sets a new color to a particular color element.


Syntax

gh_imgui.push_style_color(
 item_type,
 r, g, b, a
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


element_type = IMGUI_WINDOW_BG_COLOR

gh_imgui.push_style_color(element_type, r, g, b, a)
			


radio_button

Description

Display a radio button.


Syntax

gh_imgui.radio_button(
 name,
 active
)

Languages


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)
			


rebuild_all_fonts

Description

Rebuild all fonts. Call this function once you have loaded some fonts with add_font_xxx().


Syntax

gh_imgui.rebuild_all_fonts()

Languages


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_imgui.rebuild_all_fonts()
			


reset_default_font

Description

Resets the default font used by ImGui.


Syntax

gh_imgui.reset_default_font()

Languages


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_imgui.reset_default_font()
			


same_line

Description

Allows to group items horizontally.


Syntax

gh_imgui.same_line(
 local_pos_x,
 spacing_w
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.same_line(local_pos_x, spacing_w)
			


select_draw_list

Description

Select the draw list that will receive all draw commands. Default is DRAWLIST_WINDOW.


Syntax

gh_imgui.select_draw_list(
 draw_list
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


IMGUI_DRAWLIST_WINDOW = 0
IMGUI_DRAWLIST_BACKGROUND = 1
IMGUI_DRAWLIST_FOREGROUND = 2

draw_list = IMGUI_DRAWLIST_WINDOW

gh_imgui.select_draw_list(draw_list)
			


selectable

Description

Allows to select texts in list / widgets.


Syntax

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

Languages


Parameters


Return Values


Code sample


-- Possible flags
ImGuiSelectableFlags_None = 0
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
ImGuiSelectableFlags_Disabled = 8 -- Cannot be selected, display greyed out text

selected = 0
flags = ImGuiSelectableFlags_SpanAllColumns

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


separator

Description

Adds an horizontal line (separator).


Syntax

gh_imgui.separator()

Languages


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_imgui.separator()
			


set_color

Description

Sets the color of the next widget.


Syntax

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

Languages


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
IMGUI_NAV_HIGHLIGHT_COLOR = 46
IMGUI_NAV_WINDOW_IN_HIGHLIGHT_COLOR = 47
IMGUI_MODAL_WINDOW_DIM_BG_COLOR = 48
IMGUI_TAB_COLOR = 49
IMGUI_TAB_HOVERED_COLOR = 50
IMGUI_TAB_ACTIVE_COLOR = 51
IMGUI_TAB_UNFOCUSED_COLOR = 52
IMGUI_TAB_UNFOCUSED_ACTIVE_COLOR = 53

widget_type = IMGUI_BUTTON_COLOR

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


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


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.set_cur_font_display_offset(x, y)
			


set_default_font

Description

Sets the default font.


Syntax

gh_imgui.set_default_font(
 font_id
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.set_default_font(font_id)
			


set_frame_border_size

Description

Sets the size of the frame border.


Syntax

gh_imgui.set_frame_border_size(
 x
)

Languages


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


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.set_frame_rounding(x)
			


set_indent_spacing

Description

Sets the indent size.


Syntax

gh_imgui.set_indent_spacing(
 spacing
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.set_indent_spacing(spacing)
			


set_item_default_focus

Description

Makes last item the default focused item of a window.


Syntax

gh_imgui.set_item_default_focus()

Languages


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_imgui.set_item_default_focus()
			


set_keyboard_focus_here

Description

Focuses keyboard on the next widget. Use positive offset to access sub components of a multiple component widget. Use -1 to access previous widget.


Syntax

gh_imgui.set_keyboard_focus_here(
 offset
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.set_keyboard_focus_here(offset)
			


set_next_item_width

Description

Sets the size of the next item.


Syntax

gh_imgui.set_next_item_width(
 width
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.set_next_item_width(width)
			


set_next_window_content_size

Description

Sets the size of the window content.


Syntax

gh_imgui.set_next_window_content_size(
 width, height
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.set_next_window_content_size(width, height)
			


set_scroll

Description

Sets the scrolling amount in X and Y [0..get_scroll_max()].


Syntax

gh_imgui.set_scroll(
 scroll_x, scroll_y
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.set_scroll(scroll_x, scroll_y)
			


set_scroll_from_pos_y

Description

Adjusts scrolling amount to make given position visible. Generally get_cursor_start_pos() + offset to compute a valid position.


Syntax

gh_imgui.set_scroll_from_pos_y(
 local_y,
 center_y_ratio
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.set_scroll_from_pos_y(local_y, center_y_ratio)
			


set_scroll_here_y

Description

Adjusts scrolling amount to make current cursor position visible. center_y_ratio=0.0: top, 0.5: center, 1.0: bottom. When using to make a default/current item visible, consider using set_item_default_focus() instead.


Syntax

gh_imgui.set_scroll_here_y(
 center_y_ratio
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.set_scroll_here_y(center_y_ratio)
			


set_style_colors

Description

Sets a built-in color style.


Syntax

gh_imgui.set_style_colors(
 style
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


-- Available sytles:
"classic"
"dark"
"light"
"krosoft"
"maya"
"rayteak"
"fromhue"
"cherry"
"dark2"
"corporate_grey"

style_name = "classic"
gh_imgui.set_style_colors(style_name)
			


set_tooltip

Description

Sets a tooltip.


Syntax

gh_imgui.set_tooltip(
 caption
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


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


set_window_border_size

Description

Sets the size of the window border.


Syntax

gh_imgui.set_window_border_size(
 x
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.set_window_border_size(x)
			


set_window_focus

Description

Sets named window to be focused (front-most).


Syntax

gh_imgui.set_window_focus(
 name
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.set_window_focus(name)
			


set_window_rounding

Description

Sets the window corner rounding.


Syntax

gh_imgui.set_window_rounding(
 x
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.set_window_rounding(x)
			


show_demo_window

Description

Renders the ImGui demo window.


Syntax

gh_imgui.show_demo_window()

Languages


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


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_imgui.show_metrics_window()
			


show_test_window

Description

Shows ImGui test window.


Syntax

gh_imgui.show_test_window()

Languages


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()
			


slider_1f

Description

Displays a 1D slider.


Syntax

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

Languages


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


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


Parameters


Return Values


Code sample


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


spacing

Description

Adds a vertical space.


Syntax

gh_imgui.spacing()

Languages


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_imgui.spacing()
			


tab_bar_begin

Description

Begins a tab bar.


Syntax

is_opened = gh_imgui.tab_bar_begin(
 label
)

Languages


Parameters


Return Values


Code sample


ret = gh_imgui.tab_bar_begin("tabbar01")
			


tab_bar_begin_v2

Description

Begins a tab bar.


Syntax

is_opened = gh_imgui.tab_bar_begin_v2(
 label,
 flags
)

Languages


Parameters


Return Values


Code sample


ImGuiTabBarFlags_None = 0,
ImGuiTabBarFlags_Reorderable = 1
ImGuiTabBarFlags_AutoSelectNewTabs = 2
ImGuiTabBarFlags_NoCloseWithMiddleMouseButton = 4
ImGuiTabBarFlags_NoTabListPopupButton = 8
ImGuiTabBarFlags_NoTabListScrollingButtons = 16
ImGuiTabBarFlags_NoTooltip = 32
ImGuiTabBarFlags_FittingPolicyResizeDown = 64
ImGuiTabBarFlags_FittingPolicyScroll = 128

ret = gh_imgui.tab_bar_begin_v2("tabbar01", ImGuiTabBarFlags_Reorderable)
			


tab_bar_end

Description

Ends a tab bar.


Syntax

gh_imgui.tab_bar_end()

Languages


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


ImGuiTabBarFlags_Reorderable = 1

if (gh_imgui.tab_bar_begin_v2("tabbar01", ImGuiTabBarFlags_Reorderable) == 1) then
    ...
    gh_imgui.tab_bar_end()
end
			


tab_item_begin

Description

Begins a tab bar item.


Syntax

is_opened = gh_imgui.tab_item_begin(
 label,
 show_tab,
 flags
)

Languages


Parameters


Return Values


Code sample


flags = ImGuiTabItemFlags_None -- 0
show_tab = 1
if (gh_imgui.tab_bar_begin("tabbar01", show_tab, flags) == 1) then
    flags = 0

    if (gh_imgui.tab_item_begin("TAB1", 1, flags) == 1) then
        gh_imgui.text("This is the TAB1")
        gh_imgui.tab_item_end()
    end

    if (gh_imgui.tab_item_begin("TAB2", 0, flags) == 1) then
        gh_imgui.text("This is the TAB2")
        gh_imgui.tab_item_end()
    end

    gh_imgui.tab_bar_end()
end
			


tab_item_begin_v2

Description

Begins a tab bar item.


Syntax

is_opened = gh_imgui.tab_item_begin_v2(
 label,
 flags
)

Languages


Parameters


Return Values


Code sample


if (gh_imgui.tab_bar_begin_v2("tabbar01", flags) == 1) then
    flags = 0

    if (gh_imgui.tab_item_begin("TAB1", 1, flags) == 1) then
        gh_imgui.text("This is the TAB1")
        gh_imgui.tab_item_end()
    end

    if (gh_imgui.tab_item_begin("TAB2", 1, flags) == 1) then
        gh_imgui.text("This is the TAB2")
        gh_imgui.tab_item_end()
    end

    gh_imgui.tab_bar_end()
end
			


tab_item_end

Description

Ends a tab bar item.


Syntax

gh_imgui.tab_item_end()

Languages


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


flags = 0

if (gh_imgui.tab_bar_begin_v2("tabbar01", flags) == 1) then
    flags = 0

    if (gh_imgui.tab_item_begin("TAB1", 1, flags) == 1) then
        gh_imgui.text("This is the TAB1")
        gh_imgui.tab_item_end()
    end

    if (gh_imgui.tab_item_begin("TAB2", 1, flags) == 1) then
        gh_imgui.text("This is the TAB2")
        gh_imgui.tab_item_end()
    end

    gh_imgui.tab_bar_end()
end
			


terminate

Description

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


Syntax

gh_imgui.terminate()

Languages


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


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


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_unformatted_v1

Description

Displays a raw text without formatting. Recommended for long chunks of text.


Syntax

gh_imgui.text_unformatted_v1(
 text
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.text_unformatted_v1("GeeXLab is powerful!")
			


text_unformatted_v2

Description

Displays a raw text without formatting. Recommended for long chunks of text.


Syntax

gh_imgui.text_unformatted_v2(
 text,
 text_end
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.text_unformatted_v2("GeeXLab is powerful!")
			


text_wrapped

Description

Displays a wrapped text.


Syntax

gh_imgui.text_wrapped(
 text
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.text_wrapped("GeeXLab is powerful!")
			


tree_node

Description

Starts a tree.


Syntax

state = gh_imgui.tree_node(
 label
)

Languages


Parameters


Return Values


Code sample


node_open = gh_imgui.tree_node("Root")
if (node_open == 1) then
    gh_imgui.tree_node_leaf("Child 1")
    if (gh_imgui.is_item_clicked(mouse_button_left) == 1) then
        tree_selected_node_name = "Child 1"
    end
    gh_imgui.tree_pop()
end
			


tree_node_ex

Description

Starts a tree.


Syntax

state = gh_imgui.tree_node_ex(
 label,
 flags
)

Languages


Parameters


Return Values


Code sample


flags = ImGuiTreeNodeFlags_Selected
node_open = gh_imgui.tree_node_ex("Root", flags)
if (node_open == 1) then
    gh_imgui.tree_node_leaf("Child 1")
    if (gh_imgui.is_item_clicked(mouse_button_left) == 1) then
        tree_selected_node_name = "Child 1"
    end
    gh_imgui.tree_pop()
end
			


tree_node_leaf

Description

Display a tree leaf.


Syntax

gh_imgui.tree_node_leaf(
 label
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


node_open = gh_imgui.tree_node("Root")

if (node_open == 1) then
    gh_imgui.tree_node_leaf("Child 1")

    if (gh_imgui.is_item_clicked(mouse_button_left) == 1) then
        tree_selected_node_name = "Child 1"
    end

    gh_imgui.tree_pop()
end
			


tree_node_leaf_v2

Description

Display a tree leaf.


Syntax

gh_imgui.tree_node_leaf_v2(
 label,
 flags
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


node_open = gh_imgui.tree_node("Root")

if (node_open == 1) then
    local ImGuiTreeNodeFlags_Bullet = 512

    gh_imgui.tree_node_leaf_v2("Child 1", ImGuiTreeNodeFlags_Bullet)

    if (gh_imgui.is_item_clicked(mouse_button_left) == 1) then
        tree_selected_node_name = "Child 1"
    end

    gh_imgui.tree_pop()
end
			


tree_pop

Description

Ends a tree.


Syntax

gh_imgui.tree_pop()

Languages


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


node_open = gh_imgui.tree_node("Root")

if (node_open == 1) then
    gh_imgui.tree_node_leaf("Child 1")

    if (gh_imgui.is_item_clicked(mouse_button_left) == 1) then
        tree_selected_node_name = "Child 1"
    end

    gh_imgui.tree_pop()
end
			


underline

Description

Draw a colored line under the current item.


Syntax

gh_imgui.underline(
 r, g, b, a
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.underline(r, g, b, a)
			


unindent

Description

Sets unindent spacing.


Syntax

gh_imgui.unindent(
 indent_w
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.unindent(indent_w)
			


url

Description

Draw a clickable url.


Syntax

gh_imgui.url(
 link_caption,
 link_url,
 tooltip_text
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_imgui.url(link_caption, link_url, tooltip_text)
			


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


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


Parameters


Return Values


Code sample


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


widget

Description

Adds a widget.


Syntax

gh_imgui.widget(
 widget_type
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


IMGUI_WIDGET_SEPARATOR = 1
IMGUI_WIDGET_SAME_LINE = 2
IMGUI_WIDGET_BULLET = 3
IMGUI_WIDGET_VERTICAL_SPACING = 4
IMGUI_WIDGET_NEW_LINE = 5

gh_imgui.widget(IMGUI_WIDGET_SEPARATOR)
			


window_begin

Description

Starts the rendering of a window.


Syntax

is_open = gh_imgui.window_begin(
 name,
 width, height,
 pos_x, pos_y,
 win_flags,
 pos_flags,
 size_flags
)

Languages


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,
 win_flags,
 pos_flags,
 size_flags,
 show_window
)

Languages


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


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()
			


imguizmoquat_gizmo3d_v1

Description

Rotates an object using a virtual trackball.


Syntax

gh_imgui.imguizmoquat_gizmo3d_v1(
 label,
 size,
 mode,
 object_id
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


local mode3Axes = 1
local modeDirection = 2
local modeDirPlane = 4
local modeDual = 8
local modeMask = 15
local cubeAtOrigin = 16
local sphereAtOrigin = 32
local noSolidAtOrigin = 64
local modeFullAxes = 128
local axesModeMask = 240
gh_imgui.imguizmoquat_gizmo3d_v1("##gizmo01", 100.0, modeDirection + cubeAtOrigin, torus)
			


imguizmoquat_gizmo3d_v2

Description

Rotates a virtual trackball and returns the orientation quaternion.


Syntax

qx, qy, qz, qw = gh_imgui.imguizmoquat_gizmo3d_v2(
 label,
 size,
 mode,
 q0x, q0y, q0z, q0w
)

Languages


Parameters


Return Values


Code sample


local mode3Axes = 1
local modeDirection = 2
local modeDirPlane = 4
local modeDual = 8
local modeMask = 15
local cubeAtOrigin = 16
local sphereAtOrigin = 32
local noSolidAtOrigin = 64
local modeFullAxes = 128
local axesModeMask = 240

q0 = {x=0, y=0, z=0, w=0}
qr = {x=0, y=0, z=0, w=0}

qr.x, qr.w, qr.z, qr.w = gh_imgui.imguizmoquat_gizmo3d_v2("##gizmo01", 100.0, modeDirection + cubeAtOrigin, q0.x, q0.y, q0.z, q0.w)
			


imguizmoquat_gizmo3d_v3

Description

Rotates a virtual trackball and returns the 4x4 orientation matrix.


Syntax

m0,m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12,m13,m14,m15 = gh_imgui.imguizmoquat_gizmo3d_v3(
 label,
 size,
 mode,
 q0x, q0y, q0z, q0w
)

Languages


Parameters


Return Values


Code sample


local mode3Axes = 1
local modeDirection = 2
local modeDirPlane = 4
local modeDual = 8
local modeMask = 15
local cubeAtOrigin = 16
local sphereAtOrigin = 32
local noSolidAtOrigin = 64
local modeFullAxes = 128
local axesModeMask = 240

q0 = {x=0, y=0, z=0, w=0}

m0,m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12,m13,m14,m15 = gh_imgui.imguizmoquat_gizmo3d_v3("##gizmo01", 100.0, modeDirection + cubeAtOrigin, q0.x, q0.y, q0.z, q0.w)
			






GeeXLab Rootard Guide | Downloads | Contact | Newsletter