WebBrowserUtils.GetScreenPointToLocalPositionDeltaOnImage(Graphic, Vector2, Vector2) Method

Definition

Gets the local position delta (0 -> 1) from a screen position on a Graphic from a top-left origin point

To calculate the pixel position, do x * [Desired height] and y * [Desired Width]

public static bool GetScreenPointToLocalPositionDeltaOnImage (UnityEngine.UI.Graphic graphic, UnityEngine.Vector2 screenPosition, out UnityEngine.Vector2 position);

Parameters

graphic
Graphic

Graphic that you want to calculate the local position on

screenPosition
Vector2

The screen position

position
Vector2

The local delta position

Returns

Boolean

Exceptions

Thrown if the graphic is null

Applies to