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