RectangleContainsScreenPoint
Does the RectTransform contain the screen point?
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.UIModule
RectangleContainsScreenPoint(RectTransform, Vector2)
Does the RectTransform contain the screen point?
public static bool RectangleContainsScreenPoint(RectTransform rect, Vector2 screenPoint)
Parameters
Returns
Type | Description |
|---|---|
| bool | True if the point is inside the rectangle. |
RectangleContainsScreenPoint(RectTransform, Vector2, Camera)
Does the RectTransform contain the screen point as seen from the given camera?
public static bool RectangleContainsScreenPoint(RectTransform rect, Vector2 screenPoint, Camera cam)
Parameters
The RectTransform to test with.
The screen point to test.
The camera from which the test is performed from. (Optional)
Returns
Type | Description |
|---|---|
| bool | True if the point is inside the rectangle. |
RectangleContainsScreenPoint(RectTransform, Vector2, Camera, Vector4)
Does the RectTransform, with the given offset, contain the screen point as seen from the given camera?
public static bool RectangleContainsScreenPoint(RectTransform rect, Vector2 screenPoint, Camera cam, Vector4 offset)
Parameters
The RectTransform to test with.
The screen point to test.
The camera from which the test is performed from. (Optional)
The offset to apply to the RectTransform.
Returns
Type | Description |
|---|---|
| bool | True if the point is inside the rectangle. |