C# Class UnityEngine.RectTransformUtility

Utility class containing helper methods for working with RectTransform.

ファイルを表示 Open project: CarlosHBC/UnityDecompiled Class Usage Examples

Public Methods

Method Description
CalculateRelativeRectTransformBounds ( Transform trans ) : Bounds
CalculateRelativeRectTransformBounds ( Transform root, Transform child ) : Bounds
FlipLayoutAxes ( RectTransform rect, bool keepPositioning, bool recursive ) : void

Flips the horizontal and vertical axes of the RectTransform size and alignment, and optionally its children as well.

FlipLayoutOnAxis ( RectTransform rect, int axis, bool keepPositioning, bool recursive ) : void

Flips the alignment of the RectTransform along the horizontal or vertical axis, and optionally its children as well.

PixelAdjustPoint ( Vector2 point, Transform elementTransform, Canvas canvas ) : Vector2

Convert a given point in screen space into a pixel correct point.

PixelAdjustRect ( RectTransform rectTransform, Canvas canvas ) : Rect

Given a rect transform, return the corner points in pixel accurate coordinates.

RectangleContainsScreenPoint ( RectTransform rect, Vector2 screenPoint ) : bool
RectangleContainsScreenPoint ( RectTransform rect, Vector2 screenPoint, Camera cam ) : bool

Does the RectTransform contain the screen point as seen from the given camera?

ScreenPointToLocalPointInRectangle ( RectTransform rect, Vector2 screenPoint, Camera cam, Vector2 &localPoint ) : bool
ScreenPointToRay ( Camera cam, Vector2 screenPos ) : Ray
ScreenPointToWorldPointInRectangle ( RectTransform rect, Vector2 screenPoint, Camera cam, Vector3 &worldPoint ) : bool
WorldToScreenPoint ( Camera cam, Vector3 worldPoint ) : Vector2

Private Methods

Method Description
GetTransposed ( Vector2 input ) : Vector2
INTERNAL_CALL_PixelAdjustPoint ( Vector2 &point, Transform elementTransform, Canvas canvas, Vector2 &value ) : void
INTERNAL_CALL_PixelAdjustRect ( RectTransform rectTransform, Canvas canvas, Rect &value ) : void
INTERNAL_CALL_RectangleContainsScreenPoint ( RectTransform rect, Vector2 &screenPoint, Camera cam ) : bool
RectTransformUtility ( ) : System

Method Details

CalculateRelativeRectTransformBounds() public static method

public static CalculateRelativeRectTransformBounds ( Transform trans ) : Bounds
trans Transform
return Bounds

CalculateRelativeRectTransformBounds() public static method

public static CalculateRelativeRectTransformBounds ( Transform root, Transform child ) : Bounds
root Transform
child Transform
return Bounds

FlipLayoutAxes() public static method

Flips the horizontal and vertical axes of the RectTransform size and alignment, and optionally its children as well.

public static FlipLayoutAxes ( RectTransform rect, bool keepPositioning, bool recursive ) : void
rect RectTransform The RectTransform to flip.
keepPositioning bool Flips around the pivot if true. Flips within the parent rect if false.
recursive bool Flip the children as well?
return void

FlipLayoutOnAxis() public static method

Flips the alignment of the RectTransform along the horizontal or vertical axis, and optionally its children as well.

public static FlipLayoutOnAxis ( RectTransform rect, int axis, bool keepPositioning, bool recursive ) : void
rect RectTransform The RectTransform to flip.
axis int The axis to flip along. 0 is horizontal and 1 is vertical.
keepPositioning bool Flips around the pivot if true. Flips within the parent rect if false.
recursive bool Flip the children as well?
return void

PixelAdjustPoint() public static method

Convert a given point in screen space into a pixel correct point.

public static PixelAdjustPoint ( Vector2 point, Transform elementTransform, Canvas canvas ) : Vector2
point Vector2
elementTransform Transform
canvas Canvas
return Vector2

PixelAdjustRect() public static method

Given a rect transform, return the corner points in pixel accurate coordinates.

public static PixelAdjustRect ( RectTransform rectTransform, Canvas canvas ) : Rect
rectTransform RectTransform
canvas Canvas
return Rect

RectangleContainsScreenPoint() public static method

public static RectangleContainsScreenPoint ( RectTransform rect, Vector2 screenPoint ) : bool
rect RectTransform
screenPoint Vector2
return bool

RectangleContainsScreenPoint() public static method

Does the RectTransform contain the screen point as seen from the given camera?

public static RectangleContainsScreenPoint ( RectTransform rect, Vector2 screenPoint, Camera cam ) : bool
rect RectTransform The RectTransform to test with.
screenPoint Vector2 The screen point to test.
cam Camera The camera from which the test is performed from. (Optional)
return bool

ScreenPointToLocalPointInRectangle() public static method

public static ScreenPointToLocalPointInRectangle ( RectTransform rect, Vector2 screenPoint, Camera cam, Vector2 &localPoint ) : bool
rect RectTransform
screenPoint Vector2
cam Camera
localPoint Vector2
return bool

ScreenPointToRay() public static method

public static ScreenPointToRay ( Camera cam, Vector2 screenPos ) : Ray
cam Camera
screenPos Vector2
return Ray

ScreenPointToWorldPointInRectangle() public static method

public static ScreenPointToWorldPointInRectangle ( RectTransform rect, Vector2 screenPoint, Camera cam, Vector3 &worldPoint ) : bool
rect RectTransform
screenPoint Vector2
cam Camera
worldPoint Vector3
return bool

WorldToScreenPoint() public static method

public static WorldToScreenPoint ( Camera cam, Vector3 worldPoint ) : Vector2
cam Camera
worldPoint Vector3
return Vector2