Show / Hide Table of Contents

Class RectTransformExtensions

Unity RectTransform extension methods.

Inheritance
System.Object
RectTransformExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ToString()
System.Object.ReferenceEquals(System.Object, System.Object)
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

to operate with.

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

to operate with.

SetBottom(RectTransform, Single)

Offsets the bottom border of a by the specified amount from the bottom border of a parent . Intended to be used with a Stretch Anchor Preset.

Declaration
public static void SetBottom(this RectTransform rectTransform, float bottom)
Parameters
Type Name Description
RectTransform rectTransform

to operate with.

System.Single bottom

Offset value of bottom border from parent's bottom border

SetLeft(RectTransform, Single)

Offsets the left border of a by the specified amount from the left border of a parent . Intended to be used with a Stretch Anchor Preset.

Declaration
public static void SetLeft(this RectTransform rectTransform, float left)
Parameters
Type Name Description
RectTransform rectTransform

to operate with.

System.Single left

Offset value of left border from parent's left border

SetRight(RectTransform, Single)

Offsets the right border of a by the specified amount from the right border of a parent . Intended to be used with a Stretch Anchor Preset.

Declaration
public static void SetRight(this RectTransform rectTransform, float right)
Parameters
Type Name Description
RectTransform rectTransform

to operate with.

System.Single right

Offset value of right border from the parent's right border

SetTop(RectTransform, Single)

Offsets the top border of a by the specified amount from the top border of a parent . Intended to be used with a Stretch Anchor Preset.

Declaration
public static void SetTop(this RectTransform rectTransform, float top)
Parameters
Type Name Description
RectTransform rectTransform

to operate with.

System.Single top

Offset value of top border from parent's top border

In This Article
Back to top Generated by DocFX