Class RectTransformExtensions
Unity RectTransform
extension methods.
Inheritance
Inherited Members
Namespace: StansAssets.Foundation.Extensions
Assembly: cs.temp.dll.dll
Syntax
public static class RectTransformExtensions
Methods
GetScreenRect(RectTransform)
Gets the screen rect of provided
Declaration
public static Rect GetScreenRect(this RectTransform rectTransform)
Parameters
Type | Name | Description |
---|---|---|
RectTransform | rectTransform |
Returns
Type | Description |
---|---|
Rect | Screen rect. |
Reset(RectTransform)
Resets anchorMin
, anchorMax
, offsetMin
, offsetMax
to Vector2.zero
.
Declaration
public static void Reset(this RectTransform rectTransform)
Parameters
Type | Name | Description |
---|---|---|
RectTransform | rectTransform |
SetBottom(RectTransform, Single)
Offsets the bottom border of a
Declaration
public static void SetBottom(this RectTransform rectTransform, float bottom)
Parameters
Type | Name | Description |
---|---|---|
RectTransform | rectTransform | |
System.Single | bottom | Offset value of bottom border from parent's bottom border |
SetLeft(RectTransform, Single)
Offsets the left border of a
Declaration
public static void SetLeft(this RectTransform rectTransform, float left)
Parameters
Type | Name | Description |
---|---|---|
RectTransform | rectTransform | |
System.Single | left | Offset value of left border from parent's left border |
SetRight(RectTransform, Single)
Offsets the right border of a
Declaration
public static void SetRight(this RectTransform rectTransform, float right)
Parameters
Type | Name | Description |
---|---|---|
RectTransform | rectTransform | |
System.Single | right | Offset value of right border from the parent's right border |
SetTop(RectTransform, Single)
Offsets the top border of a
Declaration
public static void SetTop(this RectTransform rectTransform, float top)
Parameters
Type | Name | Description |
---|---|---|
RectTransform | rectTransform | |
System.Single | top | Offset value of top border from parent's top border |