RectTransformUtility
static class in UnityEngine · UnityEngine.UIModule
In Tassix
Converting between screen points and RectTransforms.
Methods 10
static Bounds CalculateRelativeRectTransformBounds(Transform root, Transform child)static Bounds CalculateRelativeRectTransformBounds(Transform trans)static void FlipLayoutAxes(RectTransform rect, bool keepPositioning, bool recursive)static void FlipLayoutOnAxis(RectTransform rect, int axis, bool keepPositioning, bool recursive)static Rect PixelAdjustRect(RectTransform rectTransform, Canvas canvas)static bool RectangleContainsScreenPoint(RectTransform rect, Vector2 screenPoint)static bool RectangleContainsScreenPoint(RectTransform rect, Vector2 screenPoint, Camera? cam)static bool RectangleContainsScreenPoint(RectTransform rect, Vector2 screenPoint, Camera? cam, Vector4 offset)Whether the screen point, projected onto the rect's plane, falls inside it (grown by -offset: left, bottom, right, top padding).
static bool ScreenPointToLocalPointInRectangle(RectTransform rect, Vector2 screenPoint, Camera? cam, out Vector2 localPoint)static Ray ScreenPointToRay(Camera? cam, Vector2 screenPos)A ray from the camera through the screen point; without a camera, straight into the screen from the point.
static bool ScreenPointToWorldPointInRectangle(RectTransform rect, Vector2 screenPoint, Camera? cam, out Vector3 worldPoint)