Class: RenderTarget

PIXI.RenderTarget

new PIXI.RenderTarget (gl, width, height, scaleMode, resolution, root)

Name Type Default Description
gl WebGLRenderingContext

The current WebGL drawing context

width number 0 optional

the horizontal range of the filter

height number 0 optional

the vertical range of the filter

scaleMode number PIXI.settings.SCALE_MODE optional

See PIXI.SCALE_MODES for possible values

resolution number 1 optional

The current resolution / device pixel ratio

root boolean false optional

Whether this object is the root element or not

Members

clearColor

The background colour of this render target, as an array of [r,g,b,a] values

defaultFrame glCore.GLBuffer

The stencil buffer stores masking data for the render target

filterData

Stores filter data for the render target

The frame.

frameBuffer PIXI.glCore.GLFramebuffer

A frame buffer

gl WebGLRenderingContext

The current WebGL drawing context.

projectionMatrix PIXI.Matrix

The projection matrix

resolution number

The current resolution / device pixel ratio

Default Value:
  • 1

root boolean

Whether this object is the root element or not

Default Value:
  • false

scaleMode number

The scale mode.

Default Value:
  • PIXI.settings.SCALE_MODE
See:

The size of the object as a rectangle

stencilBuffer glCore.GLBuffer

The stencil buffer stores masking data for the render target

stencilMaskStack

The data structure for the stencil masks

texture PIXI.glCore.GLTexture

The texture

transform PIXI.Matrix

The object's transform

Methods

activate ()

Binds the buffers and initialises the viewport.

attachStencilBuffer ()

Binds the stencil buffer.

calculateProjection (destinationFrame, sourceFrame)

Updates the projection matrix based on a projection frame (which is a rectangle)

Name Type Description
destinationFrame Rectangle

The destination frame.

sourceFrame Rectangle

The source frame.

clear (clearColor)

Clears the filter texture.

Name Type Default Description
clearColor this.clearColor optional

Array of [r,g,b,a] to clear the framebuffer

destroy ()

Destroys the render target.

resize (width, height)

Resizes the texture to the specified width and height

Name Type Description
width number

the new width of the texture

height number

the new height of the texture

setFrame (destinationFrame, sourceFrame)

Sets the frame of the render target.

Name Type Description
destinationFrame Rectangle

The destination frame.

sourceFrame Rectangle

The source frame.