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

rectThe rect to get the linear parameter from.
positionA position within the rect.

Returns

Vector2The linear parameter t where each axis falls in the range [0..1].