LuaSTG-x Core API
imgui Class Reference

Classes

class  ColorTextEdit
 
class  ImDrawList
 
class  ImFont
 
class  ImFontAtlas
 
class  ImFontAtlasCustomRect
 
class  ImFontConfig
 
class  ImFontGlyph
 
class  ImGuiIO
 
class  ImGuiStyle
 
class  ImGuiViewport
 
class  style
 

Public Member Functions

static function acceptDragDropPayload (local type, local flags)
 
static function addFontTTF (local path, local size, local config, local ranges)
 
static function alignTextToFramePadding ()
 
static function arrowButton (local str_id, local dir)
 
static function begin (local name, local open, local flags)
 
static function beginChild (local id, local size, local border, local flags)
 
static function beginChildFrame (local id, local size, local flags)
 
static function beginCombo (local label, local preview_value, local flags)
 
static function beginDragDropSource ()
 
static function beginDragDropTarget ()
 
static function beginGroup ()
 
static function beginMainMenuBar ()
 
static function beginMenu (local label, local enabled)
 
static function beginMenuBar ()
 
static function beginPopup (local str_id, local flags)
 
static function beginPopupContextItem ()
 
static function beginPopupContextVoid ()
 
static function beginPopupContextWindow ()
 
static function beginPopupModal (local name, local open, local flags)
 
static function beginTabBar (local str_id, local flags)
 
static function beginTabItem (local name, local open, local flags)
 
static function beginTooltip ()
 
static function bullet ()
 
static function bulletText (local fmt)
 
static function button (local label, local size)
 
static function c3b (local r, local g, local b)
 
static function c4b (local r, local g, local b, local a)
 
static function calcItemWidth ()
 
static function calcListClipping (local items_count, local items_height)
 
static function calcTextSize (local text, local text_end, local hide_text_after_double_hash, local wrap_width)
 
static function captureKeyboardFromApp ()
 
static function captureMouseFromApp ()
 
static function ccNode (local node, local tint_color, local border_color)
 
static function ccNodeButton (local node, local frame_padding, local bg_color, local tint_color)
 
static function checkbox (local label, local v)
 
static function checkboxFlags (local label, local flags, local flags_value)
 
static function checkKeyboard (local key, local ...)
 
static function clear ()
 
static function closeCurrentPopup ()
 
static function collapsingHeader (local label, local open, local flags)
 
static function color (local ...)
 
static function color32 (local ...)
 
static function colorButton (local desc_id, local col, local flags, local size)
 
static function colorConvertFloat4ToU32 (local in_)
 
static function colorConvertU32ToFloat4 (local in_)
 
static function colorEdit3 (local label, local color, local flags)
 
static function colorEdit4 (local label, local color, local flags)
 
static function colorPicker3 (local label, local color, local flags)
 
static function colorPicker4 (local label, local color, local flags, local ref_color)
 
static function columns ()
 
static function combo (local label, local current_item, local items, local popup_max_height_in_items)
 
static function configFlagCheck (local flag)
 
static function configFlagDisable (local flag, local ...)
 
static function configFlagEnable (local flag, local ...)
 
static function create ()
 
static function createLayer ()
 
static function debugCheckVersionAndDataLayout (local version_str, local sz_io, local sz_style, local sz_vec2, local sz_vec4, local sz_drawvert, local sz_drawidx)
 
static function destroyPlatformWindows ()
 
static function dockSpace (local id, local size, local flags)
 
static function dockSpaceOverViewport ()
 
static function dragFloat (local label, local value, local v_speed, local v_min, local v_max, local format, local power)
 
static function dragFloatN (local label, local array, local v_speed, local v_min, local v_max, local format, local power)
 
static function dragInt (local label, local value, local v_speed, local v_min, local v_max, local format, local power)
 
static function dragIntN (local label, local array, local v_speed, local v_min, local v_max, local format, local power)
 
static function dummy (local size)
 
static function endChild ()
 
static function endChildFrame ()
 
static function endCombo ()
 
static function endDragDropSource ()
 
static function endDragDropTarget ()
 
static function endFrame ()
 
static function endGroup ()
 
static function endMainMenuBar ()
 
static function endMenu ()
 
static function endMenuBar ()
 
static function endPopup ()
 
static function endTabBar ()
 
static function endTabItem ()
 
static function endToLua ()
 
static function endTooltip ()
 
static function findViewportByID (local id)
 
static function get ()
 
static function getBackgroundDrawList (local viewport)
 
static function getClipboardText ()
 
static function getColorU32 (local idx, local alpha_mul)
 
static function getColumnIndex ()
 
static function getColumnOffset ()
 
static function getColumnsCount ()
 
static function getColumnWidth ()
 
static function getContentRegionAvail ()
 
static function getContentRegionMax ()
 
static function getCursorPos ()
 
static function getCursorPosX ()
 
static function getCursorPosY ()
 
static function getCursorScreenPos ()
 
static function getCursorStartPos ()
 
static function getDragDropPayload ()
 
static function getFont ()
 
static function getFontSize ()
 
static function getFontTexUvWhitePixel ()
 
static function getForegroundDrawList (local viewport)
 
static function getFrameCount ()
 
static function getFrameHeight ()
 
static function getFrameHeightWithSpacing ()
 
static function getID (local str_id_begin, local str_id_end)
 
static function getIO ()
 
static function getItemRectMax ()
 
static function getItemRectMin ()
 
static function getItemRectSize ()
 
static function getKeyIndex (local imgui_key)
 
static function getKeyPressedAmount (local key_index, local repeat_delay, local rate)
 
static function getMainViewport ()
 
static function getMouseCursor ()
 
static function getMouseDragDelta ()
 
static function getMousePos ()
 
static function getMousePosOnOpeningCurrentPopup ()
 
static function getScrollMaxX ()
 
static function getScrollMaxY ()
 
static function getScrollX ()
 
static function getScrollY ()
 
static function getStyle ()
 
static function getStyleColorName (local idx)
 
static function getStyleColorU32 (local idx)
 
static function getStyleColorVec4 (local idx)
 
static function getTextLineHeight ()
 
static function getTextLineHeightWithSpacing ()
 
static function getTime ()
 
static function getTreeNodeToLabelSpacing ()
 
static function getVersion ()
 
static function getWindowContentRegionMax ()
 
static function getWindowContentRegionMin ()
 
static function getWindowContentRegionWidth ()
 
static function getWindowDockID ()
 
static function getWindowDpiScale ()
 
static function getWindowDrawList ()
 
static function getWindowHeight ()
 
static function getWindowPos ()
 
static function getWindowSize ()
 
static function getWindowViewport ()
 
static function getWindowWidth ()
 
static function hide ()
 
static function image (local tex, local size, local uv0, local uv1, local tint_color, local border_color)
 
static function imageButton (local tex, local size, local uv0, local uv1, local frame_padding, local bg_color, local tint_color)
 
static function indent ()
 
static function inputFloat (local label, local v, local step, local step_fase, local format, local flags)
 
static function inputFloatN (local label, local v, local step, local step_fase, local format, local flags)
 
static function inputInt (local label, local v, local step, local step_fast, local flags)
 
static function inputIntN (local label, local v, local step, local step_fase, local flags)
 
static function inputText (local label, local str, local flags)
 
static function inputTextMultiline (local label, local str, local size, local flags)
 
static function inputTextWithHint (local label, local hint, local str, local flags)
 
static function invisibleButton (local str_id, local size)
 
static function isAnyItemActive ()
 
static function isAnyItemFocused ()
 
static function isAnyItemHovered ()
 
static function isAnyMouseDown ()
 
static function isItemActivated ()
 
static function isItemActive ()
 
static function isItemClicked ()
 
static function isItemDeactivated ()
 
static function isItemDeactivatedAfterEdit ()
 
static function isItemEdited ()
 
static function isItemFocused ()
 
static function isItemHovered ()
 
static function isItemToggledOpen ()
 
static function isItemVisible ()
 
static function isKeyDown (local user_key_index)
 
static function isKeyPressed (local user_key_index, local repeat_)
 
static function isKeyReleased (local user_key_index)
 
static function isMouseClicked (local button, local repeat_)
 
static function isMouseDoubleClicked (local button)
 
static function isMouseDown (local button)
 
static function isMouseDragging (local button, local lock_threshold)
 
static function isMouseHoveringRect (local r_min, local r_max, local clip)
 
static function isMousePosValid (local mouse_pos)
 
static function isMouseReleased (local button)
 
static function isPopupOpen (local str_id, local flags)
 
static function isRectVisible (local rect_min, local rect_max)
 
static function isVisible ()
 
static function isWindowAppearing ()
 
static function isWindowCollapsed ()
 
static function isWindowDocked ()
 
static function isWindowFocused ()
 
static function isWindowHovered ()
 
static function labelText (local label, local fmt)
 
static function listBox (local label, local current_item, local items, local height_in_items)
 
static function listBoxFooter ()
 
static function listBoxHeader (local label, local items_count, local height_in_items)
 
static function loadIniSettingsFromDisk (local ini_filename)
 
static function loadIniSettingsFromMemory (local ini_data, local ini_size)
 
static function logButtons ()
 
static function logFinish ()
 
static function logText (local fmt)
 
static function logToClipboard ()
 
