C# Class UnityEngine.RectTransformUtility

Utility class containing helper methods for working with RectTransform.

Afficher le fichier Open project: CarlosHBC/UnityDecompiled Class Usage Examples

Méthodes publiques

Méthode 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

Méthode 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 méthode

public static CalculateRelativeRectTransformBounds ( Transform trans ) : Bounds
trans Transform
Résultat Bounds

CalculateRelativeRectTransformBounds() public static méthode

public static CalculateRelativeRectTransformBounds ( Transform root, Transform child ) : Bounds
root Transform
child Transform
Résultat Bounds

FlipLayoutAxes() public static méthode

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?
Résultat void

FlipLayoutOnAxis() public static méthode

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?
Résultat void

PixelAdjustPoint() public static méthode

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
Résultat Vector2

PixelAdjustRect() public static méthode

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

public static PixelAdjustRect ( RectTransform rectTransform, Canvas canvas ) : Rect
rectTransform RectTransform
canvas Canvas
Résultat Rect

RectangleContainsScreenPoint() public static méthode

public static RectangleContainsScreenPoint ( RectTransform rect, Vector2 screenPoint ) : bool
rect RectTransform
screenPoint Vector2
Résultat bool

RectangleContainsScreenPoint() public static méthode

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)
Résultat bool

ScreenPointToLocalPointInRectangle() public static méthode

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

ScreenPointToRay() public static méthode

public static ScreenPointToRay ( Camera cam, Vector2 screenPos ) : Ray
cam Camera
screenPos Vector2
Résultat Ray

ScreenPointToWorldPointInRectangle() public static méthode

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

WorldToScreenPoint() public static méthode

public static WorldToScreenPoint ( Camera cam, Vector3 worldPoint ) : Vector2
cam Camera
worldPoint Vector3
Résultat Vector2