NGUI: Next-Gen UI kit  3.7.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros
UIWidgetInspector Class Reference

Inspector class used to edit UIWidgets. More...

Inheritance diagram for UIWidgetInspector:
UIRectEditor UIBasicSpriteEditor UILabelInspector UI2DSpriteEditor UISpriteInspector UITextureInspector

Public Types

enum  Action { Action.None, Action.Move, Action.Scale, Action.Rotate }
 

Public Member Functions

void OnSceneGUI ()
 Draw the on-screen selection, knobs, and handle all interaction logic. More...
 
void DrawWidgetTransform ()
 Draw common widget properties that can be shown as a part of the Transform Inspector. More...
 
- Public Member Functions inherited from UIRectEditor
override void OnInspectorGUI ()
 Draw the inspector properties. More...
 
void DrawAnchorTransform ()
 

Static Public Member Functions

static bool Raycast (Vector3[] corners, out Vector3 hit)
 Raycast into the screen. More...
 
static void DrawKnob (Vector3 point, bool selected, bool canResize, int id)
 Draw a control dot at the specified world position. More...
 
static float GetScreenDistance (Vector3 worldPos, Vector2 mousePos)
 Screen-space distance from the mouse position to the specified world position. More...
 
static float GetScreenDistance (Vector3[] worldPoints, Vector2 mousePos, out int index)
 Closest screen-space distance from the mouse position to one of the specified world points. More...
 
static void SetCursorRect (Rect rect, MouseCursor cursor)
 Set the mouse cursor rectangle, refreshing the screen when it gets changed. More...
 
static Vector3[] GetHandles (Vector3[] corners)
 Convert the specified 4 corners into 8 pivot points (adding left, top, right, bottom – in that order). More...
 
static UIWidget.Pivot GetPivotUnderMouse (Vector3[] worldPos, Event e, bool[] resizable, bool movable, ref Action action)
 Determine what kind of pivot point is under the mouse and update the cursor accordingly. More...
 
static void DrawAnchorHandle (UIRect.AnchorPoint anchor, Transform myTrans, Vector3[] myCorners, int side, int id)
 Draw the specified anchor point. More...
 
static void DrawColor (SerializedObject so, UIWidget w)
 Draw the widget's color. More...
 
static void DrawInspectorProperties (SerializedObject so, UIWidget w, bool drawColor)
 Draw common widget properties. More...
 
- Static Public Member Functions inherited from UIRectEditor
static void UpdateHorizontalAnchor (UIRect r, UIRect.AnchorPoint anchor, bool resetRelative)
 Convenience function that switches the anchor mode and ensures that dimensions are kept intact. More...
 
static void UpdateVerticalAnchor (UIRect r, UIRect.AnchorPoint anchor, bool resetRelative)
 Convenience function that switches the anchor mode and ensures that dimensions are kept intact. More...
 

Static Public Attributes

static new UIWidgetInspector instance
 
static UIWidget.Pivot[] pivotPoints
 
- Static Public Attributes inherited from UIRectEditor
static UIRectEditor instance
 

Protected Member Functions

override void OnDisable ()
 Clear the instance reference. More...
 
override void OnEnable ()
 Cache the reference. More...
 
override void DrawCustomProperties ()
 All widgets have depth, color and make pixel-perfect options More...
 
override void OnDrawFinalProperties ()
 
- Protected Member Functions inherited from UIRectEditor
void ReEvaluateAnchorType ()
 Manually re-evaluate the current anchor type. More...
 
virtual bool ShouldDrawProperties ()
 
virtual void DrawFinalProperties ()
 Draw the "Anchors" property block. More...
 
SerializedProperty DrawSingleAnchorSelection ()
 Draw a selection for a single target (one target sets all 4 sides) More...
 
void DrawAnchor (int index, bool targetSelection)
 Helper function that draws the suffix after the relative fields. More...
 
void UpdateAnchors (bool resetRelative)
 Convenience function that switches the anchor mode and ensures that dimensions are kept intact. More...
 
void UpdateAnchor (int index, bool resetRelative)
 Convenience function that switches the anchor mode and ensures that dimensions are kept intact. More...
 

Protected Attributes

UIWidget mWidget
 
- Protected Attributes inherited from UIRectEditor
AnchorType mAnchorType = AnchorType.None
 
Transform[] mTarget = new Transform[4]
 
bool[] mCustom = new bool[] { false, false, false, false }
 

Static Protected Attributes

static bool mUseShader = false
 
- Static Protected Attributes inherited from UIRectEditor
static string[] PrefixName = new string[] { "Left", "Right", "Bottom", "Top" }
 
static string[] FieldName = new string[] { "leftAnchor", "rightAnchor", "bottomAnchor", "topAnchor" }
 
