Table of Contents

Class ViewportHitTest

Pure point-in-rect test for pointer-ownership checks, top-left screen origin against a bottom-left origin rect (the Unity camera pixelRect convention).

public static class ViewportHitTest
Inheritance
object
ViewportHitTest

Methods

Contains(double, double, double, double, double, double, double)

True when a top-left-origin screen point falls inside a bottom-left-origin rect, after flipping the point against screenHeightPx.

public static bool Contains(double screenTopLeftX, double screenTopLeftY, double rectX, double rectY, double rectWidth, double rectHeight, double screenHeightPx)

Parameters

screenTopLeftX double

Pointer X, top-left origin.

screenTopLeftY double

Pointer Y, top-left origin.

rectX double

Rect origin X, bottom-left origin.

rectY double

Rect origin Y, bottom-left origin.

rectWidth double

Rect width.

rectHeight double

Rect height.

screenHeightPx double

Screen height in px, used to flip the point.

Returns

bool