UrGUI: easy to use library to create simple UI/GUI in Unity using bult-in IMGUI system
The main focus of this project is to create an easy-to-use library for Unity, primarily used for modding and debugging purposes. By using Unity's built-in IMGUI system you can be sure this library will work with almost any version of Unity
UrGUI.dll
UrGUI.dll
in /UserLibs/
a simple menu with label and button
using UrGUI.GUIWindow;
private GUIWindow window;
private void Start()
{
window = GUIWindow.Begin("Quickstart");
window.Label("Lorem ipsum");
window.Button("Press me!", () => print("Button has been pressed!"));
}
private void OnGUI()
{
window.Draw();
}
(x, y, width, height) ```cs window = GUIWindow.Begin("Custom size!", startX: 50, 50, 200, 600); ```
#### Label ```cs window.Label("Lorem ipsum dolor sit amet"); ```
#### Button ```cs window.Button("Press me!", () => print("Button has been pressed!")); ```
#### Slider ```cs window.Slider("Slider:", (value) => print($"Slider value is now {value}"), 0.69f, 0f, 1f, true); ```
#### Toggle ```cs window.Toggle("Is UrGUI best?", (value) => print($"Toggle value is now {value}"), false); ```
#### ColorPicker ```cs window.ColorPicker("Cube clr:", (clr) => Debug.Log($"Color has been changed to {clr}"), Color.red); ```
#### DropDown ```cs var selection = new Dictionary(); for (int i = 0; i < 10; i++) selection.Add(i, $"Option n.{i}"); window.DropDown("Selection:", (id) => print($"'{id}'. has been selected!"), 0, selection); ```
#### TextField ```cs window.TextField("Name:", (value) => Debug.Log($"TextField has been changed to '{value}'"), "Sample Text"); ```
#### IntField ```cs window.IntField("Age:", (value) => Debug.Log($"FloatField has been changed to '{value}'"), 1234); ```
#### FloatField ```cs window.FloatField("X:", (value) => Debug.Log($"FloatField has been changed to '{value}'"), 12.34f); ```
### Decorative
#### Separator *Horizontal line used to separate controls* ```cs window.Separator(); ```
#### Space *same as empty label* ```cs window.Space(); ```
UrGUI is licensed under the MIT License. See LICENSE for the full License.
Third-party Libraries used as Source Code and/or bundled in Binary Form:
This Repository is not sponsored by, affiliated with or endorsed by Unity Technologies or its affiliates. "Unity" is a trademark or a registered trademark of Unity Technologies or its affiliates in the U.S. and elsewhere.
Used softwares