Table of Contents
Extensions for RectTransforms
public static class RectTransformExt
Inheritance System.Object RectTransformExt
public static bool ContainsScreenPoint(this RectTransform rect, Vector2 screenPoint);
rect
UnityEngine.RectTransform
screenPoint
UnityEngine.Vector2
Checks whether an inner rect transform is fully contained within an outer rect transform
public static bool FullyContains(this RectTransform outer, RectTransform inner);
outer
UnityEngine.RectTransform
outer rect
inner
UnityEngine.RectTransform
inner rect
System.Boolean
whether inner is fully contained within outer
Gets the mouse position as a local position within this rectangle
public static Vector2 MousePositionLocal(this RectTransform rect, bool clamp=false);
rect
UnityEngine.RectTransform
this
clamp
System.Boolean
whether to clamp the position to within the bounds of this rect
Checks whether a rect overlaps with another rect
public static bool OverlapsWith(this RectTransform a, RectTransform b);
rect
rect
System.Boolean
whether rects overlap
public static Vector2 ScreenPointToLocalPoint(this RectTransform rect, Vector2 screenPoint);
rect
UnityEngine.RectTransform
screenPoint
UnityEngine.Vector2