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
- Get
UrGUI.dll
- Download built assembly from Release page
- Download source code and build it yourself
- put
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();
}
I want to set my own position and size!
(x, y, width, height)
window = GUIWindow.Begin("Custom size!", startX: 50, 50, 200, 600);
window.Label("Lorem ipsum dolor sit amet");
window.Button("Press me!", () => print("Button has been pressed!"));
window.Slider("Slider:", (value) => print($"Slider value is now {value}"), 0.69f, 0f, 1f, true);
window.Toggle("Is UrGUI best?", (value) => print($"Toggle value is now {value}"), false);
window.ColorPicker("Cube clr:", (clr) => Debug.Log($"Color has been changed to {clr}"), Color.red);
var selection = new Dictionary<int, string>(); for (int i = 0; i < 10; i++) selection.Add(i, $"Option n.{i}"); window.DropDown("Selection:", (id) => print($"'{id}'. has been selected!"), 0, selection);
window.TextField("Name:", (value) => Debug.Log($"TextField has been changed to '{value}'"), "Sample Text");
window.IntField("Age:", (value) => Debug.Log($"FloatField has been changed to '{value}'"), 1234);
window.FloatField("X:", (value) => Debug.Log($"FloatField has been changed to '{value}'"), 12.34f);
Horizontal line used to separate controls
window.Separator();
same as empty label
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:
- Unity Runtime Libraries are part of Unity Software. Their usage is subject to Unity Terms of Service, including Unity Software Additional Terms.
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
- ScreenToGif to create these amazing gifs