static function logToFile ()
 
static function logToTTY ()
 
static function markdown (local content)
 
static function menuItem (local label, local shortcut, local selected, local enabled)
 
static function newFrame ()
 
static function newLine ()
 
static function nextColumn ()
 
static function off ()
 
static function on (local target)
 
static function openPopup (local str_id, local popup_flags)
 
static function openPopupContextItem ()
 
static function p (local x, local y)
 
static function plotHistogram (local label, local values, local values_count, local values_offset, local overlay_text, local scale_min, local scale_max, local graph_size, local stride)
 
static function plotLines (local label, local values, local values_count, local values_offset, local overlay_text, local scale_min, local scale_max, local graph_size, local stride)
 
static function popAllowKeyboardFocus ()
 
static function popButtonRepeat ()
 
static function popClipRect ()
 
static function popFont ()
 
static function popID ()
 
static function popItemWidth ()
 
static function popStyleColor (local count)
 
static function popStyleVar (local count)
 
static function popTextWrapPos ()
 
static function progressBar (local fraction, local size_arg, local overlay)
 
static function pushAllowKeyboardFocus (local allow_keyboard_focus)
 
static function pushButtonRepeat (local repeat_)
 
static function pushClipRect (local clip_rect_min, local clip_rect_max, local intersect_with_current_clip_rect)
 
static function pushFont (local font)
 
static function pushID (local id)
 
static function pushItemWidth (local item_width)
 
static function pushStyleColor (local idx, local color)
 
static function pushStyleVar (local idx, local value)
 
static function pushTextWrapPos ()
 
static function radioButton (local label, local active)
 
static function radioButton (local label, local v, local v_button)
 
static function render ()
 
static function renderPlatformWindowsDefault ()
 
static function resetMouseDragDelta ()
 
static function sameLine ()
 
static function saveIniSettingsToDisk (local ini_filename)
 
static function saveIniSettingsToMemory ()
 
static function selectable (local label, local selected, local flags, local size)
 
static function separator ()
 
static function setCCLabelColor (local label, local col)
 
static function setCCNodeColor (local node, local col)
 
static function setClipboardText (local text)
 
static function setColorEditOptions (local flags)
 
static function setColumnOffset (local column_index, local offset_x)
 
static function setColumnWidth (local column_index, local width)
 
static function setCursorPos (local local_pos)
 
static function setCursorPosX (local local_x)
 
static function setCursorPosY (local local_y)
 
static function setCursorScreenPos (local pos)
 
static function setDragDropPayload (local type, local value, local flags)
 
static function setItemAllowOverlap ()
 
static function setItemDefaultFocus ()
 
static function setKeyboardFocusHere ()
 
static function setMarkdownFont (local index, local font, local seperator, local scale)
 
static function setMarkdownImageCallback (local f)
 
static function setMarkdownLinkCallback (local f)
 
static function setMarkdownLinkIcon (local icon)
 
static function setMouseCursor (local cursor_type)
 
static function setNextItemOpen (local is_open, local cond)
 
static function setNextItemWidth (local item_width)
 
static function setNextWindowBgAlpha (local alpha)
 
static function setNextWindowCollapsed (local collapsed, local cond)
 
static function setNextWindowContentSize (local size)
 
static function setNextWindowDockID (local dock_id, local cond)
 
static function setNextWindowFocus ()
 
static function setNextWindowPos (local pos, local cond, local pivot)
 
static function setNextWindowSize (local size, local cond)
 
static function setNextWindowSizeConstraints (local size_min, local size_max)
 
static function setNextWindowViewport (local viewport_id)
 
static function setScrollFromPosX (local local_x, local center_x_ratio)
 
static function setScrollFromPosY (local local_y, local center_y_ratio)
 
static function setScrollHereX ()
 
static function setScrollHereY ()
 
static function setScrollX (local scroll_x)
 
static function setScrollY (local scroll_y)
 
static function setStyleColor (local idx, local col)
 
static function setTabItemClosed (local tab_or_docked_window_label)
 
static function setToggleEnable (local b)
 
static function setTooltip (local fmt)
 
static function setVisible (local b)
 
static function setWindowCollapsed (local name, local collapsed, local cond)
 
static function setWindowFocus (local name)
 
static function setWindowFontScale (local scale)
 
static function setWindowPos (local name, local pos, local cond)
 
static function setWindowSize (local name, local size, local cond)
 
static function show ()
 
static function showAboutWindow (local open)
 
static function showDemoWindow (local open)
 
static function showFontSelector (local label)
 
static function showMetricsWindow (local open)
 
static function showStyleEditor (local show)
 
static function showStyleSelector (local label)
 
static function showUserGuide ()
 
static function shutdown ()
 
static function size (local ...)
 
static function sliderAngle (local label, local v_rad, local v_deg_min, local v_deg_max, local format)
 
static function sliderFloat (local label, local value, local v_min, local v_max, local format, local power)
 
static function sliderFloatN (local label, local array, local v_min, local v_max, local format, local power)
 
static function sliderInt (local label, local value, local v_min, local v_max, local format)
 
static function sliderIntN (local label, local array, local v_min, local v_max, local format, local power)
 
static function smallButton (local label)
 
static function spacing ()
 
static function styleColorsClassic ()
 
static function styleColorsDark ()
 
static function styleColorsLight ()
 
static function text (local fmt)
 
static function textColored (local col, local fmt)
 
static function textDisabled (local fmt)
 
static function textUnformatted (local text, local text_end)
 
static function textWrapped (local fmt)
 
static function tocc4b (local imVec4)
 
static function toccsize (local imVec2)
 
static function treeNode (local str_id, local fmt)
 
static function treeNodeEx (local str_id, local flags, local fmt)
 
static function treePop ()
 
static function treePush (local str_id)
 
static function unindent ()
 
static function unpack (local t)
 
static function updatePlatformWindows ()
 
static function vec2 (local x, local y)
 
static function vec4 (local x, local y, local z, local w)
 
static function vSliderFloat (local label, local size, local value, local v_min, local v_max, local format, local power)
 
static function vSliderInt (local label, local size, local value, local v_min, local v_max, local format)
 

Member Function Documentation

◆ acceptDragDropPayload()

static function acceptDragDropPayload ( local  type,
local  flags 
)

accept contents of a given type. If ImGuiDragDropFlags_AcceptBeforeDelivery is set you can peek into the payload before the mouse button is released.

Parameters
typestring
flagsnumber
Returns
boolean,any

◆ addFontTTF()

static function addFontTTF ( local  path,
local  size,
local  config,
local  ranges 
)
Parameters
pathstring
sizenumber
configtable
rangesnumber
Returns
imgui.ImFont

◆ alignTextToFramePadding()

static function alignTextToFramePadding ( )

vertically align upcoming text baseline to FramePadding.y so that it will align properly to regularly framed items (call if you have text on a line before a framed item)

◆ arrowButton()

static function arrowButton ( local  str_id,
local  dir 
)

square button with an arrow shape

Parameters
str_idstring
dirnumber
Returns
boolean

◆ begin()

static function begin ( local  name,
local  open,
local  flags 
)

Windows

  • Begin() = push window to the stack and start appending to it. End() = pop window from the stack.
  • You may append multiple times to the same window during the same frame.
  • Passing 'bool* p_open != NULL' shows a window-closing widget in the upper-right corner of the window,

    which clicking will set the boolean to false when clicked.

  • Begin() return false to indicate the window is collapsed or fully clipped, so you may early out and omit submitting

    anything to the window. Always call a matching End() for each Begin() call, regardless of its return value!

    (this is due to legacy reason and is inconsistent with most other functions such as BeginMenu/EndMenu, BeginPopup/EndPopup, etc.

    where the EndXXX call should only be called if the corresponding BeginXXX function returned true.)

  • Note that the bottom of window stack always contains a window called "Debug".
Parameters
namestring
openboolean optional, nullable
flagsnumber optional ImGuiWindowFlags
Returns
boolean,boolean|nil

◆ beginChild()

static function beginChild ( local  id,
local  size,
local  border,
local  flags 
)

Child Windows

  • Use child windows to begin into a self-contained independent scrolling/clipping regions within a host window. Child windows can embed their own child.
  • For each independent axis of 'size': ==0.0f: use remaining host window size / >0.0f: fixed size / <0.0f: use remaining window size minus abs(size) / Each axis can use a different mode, e.g. ImVec2(0,400).
  • BeginChild() returns false to indicate the window is collapsed or fully clipped, so you may early out and omit submitting anything to the window.

    Always call a matching EndChild() for each BeginChild() call, regardless of its return value (this is due to legacy reason and is inconsistent with most other functions such as BeginMenu/EndMenu, BeginPopup/EndPopup, etc. where the EndXXX call should only be called if the corresponding BeginXXX function returned true.)

Parameters
idstring
sizeImVec2 optional
bordernumber optional
flagsnumber optional ImGuiWindowFlags
Returns
boolean

◆ beginChildFrame()

static function beginChildFrame ( local  id,
local  size,
local  flags 
)

helper to create a child window / scrolling region that looks like a normal widget frame

Parameters
idnumber
sizeImVec2
flagsnumber
Returns
boolean

◆ beginCombo()

