ImGui bindings.
ImGui bindings.
Represents a texture for the UI API.
Represents a font for the UI API.
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.
Callback data for text input widgets. Do not keep handles of this around!
Sorting specification for a single column of a table.
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.
A drawing list for a layer on the UI.
Load a texture for the UI API.
UI::Texture@
Load a texture for the UI API from a memory buffer.
UI::Texture@
Loads a font for use in the UI API. Note that fonts can take up a lot of memory, so be careful in how many characters you request here! The defaults are usually enough. The font loads instantly (is a free call) for the following font combinations: "DroidSans-Bold.ttf" at size 16, "DroidSansMono.ttf" at size 16, "DroidSans.ttf" at size 20 or 26.
UI::Font@
Loads a font for use in the UI API. Consider using the first LoadFont
overload instead of this one, as it is slightly simpler. Note that fonts can take up a lot of memory, so be careful in how many characters you request here! The defaults are usually enough. The font loads instantly (is a free call) for the following font combinations: "DroidSans-Bold.ttf" at size 16, "DroidSansMono.ttf" at size 16, "DroidSans.ttf" at size 20 or 26.
UI::Font@
Begins an imgui window.
bool
Begins an imgui window.
bool
Ends an imgui window. Must always be called even if Begin returns false!
Begins a new group.
Ends a group.
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.
Ends the formatting group.
Begins a group of disabled widgets.
Ends a group of disabled widgets.
Temporarily pushes a color change for the next widgets. You must call PopStyleColor() sometime after!
Pops one or more temporary color changes.
Temporarily pushes a style change for the next widgets. You must call PopStyleVar() sometime after!
Temporarily pushes a style change for the next widgets. You must call PopStyleVar() sometime after!
Pops one or more temporary style changes.
Gets the current float value of a style variable.
float
Gets the current vector value of a style variable.
vec2
Set scrolling amount, from 0 to GetScrollMaxX().
Set scrolling amount, from 0 to GetScrollMaxY().
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.
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.
Adjust scrolling amount to make given position visible. Generally GetCursorStartPos() + offset to compute a valid position.
Adjust scrolling amount to make given position visible. Generally GetCursorStartPos() + offset to compute a valid position.
Sets the size for the next window created with UI::Begin(). The size is automatically scaled by UI::GetScale().
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().
Sets the size for the next window contents. Set height to 0 to only set width. The size is automatically scaled by UI::GetScale().
Sets the width of the next item. The width is automatically scaled by UI::GetScale().
Sets whether the next item should be open.
Pushes an ID to the stack.
Pushes an ID to the stack.
Pushes an ID to the stack.
Pops an ID from the stack.
Pushes a font to the stack.
Pops a font from the stack.
Pushes width of items.
Pops width of items.
Marks the next control to be drawn on the same line as the last one.
Marks the next control to be drawn on the next line rather than the current line.
Move content position toward the right, by w, or style.IndentSpacing if w <= 0.
move content position back to the left, by w, or style.IndentSpacing if w <= 0.
Separator line.
Separator line with custom flags and thickness.
Separator line with text in it.
Separator line with text in it, where the text is the same color as the line. This matches Openplanet's own UI.
Dummy space.
Dummy space with a custom baseline.
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.
Pops word-wrapping position for Text*() commands.
Calculates the word wrapping position of the given string.
int
Clickable button. Returns true if it was clicked.
bool
Clickable button with a specific color. Returns true if it was clicked.
bool
Clickable invisible button. Returns true if it was clicked.
bool
Simple text label with an optional length.
Simple text label with word wrapping.
Simple text label with word wrapping, but the text resets to the start of the window instead of the starting cursor position.
Simple text label, but in its disabled color.
Text label with a value.
Hyperlink text button. Returns true when clicked.
bool
Hyperlink text button. Automatically opens the given URL when clicked.
Line graph.
Histogram graph.
Checkbox. For value, pass the current value. The return value is the new value.
bool
Radio button. For active, pass whether the current value is active. Returns true if the button was pressed.
bool
Progress bar.
Ends an imgui menu bar.
Ends an imgui menu.
Clickable menu item. Returns true when clicked.
bool
Returns true if the previous window is just now appearing.
bool
Node in a tree list. Returns true if opened.
bool
End of the previously tree node. Must only be called if TreeNode() returned true.
Advance the cursor position to the normal label position for tree nodes.
Collapsable header. Returns true if open.
bool
Begins a table layout. Call this with count set to 1 to reset to normal.
Goes to the next column.
Returns true if the mouse is hovering the previous control.
bool
Returns true if the previous control is clicked.
bool
Calculate full item size given user provided 'size' parameter and default width/height. Default width is often == CalcItemWidth().
vec2
Returns true if the given shortcut was pressed.
bool
Sets a shortcut for the next item.
Set key owner to last item ID if it is hovered or active.
Returns true if the given mouse button is down.
bool
Returns true if the given mouse button was just clicked.
bool
Returns true if the given mouse button was just released.
bool
Returns true if the given mouse button was just double clicked.
bool
Returns true if the mouse is dragging.
bool
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
Sets the last item's tooltip on mouse hover. This is a shorthand for IsItemHovered()
and SetTooltip()
.
Sets the tooltip to currently show on the mouse cursor. See also SetItemTooltip()
.
Begins a tooltip dialog.
Begins a tooltip when the last item has been hovered. This is a shortcut for IsItemHovered()
and BeginTooltip()
.
bool
Ends a tooltip dialog.
Opens a popup with the given ID. Must be within the same scope of ID's.
Closes the current popup.
Begins a popup.
bool
Begins a modal popup.
bool
Begins a modal popup.
bool
Ends a popup.
Begins a combo box.
bool
Represents a selectable item. Could be inside of a combo box.
bool
Puts default focus on the last added item.
Ends a combo box.
Input text. Returns the new value.
string
Input text. Returns the new value as well as the changed boolean.
string
Input text in a multiline box. Returns the new value.
string
Input text in a multiline box. Returns the new value as well as the changed boolean.
string
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.
Input integer. Returns the new value.
int
Input float. Returns the new value.
float
Input vec2. Returns the new value.
vec2
Input vec3. Returns the new value.
vec3
Input vec4. Returns the new value.
vec4
Slider for integers. Returns the new value.
int
Slider for floats. Returns the new value.
float
Slider for vec2. Returns the new value.
vec2
Slider for vec3. Returns the new value.
vec3
Slider for vec4. Returns the new value.
vec4
Slider for doubles. Returns the new value.
double
Vertical slider for integers. Returns the new value.
int
Vertical slider for floats. Returns the new value.
float
Vertical slider for doubles. Returns the new value.
double
Input color. Returns the new value.
vec3
Input color. Returns the new value.
vec4
An image.
An image scaled to a specific size.
Begins a self-container independent scrolling container using UI::ChildFlags::Border for the border parameter. This function exists for backwards compatibility only.
bool
Begins a self-contained independent scrolling container.
bool
Ends a child container. Must always be called even if BeginChild returns false!
Begins a multi-tab container.
Begins a tab item within a multi-tab container.
bool
Begins a tab item within a multi-tab container.
bool
Ends a tab item within a multi-tab container.
Ends a multi-tab container.
Begins a table. Only call EndTable() if BeginTable() returns true.
bool
Ends a table.
Append into the first cell of a new row in a table.
Append into the next column (or first column of new row) of a table. Returns true if visible.
bool
Append into a specified column of a table. Returns true if visible.
bool
Sets up a column within a table with a label, flags, and initial size.
Lock columns and rows in a table so they stay visible when scrolled.
Submit all table header cells based on data provided to TableSetupColumn.
Submit one header cell manually. (Prefer TableHeadersRow!)
Get latest sort specs for the table. Returns null when not sorting.
UI::TableSortSpecs@
Returns an empty string if column didn't have a name declared by TableSetupColumn(). Pass -1 to use current column.
string
Returns column flags so you can query their Enabled/Visible/Sorted/Hovered status flags. Pass -1 to use current column.
UI::TableColumnFlags
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)
Change the color of a cell, row, or column. See UI::TableBgTarget flags for details.
Begins a listbox. This is essentially a thin wrapper to using BeginChild/EndChild with some stylistic changes.
bool
Ends a listbox.
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).
Gets the line height of text plus the distance between 2 consecutive lines of text.
float
Gets the frame height plus the distance in pixels between 2 consecutive lines of framed widgets.
float
Sets the current position of the UI cursor.
Sets the current position of the UI window.
Sets the current size of the UI window.
Is the current window focused? Or its root/child, depending on flags.
bool
Set the cursor shape of the mouse.
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
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
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
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
A tree of nods, much like Nod Explorer.
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
Shows the overlay.
Hides the overlay.
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
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
Returns the name of the currently active action map in the game.
string
Returns true if docking is enabled in the Openplanet settings.
bool
Shows a notification in the overlay.
Shows a notification in the overlay with an additional header.
Shows a notification in the overlay with an additional header and background color.
Get the current position of the mouse relative to the top-left corner of the window.
vec2
Get the vertical scroll amount since the last frame. 1 unit scrolls about 5 lines text. >0 scrolls Up, <0 scrolls Down.
float
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
Converts normalized HSV values into normalized RGB values.
vec4
Converts normalized RGB values into normalized HSV values.
vec3
Renders a block of text with Markdown formatting.
Get background draw list. (Note: You might want to prefer using the Nvg API!)
UI::DrawList@
Get draw list associated to the current UI window. (Do not keep this handle around outside of windows this was called from!)
UI::DrawList@
How to handle inputs going forward.
Window flags that can be passed to UI::Begin().
Child flags that can be passed to UI::BeginChild().
Button flags that can be passed to UI::InvisibleButton().
Color variables that can be passed to UI::PushStyleColor().
Style variables that can be passed to UI::PushStyleVar().
Flags for UI::IsWindowFocused().
Combo flags that can be passed to UI::BeginCombo().
Selectable flags that can be passed to UI::Selectable().
Flags that can be passed to UI::TreeNode().
Flags that can be passed to UI::PushItemFlag().
Flags that can be passed to UI::InputText().
Flags that can be passed to UI::Slider*().
Flags that can be passed to UI::BeginTable().
Flags that can be passed to UI::TableNextRow().
Flags that can be passed to UI::TableSetupColumn().
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.
Flags that can be passed to UI::BeginTab().
Flags that can be passed to UI::BeginTabItem().
Conditions for certain UI set operations.
UI-specific keys.
UI-specific mouse buttons.
Flags that can be passed to IsItemHovered.
Flags that can be passed to Shortcut and SetNextItemShortcut.
Cursors that can be passed to SetMouseCursor.
Callback function for UI::NodTree.
Callback function for UI::InputText.