RectExtensions.InverseLerp
Extension Method in RectExtensions
Declaration
public static Vector2 InverseLerp(this Rect rect, Vector2 position)Description
Returns the linear parameter t that produces the interpolant for each axis within the rect's minimum and maximum values.
Parameters
| rect | The rect to get the linear parameter from. |
| position | A position within the rect. |
Returns
| Vector2 | The linear parameter t where each axis falls in the range [0..1]. |