static function beginCombo ( local  label,
local  preview_value,
local  flags 
)
Parameters
labelstring
preview_valuestring
flagsnumber
Returns
boolean

◆ beginDragDropSource()

static function beginDragDropSource ( )

call when the current item is active. If this return true, you can call SetDragDropPayload() + EndDragDropSource()

Returns
boolean

◆ beginDragDropTarget()

static function beginDragDropTarget ( )

call after submitting an item that may receive a payload. If this returns true, you can call AcceptDragDropPayload() + EndDragDropTarget()

Returns
boolean

◆ beginGroup()

static function beginGroup ( )

lock horizontal starting position

◆ beginMainMenuBar()

static function beginMainMenuBar ( )

create and append to a full screen menu-bar.

Returns
boolean

◆ beginMenu()

static function beginMenu ( local  label,
local  enabled 
)

create a sub-menu entry. only call EndMenu() if this returns true!

Parameters
labelstring
enabledboolean
Returns
boolean

◆ beginMenuBar()

static function beginMenuBar ( )

append to menu-bar of current window (requires ImGuiWindowFlags_MenuBar flag set on parent window).

Returns
boolean

◆ beginPopup()

static function beginPopup ( local  str_id,
local  flags 
)

return true if the popup is open, and you can start outputting to it.

Parameters
str_idstring
flagsnumber
Returns
boolean

◆ beginPopupContextItem()

static function beginPopupContextItem ( )

open+begin popup when clicked on last item. if you can pass a NULL str_id only if the previous item had an id. If you want to use that on a non-interactive item such as Text() you need to pass in an explicit ID here. read comments in .cpp!

Returns
boolean

◆ beginPopupContextVoid()

static function beginPopupContextVoid ( )

open+begin popup when clicked in void (where there are no windows).

Returns
boolean

◆ beginPopupContextWindow()

static function beginPopupContextWindow ( )

open+begin popup when clicked on current window.

Returns
boolean

◆ beginPopupModal()

static function beginPopupModal ( local  name,
local  open,
local  flags 
)

return true if the modal is open, and you can start outputting to it.

Parameters
namestring
openboolean optional, nullable
flagsnumber optional
Returns
boolean,boolean

◆ beginTabBar()

static function beginTabBar ( local  str_id,
local  flags 
)

create and append into a TabBar

Parameters
str_idstring
flagsnumber
Returns
boolean

◆ beginTabItem()

static function beginTabItem ( local  name,
local  open,
local  flags 
)

create a Tab. Returns true if the Tab is selected.

Parameters
namestring
openboolean optional, nullable
flagsnumber optional
Returns
boolean,boolean

◆ beginTooltip()

static function beginTooltip ( )

begin/append a tooltip window. to create full-featured tooltip (with any kind of items).

◆ bullet()

static function bullet ( )

draw a small circle and keep the cursor on the same line. advance cursor x position by GetTreeNodeToLabelSpacing(), same distance that TreeNode() uses

◆ bulletText()

static function bulletText ( local  fmt)

shortcut for Bullet()+Text()

Parameters
fmtstring

◆ button()

static function button ( local  label,
local  size 
)

button

Parameters
labelstring
sizeImVec2
Returns
boolean

◆ c3b()

static function c3b ( local  r,
local  g,
local  b 
)

◆ c4b()

static function c4b ( local  r,
local  g,
local  b,
local  a 
)

◆ calcItemWidth()

static function calcItemWidth ( )

width of item given pushed settings and current cursor position

Returns
number

◆ calcListClipping()

static function calcListClipping ( local  items_count,
local  items_height 
)

calculate coarse clipping for large list of evenly sized items. Prefer using the ImGuiListClipper higher-level helper if you can.

Parameters
items_countnumber
items_heightnumber
Returns
number,number out_items_display_start, out_items_display_end

◆ calcTextSize()

static function calcTextSize ( local  text,
local  text_end,
local  hide_text_after_double_hash,
local  wrap_width 
)
Parameters
textstring
text_endstring
hide_text_after_double_hashboolean
wrap_widthnumber
Returns
ImVec2

◆ captureKeyboardFromApp()

static function captureKeyboardFromApp ( )

attention: misleading name! manually override io.WantCaptureKeyboard flag next frame (said flag is entirely left for your application to handle). e.g. force capture keyboard when your widget is being hovered. This is equivalent to setting "io.WantCaptureKeyboard = want_capture_keyboard_value"; after the next NewFrame() call.

◆ captureMouseFromApp()

static function captureMouseFromApp ( )

attention: misleading name! manually override io.WantCaptureMouse flag next frame (said flag is entirely left for your application to handle). This is equivalent to setting "io.WantCaptureMouse = want_capture_mouse_value;" after the next NewFrame() call.

◆ ccNode()

static function ccNode ( local  node,
local  tint_color,
local  border_color 
)
Parameters
nodecc.Node
tint_colorImVec4
border_colorImVec4

◆ ccNodeButton()

static function ccNodeButton ( local  node,
local  frame_padding,
local  bg_color,
local  tint_color 
)
Parameters
nodecc.Node
frame_paddingnumber if <0, uses default frame padding settings. 0 for no padding
bg_colorImVec4
tint_colorImVec4
Returns
boolean

◆ checkbox()

static function checkbox ( local  label,
local  v 
)
Parameters
labelstring
vboolean
Returns
boolean,boolean pressed, v_new

◆ checkboxFlags()

static function checkboxFlags ( local  label,
local  flags,
local  flags_value 
)
Parameters
labelstring
flagsnumber
flags_valuenumber
Returns
boolean,number

◆ checkKeyboard()

static function checkKeyboard ( local  key,
local ...   
)
Parameters
keystring @key name

◆ clear()

static function clear ( )

◆ closeCurrentPopup()

static function closeCurrentPopup ( )

manually close the popup we have begin-ed into.

◆ collapsingHeader()

static function collapsingHeader ( local  label,
local  open,
local  flags 
)

if returning 'true' the header is open. doesn't indent nor push on ID stack. user doesn't have to call TreePop().

when 'open' is given, display an additional small close button on upper right of the header

Parameters
labelstring
openboolean
flagsnumber
Returns
boolean,boolean
重载
fun(label:string,flags:number):boolean

◆ color()

static function color ( local ...  )
Returns
vec4_table

◆ color32()

static function color32 ( local ...  )
Returns
number @ABGR

◆ colorButton()

static function colorButton ( local  desc_id,
local  col,
local  flags,
local  size 
)

display a colored square/button, hover for details, return true when pressed.

Parameters
desc_idstring
colImVec4
flagsnumber
sizeImVec2
Returns
boolean

◆ colorConvertFloat4ToU32()

static function colorConvertFloat4ToU32 ( local  in_)

Inputs Utilities

Parameters
in_ImVec4
Returns
number

◆ colorConvertU32ToFloat4()

static function colorConvertU32ToFloat4 ( local  in_)
Parameters
in_number
Returns
ImVec4

◆ colorEdit3()

static function colorEdit3 ( local  label,
local  color,
local  flags 
)
Parameters
labelstring
colornumber[]
flagsnumber
Returns
boolean,number[]

◆ colorEdit4()

static function colorEdit4 ( local  label,
local  color,
local  flags 
)
Parameters
labelstring
colornumber[]
flagsnumber
Returns
boolean,number[]

◆ colorPicker3()

static function colorPicker3 ( local  label,
local  color,
local  flags 
)
Parameters
labelstring
colornumber[]
flagsnumber
Returns
boolean,number[]

◆ colorPicker4()

static function colorPicker4 ( local  label,
local  color,
local  flags,
local  ref_color 
)
Parameters
labelstring
colornumber[]
flagsnumber
ref_colornumber[]
Returns
boolean,number[]

◆ columns()

static function columns ( )

◆ combo()

static function combo ( local  label,
local  current_item,
local  items,
local  popup_max_height_in_items 
)

combo

Parameters
labelstring
current_itemnumber
itemsstring[]
popup_max_height_in_itemsnumber
Returns
boolean,number

◆ configFlagCheck()

static function configFlagCheck ( local  flag)

◆ configFlagDisable()

static function configFlagDisable ( local  flag,
local ...   
)

◆ configFlagEnable()

static function configFlagEnable ( local  flag,
local ...   
)

◆ create()

static function create ( )
Returns
cc.Layer

◆ createLayer()

static function createLayer ( )
Returns
cc.Layer

◆ debugCheckVersionAndDataLayout()

static function debugCheckVersionAndDataLayout ( local  version_str,
local  sz_io,
local  sz_style,
local  sz_vec2,
local  sz_vec4,
local  sz_drawvert,
local  sz_drawidx 
)
Parameters
version_strstring
sz_ionumber
sz_stylenumber
sz_vec2number
sz_vec4number
sz_drawvertnumber
sz_drawidxnumber
Returns
boolean

◆ destroyPlatformWindows()

static function destroyPlatformWindows ( )

call DestroyWindow platform functions for all viewports. call from back-end Shutdown() if you need to close platform windows before imgui shutdown. otherwise will be called by DestroyContext().

◆ dockSpace()

static function dockSpace ( local  id,
local  size,
local  flags 
)
Parameters
idnumber
sizeImVec2
flagsnumber

◆ dockSpaceOverViewport()

static function dockSpaceOverViewport ( )
Returns
number

