Documentation

UI

Namespace

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.

Returns UI::Texture@

Load a texture for the UI API from a memory buffer.

Returns 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.

Returns 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.

Returns UI::Font@

Return true when Dear ImGui will use mouse inputs.

Returns bool

Return true when Dear ImGui will use keyboard inputs.

Returns 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.

Gets the current style color.

Returns vec4

Gets the name of the given style color.

Returns string

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.

Returns float

Gets the current vector value of a style variable.

Returns vec2

Get scrolling amount, from 0 to GetScrollMaxX().

Returns float

Get scrolling amount, from 0 to GetScrollMaxY().

Returns float

Set scrolling amount, from 0 to GetScrollMaxX().

Set scrolling amount, from 0 to GetScrollMaxY().

Get maximum horizontal scrolling amount.

Returns float

Get maximum vertical scrolling amount.

Returns float

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.

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 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.

Clickable button. Returns true if it was clicked.

Returns bool

Clickable button with a specific color. Returns true if it was clicked.

Returns bool

Clickable invisible button. Returns true if it was clicked.

Returns 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.

Hyperlink text button. Returns true when clicked.

Returns bool

Hyperlink text button. Automatically opens the given URL when clicked.

Checkbox. For value, pass the current value. The return value is the new value.

Returns bool

Radio button. For active, pass whether the current value is active. Returns true if the button was pressed.

Returns bool

Begins an imgui menu bar.

Returns bool

Ends an imgui menu bar.

Ends an imgui menu.

Returns true if the previous window is just now appearing.

Returns bool

Node in a tree list. Returns true if opened.

Returns 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.

Returns 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.

Returns bool

Returns true if the previous control is active.

Returns bool

Returns true if the previous control is focused.

Returns bool

Returns true if the previous control is clicked.

Returns bool

Returns true if the previous control is deactivated.

Returns bool

Returns the rectangle of the previous control in screen space.

Returns vec4

Calculate full item size given user provided 'size' parameter and default width/height. Default width is often == CalcItemWidth().

Returns vec2

Returns true if the given key was pressed.

Returns bool

Returns true if the given key was released.

Returns bool

Returns true if the given key is currently down.

Returns bool

Returns true if the given shortcut was pressed.

Returns bool

Set key owner to last item ID if it is hovered or active.

Returns true if the given mouse button is down.

Returns bool

Returns true if the given mouse button was just clicked.

Returns bool

Returns true if the given mouse button was just released.

Returns bool

Returns true if the given mouse button was just double clicked.

Returns 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.

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

Returns 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 context item.

Returns bool

Ends a popup.

Represents a selectable item. Could be inside of a combo box.

Returns bool

Puts default focus on the last added item.

Ends a combo box.

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.

Returns int

Input float. Returns the new value.

Returns float

Input vec2. Returns the new value.

Returns vec2

Input vec3. Returns the new value.

Returns vec3

Input vec4. Returns the new value.

Returns vec4

Input color. Returns the new value.

Returns vec3

Input color. Returns the new value.

Returns vec4

An image scaled to a specific size.

Deprecated

Begins a self-container independent scrolling container using UI::ChildFlags::Border for the border parameter. This function exists for backwards compatibility only.

Returns bool

Ends a child container. Must always be called even if BeginChild returns false!

Begins a tab item within a multi-tab container.

Returns bool

Ends a tab item within a multi-tab container.

Ends a multi-tab container.

Ends a table.

Append into the next column (or first column of new row) of a table. Returns true if visible.

Returns bool

Append into a specified column of a table. Returns true if visible.

Returns bool

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.

Returns number of columns (value passed to BeginTable).

Returns int

Returns current column index.

Returns int

Returns current row index.

Returns int

Returns an empty string if column didn't have a name declared by TableSetupColumn(). Pass -1 to use current column.

Returns string

Returns column flags so you can query their Enabled/Visible/Sorted/Hovered status flags. Pass -1 to use current column.

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.

Returns 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. Typically the font size.

Returns float

Gets the line height of text plus the distance between 2 consecutive lines of text.

Returns float

Gets the frame height.

Returns float

Gets the frame height plus the distance in pixels between 2 consecutive lines of framed widgets.

Returns float

Gets the current position of the UI cursor.

Returns vec2

Sets the current position of the UI cursor.

Gets the current position of the UI window.

Returns vec2

Sets the current position of the UI window.

Gets the current size of the UI window.

Returns vec2

Is the current window focused? Or its root/child, depending on flags.

Returns bool

Set the cursor shape of the mouse.

Gets the currently available size in the window.

Returns vec2
Deprecated

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.

Returns vec2
Deprecated

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.

Returns vec2
Deprecated

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.

Returns vec2
Deprecated

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.

Returns float

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.

Returns float

Returns true if the overlay is currently visible.

Returns bool

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.

Returns 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.

Returns bool

Returns the name of the currently active action map in the game.

Returns string

Returns true if docking is enabled in the Openplanet settings.

Returns bool

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.

Returns vec2

Get the vertical scroll amount since the last frame. 1 unit scrolls about 5 lines text. >0 scrolls Up, <0 scrolls Down.

Returns 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.

Returns float

Converts normalized HSV values into normalized RGB values.

Returns vec4

Converts normalized RGB values into normalized HSV values.

Returns vec3

Renders a block of text with Markdown formatting.

Get background draw list. (Note: You might want to prefer using the Nvg API!)

Returns UI::DrawList@

Get foreground draw list.

Returns UI::DrawList@

Get draw list associated to the current UI window. (Do not keep this handle around outside of windows this was called from!)

Returns 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::InputText.