Format
typescript
RenderTexture.GetPixel(x, y, mipLevel)class: RenderTexture
Description
Get the pixel color at coordinates (x, y).
Parameters
| param_name | type | description |
|---|---|---|
| x | number | x-axis coordinate |
| y | number | y-axis coordinate |
| mipLevel | number | mipmap level |
Return
| type | description |
|---|---|
Color | Pixel color |
Code Example
typescript
function Test() {
try {
let temp_texture = RenderTexture.GetTemporary(100, 100, RenderTextureFormat.Default, DepthType.Depth24Stencil8, AntiAliasingLevel.x8);
let pixel = temp_texture.GetPixel(10,20,1)
} catch (error) {
Debug.Log(error);
}
}