Format
typescript
RenderTexture.Apply(mipLevel)class: RenderTexture
Description
Applies a texture to the screen.
Parameters
| param_name | type | description |
|---|---|---|
| mipLevel | number? | The mip level of the texture to apply. |
Return
| type | description |
|---|---|
void |
Code Example
typescript
function Test() {
try {
let temp_texture = RenderTexture.GetTemporary(100, 100, RenderTextureFormat.Default, DepthType.Depth24Stencil8, AntiAliasingLevel.x8);
// Set the color of the pixel at coordinates (10, 20)
temp_texture.setPixel(10,20,Color.new(1,1,1,1));
temp_texture.Apply();
} catch (error) {
Debug.Log(error);
}
}