Class GUI
The interface for GUI with manual positioning.
Inheritance
Inherited Members
Namespace:ImGui
Assembly:ImGui.dll
Syntax
public class GUIFields
| Improve this DocActive
Declaration
public const string Active = "Active"Field Value
| Type | Description | 
|---|---|
| System.String | 
Hover
Declaration
public const string Hover = "Hover"Field Value
| Type | Description | 
|---|---|
| System.String | 
Normal
Declaration
public const string Normal = "Normal"Field Value
| Type | Description | 
|---|---|
| System.String | 
Methods
| Improve this DocButton(Rect, String, String)
Create a button. When the user click it, something will happen immediately.
Declaration
public static bool Button(Rect rect, string text, string id)Parameters
| Type | Name | Description | 
|---|---|---|
| Rect | rect | position and size of the control | 
| System.String | text | text to display on the button | 
| System.String | id | the unique id of this control | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | true when the users clicks the button. | 
HoverButton(Rect, String, String)
Create a button that will be actived when the mouse is over it.
Declaration
public static bool HoverButton(Rect rect, string text, string id)Parameters
| Type | Name | Description | 
|---|---|---|
| Rect | rect | position and size of the control | 
| System.String | text | text to display on the control | 
| System.String | id | the unique id of this control | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | whether it is activated (the mouse is over it) | 
Image(Rect, String, String)
Create a image.
Declaration
public static void Image(Rect rect, string filePath, string id)Parameters
| Type | Name | Description | 
|---|---|---|
| Rect | rect | position and size of the control | 
| System.String | filePath | file path of the image to display. The path should be relative to current dir or absolute. | 
| System.String | id | the unique id of this control | 
Label(Rect, String, String)
Create a label.
Declaration
public static void Label(Rect rect, string text, string id)Parameters
| Type | Name | Description | 
|---|---|---|
| Rect | rect | position and size of the control | 
| System.String | text | text to display on the label | 
| System.String | id | the unique id of this control | 
PolygonButton(Rect, IReadOnlyList<Point>, Rect, String, String)
Create a polyon-button.
Declaration
public static bool PolygonButton(Rect rect, IReadOnlyList<Point> points, Rect textRect, string text, string id)Parameters
| Type | Name | Description | 
|---|---|---|
| Rect | rect | position and size of the control | 
| System.Collections.Generic.IReadOnlyList<Point> | points | Point list of the polygon. | 
| Rect | textRect | the rect that occupied by the text | 
| System.String | text | text to display on the button | 
| System.String | id | the unique id of this control | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | true when the users clicks the button. | 
Slider(Rect, Double, Double, Double, String)
Create a horizontal slider that user can drag to select a value.
Declaration
public static double Slider(Rect rect, double value, double minValue, double maxValue, string id)Parameters
| Type | Name | Description | 
|---|---|---|
| Rect | rect | position and size of the control | 
| System.Double | value | The value the slider shows. | 
| System.Double | minValue | The value at the top end of the slider. | 
| System.Double | maxValue | The value at the bottom end of the slider. | 
| System.String | id | the unique id of this control | 
Returns
| Type | Description | 
|---|---|
| System.Double | The value set by the user. | 
Remarks
minValue <= value <= maxValue
Toggle(Rect, Boolean, String)
Create a toggle (check-box).
Declaration
public static bool Toggle(Rect rect, bool value, string id)Parameters
| Type | Name | Description | 
|---|---|---|
| Rect | rect | position and size of the control | 
| System.Boolean | value | Is this toggle checked or unchecked? | 
| System.String | id | the unique id of this control | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | new value of the toggle | 
ToggleButton(Rect, String, Boolean, String)
Create a button that acts like a toggle.
Declaration
public static bool ToggleButton(Rect rect, string text, bool value, string id)Parameters
| Type | Name | Description | 
|---|---|---|
| Rect | rect | position and size of the control | 
| System.String | text | text to display on the button | 
| System.Boolean | value | Is this toggle checked or unchecked? | 
| System.String | id | the unique id of this control | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | new value of the toggle-button | 
VSlider(Rect, Double, Double, Double, String)
Create a vertical slider that user can drag to select a value.
Declaration
public static double VSlider(Rect rect, double value, double minValue, double maxValue, string id)Parameters
| Type | Name | Description | 
|---|---|---|
| Rect | rect | position and size of the control | 
| System.Double | value | The value the slider shows. | 
| System.Double | minValue | The value at the top end of the slider. | 
| System.Double | maxValue | The value at the bottom end of the slider. | 
| System.String | id | the unique id of this control | 
Returns
| Type | Description | 
|---|---|
| System.Double | The value set by the user. | 
Remarks
minValue <= value <= maxValue