Red Onion UI

This is an attempt to create real Unity UI library (not IMGUI) that is relatively easy to use. It should be similar to WinForms with top-down coordinate system (unlike Unity where Y is up).

Generated documentation here

Element

UI.Element is the base class for all UI elements / controls. It manages UnityEngine.GameObject and its RectTransform, provides layout settings and basic AddElement to add child elements.

Panel

UI.Panel is the basis for more complex layout. You will usually nest few panels with alternating Layout.Horizontal and Layout.Vertical (do not forget to assign its Layout property, it is set to Layout.None when the panel is created).

Methods

Window

UI.Window is the root element that will host all inner elements. It integrates frame with header (title and close button) and content panel. It is the only UI element that is not derived from UI.Element (which may change) and redirects most methods and properties to its content panel (Parent of contained elements currently point here, which may change), some to the frame. It is draggable, has CanvasGroup and ContentSizeFitter initially set to FitMode.PreferredSize for both height and width, which means it will autosize to fit the content (with minimal W:160,H:120 by default).

Events

Methods

Label

UI.Label is simple line of text used to label other elements.

Button

UI.Button is there to perform actions when clicked.

Events

TextBox

UI.TextBox is there to get some input from the user.

Events

WIP ;)