WebBrowserUtils.GetScreenPointToLocalPositionDeltaOnImage(Graphic, Vector2, Vector2) Method

Definition

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

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

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

Parameters

graphic
UnityEngine.UI.Graphic

UnityEngine.UI.Graphic that you want to calculate the local position on

screenPosition
UnityEngine.Vector2

The screen position

position
UnityEngine.Vector2

The local delta position

Returns

System.Boolean

Exceptions

System.ArgumentNullException

Thrown if the graphic is null