Velaptor.NativeInterop.ImGui.IImGuiInvoker
Velaptor
Velaptor.NativeInterop.ImGui
IImGuiInvoker Interface
Invokes ImGuiNET.ImGui functions.
public interface IImGuiInvoker
Derived
↳ ImGuiInvoker
Methods
ArrowButton(string, ImGuiDir)
Creates an arrow button.
bool ArrowButton(string str_id, ImGuiNET.ImGuiDir dir);
Parameters
str_id
System.String
The id of the button.
The direction of the text relative to the button.
Returns
System.Boolean
True if the button has been clicked.
Begin(string, ImGuiWindowFlags)
Creates a new window.
bool Begin(string name, ImGuiNET.ImGuiWindowFlags flags);
Parameters
name
System.String
The name of the window which becomes the title.
flags
ImGuiNET.ImGuiWindowFlags
Various window options.
Returns
System.Boolean
True if the window is currently open.
Remarks
Make sure to invoke the End() method after creating a window.
BeginCombo(string, string, ImGuiComboFlags)
Creates a combo box control.
bool BeginCombo(string label, string preview_value, ImGuiNET.ImGuiComboFlags flags);
Parameters
label
System.String
The label of the combo box.
preview_value
System.String
The preview value of the selected item.
flags
ImGuiNET.ImGuiComboFlags
The combobox options.
Returns
System.Boolean
True if an item was chosen.
Button(string)
Creates a button with the given label.
void Button(string label);
Parameters
label
System.String
The button label.
CalcTextSize(string)
Calculates the size of the given text.
System.Numerics.Vector2 CalcTextSize(string text);
Parameters
text
System.String
The text to measure.
Returns
System.Numerics.Vector2
The size of the text described by the X representing the width and the Y representing the height.
Checkbox(string, bool)
Creates a checkbox with the given label.
bool Checkbox(string label, ref bool v);
Parameters
label
System.String
The checkbox label.
The state of the checkbox.
Returns
System.Boolean
True if the checkbox state was changed.
End()
Signifies the end of the creation of a window.
void End();
EndCombo()
Signifies the end of the creation of a combo box.
void EndCombo();
Remarks
This method should be called after BeginCombo(string, string, ImGuiComboFlags) if and only if BeginCombo(string, string, ImGuiComboFlags) returns true.
GetCursorPos()
Gets the current position of the cursor.
System.Numerics.Vector2 GetCursorPos();
Returns
System.Numerics.Vector2
The cursor position.
GetFrameHeightWithSpacing()
Gets the current frame height with spacing.
float GetFrameHeightWithSpacing();
Returns
System.Single
The frame height.
GetIO()
Gets the IO object for system and ImGuiNET.ImGui related settings and information.
ImGuiNET.ImGuiIOPtr GetIO();
Returns
ImGuiNET.ImGuiIOPtr
The config/settings/info object.
GetStyle()
Gets the style object for ImGui.
ImGuiNET.ImGuiStylePtr GetStyle();
Returns
ImGuiNET.ImGuiStylePtr
The style object.
GetWindowPos()
Gets the position of a window.
System.Numerics.Vector2 GetWindowPos();
Returns
System.Numerics.Vector2
The window position.
GetWindowSize()
Gets the size of a window.
System.Numerics.Vector2 GetWindowSize();
Returns
System.Numerics.Vector2
The size.
Remarks
The size of the text described by the X representing the width and the Y representing the height.
IsItemHovered()
Returns a value indicating whether the mouse is hovering over an item.
bool IsItemHovered();
Returns
System.Boolean
True if the mouse is hovering over the item.
IsMouseDown(ImGuiMouseButton)
Returns a value indicating whether the given mouse button is in the down state.
bool IsMouseDown(ImGuiNET.ImGuiMouseButton button);
Parameters
button
ImGuiNET.ImGuiMouseButton
The button to check.
Returns
System.Boolean
True if the mouse is in the down state.
IsMouseDragging(ImGuiMouseButton)
Gets a value indicating whether a window is being dragged by the given mouse button.
bool IsMouseDragging(ImGuiNET.ImGuiMouseButton button);
Parameters
button
ImGuiNET.ImGuiMouseButton
The mouse button.
Returns
System.Boolean
True if the window is being dragged.
IsMouseReleased(ImGuiMouseButton)
Returns a value indicating whether the given mouse button is in the released state.
bool IsMouseReleased(ImGuiNET.ImGuiMouseButton button);
Parameters
button
ImGuiNET.ImGuiMouseButton
The button to check.
Returns
System.Boolean
True if the mouse is in the up state.
IsWindowFocused()
Gets a value indicating whether a window is focused.
bool IsWindowFocused();
Returns
System.Boolean
True if the window is in focus.
PopButtonRepeat()
Stops the button from firing repeatedly when held down.
void PopButtonRepeat();
PopID()
Ends the current scoped ID.
void PopID();
PopStyleColor()
Pops the most recent style color.
void PopStyleColor();
PopStyleColor(int)
Pops the most recent style colors a total number of times by the given count.
void PopStyleColor(int count);
Parameters
count
System.Int32
The total number of recent style color pushes to pop.
PopStyleVar(int)
Restores previous updated styles back to their original values.
void PopStyleVar(int count);
Parameters
count
System.Int32
The number of previous applied styles to restore.
PushButtonRepeat(bool)
Sets up a button to fire repeatedly when held down.
void PushButtonRepeat(bool repeat);
Parameters
repeat
System.Boolean
True to set the button to repeat.
PushID(string)
Creates a new scoped ID for further control operations.
void PushID(string str_id);
Parameters
str_id
System.String
The id of the scope.
PushStyleColor(ImGuiCol, Vector4)
Pushes the color using the given col to the current style described by the given idx.
void PushStyleColor(ImGuiNET.ImGuiCol idx, System.Numerics.Vector4 col);
Parameters
The type of area of the style to push the color.
The color to push.
PushStyleVar(ImGuiStyleVar, float)
Temporarily modifies the style of ImGuiNET.ImGui by applying a style to a part of
the GUI dictated by the given idx with the given val.
void PushStyleVar(ImGuiNET.ImGuiStyleVar idx, float val);
Parameters
The style to update.
val
System.Single
The value to apply.
Remarks
Remains in effect until the PopStyleVar(int) is invoked.
SameLine()
Sets the next control to be on the same line as the previous control.
void SameLine();
SameLine(float, float)
Sets the next control to be on the same line as the previous control.
void SameLine(float offset_from_start_x, float spacing);
Parameters
offset_from_start_x
System.Single
The horizontal offset from the start of the previous control.
spacing
System.Single
The amount of spacing between the controls.
Selectable(string, bool)
Returns a value indicating whether the given item label is selectable.
bool Selectable(string label, bool selected);
Parameters
label
System.String
The text to be displayed for the item in the combo box.
selected
System.Boolean
Determines whether the item is selected when the combo box is first displayed.
Returns
System.Boolean
True if the item is selected.
SetCursorPos(Vector2)
Sets the position of the cursor.
void SetCursorPos(System.Numerics.Vector2 local_pos);
Parameters
local_pos
System.Numerics.Vector2
The position of where to set the cursor.
SetItemDefaultFocus()
Sets the default keyboard focus to the item that was previously added.
void SetItemDefaultFocus();
Remarks
This method is typically used in conjunction with combo boxes or list boxes.
SetNextItemWidth(float)
Sets the width of the next item.
void SetNextItemWidth(float item_width);
Parameters
item_width
System.Single
The width.
SetWindowPos(Vector2)
Sets the position of the window.
void SetWindowPos(System.Numerics.Vector2 pos);
Parameters
The position.
SetWindowSize(Vector2)
Sets the size of the window.
void SetWindowSize(System.Numerics.Vector2 size);
Parameters
The window size.
Remarks
The size of the text described by the X representing the width and the Y representing the height.
SliderFloat(string, float, float, float)
Creates a slider scope with a float value.
bool SliderFloat(string label, ref float v, float v_min, float v_max);
Parameters
label
System.String
The label of the control.
The value of the control.
v_min
System.Single
The minimum value.
v_max
System.Single
The maximum value.
Returns
System.Boolean
True if the button has been clicked.
Text(string)
Creates a test control.
void Text(string fmt);
Parameters
fmt
System.String
The text to display.
Remarks
The fmt can take syntax for formatting values such as:
- Numerical Formatting
You can control how numeric values are displayed, including the number of decimal places,
whether to use scientific notation, whether to include a thousands separator, and more.
For example, {0:F2} formats the number with two decimal places. - Date and Time Formatting
You can control how DateTime values are displayed, including the date format, time format, and more.
For example, {0:yyyy-MM-dd} formats the date as year-month-day. - String Padding
You can control the width of the field in which the string is printed, and whether it’s aligned to
the left or right. For example, {0,10} prints the string in a field of width 10, right-aligned,
while {0,-10} prints it left-aligned. - Custom Formatting
You can define your own format strings to control how certain types of objects are displayed.
can escape a brace by adding another brace.
ple: {{ and }} will display as { and }.