Table Of Contents

Previous topic

17.10. The RenderBuffer Object

Next topic

17.12. The Semantics Object

This Page

17.11. The RenderTarget Object

A RenderTarget object is collection of renderable objects, Textures or RenderBuffers, that can be set as a rendering target.

GraphicsDevice.maxSupported(“RENDERTARGET_COLOR_TEXTURES”) can be use to check the number of supported color textures.

17.11.1. Constructor

A RenderTarget object can be constructed with GraphicsDevice.createRenderTarget.

17.11.2. Methods

17.11.2.1. getWidth

Summary

Get the width of the current RenderTarget object.

Syntax

var width = renderTarget.getWidth();

17.11.2.2. getHeight

Summary

Get the height of the current RenderTarget object.

Syntax

var height = renderTarget.getHeight();

17.11.2.3. destroy

Summary

Releases the RenderTarget resources, the object will be invalid after the method is called.

Syntax

renderTarget.destroy();

17.11.3. Properties

17.11.3.1. id

Summary

The unique identification number of the RenderTarget object.

Syntax

var renderTargetId = renderTarget.id;

Note

Read Only

17.11.3.2. colorTexture0

Summary

The Texture object set as the target for color rendering at index 0.

Syntax

var mainColor = renderTarget.colorTexture0;

Note

Read Only

17.11.3.3. colorTexture1

Summary

The Texture object set as the target for color rendering at index 1.

Syntax

var color1 = renderTarget.colorTexture1;

Note

Read Only

17.11.3.4. colorTexture2

Summary

The Texture object set as the target for color rendering at index 2.

Syntax

var color2 = renderTarget.colorTexture2;

Note

Read Only

17.11.3.5. colorTexture3

Summary

The Texture object set as the target for color rendering at index 3.

Syntax

var color3 = renderTarget.colorTexture3;

Note

Read Only

17.11.3.6. depthBuffer

Summary

The RenderBuffer object set as the target for depth rendering.

Syntax

var depthBuffer = renderTarget.depthBuffer;

Note

Read Only

17.11.3.7. depthTexture

Summary

The Texture object set as the target for depth rendering.

Syntax

var depthTexture = renderTarget.depthTexture;

Note

Read Only

17.11.3.8. face

Summary

The index of the destination face when using cubemaps as rendering targets.

Syntax

var faceIndex = renderTarget.face;

Note

Read Only