Giter VIP home page Giter VIP logo

unityguiextensions's Introduction

UnityGUIExtensions

This package provides you with a set of classes providing extended GUI widgets for Unity -- both for runtime usage and for editor usage --

Widgets (including where they can be used from):

  • AutoSelect TextArea (Runtime & Editor) - A variant of the TextArea that auto-selects all content when the widget gets focus, and which provides length-clamping for the Editor variant.

  • Toolbar (Editor) - Some helpers for drawing toolbars in the same manner Unity itself does.

  • Vertical Split-Panes (Editor) - Vertically stacked split-panes with draggable resizing.

  • Horizontal Split-Panes (Editor) - Horizontally stacked split-panes with draggable resizing.

Requirements

  • Unity 3.1 or 3.0. This will not work on Unity 2.x, or Unity/iPhone 1.x.

Install

Grab the unitypackage and install it into your project:

http://github.com/MrJoy/UnityGUIExtensions.Examples/downloads

OR, if you are using Git for your Unity project, you can add this as a sub-module:

mkdir -p Assets/Editor/
git submodule add git://github.com/MrJoy/UnityGUIExtensions.git Assets/Editor/UnityGUIExtensions
git submodule init
git submodule update

Source

UnityGUIExtensions' Git repo is available on GitHub, which can be browsed at:

http://github.com/MrJoy/UnityGUIExtensions

and cloned with:

git clone git://github.com/MrJoy/UnityGUIExtensions.git

An example Unity project (which refers to this project as a sub-module) is available here:

http://github.com/MrJoy/UnityGUIExtensions.Examples

and can be cloned with:

git clone git://github.com/MrJoy/UnityGUIExtensions.Examples.git
git submodule init
git submodule update

Usage

AutoSelect TextArea

Instead of:

myString = GUILayout.TextArea(myString);

You just do:

myString = GUILayoutAutoSelect.TextArea("uniqueWidgetName", myString);

Variants exist corresponding to all the method signatures of GUI.TextArea, GUILayout.TextArea, EditorGUI.TextArea, and EditorGUILayout.TextArea. Additionally, the EditorGUIExt/EditorGUILayoutExt versions have an additional set of signatures that include the maxLength attribute.

Vertical Split-Panes

This feature may only be used from editor classes

Simplest possible usage:

public void OnGUI() {
  EditorGUILayoutVerticalPanes.Begin();
    // Draw your upper pane here.
  EditorGUILayoutVerticalPanes.Splitter();
    // Draw your lower pane here.
  EditorGUILayoutVerticalPanes.End();
}

However, if you wish to exert more control over this, you can specify a configuration for the panes:

private VerticalPaneState paneConfiguration = new VerticalPaneState() {
  initialTopPaneHeight = 80,
  minPaneHeightTop = 65,
  minPaneHeightBottom = 100
};

public void OnGUI() {
  EditorGUILayoutVerticalPanes.Begin(paneConfiguration);
    // Draw your upper pane here.
  EditorGUILayoutVerticalPanes.Splitter();
    // Draw your lower pane here.
  EditorGUILayoutVerticalPanes.End();
}

Horizontal Split-Panes

This feature may only be used from editor classes

Simplest possible usage:

public void OnGUI() {
  EditorGUILayoutHorizontalPanes.Begin();
    // Draw your left pane here.
  EditorGUILayoutHorizontalPanes.Splitter();
    // Draw your right pane here.
  EditorGUILayoutHorizontalPanes.End();
}

However, if you wish to exert more control over this, you can specify a configuration for the panes:

private HorizontalPaneState paneConfiguration = new HorizontalPaneState() {
  initialLeftPaneWidth = 80,
  minPaneWidthLeft = 65,
  minPaneWidthRight = 100
};

public void OnGUI() {
  EditorGUILayoutHorizontalPanes.Begin(paneConfiguration);
    // Draw your left pane here.
  EditorGUILayoutHorizontalPanes.Splitter();
    // Draw your right pane here.
  EditorGUILayoutHorizontalPanes.End();
}

Toolbars

This feature may only be used from editor classes

(Documentation coming soon.)

License

Copyright (c) 2010-2015 Jon Frisby

Dual licensed under the terms of the MIT X11 or GNU GPL.

Contributing

If you'd like to contribute to UnityGUIExtensions, I ask that you fork MrJoy/UnityGUIExtensions on GitHub, and push up a topic branch for each feature you add or bug you fix. Then create a pull request and explain what your code does. This allows us to discuss and merge each change separately.

unityguiextensions's People

Contributors

mrjoy avatar

Watchers

James Cloos avatar  avatar

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.