Skip to content

Latest commit

 

History

History
49 lines (38 loc) · 1.79 KB

README.md

File metadata and controls

49 lines (38 loc) · 1.79 KB

QGUI

A simple but effective IMGUI library for the Unity Engine for when EditorGUILayout is unavailable. It was created for internal use within my various tools and plugins

QGUI provides the LayoutController that eases working with Rects by being able to reserve the demanded space within the rect, automatically applying padding and offsets for you

Example Usage

The following is an example of using QGUI's LayoutController to emulate a HorizontalLayoutGroup where EditorGUILayout is unavailable

EditorGUILayout

EditorGUILayout.BeginHorizontal();
val1 = EditorGUILayout.Toggle(label1, val1, GUILayout.Width(100));
val2 = EditorGUILayout.Toggle(label2, val2);
EditorGUILayout.EndHorizontal();

QGUI

LayoutController layout = new LayoutController(rect);
val1 = EditorGUI.Toggle(layout.ReserveHorizontal(100), label1, val1);
val2 = EditorGUI.Toggle(layout.CurrentRect, label2, val2);

Installation via Package Manager

2019.3+

Starting with Unity 2019.3, the package manager UI has support for git packages

Click the + to add a new git package and add https://github.com/QFSW/QGUI.git as the source

2018.3 - 2019.2

To install via package manager, add the file Packages/manifest.json and add the following line to the "dependencies"

"com.qfsw.qgui": "https://github.com/QFSW/QGUI.git"

Your file should end up like this

{
  "dependencies": {
    "com.qfsw.qgui": "https://github.com/QFSW/QGUI.git",
    ...
  },
}