Class ImGuiLibrary¶
Namespace: Apogee.DevTools
Assembly: Apogee.DevTools.dll
Dear ImGui for Luau scripts, as the global table imgui: snake_case functions over the same calls the dev tools use. A widget returns
changed, value; a window or tree that can be open returns whether it is; every begin has its end (ImGui recovers from a script that forgets,
at the end of the frame). With no frame open every call does nothing and returns what it was given, so tool code can stay in a shipped game.
Ids are the labels, with ImGui's ## and ### conventions.
[ScriptLibrary("imgui")]
public static class ImGuiLibrary
Inheritance¶
Inherited Members¶
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Methods¶
BeginChild(string, float, float)¶
A scrolling region inside a window. Always call end_child.
public static bool BeginChild(string id, float width = 0, float height = 0)
Parameters¶
id string
width float
height float
Returns¶
BeginDisabled(bool)¶
public static void BeginDisabled(bool disabled = true)
Parameters¶
disabled bool
BeginMainMenuBar()¶
public static bool BeginMainMenuBar()
Returns¶
BeginMenu(string)¶
public static bool BeginMenu(string label)
Parameters¶
label string
Returns¶
BeginPopup(string)¶
A popup opened with open_popup; when it returns true, fill it and call end_popup.
public static bool BeginPopup(string id)
Parameters¶
id string
Returns¶
BeginPopupModal(string)¶
public static bool BeginPopupModal(string title)
Parameters¶
title string
Returns¶
BeginTabBar(string)¶
public static bool BeginTabBar(string id)
Parameters¶
id string
Returns¶
BeginTabItem(string)¶
public static bool BeginTabItem(string label)
Parameters¶
label string
Returns¶
BeginTable(string, int, ImGuiTableFlags)¶
A table; when it returns true, fill it and call end_table.
public static bool BeginTable(string id, int columns, ImGuiTableFlags flags = ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersInnerH | ImGuiTableFlags.SizingStretchProp)
Parameters¶
id string
columns int
flags ImGuiTableFlags
Returns¶
BeginWindow(string, Value, ImGuiWindowFlags)¶
Begins a window. Pass true for open to give it a close button; the second result is whether it is still open. Always call end_window.
public static (bool Visible, bool Open) BeginWindow(string title, Value open = default, ImGuiWindowFlags flags = ImGuiWindowFlags.None)
Parameters¶
title string
open Value
flags ImGuiWindowFlags
Returns¶
Button(string)¶
public static bool Button(string label)
Parameters¶
label string
Returns¶
Checkbox(string, bool)¶
public static (bool Changed, bool Value) Checkbox(string label, bool value)
Parameters¶
label string
value bool
Returns¶
CloseCurrentPopup()¶
public static void CloseCurrentPopup()
CollapsingHeader(string, bool)¶
public static bool CollapsingHeader(string label, bool openByDefault = false)
Parameters¶
label string
openByDefault bool
Returns¶
ColorEdit(string, float[])¶
A color editor: red, green, blue and alpha, from 0 to 1.
public static (bool Changed, float[] Color) ColorEdit(string label, float[] color)
Parameters¶
label string
color float[]
Returns¶
Combo(string, int, string[])¶
A drop-down: index counts from 1, like a Luau list.
public static (bool Changed, int Index) Combo(string label, int index, string[] items)
Parameters¶
label string
index int
items string[]
Returns¶
ContentRegionAvail()¶
The room left in the window: width and height.
public static (float Width, float Height) ContentRegionAvail()
Returns¶
DisplaySize()¶
public static (float Width, float Height) DisplaySize()
Returns¶
DragFloat(string, float, float, float, float)¶
public static (bool Changed, float Value) DragFloat(string label, float value, float speed = 0.1, float min = 0, float max = 0)
Parameters¶
label string
value float
speed float
min float
max float
Returns¶
DragFloat3(string, Vector3, float)¶
public static (bool Changed, Vector3 Value) DragFloat3(string label, Vector3 value, float speed = 0.1)
Parameters¶
label string
value Vector3
speed float
Returns¶
Dummy(float, float)¶
public static void Dummy(float width, float height)
Parameters¶
width float
height float
EndChild()¶
public static void EndChild()
EndDisabled()¶
public static void EndDisabled()
EndMainMenuBar()¶
public static void EndMainMenuBar()
EndMenu()¶
public static void EndMenu()
EndPopup()¶
public static void EndPopup()
EndTabBar()¶
public static void EndTabBar()
EndTabItem()¶
public static void EndTabItem()
EndTable()¶
public static void EndTable()
EndWindow()¶
public static void EndWindow()
Indent(float)¶
public static void Indent(float width = 0)
Parameters¶
width float
InputFloat(string, float)¶
public static (bool Changed, float Value) InputFloat(string label, float value)
Parameters¶
label string
value float
Returns¶
InputInt(string, int)¶
public static (bool Changed, int Value) InputInt(string label, int value)
Parameters¶
label string
value int
Returns¶
InputText(string, string, int)¶
A text field of at most max_length bytes.
public static (bool Changed, string Value) InputText(string label, string value, int maxLength = 256)
Parameters¶
label string
value string
maxLength int
Returns¶
IsItemClicked()¶
public static bool IsItemClicked()
Returns¶
IsItemHovered()¶
public static bool IsItemHovered()
Returns¶
MenuItem(string, string?, bool)¶
public static bool MenuItem(string label, string? shortcut = null, bool selected = false)
Parameters¶
label string
shortcut string?
selected bool
Returns¶
OpenPopup(string)¶
public static void OpenPopup(string id)
Parameters¶
id string
PlotLines(string, float[], float, float, float)¶
public static void PlotLines(string label, float[] values, float min = 0, float max = 0, float height = 60)
Parameters¶
label string
values float[]
min float
max float
height float
PopId()¶
public static void PopId()
PopStyleColor(int)¶
public static void PopStyleColor(int count = 1)
Parameters¶
count int
PopStyleVar(int)¶
public static void PopStyleVar(int count = 1)
Parameters¶
count int
ProgressBar(float, float, float, string?)¶
public static void ProgressBar(float fraction, float width = -1, float height = 0, string? overlay = null)
Parameters¶
fraction float
width float
height float
overlay string?
PushId(string)¶
public static void PushId(string id)
Parameters¶
id string
PushIdNumber(int)¶
public static void PushIdNumber(int id)
Parameters¶
id int
PushStyleColor(ImGuiCol, float[])¶
public static void PushStyleColor(ImGuiCol color, float[] value)
Parameters¶
color ImGuiCol
value float[]
PushStyleVar(ImGuiStyleVar, float)¶
public static void PushStyleVar(ImGuiStyleVar variable, float value)
Parameters¶
variable ImGuiStyleVar
value float
SameLine()¶
public static void SameLine()
Selectable(string, bool)¶
public static bool Selectable(string label, bool selected = false)
Parameters¶
label string
selected bool
Returns¶
Separator()¶
public static void Separator()
SetNextItemWidth(float)¶
public static void SetNextItemWidth(float width)
Parameters¶
width float
SetNextWindowPos(float, float, ImGuiCond)¶
public static void SetNextWindowPos(float x, float y, ImGuiCond condition = ImGuiCond.FirstUseEver)
Parameters¶
x float
y float
condition ImGuiCond
SetNextWindowSize(float, float, ImGuiCond)¶
public static void SetNextWindowSize(float width, float height, ImGuiCond condition = ImGuiCond.FirstUseEver)
Parameters¶
width float
height float
condition ImGuiCond
SetTooltip(string)¶
public static void SetTooltip(string text)
Parameters¶
text string
ShowDemoWindow()¶
Dear ImGui's own demo window: every widget there is, for a look at what is possible.
public static void ShowDemoWindow()
SliderFloat(string, float, float, float)¶
public static (bool Changed, float Value) SliderFloat(string label, float value, float min, float max)
Parameters¶
label string
value float
min float
max float
Returns¶
SliderInt(string, int, int, int)¶
public static (bool Changed, int Value) SliderInt(string label, int value, int min, int max)
Parameters¶
label string
value int
min int
max int
Returns¶
Spacing()¶
public static void Spacing()
TableHeadersRow()¶
public static void TableHeadersRow()
TableNextColumn()¶
public static bool TableNextColumn()
Returns¶
TableNextRow()¶
public static void TableNextRow()
TableSetupColumn(string)¶
public static void TableSetupColumn(string label)
Parameters¶
label string
Text(string)¶
public static void Text(string text)
Parameters¶
text string
TextColored(float[], string)¶
Text in a color: a table of 3 or 4 numbers from 0 to 1.
public static void TextColored(float[] color, string text)
Parameters¶
color float[]
text string
TextDisabled(string)¶
public static void TextDisabled(string text)
Parameters¶
text string
TextWrapped(string)¶
public static void TextWrapped(string text)
Parameters¶
text string
TreeNode(string)¶
A tree node; when it returns true, call tree_pop after its content.
public static bool TreeNode(string label)
Parameters¶
label string
Returns¶
TreePop()¶
public static void TreePop()
Unindent(float)¶
public static void Unindent(float width = 0)
Parameters¶
width float
WantCaptureKeyboard()¶
public static bool WantCaptureKeyboard()
Returns¶
WantCaptureMouse()¶
True while ImGui wants the mouse: the pointer is over a window, so the game should not also react to a click.
public static bool WantCaptureMouse()