TextureExtensions.GetUVCoordinates
Extension Method in TextureExtensions
Declaration
public static void GetUVCoordinates(this Texture2D texture, int px, int py, out float u, out float v)
Description
Maps the pixel coordinates in the range [0..width-1] and [0..height-1] to UV coordinates in the range [0..1].
Parameters
texture | The texture to get the UV coordinates from. |
px | The pixel coordinate in the x-axis. |
py | The pixel coordinate in the y-axis. |
u | The output UV coordinate in the x-axis. |
v | The output UV coordinate in the y-axis. |