Skip to content

Format

typescript
RenderTexture.renderTextureFormat

class: RenderTexture

Description

(Read Only) The format of the render texture.

This method returns an enumeration type. For more details, please refer to RenderTextureFormat.

Parameters

param_nametypedescription

Return

typedescription
RenderTextureFormatThe enumeration value of RenderTextureFormat.

Code Example

typescript
function Test() {
    try {
        let temp_texture = RenderTexture.GetTemporary(100, 100, RenderTextureFormat.Default, DepthType.Depth24Stencil8, AntiAliasingLevel.x8);
        // Get the format of the render texture
        let renderTextureFormat = temp_texture.getRenderTextureFormat();
    } catch (error) {
        Debug.Log(error);
    }
}