ImGui bindings.
ImGui bindings.
class UI::Texture
Represents a texture for the UI API.
class UI::Font
Represents a font for the UI API.
class UI::ListClipper
Helper class to manually clip large lists of items. To use this, create an instance on the stack. Call Begin, or pass the the total item count the constructor which will call Begin for you. Make a while loop with the condition clipper.Step(). Inside of the loop, make a for loop with int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++. Inside of the for loop, put whatever UI elements you need for the item at index i. Remember that all UI items in the list must be the same height for ListClipper to work.
class UI::InputTextCallbackData
Callback data for text input widgets. Do not keep handles of this around!
class UI::TableColumnSortSpecs
Sorting specification for a single column of a table.
class UI::TableSortSpecs
Sorting information for tables. Do not keep this object around! Use the Dirty property to see if the sorting changed, then set it to false when you've sorted your list.
class UI::DrawList
A drawing list for a layer on the UI.
Texture@ UI::LoadTexture(const string&in filename)
Load a texture for the UI API.
UI::Texture@ Texture@ UI::LoadTexture(MemoryBuffer&in buffer)
Load a texture for the UI API from a memory buffer.
UI::Texture@ Font@ UI::LoadSystemFont(const string&in filename)
Loads a font from the system for use in the UI API. Unlike LoadFont(), this function returns null when the font is not found. The system fonts may be different for every user across different operating systems and platforms.
UI::Font@ Font@ UI::LoadFont(const string&in filename, float size = 16.0f)
Loads a font for use in the UI API.
UI::Font@ Font@ UI::LoadFont(const string&in filename, float size, const uint[]@, bool ba = false, bool bb = false, bool bc = false)
Loads a font for use in the UI API.
UI::Font@ Font@ UI::LoadFont(const string&in filename, float size, int minChars, int maxChars, bool = false, bool = false, bool = false)
Loads a font for use in the UI API. Consider using the first LoadFont overload instead of this one, as it is slightly simpler.
UI::Font@ int UI::GetDefaultWindowFlags()
Return the preferred window flags as set by the user in the Openplanet settings.
int bool UI::Begin(const string&in title, int flags = UI::GetDefaultWindowFlags())
Begins an imgui window.
bool bool UI::Begin(const string&in title, bool&out open, int flags = UI::GetDefaultWindowFlags())
Begins an imgui window.
bool void UI::End()
Ends an imgui window. Must always be called even if Begin returns false!
void UI::BeginGroup()
Begins a new group.
void UI::EndGroup()
Ends a group.
void UI::BeginFormattingGroup()
Begins the formatting group for $-style formatting. This means that 2 consecutive widgets will share the color stack (and the default text color) of the first widget.
void UI::EndFormattingGroup()
Ends the formatting group.
void UI::BeginDisabled(bool disabled = true)
Begins a group of disabled widgets.
void UI::EndDisabled()
Ends a group of disabled widgets.
void UI::PushStyleColor(Col idx, const vec4&in col)
Temporarily pushes a color change for the next widgets. You must call PopStyleColor() sometime after!
void UI::PopStyleColor(int count = 1)
Pops one or more temporary color changes.
void UI::PushStyleVar(StyleVar var, float value)
Temporarily pushes a style change for the next widgets. You must call PopStyleVar() sometime after!
void UI::PushStyleVar(StyleVar var, const vec2&in value)
Temporarily pushes a style change for the next widgets. You must call PopStyleVar() sometime after!
void UI::PopStyleVar(int count = 1)
Pops one or more temporary style changes.
float UI::GetStyleVarFloat(StyleVar var)
Gets the current float value of a style variable.
float vec2 UI::GetStyleVarVec2(StyleVar var)
Gets the current vector value of a style variable.
vec2 void UI::SetScrollX(float x)
Set scrolling amount, from 0 to GetScrollMaxX().
void UI::SetScrollY(float y)
Set scrolling amount, from 0 to GetScrollMaxY().
void UI::SetScrollHereX(float center_x_ratio = 0.5f)
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.
void UI::SetScrollHereY(float center_y_ratio = 0.5f)
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.
void UI::SetScrollFromPosX(float local_x, float center_x_ratio = 0.5f)
Adjust scrolling amount to make given position visible. Generally GetCursorStartPos() + offset to compute a valid position.
void UI::SetScrollFromPosY(float local_y, float center_y_ratio = 0.5f)
Adjust scrolling amount to make given position visible. Generally GetCursorStartPos() + offset to compute a valid position.
void UI::SetNextWindowSize(int w, int h, Cond cond = UI::Cond::Appearing)
Sets the size for the next window created with UI::Begin(). The size is automatically scaled by UI::GetScale().
void UI::SetNextWindowPos(int x, int y, Cond cond = UI::Cond::Appearing, float pivotx = 0.0f, float pivoty = 0.0f)
Sets the position for the next window created with UI::Begin(). Pivot floats can be used to align the window on the given point. The position is automatically scaled by UI::GetScale().
void UI::SetNextWindowContentSize(int w, int h = 0)
Sets the size for the next window contents. Set height to 0 to only set width. The size is automatically scaled by UI::GetScale().
void UI::SetNextWindowSizeConstraints(int min_width, int min_height, int max_width, int max_height)
Sets next window size limits. Use 0 if you don't want limits. Use -1 for both min and max of same axis to preserve current size (which itself is a constraint). The size is automatically scaled by UI::GetScale().
void UI::SetNextWindowCollapsed(bool collapsed, Cond cond = UI::Cond::None)
Sets next window collapsed state.
void UI::SetNextWindowBgAlpha(float alpha)
Sets next window background color alpha. This is a helper to easily override the alpha component of UI::Col::WindowBg, ChildBg, and PopupBg. You may also use UI::WindowFlags::NoBackground.
void UI::SetNextItemWidth(float w)
Sets the width of the next item. The width is automatically scaled by UI::GetScale().
void UI::SetNextItemOpen(bool is_open, Cond cond = UI::Cond::None)
Sets whether the next item should be open.
void UI::PushID(const ?&in)
Pushes an ID to the stack.
void UI::PushID(int id)
Pushes an ID to the stack.
void UI::PushID(const string&in id)
Pushes an ID to the stack.
void UI::PopID()
Pops an ID from the stack.
void UI::PushFont(Font@ font)
Pushes a font to the stack using the font's legacy size. This is the equivalent to calling UI::PushFont(font, font.FontSize). Note that this overload will always push the legacy size of the font as the font size, it will not leave the font size as-is.
void UI::PushFont(Font@ font, float size)
Pushes a font and/or font size to the stack.
void UI::PopFont()
Pops a font from the stack.
void UI::PushFontSize(float size)
Pushes a font size to the stack using the current font. This is equivalent to calling UI::PushFont(null, size).
void UI::PopFontSize()
Pops a font size from the stack. This is equivalent to calling UI::PopFont().
void UI::PushItemWidth(float item_width)
Pushes width of items.
void UI::PopItemWidth()
Pops width of items.
void UI::SameLine(float offset_from_start_x = 0.0f, float spacing = -1.0f)
Marks the next control to be drawn on the same line as the last one.
void UI::NewLine()
Marks the next control to be drawn on the next line rather than the current line.
void UI::Indent(float w = 0.0f)
Move content position toward the right, by w, or style.IndentSpacing if w <= 0.
void UI::Unindent(float w = 0.0f)
move content position back to the left, by w, or style.IndentSpacing if w <= 0.
void UI::Separator()
Separator line.
void UI::Separator(int flags, float thickness = 1.0f)
Separator line with custom flags and thickness.
void UI::SeparatorText(const string&in label)
Separator line with text in it.
void UI::SeparatorTextOpenplanet(const string&in label)
Separator line with text in it, where the text is the same color as the line. This matches Openplanet's own UI.
void UI::Dummy(const vec2&in size)
Dummy space.
void UI::Dummy(const vec2&in size, float text_baseline_y)
Dummy space with a custom baseline.
void UI::PushTextWrapPos(float wrap_local_pos_x = 0.0f)
Push word-wrapping position for Text*() commands. Less than 0: no wrapping; 0: wrap to end of window (or column); > 0: wrap at the given position in window local space.
void UI::PopTextWrapPos()
Pops word-wrapping position for Text*() commands.
int UI::CalcWordWrapPosition(float size, const string&in text, float wrap_width, int text_offset = 0, Font@ font = null)
Calculates the word wrapping position of the given string.
int bool UI::Button(const string&in label, const vec2&in size = vec2())
Clickable button. Returns true if it was clicked.
bool bool UI::ButtonColored(const string&in label, float h, float s = 0.6f, float v = 0.6f, const vec2&in size = vec2())
Clickable button with a specific color. Returns true if it was clicked.
bool bool UI::InvisibleButton(const string&in id, const vec2&in size, int flags = UI::ButtonFlags::None)
Clickable invisible button. Returns true if it was clicked.
bool void UI::Text(const string&in text, int length = -1)
Simple text label with an optional length.
void UI::TextAligned(float align_x, float size_x, const string&in text)
Simple text label with alignment.
void UI::TextWrapped(const string&in text)
Simple text label with word wrapping.
void UI::TextWrappedWindow(const string&in text, float new_line_padding = 0, float extra_wrap_size = 0)
Simple text label with word wrapping, but the text resets to the start of the window instead of the starting cursor position.
void UI::TextDisabled(const string&in text)
Simple text label, but in its disabled color.
void UI::LabelText(const string&in label, const string&in text)
Text label with a value.
bool UI::TextLink(const string&in label)
Hyperlink text button. Returns true when clicked.
bool void UI::TextLinkOpenURL(const string&in label, const string&in url)
Hyperlink text button. Automatically opens the given URL when clicked.
void UI::PlotLines(const string&in label, const float[]&in values, int offset = 0, float height = 0.0f)
Line graph.
void UI::PlotHistogram(const string&in label, const float[]&in values, int offset = 0, float height = 0.0f)
Histogram graph.
bool UI::Checkbox(const string&in label, bool value)
Checkbox. For value, pass the current value. The return value is the new value.
bool bool UI::RadioButton(const string&in label, bool active)
Radio button. For active, pass whether the current value is active. Returns true if the button was pressed.
bool void UI::ProgressBar(float fraction, const vec2&in size = vec2(-1, 0), const string&in overlay = "")
Progress bar.
void UI::EndMenuBar()
Ends an imgui menu bar.
void UI::EndMenu()
Ends an imgui menu.
bool UI::MenuItem(const string&in label, const string&in shortcut = "", bool selected = false, bool enabled = true)
Clickable menu item. Returns true when clicked.
bool bool UI::IsWindowAppearing()
Returns true if the previous window is just now appearing.
bool bool UI::TreeNode(const string&in text, int flags = UI::TreeNodeFlags::None)
Node in a tree list. Returns true if opened.
bool void UI::TreePop()
End of the previously tree node. Must only be called if TreeNode() returned true.
void UI::TreeAdvanceToLabelPos()
Advance the cursor position to the normal label position for tree nodes.
bool UI::CollapsingHeader(const string&in label)
Collapsable header. Returns true if open.
bool void UI::Columns(int count, const string&in id = "", bool border = true)
Begins a table layout. Call this with count set to 1 to reset to normal.
void UI::NextColumn()
Goes to the next column.
bool UI::IsItemHovered(int flags = UI::HoveredFlags::None)
Returns true if the mouse is hovering the previous control.
bool bool UI::IsItemClicked(MouseButton button = UI::MouseButton::Left)
Returns true if the previous control is clicked.
bool vec2 UI::CalcItemSize(const vec2&in size, float w, float h)
Calculate full item size given user provided 'size' parameter and default width/height. Default width is often == CalcItemWidth().
vec2 bool UI::Shortcut(int key_chord, int flags = UI::InputFlags::None)
Returns true if the given shortcut was pressed.
bool void UI::SetNextItemShortcut(int key_chord, int flags = UI::InputFlags::None)
Sets a shortcut for the next item.
void UI::SetItemKeyOwner(Key key, int flags = UI::InputFlags::None)
Set key owner to last item ID if it is hovered or active.
bool UI::IsMouseDown(MouseButton button = UI::MouseButton::Left)
Returns true if the given mouse button is down.
bool bool UI::IsMouseClicked(MouseButton button = UI::MouseButton::Left, bool repeat = false)
Returns true if the given mouse button was just clicked.
bool bool UI::IsMouseReleased(MouseButton button = UI::MouseButton::Left)
Returns true if the given mouse button was just released.
bool bool UI::IsMouseDoubleClicked(MouseButton button = UI::MouseButton::Left)
Returns true if the given mouse button was just double clicked.
bool bool UI::IsMouseDragging(MouseButton button = UI::MouseButton::Left, float lock_threshold = -1)
Returns true if the mouse is dragging.
bool bool UI::IsMouseHoveringRect(const vec2&in r_min, const vec2&in r_max, bool clip = true)
Returns true if the mouse is hovering the given bounding rect (in screen space). Clipped by current clipping settings, but disregarding of other consideration of focus/window ordering/popup-block.
bool vec2 UI::GetMouseDragDelta(MouseButton button = UI::MouseButton::Left, float lock_threshold = -1)
Returns the delta from the initial clicking position while the mouse button is pressed or was just released. This is locked and will return 0.0f until the mouse moves past a distance threshold at least once.
vec2 void UI::SetItemTooltip(const string&in text)
Sets the last item's tooltip on mouse hover. This is a shorthand for IsItemHovered() and SetTooltip().
void UI::SetTooltip(const string&in text)
Sets the tooltip to currently show on the mouse cursor. See also SetItemTooltip().
void UI::BeginTooltip()
Begins a tooltip dialog.
bool UI::BeginItemTooltip()
Begins a tooltip when the last item has been hovered. This is a shortcut for IsItemHovered() and BeginTooltip().
bool void UI::EndTooltip()
Ends a tooltip dialog.
void UI::OpenPopup(const string&in id)
Opens a popup with the given ID. Must be within the same scope of ID's.
void UI::CloseCurrentPopup()
Closes the current popup.
bool UI::BeginPopup(const string&in id, int flags = UI::WindowFlags::None)
Begins a popup.
bool bool UI::BeginPopupModal(const string&in id, int flags = UI::WindowFlags::None)
Begins a modal popup.
bool bool UI::BeginPopupModal(const string&in id, bool&out open, int flags = UI::WindowFlags::None)
Begins a modal popup.
bool void UI::EndPopup()
Ends a popup.
bool UI::BeginCombo(const string&in label, const string&in current, int flags = UI::ComboFlags::None)
Begins a combo box.
bool bool UI::Selectable(const string&in label, bool selected, int flags = UI::SelectableFlags::None)
Represents a selectable item. Could be inside of a combo box.
bool void UI::SetItemDefaultFocus()
Puts default focus on the last added item.
void UI::EndCombo()
Ends a combo box.
string UI::InputText(const string&in label, string str, int flags = UI::InputTextFlags::None, InputTextCallback@ callback = null)
Input text. Returns the new value.
string string UI::InputText(const string&in label, string str, bool&out changed, int flags = UI::InputTextFlags::None, InputTextCallback@ callback = null)
Input text. Returns the new value as well as the changed boolean.
string string UI::InputTextMultiline(const string&in label, string str, const vec2&in size = vec2(0, 0), InputTextFlags flags = UI::InputTextFlags::None, InputTextCallback@ callback = null)
Input text in a multiline box. Returns the new value.
string string UI::InputTextMultiline(const string&in label, string str, bool&out changed, const vec2&in size = vec2(0, 0), InputTextFlags flags = UI::InputTextFlags::None, InputTextCallback@ callback = null)
Input text in a multiline box. Returns the new value as well as the changed boolean.
string void UI::SetKeyboardFocusHere(int offset = 0)
Sets the keyboard focus on the next widget. Use positive offsets to access sub components of a multiple component widget. Use -1 to access previous widget.
int UI::InputInt(const string&in label, int num, int step = 1)
Input integer. Returns the new value.
int float UI::InputFloat(const string&in label, float num, float step = 1.0f, float step_fast = 1.0f, const string&in format = "%.3f", InputTextFlags flags = UI::InputTextFlags::None)
Input float. Returns the new value.
float vec2 UI::InputFloat2(const string&in label, const vec2&in v, const string&in format = "%.3f", InputTextFlags flags = UI::InputTextFlags::None)
Input vec2. Returns the new value.
vec2 vec3 UI::InputFloat3(const string&in label, const vec3&in v, const string&in format = "%.3f", InputTextFlags flags = UI::InputTextFlags::None)
Input vec3. Returns the new value.
vec3 vec4 UI::InputFloat4(const string&in label, const vec4&in v, const string&in format = "%.3f", InputTextFlags flags = UI::InputTextFlags::None)
Input vec4. Returns the new value.
vec4 int UI::SliderInt(const string&in label, int num, int min, int max, const string&in format = "%d", int flags = UI::SliderFlags::None)
Slider for integers. Returns the new value.
int float UI::SliderFloat(const string&in label, float num, float min, float max, const string&in format = "%.3f", int flags = UI::SliderFlags::None)
Slider for floats. Returns the new value.
float vec2 UI::SliderFloat2(const string&in label, const vec2&in v, float min, float max, const string&in format = "%.3f", int flags = UI::SliderFlags::None)
Slider for vec2. Returns the new value.
vec2 vec3 UI::SliderFloat3(const string&in label, const vec3&in v, float min, float max, const string&in format = "%.3f", int flags = UI::SliderFlags::None)
Slider for vec3. Returns the new value.
vec3 vec4 UI::SliderFloat4(const string&in label, const vec4&in v, float min, float max, const string&in format = "%.3f", int flags = UI::SliderFlags::None)
Slider for vec4. Returns the new value.
vec4 double UI::SliderDouble(const string&in label, double num, double min, double max, const string&in format = "%.3f", int flags = UI::SliderFlags::None)
Slider for doubles. Returns the new value.
double int UI::VSliderInt(const string&in label, const vec2&in size, int num, int min, int max, const string&in format = "%d", int flags = UI::SliderFlags::None)
Vertical slider for integers. Returns the new value.
int float UI::VSliderFloat(const string&in label, const vec2&in size, float num, float min, float max, const string&in format = "%.3f", int flags = UI::SliderFlags::None)
Vertical slider for floats. Returns the new value.
float double UI::VSliderDouble(const string&in label, const vec2&in size, double num, double min, double max, const string&in format = "%.3f", int flags = UI::SliderFlags::None)
Vertical slider for doubles. Returns the new value.
double int UI::DragInt(const string&in label, int num, float speed = 1.0f, int min = 0, int max = 0, const string&in format = "%d", int flags = UI::SliderFlags::None)
Drag slider for integers. Returns the new value. If min >= max, there are no bounds.
int float UI::DragFloat(const string&in label, float num, float speed = 1.0f, float min = 0, float max = 0, const string&in format = "%.3f", int flags = UI::SliderFlags::None)
Drag slider for floats. Returns the new value. If min >= max, there are no bounds.
float vec2 UI::DragFloat2(const string&in label, const vec2&in v, float speed = 1.0f, float min = 0, float max = 0, const string&in format = "%.3f", int flags = UI::SliderFlags::None)
Drag slider for vec2. Returns the new value. If min >= max, there are no bounds.
vec2 vec3 UI::DragFloat3(const string&in label, const vec3&in v, float speed = 1.0f, float min = 0, float max = 0, const string&in format = "%.3f", int flags = UI::SliderFlags::None)
Drag slider for vec3. Returns the new value. If min >= max, there are no bounds.
vec3 vec4 UI::DragFloat4(const string&in label, const vec4&in v, float speed = 1.0f, float min = 0, float max = 0, const string&in format = "%.3f", int flags = UI::SliderFlags::None)
Drag slider for vec4. Returns the new value. If min >= max, there are no bounds.
vec4 double UI::DragDouble(const string&in label, double num, float speed = 1.0f, double min = 0, double max = 0, const string&in format = "%.3f", int flags = UI::SliderFlags::None)
Drag slider for doubles. Returns the new value. If min >= max, there are no bounds.
double vec3 UI::InputColor3(const string&in label, const vec3&in color, int flags = UI::ColorEditFlags::None)
Input color. Returns the new value.
vec3 vec4 UI::InputColor4(const string&in label, const vec4&in color, int flags = UI::ColorEditFlags::None)
Input color. Returns the new value.
vec4 void UI::Image(Texture@ texture)
An image.
void UI::Image(Texture@ texture, const vec2&in size, const vec2&in uv0 = vec2(0, 0), const vec2&in uv1 = vec2(1, 1))
An image scaled to a specific size and uv coordinates.
void UI::ImageWithBg(Texture@ texture, const vec2&in size, const vec2&in uv0 = vec2(0, 0), const vec2&in uv1 = vec2(1, 1), const vec4&in bg_col = vec4(), const vec4&in tint_col = vec4(1, 1, 1, 1))
An image scaled to a specific size, uv coordinates, background color, and tint color.
bool UI::BeginChild(const string&in id, const vec2&in size, bool border, int flags = UI::WindowFlags::None)
Begins a self-container independent scrolling container using UI::ChildFlags::Border for the border parameter. This function exists for backwards compatibility only.
bool bool UI::BeginChild(const string&in id, const vec2&in size = vec2(), int childFlags = UI::ChildFlags::None, int flags = UI::WindowFlags::None)
Begins a self-contained independent scrolling container.
bool void UI::EndChild()
Ends a child container. Must always be called even if BeginChild returns false!
void UI::BeginTabBar(const string&in id, int flags = UI::TabBarFlags::None)
Begins a multi-tab container.
bool UI::BeginTabItem(const string&in label, int flags = UI::TabItemFlags::None)
Begins a tab item within a multi-tab container.
bool bool UI::BeginTabItem(const string&in label, bool&out open, int flags = UI::TabItemFlags::None)
Begins a tab item within a multi-tab container.
bool void UI::EndTabItem()
Ends a tab item within a multi-tab container.
void UI::EndTabBar()
Ends a multi-tab container.
bool UI::BeginTable(const string&in id, int columns, int flags = UI::TableFlags::None, const vec2&in outer_size = vec2(), float inner_width = 0.0f)
Begins a table. Only call EndTable() if BeginTable() returns true.
bool void UI::EndTable()
Ends a table.
void UI::TableNextRow(int flags = UI::TableRowFlags::None, float min_height = 0.0f)
Append into the first cell of a new row in a table.
bool UI::TableNextColumn()
Append into the next column (or first column of new row) of a table. Returns true if visible.
bool bool UI::TableSetColumnIndex(int index)
Append into a specified column of a table. Returns true if visible.
bool void UI::TableSetupColumn(const string&in label, int flags = UI::TableColumnFlags::None, float init_width_or_weight = 0.0f, uint user_id = 0)
Sets up a column within a table with a label, flags, and initial size.
void UI::TableSetupScrollFreeze(int cols, int rows)
Lock columns and rows in a table so they stay visible when scrolled.
void UI::TableHeadersRow()
Submit all table header cells based on data provided to TableSetupColumn.
void UI::TableHeader(const string&in label)
Submit one header cell manually. (Prefer TableHeadersRow!)
TableSortSpecs@ UI::TableGetSortSpecs()
Get latest sort specs for the table. Returns null when not sorting.
UI::TableSortSpecs@ string UI::TableGetColumnName(int column_n = -1)
Returns an empty string if column didn't have a name declared by TableSetupColumn(). Pass -1 to use current column.
string TableColumnFlags UI::TableGetColumnFlags(int column_n = -1)
Returns column flags so you can query their Enabled/Visible/Sorted/Hovered status flags. Pass -1 to use current column.
UI::TableColumnFlags void UI::TableSetColumnEnabled(int column_n, bool v)
Change user accessible enabled/disabled state of a column. Set to false to hide the column. User can use the context menu to change this themselves (right-click in headers, or right-click in columns body with UI::TableFlags::ContextMenuInBody)
void UI::TableSetBgColor(TableBgTarget target, const vec4&in color, int column_n = -1)
Change the color of a cell, row, or column. See UI::TableBgTarget flags for details.
int UI::TableGetHoveredRow()
Return previous frame hovered row. Note that this is different from TableGetHoveredColumn.
int int UI::TableGetHoveredColumn()
Return hovered column. Returns -1 when table is not hovered. Return columns_count if the unused space at the right of visible columns is hovered. Can also use (TableGetColumnFlags() & UI::TableColumnFlags::IsHovered) instead.
int bool UI::BeginListBox(const string&in id, const vec2&in size = vec2())
Begins a listbox. This is essentially a thin wrapper to using BeginChild/EndChild with some stylistic changes.
bool void UI::EndListBox()
Ends a listbox.
void UI::AlignTextToFramePadding()
Vertically align upcoming text baseline to frame padding so that it will align properly to regularly framed items (call if you have text on a line before a framed item).
float UI::GetTextLineHeightWithSpacing()
Gets the line height of text plus the distance between 2 consecutive lines of text.
float float UI::GetFrameHeightWithSpacing()
Gets the frame height plus the distance in pixels between 2 consecutive lines of framed widgets.
float void UI::SetCursorPos(const vec2&in pos)
Sets the current position of the UI cursor.
void UI::SetCursorPosX(float x)
Sets the current X position of the UI cursor.
void UI::SetCursorPosY(float y)
Sets the current Y position of the UI cursor.
vec2 UI::GetCursorScreenPos()
Cursor position in absolute coordinates. Prefer using this rather than GetCursorPos().
vec2 void UI::SetCursorScreenPos(const vec2&in pos)
Set cursor position in absolute coordinates.
void UI::SetWindowPos(const vec2&in size, Cond cond = UI::Cond::None)
Sets the current position of the UI window.
void UI::SetWindowSize(const vec2&in size, Cond cond = UI::Cond::None)
Sets the current size of the UI window.
bool UI::IsWindowFocused(int flags = UI::FocusedFlags::None)
Is the current window focused? Or its root/child, depending on flags.
bool void UI::SetMouseCursor(MouseCursor cursor)
Set the cursor shape of the mouse.
vec2 UI::GetContentRegionMax()
Gets the current content boundaries. This is deprecated; you should never need this function. You can do everything with GetCursorScreenPos() and GetContentRegionAvail() in a more simple way.
vec2 vec2 UI::GetWindowContentRegionMin()
Gets the content boundaries minimum. This is deprecated; you should never need this function. You can do everything with GetCursorScreenPos() and GetContentRegionAvail() in a more simple way.
vec2 vec2 UI::GetWindowContentRegionMax()
Gets the content boundaries maximum. This is deprecated; you should never need this function. You can do everything with GetCursorScreenPos() and GetContentRegionAvail() in a more simple way.
vec2 float UI::GetWindowContentRegionWidth()
Gets the content width. This is deprecated; you should never need this function. You can do everything with GetCursorScreenPos() and GetContentRegionAvail() in a more simple way.
float void UI::NodTree(CMwNod@ nod, NodTreeMemberCallback@ memberCallback = null)
A tree of nods, much like Nod Explorer.
float UI::GetScale()
Returns the current scale of the UI. This can be set by the user in the Openplanet settings. You might need this if you are working with numbers that represent pixels and want to support high UI scales.
float void UI::ShowOverlay()
Shows the overlay.
void UI::HideOverlay()
Hides the overlay.
bool UI::IsGameUIVisible()
Returns true if the game UI is currently visible, or false if it was hidden. By default, the button for this is asterisk on the numpad. Note that this also returns true if the player is not currently in game.
bool bool UI::IsRendering()
Returns true if Openplanet's overlay is rendering at all. For example, this can return false if the global option "Hide overlay on hidden game UI" is enabled.
bool string UI::CurrentActionMap()
Returns the name of the currently active action map in the game.
string bool UI::IsDockingEnabled()
Returns true if docking is enabled in the Openplanet settings.
bool void UI::ShowNotification(const string&in text, int time = 5000)
Shows a notification in the overlay.
void UI::ShowNotification(const string&in header, const string&in text, int time = 5000)
Shows a notification in the overlay with an additional header.
void UI::ShowNotification(const string&in header, const string&in text, const vec4&in colBackground, int time = 5000)
Shows a notification in the overlay with an additional header and background color.
vec2 UI::GetMousePos()
Get the current position of the mouse relative to the top-left corner of the window.
vec2 float UI::GetMouseWheelDelta()
Get the vertical scroll amount since the last frame. 1 unit scrolls about 5 lines text. >0 scrolls Up, <0 scrolls Down.
float float UI::GetMouseWheelDeltaHor()
Get the horizontal scroll amount since the last frame. >0 scrolls Left, <0 scrolls Right. Most users don't have a mouse with a horizontal wheel.
float vec4 UI::HSV(float h, float s, float v)
Converts normalized HSV values into normalized RGB values.
vec4 vec3 UI::ToHSV(float r, float g, float b)
Converts normalized RGB values into normalized HSV values.
vec3 void UI::Markdown(const string&in str)
Renders a block of text with Markdown formatting.
vec2 UI::MeasureString(const string&in str, Font@ font = null, float size = 0.0f, float wrapWidth = 0.0f)
Calculates the size that a string will be drawn at.
vec2 DrawList@ UI::GetBackgroundDrawList()
Get background draw list. (Note: You might want to prefer using the Nvg API!)
UI::DrawList@ DrawList@ UI::GetWindowDrawList()
Get draw list associated to the current UI window. (Do not keep this handle around outside of windows this was called from!)
UI::DrawList@ enum UI::InputBlocking
How to handle inputs going forward.
enum UI::WindowFlags
Window flags that can be passed to UI::Begin().
enum UI::ChildFlags
Child flags that can be passed to UI::BeginChild().
enum UI::ButtonFlags
Button flags that can be passed to UI::InvisibleButton().
enum UI::Col
Color variables that can be passed to UI::PushStyleColor().
enum UI::StyleVar
Style variables that can be passed to UI::PushStyleVar().
enum UI::FocusedFlags
Flags for UI::IsWindowFocused().
enum UI::ComboFlags
Combo flags that can be passed to UI::BeginCombo().
enum UI::SelectableFlags
Selectable flags that can be passed to UI::Selectable().
enum UI::TreeNodeFlags
Flags that can be passed to UI::TreeNode().
enum UI::ItemFlags
Flags that can be passed to UI::PushItemFlag().
enum UI::InputTextFlags
Flags that can be passed to UI::InputText().
enum UI::SliderFlags
Flags that can be passed to UI::Slider*().
enum UI::ColorEditFlags
Flags that can be passed to UI::InputColor*().
enum UI::SeparatorFlags
Flags that can be passed to UI::Separator().
enum UI::TableFlags
Flags that can be passed to UI::BeginTable().
enum UI::TableRowFlags
Flags that can be passed to UI::TableNextRow().
enum UI::TableColumnFlags
Flags that can be passed to UI::TableSetupColumn().
enum UI::TableBgTarget
Background colors are rendering in 3 layers: Layer 0: draw with RowBg0 color if set, otherwise draw with ColumnBg0 if set. Layer 1: draw with RowBg1 color if set, otherwise draw with ColumnBg1 if set. Layer 2: draw with CellBg color if set. The purpose of the two row/columns layers is to let you decide if a background color changes should override or blend with the existing color. When using UI::TableFlags::RowBg on the table, each row has the RowBg0 color automatically set for odd/even rows. If you set the color of RowBg0 target, your color will override the existing RowBg0 color. If you set the color of RowBg1 or ColumnBg1 target, your color will blend over the RowBg0 color.
enum UI::TabBarFlags
Flags that can be passed to UI::BeginTabBar().
enum UI::TabItemFlags
Flags that can be passed to UI::BeginTabItem().
enum UI::Cond
Conditions for certain UI set operations.
enum UI::Key
UI-specific keys.
enum UI::MouseButton
UI-specific mouse buttons.
enum UI::HoveredFlags
Flags that can be passed to IsItemHovered.
enum UI::InputFlags
Flags that can be passed to Shortcut and SetNextItemShortcut.
enum UI::MouseCursor
Cursors that can be passed to SetMouseCursor.
void UI::NodTreeMemberCallback(CMwNod@ nod, Reflection::MwMemberInfo@ info)
Callback function for UI::NodTree.
void UI::InputTextCallback(InputTextCallbackData@ data)
Callback function for UI::InputText.