◆ dragFloat()

static function dragFloat ( local  label,
local  value,
local  v_speed,
local  v_min,
local  v_max,
local  format,
local  power 
)
Parameters
labelstring
valuenumber
v_speednumber
v_minnumber
v_maxnumber
formatstring
powernumber
Returns
boolean,number

◆ dragFloatN()

static function dragFloatN ( local  label,
local  array,
local  v_speed,
local  v_min,
local  v_max,
local  format,
local  power 
)
Parameters
labelstring
arraynumber[]
v_speednumber
v_minnumber
v_maxnumber
formatstring
powernumber
Returns
boolean,number[]

◆ dragInt()

static function dragInt ( local  label,
local  value,
local  v_speed,
local  v_min,
local  v_max,
local  format,
local  power 
)
Parameters
labelstring
valuenumber
v_speednumber
v_minnumber
v_maxnumber
formatstring
powernumber
Returns
boolean,number

◆ dragIntN()

static function dragIntN ( local  label,
local  array,
local  v_speed,
local  v_min,
local  v_max,
local  format,
local  power 
)
Parameters
labelstring
arraynumber[]
v_speednumber
v_minnumber
v_maxnumber
formatstring
powernumber
Returns
boolean,number[]

◆ dummy()

static function dummy ( local  size)

add a dummy item of given size. unlike InvisibleButton(), Dummy() won't take the mouse click or be navigable into.

Parameters
sizeImVec2

◆ endChild()

static function endChild ( )

◆ endChildFrame()

static function endChildFrame ( )

always call EndChildFrame() regardless of BeginChildFrame() return values (which indicates a collapsed/clipped window)

◆ endCombo()

static function endCombo ( )

only call EndCombo() if BeginCombo() returns true!

◆ endDragDropSource()

static function endDragDropSource ( )

only call EndDragDropSource() if BeginDragDropSource() returns true!

◆ endDragDropTarget()

static function endDragDropTarget ( )

only call EndDragDropTarget() if BeginDragDropTarget() returns true!

◆ endFrame()

static function endFrame ( )

ends the Dear ImGui frame. automatically called by Render(). If you don't need to render data (skipping rendering) you may call EndFrame() without Render()... but you'll have wasted CPU already! If you don't need to render, better to not create any windows and not call NewFrame() at all!

◆ endGroup()

static function endGroup ( )

unlock horizontal starting position + capture the whole group bounding box into one "item" (so you can use IsItemHovered() or layout primitives such as SameLine() on whole group, etc.)

◆ endMainMenuBar()

static function endMainMenuBar ( )

only call EndMainMenuBar() if BeginMainMenuBar() returns true!

◆ endMenu()

static function endMenu ( )

only call EndMenu() if BeginMenu() returns true!

◆ endMenuBar()

static function endMenuBar ( )

only call EndMenuBar() if BeginMenuBar() returns true!

◆ endPopup()

static function endPopup ( )

only call EndPopup() if BeginPopupXXX() returns true!

◆ endTabBar()

static function endTabBar ( )

only call EndTabBar() if BeginTabBar() returns true!

◆ endTabItem()

static function endTabItem ( )

only call EndTabItem() if BeginTabItem() returns true!

◆ endToLua()

static function endToLua ( )

◆ endTooltip()

static function endTooltip ( )

◆ findViewportByID()

static function findViewportByID ( local  id)

this is a helper for back-ends.

Parameters
idnumber
Returns
imgui.ImGuiViewport

◆ get()

static function get ( )
Returns
cc.Layer

◆ getBackgroundDrawList()

static function getBackgroundDrawList ( local  viewport)

get background draw list for the given viewport. this draw list will be the first rendering one. Useful to quickly draw shapes/text behind dear imgui contents.

Parameters
viewportimgui.ImGuiViewport
Returns
imgui.ImDrawList
重载
fun():imgui.ImDrawList

◆ getClipboardText()

static function getClipboardText ( )
Returns
string

◆ getColorU32()

static function getColorU32 ( local  idx,
local  alpha_mul 
)

◆ getColumnIndex()

static function getColumnIndex ( )

get current column index

Returns
number

◆ getColumnOffset()

static function getColumnOffset ( )

get position of column line (in pixels, from the left side of the contents region). pass -1 to use current column, otherwise 0..GetColumnsCount() inclusive. column 0 is typically 0.0f

Returns
number

◆ getColumnsCount()

static function getColumnsCount ( )

Tab Bars, Tabs

Returns
number

◆ getColumnWidth()

static function getColumnWidth ( )

get column width (in pixels). pass -1 to use current column

Returns
number

◆ getContentRegionAvail()

static function getContentRegionAvail ( )

== GetContentRegionMax() - GetCursorPos()

Returns
ImVec2

◆ getContentRegionMax()

static function getContentRegionMax ( )

current content boundaries (typically window boundaries including scrolling, or current column boundaries), in windows coordinates

Returns
ImVec2

◆ getCursorPos()

static function getCursorPos ( )

cursor position in window coordinates (relative to window position)

Returns
ImVec2

◆ getCursorPosX()

static function getCursorPosX ( )
 (some functions are using window-relative coordinates, such as: GetCursorPos, GetCursorStartPos, GetContentRegionMax, GetWindowContentRegion* etc.
Returns
number

◆ getCursorPosY()

static function getCursorPosY ( )
  other functions such as GetCursorScreenPos or everything in ImDrawList::
Returns
number

◆ getCursorScreenPos()

static function getCursorScreenPos ( )

cursor position in absolute screen coordinates [0..io.DisplaySize] (useful to work with ImDrawList API)

Returns
ImVec2

◆ getCursorStartPos()

static function getCursorStartPos ( )

initial cursor position in window coordinates

Returns
ImVec2

◆ getDragDropPayload()

static function getDragDropPayload ( )

peek directly into the current payload from anywhere. may return NULL. use ImGuiPayload::IsDataType() to test for the payload type.

Returns
boolean,any

◆ getFont()

static function getFont ( )

get current font

Returns
imgui.ImFont

◆ getFontSize()

static function getFontSize ( )

get current font size (= height in pixels) of current font with current scale applied

Returns
number

◆ getFontTexUvWhitePixel()

static function getFontTexUvWhitePixel ( )

get UV coordinate for a while pixel, useful to draw custom shapes via the ImDrawList API

Returns
ImVec2

◆ getForegroundDrawList()

static function getForegroundDrawList ( local  viewport)

get foreground draw list for the given viewport. this draw list will be the last rendered one. Useful to quickly draw shapes/text over dear imgui contents.

Parameters
viewportimgui.ImGuiViewport
Returns
imgui.ImDrawList
重载
fun():imgui.ImDrawList

◆ getFrameCount()

static function getFrameCount ( )

get global imgui frame count. incremented by 1 every frame.

Returns
number

◆ getFrameHeight()

static function getFrameHeight ( )

~ FontSize + style.FramePadding.y * 2

Returns
number

◆ getFrameHeightWithSpacing()

static function getFrameHeightWithSpacing ( )

~ FontSize + style.FramePadding.y * 2 + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of framed widgets)

Returns
number

◆ getID()

static function getID ( local  str_id_begin,
local  str_id_end 
)

Widgets: Text

Parameters
str_id_beginstring
str_id_endstring
Returns
number
重载
fun(str_id:string):number

◆ getIO()

static function getIO ( )

access the IO structure (mouse/keyboard/gamepad inputs, time, various configuration options/flags)

Returns
imgui.ImGuiIO

◆ getItemRectMax()

static function getItemRectMax ( )

get lower-right bounding rectangle of the last item (screen space)

Returns
ImVec2

◆ getItemRectMin()

static function getItemRectMin ( )

get upper-left bounding rectangle of the last item (screen space)

Returns
ImVec2

◆ getItemRectSize()

static function getItemRectSize ( )

get size of last item

Returns
ImVec2

◆ getKeyIndex()

static function getKeyIndex ( local  imgui_key)

map ImGuiKey_* values into user's key index. == io.KeyMap[key]

Parameters
imgui_keynumber
Returns
number

◆ getKeyPressedAmount()

static function getKeyPressedAmount ( local  key_index,
local  repeat_delay,
local  rate 
)

uses provided repeat rate/delay. return a count, most often 0 or 1 but might be >1 if RepeatRate is small enough that DeltaTime > RepeatRate

Parameters
key_indexnumber
repeat_delaynumber
ratenumber
Returns
number

◆ getMainViewport()

static function getMainViewport ( )

main viewport. same as GetPlatformIO().MainViewport == GetPlatformIO().Viewports[0].

Returns
imgui.ImGuiViewport

◆ getMouseCursor()

static function getMouseCursor ( )

get desired cursor type, reset in ImGui::NewFrame(), this is updated during the frame. valid before Render(). If you use software rendering by setting io.MouseDrawCursor ImGui will render those for you

Returns
number

◆ getMouseDragDelta()

static function getMouseDragDelta ( )

return the delta from the initial clicking position while the mouse button is pressed or was just released. This is locked and return 0.0f until the mouse moves past a distance threshold at least once. If lock_threshold < -1.0f uses io.MouseDraggingThreshold.

Returns
ImVec2

◆ getMousePos()

static function getMousePos ( )

shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls

