IMGUI Controls
The items drawn using IMGUI are called Controls. While the term “Controls” may imply the item is interactable, not all Controls are interactable. There are multiple Controls available with the IMGUI system, but you can accomplish most of your IMGUI goals with the following:
Label
Button
RepeatButton
TextField
TextArea
Toggle
Note
You can find a comprehensive list of all IMGUI controls here: https://docs.unity3d.com/2023.3/Documentation/Manual/gui-Controls.html.
A Label is a non-interactive item. It can be either text or an image. To create a Label
, you call the GUI.Label()
method. The GUI.Label()
method has multiple overloads, but the primary ones you will use are the following:
public static void Label(Rect position, string text); public static void Label(Rect position, Texture image);
Where the first is used to define a text label, and the second is used to define an image label.
For example, the following...