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

Returns UI::Font@

Ends an imgui window.

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.

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

Sets the position for the next window created with UI::Begin(). Pivot floats can be used to align the window on the given point.

Sets the size for the next window contents. Set height to 0 to only set width.

Sets the width of the next item.

Sets whether the next item should be open.

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.

Separator line.

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

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

Begins a tooltip dialog.

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 color. Returns the new value.

Returns vec3

An image scaled to a specific size.

Begins a self-contained indepedendent scrolling container.

Returns bool

Ends a child container.

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.

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

Gets the currently available size in the window.

Returns vec2

Gets the current content boundaries.

Returns vec2

Gets the content boundaries minimum.

Returns vec2

Gets the content boundaries maximum.

Returns vec2

Gets the content width.

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

Converts HSV values into RGB values.

Returns vec4

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

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::InputText().

Flags that can be passed to UI::BeginTable().

Flags that can be passed to UI::TableNextRow().

Flags that can be passed to UI::TableSetupColumn().

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.

Flags that can be passed to IsItemHovered.