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.SCALE_MODES.DEFAULT |
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 |
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
Array.<number> this.clearColor optional Array of [r,g,b,a] to clear the framebuffer
-
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.