static string[] HorizontalList = new string[] { "Target's Left", "Target's Center", "Target's Right", "Custom", "Set to Current Position" }
 
static string[] VerticalList = new string[] { "Target's Bottom", "Target's Center", "Target's Top", "Custom", "Set to Current Position" }
 
static bool[] IsHorizontal = new bool[] { true, true, false, false }
 

Properties

static Color handlesColor [get]
 Color used by the handles based on the current color scheme. More...
 

Additional Inherited Members

- Protected Types inherited from UIRectEditor
enum  AnchorType { AnchorType.None, AnchorType.Unified, AnchorType.Advanced }
 
- Static Protected Member Functions inherited from UIRectEditor
static bool IsCommon (float relative)
 Whether the specified relative offset is a common value (0, 0.5, or 1) More...
 
static bool IsRect (SerializedProperty sp)
 Returns 'true' if the specified serialized property reference is a UIRect. More...
 
static UIRect GetRect (SerializedProperty sp)
 Pass something like leftAnchor.target to get its rectangle reference. More...
 
static Camera GetCamera (SerializedProperty sp)
 Pass something like leftAnchor.target to get its rectangle reference. More...
 

Detailed Description

Inspector class used to edit UIWidgets.

Member Enumeration Documentation

Enumerator
None 
Move 
Scale 
Rotate 

Member Function Documentation

static void UIWidgetInspector.DrawAnchorHandle ( UIRect.AnchorPoint  anchor,
Transform  myTrans,
Vector3[]  myCorners,
int  side,
int  id 
)
static

Draw the specified anchor point.

static void UIWidgetInspector.DrawColor ( SerializedObject  so,
UIWidget  w 
)
static

Draw the widget's color.

override void UIWidgetInspector.DrawCustomProperties ( )
protectedvirtual

All widgets have depth, color and make pixel-perfect options

Reimplemented from UIRectEditor.

static void UIWidgetInspector.DrawInspectorProperties ( SerializedObject  so,
UIWidget  w,
bool  drawColor 
)
static

Draw common widget properties.

static void UIWidgetInspector.DrawKnob ( Vector3  point,
bool  selected,
bool  canResize,
int  id 
)
static

Draw a control dot at the specified world position.

void UIWidgetInspector.DrawWidgetTransform ( )

Draw common widget properties that can be shown as a part of the Transform Inspector.

static Vector3 [] UIWidgetInspector.GetHandles ( Vector3[]  corners)
static

Convert the specified 4 corners into 8 pivot points (adding left, top, right, bottom – in that order).

static UIWidget.Pivot UIWidgetInspector.GetPivotUnderMouse ( Vector3[]  worldPos,
Event  e,
bool[]  resizable,
bool  movable,
ref Action  action 
)
static

Determine what kind of pivot point is under the mouse and update the cursor accordingly.

static float UIWidgetInspector.GetScreenDistance ( Vector3  worldPos,
Vector2  mousePos 
)
static

Screen-space distance from the mouse position to the specified world position.

static float UIWidgetInspector.GetScreenDistance ( Vector3[]  worldPoints,
Vector2  mousePos,
out int  index 
)
static

Closest screen-space distance from the mouse position to one of the specified world points.

override void UIWidgetInspector.OnDisable ( )
protectedvirtual

Clear the instance reference.

Reimplemented from UIRectEditor.

override void UIWidgetInspector.OnDrawFinalProperties ( )
protectedvirtual

Reimplemented from UIRectEditor.

override void UIWidgetInspector.OnEnable ( )
protectedvirtual

Cache the reference.

Reimplemented from UIRectEditor.

void UIWidgetInspector.OnSceneGUI ( )

Draw the on-screen selection, knobs, and handle all interaction logic.

static bool UIWidgetInspector.Raycast ( Vector3[]  corners,
out Vector3  hit 
)
static

Raycast into the screen.

static void UIWidgetInspector.SetCursorRect ( Rect  rect,
MouseCursor  cursor 
)
static

Set the mouse cursor rectangle, refreshing the screen when it gets changed.

Member Data Documentation

new UIWidgetInspector UIWidgetInspector.instance
static
bool UIWidgetInspector.mUseShader = false
staticprotected
UIWidget UIWidgetInspector.mWidget
protected
UIWidget.Pivot [] UIWidgetInspector.pivotPoints
static
Initial value:
=
{
UIWidget.Pivot.BottomLeft,
UIWidget.Pivot.TopLeft,
UIWidget.Pivot.TopRight,
UIWidget.Pivot.BottomRight,
UIWidget.Pivot.Right,
UIWidget.Pivot.Bottom,
}

Property Documentation

Color UIWidgetInspector.handlesColor
staticget

Color used by the handles based on the current color scheme.


The documentation for this class was generated from the following file: