Giter Site home page Giter Site logo

hirashi3630 / urgui Goto Github PK

View Code? Open in Web Editor NEW
18.0 2.0 5.0 6.68 MB

UrGUI: easy to create GUI for Unity mods and debug

License: MIT License

C# 100.00%
unity unity-imgui unity3d unity-extension unity3d-plugin modding modding-tools unity-modding unity-mods

urgui's Introduction

UrGUI

License: MIT GitHub issues Workflow Badge CodeFactor

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


usage-sample1


Getting Started

  1. Get UrGUI.dll
    • Download built assembly from Release page
    • Download source code and build it yourself

MelonLoader

  1. put UrGUI.dll in /UserLibs/

Usage

Quickstart

a simple menu with label and button

usage-sample1

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);

More Examples


Controls


Label

label_showcase
window.Label("Lorem ipsum dolor sit amet");



Button

button_showcase
window.Button("Press me!", () => print("Button has been pressed!"));



Slider

slider_showcase
window.Slider("Slider:", (value) => print($"Slider value is now {value}"), 0.69f, 0f, 1f, true);



Toggle

toggle_showcase
window.Toggle("Is UrGUI best?", (value) => print($"Toggle value is now {value}"), false);



ColorPicker

colorpicker_showcase
window.ColorPicker("Cube clr:", (clr) => Debug.Log($"Color has been changed to {clr}"), Color.red);



DropDown

dropdown_showcase
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); 



TextField

textfield_showcase
window.TextField("Name:", (value) => Debug.Log($"TextField has been changed to '{value}'"), "Sample Text");



IntField

intfield_showcase
window.IntField("Age:", (value) => Debug.Log($"FloatField has been changed to '{value}'"), 1234);



FloatField

floatfield_showcase
window.FloatField("X:", (value) => Debug.Log($"FloatField has been changed to '{value}'"), 12.34f);



Decorative


Separator

Horizontal line used to separate controls

window.Separator();



Space

same as empty label

window.Space();


Licensing & Credits:

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.