C# Class FullInspector.Internal.fiRectUtility

Contains common functions to help manipulate rects.
Mostra file Open project: jacobdufault/fullinspector

Public Methods

Method Description
CenterRect ( Rect toCenter, float height, Rect &centered ) : void
IndentedRect ( Rect source ) : Rect

Indents the given rect.

Margin ( Rect container, float horizontalMargin, float verticalMargin, Rect &smaller ) : void
MoveDown ( Rect rect, float amount ) : Rect

Moves the rect down (vertically) by the given amount. Returns an updated rect.

SplitHorizontalFlexibleMiddle ( Rect rect, float leftWidth, float rightWidth, Rect &left, Rect &middle, Rect &right ) : void
SplitHorizontalMiddleExact ( Rect rect, float middleWidth, float margin, Rect &left, Rect &middle, Rect &right ) : void
SplitHorizontalPercentage ( Rect rect, float percentage, float margin, Rect &left, Rect &right ) : void

Splits a rect into two, with the split occurring at a certain percentage of the rect's width.

SplitLeftHorizontalExact ( Rect rect, float leftWidth, float margin, Rect &left, Rect &right ) : void

Splits the rect into two horizontal ones, with the left rect set to an exact width.

SplitRightHorizontalExact ( Rect rect, float rightWidth, float margin, Rect &left, Rect &right ) : void
SplitVerticalPercentage ( Rect rect, float percentage, float margin, Rect &top, Rect &bottom ) : void

Splits a rect into two, with the split occurring at a certain percentage of the rect's height.

Method Details

CenterRect() public static method

public static CenterRect ( Rect toCenter, float height, Rect &centered ) : void
toCenter UnityEngine.Rect
height float
centered UnityEngine.Rect
return void

IndentedRect() public static method

Indents the given rect.
public static IndentedRect ( Rect source ) : Rect
source UnityEngine.Rect
return UnityEngine.Rect

Margin() public static method

public static Margin ( Rect container, float horizontalMargin, float verticalMargin, Rect &smaller ) : void
container UnityEngine.Rect
horizontalMargin float
verticalMargin float
smaller UnityEngine.Rect
return void

MoveDown() public static method

Moves the rect down (vertically) by the given amount. Returns an updated rect.
public static MoveDown ( Rect rect, float amount ) : Rect
rect UnityEngine.Rect
amount float
return UnityEngine.Rect

SplitHorizontalFlexibleMiddle() public static method

public static SplitHorizontalFlexibleMiddle ( Rect rect, float leftWidth, float rightWidth, Rect &left, Rect &middle, Rect &right ) : void
rect UnityEngine.Rect
leftWidth float
rightWidth float
left UnityEngine.Rect
middle UnityEngine.Rect
right UnityEngine.Rect
return void

SplitHorizontalMiddleExact() public static method

public static SplitHorizontalMiddleExact ( Rect rect, float middleWidth, float margin, Rect &left, Rect &middle, Rect &right ) : void
rect UnityEngine.Rect
middleWidth float
margin float
left UnityEngine.Rect
middle UnityEngine.Rect
right UnityEngine.Rect
return void

SplitHorizontalPercentage() public static method

Splits a rect into two, with the split occurring at a certain percentage of the rect's width.
public static SplitHorizontalPercentage ( Rect rect, float percentage, float margin, Rect &left, Rect &right ) : void
rect UnityEngine.Rect The rect to split.
percentage float The percentage to split the rect at.
margin float The margin between the two split rects.
left UnityEngine.Rect The new left rect.
right UnityEngine.Rect The new right rect.
return void

SplitLeftHorizontalExact() public static method

Splits the rect into two horizontal ones, with the left rect set to an exact width.
public static SplitLeftHorizontalExact ( Rect rect, float leftWidth, float margin, Rect &left, Rect &right ) : void
rect UnityEngine.Rect The rect to split.
leftWidth float
margin float /// The amount of space between the two rects. ///
left UnityEngine.Rect The new left rect.
right UnityEngine.Rect The new right rect.
return void

SplitRightHorizontalExact() public static method

public static SplitRightHorizontalExact ( Rect rect, float rightWidth, float margin, Rect &left, Rect &right ) : void
rect UnityEngine.Rect
rightWidth float
margin float
left UnityEngine.Rect
right UnityEngine.Rect
return void

SplitVerticalPercentage() public static method

Splits a rect into two, with the split occurring at a certain percentage of the rect's height.
public static SplitVerticalPercentage ( Rect rect, float percentage, float margin, Rect &top, Rect &bottom ) : void
rect UnityEngine.Rect The rect to split.
percentage float The percentage to split the rect at.
margin float The margin between the two split rects.
top UnityEngine.Rect The new top rect.
bottom UnityEngine.Rect The new bottom rect.
return void