Returns
ImVec2

◆ getMousePosOnOpeningCurrentPopup()

static function getMousePosOnOpeningCurrentPopup ( )

retrieve backup of mouse position at the time of opening popup we have BeginPopup() into

Returns
ImVec2

◆ getScrollMaxX()

static function getScrollMaxX ( )

get maximum scrolling amount ~~ ContentSize.X - WindowSize.X

Returns
number

◆ getScrollMaxY()

static function getScrollMaxY ( )

get maximum scrolling amount ~~ ContentSize.Y - WindowSize.Y

Returns
number

◆ getScrollX()

static function getScrollX ( )

get scrolling amount [0..GetScrollMaxX()]

Returns
number

◆ getScrollY()

static function getScrollY ( )

get scrolling amount [0..GetScrollMaxY()]

Returns
number

◆ getStyle()

static function getStyle ( )

access the Style structure (colors, sizes). Always use PushStyleCol(), PushStyleVar() to modify style mid-frame.

Returns
imgui.ImGuiStyle

◆ getStyleColorName()

static function getStyleColorName ( local  idx)

get a string corresponding to the enum value (for display, saving, etc.).

Parameters
idxnumber
Returns
string

◆ getStyleColorU32()

static function getStyleColorU32 ( local  idx)

◆ getStyleColorVec4()

static function getStyleColorVec4 ( local  idx)

retrieve style color as stored in ImGuiStyle structure. use to feed back into PushStyleColor(), otherwise use GetColorU32() to get style color with style alpha baked in.

Parameters
idxnumber
Returns
ImVec4

◆ getTextLineHeight()

static function getTextLineHeight ( )

~ FontSize

Returns
number

◆ getTextLineHeightWithSpacing()

static function getTextLineHeightWithSpacing ( )

~ FontSize + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of text)

Returns
number

◆ getTime()

static function getTime ( )

get global imgui time. incremented by io.DeltaTime every frame.

Returns
number

◆ getTreeNodeToLabelSpacing()

static function getTreeNodeToLabelSpacing ( )

horizontal distance preceding label when using TreeNode*() or Bullet() == (g.FontSize + style.FramePadding.x*2) for a regular unframed TreeNode

Returns
number

◆ getVersion()

static function getVersion ( )

get the compiled version string e.g. "1.23" (essentially the compiled value for IMGUI_VERSION)

Returns
string

◆ getWindowContentRegionMax()

static function getWindowContentRegionMax ( )

content boundaries max (roughly (0,0)+Size-Scroll) where Size can be override with SetNextWindowContentSize(), in window coordinates

Returns
ImVec2

◆ getWindowContentRegionMin()

static function getWindowContentRegionMin ( )

content boundaries min (roughly (0,0)-Scroll), in window coordinates

Returns
ImVec2

◆ getWindowContentRegionWidth()

static function getWindowContentRegionWidth ( )
Returns
number

◆ getWindowDockID()

static function getWindowDockID ( )
Returns
number

◆ getWindowDpiScale()

static function getWindowDpiScale ( )

get DPI scale currently associated to the current window's viewport.

Returns
number

◆ getWindowDrawList()

static function getWindowDrawList ( )

get draw list associated to the current window, to append your own drawing primitives

Returns
imgui.ImDrawList

◆ getWindowHeight()

static function getWindowHeight ( )

get current window height (shortcut for GetWindowSize().y) Prefer using SetNextXXX functions (before Begin) rather that SetXXX functions (after Begin).

Returns
number

◆ getWindowPos()

static function getWindowPos ( )

get current window position in screen space (useful if you want to do your own drawing via the DrawList API)

Returns
ImVec2

◆ getWindowSize()

static function getWindowSize ( )

get current window size

Returns
ImVec2

◆ getWindowViewport()

static function getWindowViewport ( )

get viewport currently associated to the current window.

Returns
imgui.ImGuiViewport

◆ getWindowWidth()

static function getWindowWidth ( )

get current window width (shortcut for GetWindowSize().x)

Returns
number

◆ hide()

static function hide ( )

◆ image()

static function image ( local  tex,
local  size,
local  uv0,
local  uv1,
local  tint_color,
local  border_color 
)
Parameters
texcc.Texture2D
sizeImVec2
uv0ImVec2
uv1ImVec2
tint_colorImVec4
border_colorImVec4
重载
fun(sp:cc.Sprite,size:ImVec2,tint_color:ImVec4,border_color:ImVec4)

◆ imageButton()

static function imageButton ( local  tex,
local  size,
local  uv0,
local  uv1,
local  frame_padding,
local  bg_color,
local  tint_color 
)
Parameters
texcc.Texture2D
sizeImVec2
uv0ImVec2
uv1ImVec2
frame_paddingnumber if <0, uses default frame padding settings. 0 for no padding
bg_colorImVec4
tint_colorImVec4
Returns
boolean
重载
fun(sp:cc.Sprite,size:ImVec2,frame_padding:number,bg_color:ImVec4,tint_color:ImVec4):boolean

◆ indent()

static function indent ( )

move content position toward the right, by style.IndentSpacing or indent_w if != 0

◆ inputFloat()

static function inputFloat ( local  label,
local  v,
local  step,
local  step_fase,
local  format,
local  flags 
)
Parameters
labelstring
vnumber
stepnumber
step_fasenumber
formatstring
flagsnumber
Returns
boolean,number

◆ inputFloatN()

static function inputFloatN ( local  label,
local  v,
local  step,
local  step_fase,
local  format,
local  flags 
)
Parameters
labelstring
vnumber[]
stepnumber
step_fasenumber
formatstring
flagsnumber
Returns
boolean,number[]

◆ inputInt()

static function inputInt ( local  label,
local  v,
local  step,
local  step_fast,
local  flags 
)
Parameters
labelstring
vnumber
stepnumber
step_fastnumber
flagsnumber
Returns
boolean,number

◆ inputIntN()

static function inputIntN ( local  label,
local  v,
local  step,
local  step_fase,
local  flags 
)
Parameters
labelstring
vnumber[]
stepnumber
step_fasenumber
flagsnumber
Returns
boolean,number[]

◆ inputText()

static function inputText ( local  label,
local  str,
local  flags 
)

inputText

Parameters
labelstring
strstring
flagsnumber
Returns
boolean,string

◆ inputTextMultiline()

static function inputTextMultiline ( local  label,
local  str,
local  size,
local  flags 
)

inputTextMultiline

Parameters
labelstring
strstring
sizeImVec2
flagsnumber
Returns
boolean,string

◆ inputTextWithHint()

static function inputTextWithHint ( local  label,
local  hint,
local  str,
local  flags 
)

inputTextWithHint

Parameters
labelstring
hintstring
strstring
flagsnumber
Returns
boolean,string

◆ invisibleButton()

static function invisibleButton ( local  str_id,
local  size 
)

button behavior without the visuals, frequently useful to build custom behaviors using the public api (along with IsItemActive, IsItemHovered, etc.)

Parameters
str_idstring
sizeImVec2
Returns
boolean

◆ isAnyItemActive()

static function isAnyItemActive ( )

is any item active?

Returns
boolean

◆ isAnyItemFocused()

static function isAnyItemFocused ( )

is any item focused?

Returns
boolean

◆ isAnyItemHovered()

static function isAnyItemHovered ( )

is any item hovered?

Returns
boolean

◆ isAnyMouseDown()

static function isAnyMouseDown ( )

is any mouse button held

Returns
boolean

◆ isItemActivated()

static function isItemActivated ( )

was the last item just made active (item was previously inactive).

Returns
boolean

◆ isItemActive()

static function isItemActive ( )

