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

Editor class used to view UIRects. More...

Inheritance diagram for UIRectEditor:
UIPanelInspector UIWidgetInspector UIBasicSpriteEditor UILabelInspector UI2DSpriteEditor UISpriteInspector UITextureInspector

Public Member Functions

override void OnInspectorGUI ()
 Draw the inspector properties. More...
 
void DrawAnchorTransform ()
 

Static Public Member Functions

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 UIRectEditor instance
 

Protected Types

enum  AnchorType { AnchorType.None, AnchorType.Unified, AnchorType.Advanced }
 

Protected Member Functions

virtual void OnEnable ()
 Determine the initial anchor type. More...
 
virtual void OnDisable ()
 Clear the instance reference. More...
 
void ReEvaluateAnchorType ()
 Manually re-evaluate the current anchor type. More...
 
virtual bool ShouldDrawProperties ()
 
virtual void DrawCustomProperties ()
 
virtual void DrawFinalProperties ()
 Draw the "Anchors" property block. More...
 
virtual void OnDrawFinalProperties ()
 
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...
 

Static Protected Member Functions

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...
 

Protected Attributes

AnchorType mAnchorType = AnchorType.None
 
Transform[] mTarget = new Transform[4]
 
bool[] mCustom = new bool[] { false, false, false, false }
 

Static Protected Attributes

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 }
 

Detailed Description

Editor class used to view UIRects.

Member Enumeration Documentation

enum UIRectEditor.AnchorType
protected
Enumerator
None 
Unified 
Advanced 

Member Function Documentation

void UIRectEditor.DrawAnchor ( int  index,
bool  targetSelection 
)
protected

Helper function that draws the suffix after the relative fields.

void UIRectEditor.DrawAnchorTransform ( )
virtual void UIRectEditor.DrawCustomProperties ( )
protectedvirtual

Reimplemented in UIWidgetInspector, and UIBasicSpriteEditor.

virtual void UIRectEditor.DrawFinalProperties ( )
protectedvirtual

Draw the "Anchors" property block.

Reimplemented in UIPanelInspector.

SerializedProperty UIRectEditor.DrawSingleAnchorSelection ( )
protected

Draw a selection for a single target (one target sets all 4 sides)

static Camera UIRectEditor.GetCamera ( SerializedProperty  sp)
staticprotected

Pass something like leftAnchor.target to get its rectangle reference.

static UIRect UIRectEditor.GetRect ( SerializedProperty  sp)
staticprotected

Pass something like leftAnchor.target to get its rectangle reference.

static bool UIRectEditor.IsCommon ( float  relative)
staticprotected

Whether the specified relative offset is a common value (0, 0.5, or 1)

static bool UIRectEditor.IsRect ( SerializedProperty  sp)
staticprotected

Returns 'true' if the specified serialized property reference is a UIRect.

virtual void UIRectEditor.OnDisable ( )
protectedvirtual

Clear the instance reference.

Reimplemented in UIWidgetInspector, and UIPanelInspector.

virtual void UIRectEditor.OnDrawFinalProperties ( )
protectedvirtual

Reimplemented in UIWidgetInspector.

virtual void UIRectEditor.OnEnable ( )
protectedvirtual

Determine the initial anchor type.

Reimplemented in UIWidgetInspector, UIPanelInspector, UILabelInspector, UI2DSpriteEditor, and UITextureInspector.

override void UIRectEditor.OnInspectorGUI ( )

Draw the inspector properties.

void UIRectEditor.ReEvaluateAnchorType ( )
protected

Manually re-evaluate the current anchor type.

virtual bool UIRectEditor.ShouldDrawProperties ( )
protectedvirtual
void UIRectEditor.UpdateAnchor ( int  index,
bool  resetRelative 
)
protected

Convenience function that switches the anchor mode and ensures that dimensions are kept intact.

void UIRectEditor.UpdateAnchors ( bool  resetRelative)
protected

Convenience function that switches the anchor mode and ensures that dimensions are kept intact.

static void UIRectEditor.UpdateHorizontalAnchor ( UIRect  r,
UIRect.AnchorPoint  anchor,
bool  resetRelative 
)
static

Convenience function that switches the anchor mode and ensures that dimensions are kept intact.

static void UIRectEditor.UpdateVerticalAnchor ( UIRect  r,
UIRect.AnchorPoint  anchor,
bool  resetRelative 
)
static

Convenience function that switches the anchor mode and ensures that dimensions are kept intact.

Member Data Documentation

string [] UIRectEditor.FieldName = new string[] { "leftAnchor", "rightAnchor", "bottomAnchor", "topAnchor" }
staticprotected
string [] UIRectEditor.HorizontalList = new string[] { "Target's Left", "Target's Center", "Target's Right", "Custom", "Set to Current Position" }
staticprotected
UIRectEditor UIRectEditor.instance
static
bool [] UIRectEditor.IsHorizontal = new bool[] { true, true, false, false }
staticprotected
AnchorType UIRectEditor.mAnchorType = AnchorType.None
protected
bool [] UIRectEditor.mCustom = new bool[] { false, false, false, false }
protected
Transform [] UIRectEditor.mTarget = new Transform[4]
protected
string [] UIRectEditor.PrefixName = new string[] { "Left", "Right", "Bottom", "Top" }
staticprotected
string [] UIRectEditor.VerticalList = new string[] { "Target's Bottom", "Target's Center", "Target's Top", "Custom", "Set to Current Position" }
staticprotected

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