is the last item active? (e.g. button being held, text field being edited. This will continuously return true while holding mouse button on an item. Items that don't interact will always return false)

Returns
boolean

◆ isItemClicked()

static function isItemClicked ( )

is the last item clicked? (e.g. button/node just clicked on) == IsMouseClicked(mouse_button) && IsItemHovered()

Returns
boolean

◆ isItemDeactivated()

static function isItemDeactivated ( )

was the last item just made inactive (item was previously active). Useful for Undo/Redo patterns with widgets that requires continuous editing.

Returns
boolean

◆ isItemDeactivatedAfterEdit()

static function isItemDeactivatedAfterEdit ( )

was the last item just made inactive and made a value change when it was active? (e.g. Slider/Drag moved). Useful for Undo/Redo patterns with widgets that requires continuous editing. Note that you may get false positives (some widgets such as Combo()/ListBox()/Selectable() will return true even when clicking an already selected item).

Returns
boolean

◆ isItemEdited()

static function isItemEdited ( )

did the last item modify its underlying value this frame? or was pressed? This is generally the same as the "bool" return value of many widgets.

Returns
boolean

◆ isItemFocused()

static function isItemFocused ( )

is the last item focused for keyboard/gamepad navigation?

Returns
boolean

◆ isItemHovered()

static function isItemHovered ( )

is the last item hovered? (and usable, aka not blocked by a popup, etc.). See ImGuiHoveredFlags for more options.

Returns
boolean

◆ isItemToggledOpen()

static function isItemToggledOpen ( )

was the last item open state toggled? set by TreeNode().

Returns
boolean

◆ isItemVisible()

static function isItemVisible ( )

is the last item visible? (items may be out of sight because of clipping/scrolling)

Returns
boolean

◆ isKeyDown()

static function isKeyDown ( local  user_key_index)

is key being held. == io.KeysDown[user_key_index]. note that imgui doesn't know the semantic of each entry of io.KeysDown[]. Use your own indices/enums according to how your backend/engine stored them into io.KeysDown[]!

Parameters
user_key_indexnumber
Returns
boolean

◆ isKeyPressed()

static function isKeyPressed ( local  user_key_index,
local  repeat_ 
)

was key pressed (went from !Down to Down). if repeat=true, uses io.KeyRepeatDelay / KeyRepeatRate

Parameters
user_key_indexnumber
repeat_boolean
Returns
boolean

◆ isKeyReleased()

static function isKeyReleased ( local  user_key_index)

was key released (went from Down to !Down)..

Parameters
user_key_indexnumber
Returns
boolean

◆ isMouseClicked()

static function isMouseClicked ( local  button,
local  repeat_ 
)

did mouse button clicked (went from !Down to Down) (0=left, 1=right, 2=middle)

Parameters
buttonnumber
repeat_boolean
Returns
boolean

◆ isMouseDoubleClicked()

static function isMouseDoubleClicked ( local  button)

did mouse button double-clicked. a double-click returns false in IsMouseClicked(). uses io.MouseDoubleClickTime.

Parameters
buttonnumber
Returns
boolean

◆ isMouseDown()

static function isMouseDown ( local  button)

is mouse button held (0=left, 1=right, 2=middle)

Parameters
buttonnumber
Returns
boolean

◆ isMouseDragging()

static function isMouseDragging ( local  button,
local  lock_threshold 
)

is mouse dragging? (if lock_threshold < -1.0f, uses io.MouseDraggingThreshold)

Parameters
buttonnumber
lock_thresholdnumber
Returns
boolean

◆ isMouseHoveringRect()

static function isMouseHoveringRect ( local  r_min,
local  r_max,
local  clip 
)

is mouse hovering given bounding rect (in screen space). clipped by current clipping settings, but disregarding of other consideration of focus/window ordering/popup-block.

Parameters
r_minImVec2
r_maxImVec2
clipboolean
Returns
boolean

◆ isMousePosValid()

static function isMousePosValid ( local  mouse_pos)

by convention we use (-FLT_MAX,-FLT_MAX) to denote that there is no mouse

Parameters
mouse_posImVec2 optional

◆ isMouseReleased()

static function isMouseReleased ( local  button)

did mouse button released (went from Down to !Down)

Parameters
buttonnumber
Returns
boolean

◆ isPopupOpen()

static function isPopupOpen ( local  str_id,
local  flags 
)

return true if the popup is open.

Parameters
str_idstring
flagsnumber
Returns
boolean

◆ isRectVisible()

static function isRectVisible ( local  rect_min,
local  rect_max 
)

test if rectangle (in screen space) is visible / not clipped. to perform coarse clipping on user's side.

Parameters
rect_minImVec2
rect_maxImVec2
Returns
boolean
重载
fun(size:ImVec2):boolean

◆ isVisible()

static function isVisible ( )

◆ isWindowAppearing()

static function isWindowAppearing ( )
Returns
boolean

◆ isWindowCollapsed()

static function isWindowCollapsed ( )
Returns
boolean

◆ isWindowDocked()

static function isWindowDocked ( )

is current window docked into another window?

Returns
boolean

◆ isWindowFocused()

static function isWindowFocused ( )

is current window focused? or its root/child, depending on flags. see flags for options.

Returns
boolean

◆ isWindowHovered()

static function isWindowHovered ( )

is current window hovered (and typically: not blocked by a popup/modal)? see flags for options. NB: If you are trying to check whether your mouse should be dispatched to imgui or to your app, you should use the 'io.WantCaptureMouse' boolean for that! Please read the FAQ!

Returns
boolean

◆ labelText()

static function labelText ( local  label,
local  fmt 
)

display text+label aligned the same way as value+label widgets

Parameters
labelstring
fmtstring

◆ listBox()

static function listBox ( local  label,
local  current_item,
local  items,
local  height_in_items 
)
Parameters
labelstring
current_itemnumber
itemsstring[]
height_in_itemsnumber
Returns
boolean,number

◆ listBoxFooter()

static function listBoxFooter ( )

terminate the scrolling region. only call ListBoxFooter() if ListBoxHeader() returned true!

◆ listBoxHeader()

static function listBoxHeader ( local  label,
local  items_count,
local  height_in_items 
)
Parameters
labelstring
items_countnumber
height_in_itemsnumber
重载
fun(label:string,size:ImVec2):boolean
Returns
boolean

◆ loadIniSettingsFromDisk()

static function loadIniSettingsFromDisk ( local  ini_filename)

call after CreateContext() and before the first call to NewFrame(). NewFrame() automatically calls LoadIniSettingsFromDisk(io.IniFilename).

Parameters
ini_filenamestring

◆ loadIniSettingsFromMemory()

static function loadIniSettingsFromMemory ( local  ini_data,
local  ini_size 
)

call after CreateContext() and before the first call to NewFrame() to provide .ini data from your own data source.

Parameters
ini_datastring
ini_sizenumber

◆ logButtons()

static function logButtons ( )

helper to display buttons for logging to tty/file/clipboard

◆ logFinish()

static function logFinish ( )

stop logging (close file, etc.)

◆ logText()

static function logText ( local  fmt)

pass text data straight to log (without being displayed)

Parameters
fmtstring

◆ logToClipboard()

static function logToClipboard ( )

start logging to OS clipboard

◆ logToFile()

static function logToFile ( )

start logging to file

◆ logToTTY()

static function logToTTY ( )

start logging to tty (stdout)

◆ markdown()

static function markdown ( local  content)
Parameters
contentstring

◆ menuItem()

static function menuItem ( local  label,
local  shortcut,
local  selected,
local  enabled 
)

return true when activated. shortcuts are displayed for convenience but not processed by ImGui at the moment

Parameters
labelstring
shortcutstring optional, nullable
selectedboolean optional
enabledboolean optional
Returns
boolean

◆ newFrame()

static function newFrame ( )

start a new Dear ImGui frame, you can submit any command from this point until Render()/EndFrame().

◆ newLine()

static function newLine ( )

undo a SameLine() or force a new line when in an horizontal-layout context.

◆ nextColumn()

static function nextColumn ( )

next column, defaults to current row or next row if the current row is finished

◆ off()

static function off ( )

◆ on()

static function on ( local  target)
Returns
cc.Layer

◆ openPopup()

static function openPopup ( local  str_id,
local  popup_flags 
)

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

Parameters
str_idstring
popup_flagsnumber

◆ openPopupContextItem()

static function openPopupContextItem ( )

helper to open popup when clicked on last item. return true when just opened. (note: actually triggers on the mouse released event to be consistent with popup behaviors)

Returns
boolean

◆ p()

static function p ( local  x,
local  y 
)

◆ plotHistogram()

static function plotHistogram ( local  label,
local  values,
local  values_count,
local  values_offset,
local  overlay_text,
local  scale_min,
local  scale_max,
local  graph_size,
local  stride 
)
Parameters
labelstring
valuesnumber[]
values_countnumber optional
values_offsetnumber optional
overlay_textstring optional, nullable
scale_minnumber optional
scale_maxnumber optional
graph_sizeImVec2 optional
stridenumber optional

◆ plotLines()

static function plotLines ( local  label,
local  values,
local  values_count,
local  values_offset,
local  overlay_text,
local  scale_min,
local  scale_max,
local  graph_size,
local  stride 
)
Parameters
labelstring
valuesnumber[]
values_countnumber optional
values_offsetnumber optional
overlay_textstring optional, nullable
scale_minnumber optional
scale_maxnumber optional
graph_sizeImVec2 optional
stridenumber optional

◆ popAllowKeyboardFocus()

static function popAllowKeyboardFocus ( )

◆ popButtonRepeat()

static function popButtonRepeat ( )

Cursor / Layout

◆ popClipRect()

static function popClipRect ( )

◆ popFont()

static function popFont ( )

◆ popID()

static function popID ( )

pop from the ID stack.

◆ popItemWidth()

static function popItemWidth ( )

◆ popStyleColor()

static function popStyleColor ( local  count)
Parameters
countnumber

◆ popStyleVar()

static function popStyleVar ( local  count)
Parameters
countnumber

◆ popTextWrapPos()

static function popTextWrapPos ( )

◆ progressBar()

static function progressBar ( local  fraction,
local  size_arg,
local  overlay 
)
Parameters
fractionnumber
size_argImVec2
overlaystring

◆ pushAllowKeyboardFocus()

static function pushAllowKeyboardFocus ( local  allow_keyboard_focus)

allow focusing using TAB/Shift-TAB, enabled by default but you can disable it for certain widgets

Parameters
allow_keyboard_focusboolean

◆ pushButtonRepeat()

static function pushButtonRepeat ( local  repeat_)

in 'repeat' mode, Button*() functions return repeated true in a typematic manner (using io.KeyRepeatDelay/io.KeyRepeatRate setting). Note that you can call IsItemActive() after any Button() to tell if the button is held in the current frame.

Parameters
repeat_boolean

◆ pushClipRect()

static function pushClipRect ( local  clip_rect_min,
local  clip_rect_max,
local  intersect_with_current_clip_rect 
)
Parameters
clip_rect_minImVec2
clip_rect_maxImVec2
intersect_with_current_clip_rectboolean

◆ pushFont()

static function pushFont ( local  font)

use NULL as a shortcut to push default font

Parameters
fontimgui.ImFont

◆ pushID()

static function pushID ( local  id)

push string into the ID stack (will hash string).

push integer into the ID stack (will hash integer).

Parameters
idnumber|string

◆ pushItemWidth()

static function pushItemWidth ( local  item_width)

push width of items for common large "item+label" widgets. >0.0f: width in pixels, <0.0f align xx pixels to the right of window (so -1.0f always align width to the right side). 0.0f = default to ~2/3 of windows width,

Parameters
item_widthnumber

◆ pushStyleColor()

static function pushStyleColor ( local  idx,
local  color 
)
Parameters
idxnumber ImGuiCol
colorImVec4|number

◆ pushStyleVar()

static function pushStyleVar ( local  idx,
local  value 
)
Parameters
idxnumber ImGuiStyleVar
valuenumber|ImVec2

◆ pushTextWrapPos()

static function pushTextWrapPos ( )

push word-wrapping position for Text*() commands. < 0.0f: no wrapping; 0.0f: wrap to end of window (or column); > 0.0f: wrap at 'wrap_pos_x' position in window local space

◆ radioButton() [1/2]

static function radioButton ( local  label,
local  active 
)

use with e.g. if (RadioButton("one", my_value==1)) { my_value = 1; }

Parameters
labelstring
activeboolean
Returns
boolean

◆ radioButton() [2/2]

static function radioButton ( local  label,
local  v,
local  v_button 
)
  • Two args: use with e.g. if (RadioButton("one", my_value==1)) { my_value = 1; }
  • Three args: shortcut to handle the above pattern when value is an integer
Parameters
labelstring
vnumber
v_buttonnumber
Returns
boolean,number
重载
fun(label:string,active:boolean):boolean

◆ render()

static function render ( )

ends the Dear ImGui frame, finalize the draw data. You can get call GetDrawData() to obtain it and run your rendering function (up to v1.60, this used to call io.RenderDrawListsFn(). Nowadays, we allow and prefer calling your render function yourself.)

◆ renderPlatformWindowsDefault()

static function renderPlatformWindowsDefault ( )

call in main loop. will call RenderWindow/SwapBuffers platform functions for each secondary viewport which doesn't have the ImGuiViewportFlags_Minimized flag set. May be reimplemented by user for custom rendering needs.

◆ resetMouseDragDelta()

static function resetMouseDragDelta ( )

◆ sameLine()

static function sameLine ( )

call between widgets or groups to layout them horizontally. X position given in window coordinates.

◆ saveIniSettingsToDisk()

static function saveIniSettingsToDisk ( local  ini_filename)

this is automatically called (if io.IniFilename is not empty) a few seconds after any modification that should be reflected in the .ini file (and also by DestroyContext).

Parameters
ini_filenamestring

◆ saveIniSettingsToMemory()

static function saveIniSettingsToMemory ( )

return a zero-terminated string with the .ini data which you can save by your own mean. call when io.WantSaveIniSettings is set, then save data by your own mean and clear io.WantSaveIniSettings.

Returns
string

◆ selectable()

static function selectable ( local  label,
local  selected,
local  flags,
local  size 
)

"bool selected" carry the selection state (read-only). Selectable() is clicked is returns true so you can modify your selection state. size.x==0.0: use remaining width, size.x>0.0: specify width. size.y==0.0: use label height, size.y>0.0: specify height

Parameters
labelstring
selectedboolean
flagsnumber
sizeImVec2
Returns
boolean

◆ separator()

static function separator ( )

separator, generally horizontal. inside a menu bar or in horizontal layout mode, this becomes a vertical separator.

◆ setCCLabelColor()

static function setCCLabelColor ( local  label,
local  col 
)
Parameters
labelcc.Label
colnumber|ImVec4|boolean

◆ setCCNodeColor()

static function setCCNodeColor ( local  node,
local  col 
)
Parameters
nodecc.Node
colnumber|ImVec4

◆ setClipboardText()

static function setClipboardText ( local  text)
Parameters
textstring

◆ setColorEditOptions()

static function setColorEditOptions ( local  flags)

initialize current options (generally on application startup) if you want to select a default format, picker type, etc. User will be able to change many settings, unless you pass the _NoOptions flag to your calls.

Parameters
flagsnumber

◆ setColumnOffset()

static function setColumnOffset ( local  column_index,
local  offset_x 
)

set position of column line (in pixels, from the left side of the contents region). pass -1 to use current column

Parameters
column_indexnumber
offset_xnumber

◆ setColumnWidth()

static function setColumnWidth ( local  column_index,
local  width 
)

set column width (in pixels). pass -1 to use current column

Parameters
column_indexnumber
widthnumber

◆ setCursorPos()

static function setCursorPos ( local  local_pos)
  are using the main, absolute coordinate system.
Parameters
local_posImVec2

◆ setCursorPosX()

static function setCursorPosX ( local  local_x)
  GetWindowPos() + GetCursorPos() == GetCursorScreenPos() etc.)
Parameters
local_xnumber

◆ setCursorPosY()

static function setCursorPosY ( local  local_y)
Parameters
local_ynumber

◆ setCursorScreenPos()

static function setCursorScreenPos ( local  pos)

cursor position in absolute screen coordinates [0..io.DisplaySize]

Parameters
posImVec2

◆ setDragDropPayload()

static function setDragDropPayload ( local  type,
local  value,
local  flags 
)

type is a user defined string of maximum 32 characters. Strings starting with '_' are reserved for dear imgui internal types.

Parameters
typestring
valueany
flagsnumber
Returns
boolean

◆ setItemAllowOverlap()

static function setItemAllowOverlap ( )

allow last item to be overlapped by a subsequent item. sometimes useful with invisible buttons, selectables, etc. to catch unused area.

◆ setItemDefaultFocus()

static function setItemDefaultFocus ( )

make last item the default focused item of a window.

◆ setKeyboardFocusHere()

static function setKeyboardFocusHere ( )

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

◆ setMarkdownFont()

static function setMarkdownFont ( local  index,
local  font,
local  seperator,
local  scale 
)
Parameters
indexnumber
fontimgui.ImFont
seperatorboolean
scalenumber optional

◆ setMarkdownImageCallback()

static function setMarkdownImageCallback ( local  f)
Parameters
ffun(text:string,link:string):cc.Sprite,ImVec2,ImVec4,ImVec4

◆ setMarkdownLinkCallback()

static function setMarkdownLinkCallback ( local  f)
Parameters
ffun(text:string,link:string,isImage:boolean)

◆ setMarkdownLinkIcon()

static function setMarkdownLinkIcon ( local  icon)
Parameters
iconstring

◆ setMouseCursor()

static function setMouseCursor ( local  cursor_type)

set desired cursor type

Parameters
cursor_typenumber

◆ setNextItemOpen()

static function setNextItemOpen ( local  is_open,
local  cond 
)

set next TreeNode/CollapsingHeader open state.

Parameters
is_openboolean
condnumber

◆ setNextItemWidth()

static function setNextItemWidth ( local  item_width)

set width of the next common large "item+label" widget. >0.0f: width in pixels, <0.0f align xx pixels to the right of window (so -1.0f always align width to the right side)

Parameters
item_widthnumber

◆ setNextWindowBgAlpha()

static function setNextWindowBgAlpha ( local  alpha)

set next window background color alpha. helper to easily modify ImGuiCol_WindowBg/ChildBg/PopupBg. you may also use ImGuiWindowFlags_NoBackground.

Parameters
alphanumber

◆ setNextWindowCollapsed()

static function setNextWindowCollapsed ( local  collapsed,
local  cond 
)

set next window collapsed state. call before Begin()

Parameters
collapsedboolean
condnumber

◆ setNextWindowContentSize()

static function setNextWindowContentSize ( local  size)

set next window content size (~ enforce the range of scrollbars). not including window decorations (title bar, menu bar, etc.). set an axis to 0.0f to leave it automatic. call before Begin()

Parameters
sizeImVec2

◆ setNextWindowDockID()

static function setNextWindowDockID ( local  dock_id,
local  cond 
)

set next window dock id (FIXME-DOCK)

Parameters
dock_idnumber
condnumber

◆ setNextWindowFocus()

static function setNextWindowFocus ( )

set next window to be focused / front-most. call before Begin()

◆ setNextWindowPos()

static function setNextWindowPos ( local  pos,
local  cond,
local  pivot 
)

set next window position. call before Begin(). use pivot=(0.5f,0.5f) to center on given point, etc.

Parameters
posImVec2
condnumber
pivotImVec2

◆ setNextWindowSize()

static function setNextWindowSize ( local  size,
local  cond 
)

set next window size. set axis to 0.0f to force an auto-fit on this axis. call before Begin()

Parameters
sizeImVec2
condnumber

◆ setNextWindowSizeConstraints()

static function setNextWindowSizeConstraints ( local  size_min,
local  size_max 
)

set next window size limits. use -1,-1 on either X/Y axis to preserve the current size. Sizes will be rounded down. Use callback to apply non-trivial programmatic constraints.

Parameters
size_minImVec2
size_maxImVec2

◆ setNextWindowViewport()

static function setNextWindowViewport ( local  viewport_id)

set next window viewport

Parameters
viewport_idnumber

◆ setScrollFromPosX()

static function setScrollFromPosX ( local  local_x,
local  center_x_ratio 
)

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

Parameters
local_xnumber
center_x_rationumber

◆ setScrollFromPosY()

static function setScrollFromPosY ( local  local_y,
local  center_y_ratio 
)

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

Parameters
local_ynumber
center_y_rationumber

◆ setScrollHereX()

static function setScrollHereX ( )

adjust scrolling amount to make current cursor position visible. center_x_ratio=0.0: left, 0.5: center, 1.0: right. When using to make a "default/current item" visible, consider using SetItemDefaultFocus() instead.

◆ setScrollHereY()

static function setScrollHereY ( )

adjust 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 SetItemDefaultFocus() instead.

◆ setScrollX()

static function setScrollX ( local  scroll_x)

set scrolling amount [0..GetScrollMaxX()]

Parameters
scroll_xnumber

◆ setScrollY()

static function setScrollY ( local  scroll_y)

set scrolling amount [0..GetScrollMaxY()]

Parameters
scroll_ynumber

◆ setStyleColor()

static function setStyleColor ( local  idx,
local  col 
)
Parameters
idxnumber
colImVec4

◆ setTabItemClosed()

static function setTabItemClosed ( local  tab_or_docked_window_label)

notify TabBar or Docking system of a closed tab/window ahead (useful to reduce visual flicker on reorderable tab bars). For tab-bar: call after BeginTabBar() and before Tab submissions. Otherwise call with a window name.

Parameters
tab_or_docked_window_labelstring

◆ setToggleEnable()

static function setToggleEnable ( local  b)

set if imgui can be toggled by keyboard

◆ setTooltip()

static function setTooltip ( local  fmt)

set a text-only tooltip, typically use with ImGui::IsItemHovered(). override any previous call to SetTooltip().

Parameters
fmtstring

◆ setVisible()

static function setVisible ( local  b)

◆ setWindowCollapsed()

static function setWindowCollapsed ( local  name,
local  collapsed,
local  cond 
)

set named window collapsed state

Parameters
namestring
collapsedboolean
condnumber

◆ setWindowFocus()

static function setWindowFocus ( local  name)

set named window to be focused / front-most. use NULL to remove focus.

Parameters
namestring

◆ setWindowFontScale()

static function setWindowFontScale ( local  scale)

set font scale. Adjust IO.FontGlobalScale if you want to scale all windows

Parameters
scalenumber

◆ setWindowPos()

static function setWindowPos ( local  name,
local  pos,
local  cond 
)

set named window position.

Parameters
namestring
posImVec2
condnumber

◆ setWindowSize()

static function setWindowSize ( local  name,
local  size,
local  cond 
)

set named window size. set axis to 0.0f to force an auto-fit on this axis.

Parameters
namestring
sizeImVec2
condnumber

◆ show()

static function show ( )

◆ showAboutWindow()

static function showAboutWindow ( local  open)

◆ showDemoWindow()

static function showDemoWindow ( local  open)

◆ showFontSelector()

static function showFontSelector ( local  label)

add font selector block (not a window), essentially a combo listing the loaded fonts.

Parameters
labelstring

◆ showMetricsWindow()

static function showMetricsWindow ( local  open)

◆ showStyleEditor()

static function showStyleEditor ( local  show)
Parameters
showboolean

◆ showStyleSelector()

static function showStyleSelector ( local  label)

add style selector block (not a window), essentially a combo listing the default styles.

Parameters
labelstring
Returns
boolean

◆ showUserGuide()

static function showUserGuide ( )

add basic help/info block (not a window): how to manipulate ImGui as a end-user (mouse/keyboard controls).

◆ shutdown()

static function shutdown ( )

◆ size()

static function size ( local ...  )

◆ sliderAngle()

static function sliderAngle ( local  label,
local  v_rad,
local  v_deg_min,
local  v_deg_max,
local  format 
)
Parameters
labelstring
v_radnumber
v_deg_minnumber
v_deg_maxnumber
formatstring
Returns
boolean,number

◆ sliderFloat()

static function sliderFloat ( local  label,
local  value,
local  v_min,
local  v_max,
local  format,
local  power 
)
Parameters
labelstring
valuenumber
v_minnumber
v_maxnumber
formatstring
powernumber
Returns
boolean,number

◆ sliderFloatN()

static function sliderFloatN ( local  label,
local  array,
local  v_min,
local  v_max,
local  format,
local  power 
)
Parameters
labelstring
arraynumber[]
v_minnumber
v_maxnumber
formatstring
powernumber
Returns
boolean,number[]

◆ sliderInt()

static function sliderInt ( local  label,
local  value,
local  v_min,
local  v_max,
local  format 
)
Parameters
labelstring
valuenumber
v_minnumber
v_maxnumber
formatstring
Returns
boolean,number

◆ sliderIntN()

static function sliderIntN ( local  label,
local  array,
local  v_min,
local  v_max,
local  format,
local  power 
)
Parameters
labelstring
arraynumber[]
v_minnumber
v_maxnumber
formatstring
Returns
boolean,number[]

◆ smallButton()

static function smallButton ( local  label)

button with FramePadding=(0,0) to easily embed within text

Parameters
labelstring
Returns
boolean

◆ spacing()

static function spacing ( )

add vertical spacing.

◆ styleColorsClassic()

static function styleColorsClassic ( )

classic imgui style

◆ styleColorsDark()

static function styleColorsDark ( )

new, recommended style (default)

◆ styleColorsLight()

static function styleColorsLight ( )

best used with borders and a custom, thicker font

◆ text()

static function text ( local  fmt)

simple formatted text

Parameters
fmtstring

◆ textColored()

static function textColored ( local  col,
local  fmt 
)

shortcut for PushStyleColor(ImGuiCol_Text, col); Text(fmt); PopStyleColor();

Parameters
colImVec4
fmtstring

◆ textDisabled()

static function textDisabled ( local  fmt)

shortcut for PushStyleColor(ImGuiCol_Text, style.Colors[ImGuiCol_TextDisabled]); Text(fmt); PopStyleColor();

Parameters
fmtstring

◆ textUnformatted()

static function textUnformatted ( local  text,
local  text_end 
)

raw text without formatting. Roughly equivalent to Text("%s", text) but: A) doesn't require null terminated string if 'text_end' is specified, B) it's faster, no memory copy is done, no buffer size limits, recommended for long chunks of text.

Parameters
textstring
text_endstring

◆ textWrapped()

static function textWrapped ( local  fmt)

shortcut for PushTextWrapPos(0.0f); Text(fmt); PopTextWrapPos();. Note that this won't work on an auto-resizing window if there's no other widgets to extend the window width, yoy may need to set a size using SetNextWindowSize().

Parameters
fmtstring

◆ tocc4b()

static function tocc4b ( local  imVec4)
Parameters
imVec4ImVec4
Returns
color4b_table

◆ toccsize()

static function toccsize ( local  imVec2)
Parameters
imVec2ImVec2
Returns
size_table

◆ treeNode()

static function treeNode ( local  str_id,
local  fmt 
)

helper variation to easily decorelate the id from the displayed string. Read the FAQ about why and how to use ID. to align arbitrary text at the same level as a TreeNode() you can use Bullet().

Parameters
str_idstring
fmtstring
Returns
boolean
重载
fun(label:string):boolean

◆ treeNodeEx()

static function treeNodeEx ( local  str_id,
local  flags,
local  fmt 
)
Parameters
str_idstring
flagsnumber
fmtstring
Returns
boolean
重载
fun(label:string, flags:number):boolean

◆ treePop()

static function treePop ( )

~ Unindent()+PopId()

◆ treePush()

static function treePush ( local  str_id)

"

Parameters
str_idstring
重载
fun()

◆ unindent()

static function unindent ( )

move content position back to the left, by style.IndentSpacing or indent_w if != 0

◆ unpack()

static function unpack ( local  t)

◆ updatePlatformWindows()

static function updatePlatformWindows ( )

call in main loop. will call CreateWindow/ResizeWindow/etc. platform functions for each secondary viewport, and DestroyWindow for each inactive viewport.

◆ vec2()

static function vec2 ( local  x,
local  y 
)

◆ vec4()

static function vec4 ( local  x,
local  y,
local  z,
local  w 
)

◆ vSliderFloat()

static function vSliderFloat ( local  label,
local  size,
local  value,
local  v_min,
local  v_max,
local  format,
local  power 
)
Parameters
labelstring
sizeImVec2
valuenumber
v_minnumber
v_maxnumber
formatstring
powernumber
Returns
boolean,number

◆ vSliderInt()

static function vSliderInt ( local  label,
local  size,
local  value,
local  v_min,
local  v_max,
local  format 
)
Parameters
labelstring
sizeImVec2
valuenumber
v_minnumber
v_maxnumber
formatstring
Returns
boolean,number

The documentation for this class was generated from the following files: