Class: RenderTexturePool



Texture pool, used by FilterSystem and plugins Stores collection of temporary pow2 or screen-sized renderTextures

If you use custom RenderTexturePool for your filters, you can use methods getFilterTexture and returnFilterTexture same as in

new RenderTexturePool (textureOptions)

Name Type Description
textureOptions object optional

options that will be passed to BaseRenderTexture constructor

Name Type Description
scaleMode PIXI.SCALE_MODES optional



PIXI.RenderTexturePool.SCREEN_KEY string staticconstant

Key that is used to store fullscreen renderTextures in a pool

enableFullScreen boolean

Allow renderTextures of the same size as screen, not just pow2

Automatically sets to true after setScreenSize

Default Value:
  • false


clear (destroyTextures)

Clears the pool

Name Type Default Description
destroyTextures boolean true optional

destroy all stored textures

createTexture (realWidth, realHeight)RenderTexture

creates of texture with params that were specified in pool constructor

Name Type Description
realWidth number

width of texture in pixels

realHeight number

height of texture in pixels

Type Description

getFilterTexture (input, resolution)PIXI.RenderTexture

Gets extra texture of the same size as input renderTexture

getFilterTexture(input, 0.5) or getFilterTexture(0.5, input)

Name Type Description
input PIXI.RenderTexture

renderTexture from which size and resolution will be copied

resolution number optional

override resolution of the renderTexture It overrides, it does not multiply

Type Description

getOptimalTexture (minWidth, minHeight, resolution)PIXI.RenderTexture protected

Gets a Power-of-Two render texture or fullScreen texture

Name Type Default Description
minWidth number

The minimum width of the render texture in real pixels.

minHeight number

The minimum height of the render texture in real pixels.

resolution number 1 optional

The resolution of the render texture.

Type Description
PIXI.RenderTexture 新的渲染纹理.

returnFilterTexture (renderTexture)

Alias for returnTexture, to be compliant with FilterSystem interface

Name Type Description
renderTexture PIXI.RenderTexture

The renderTexture to free

returnTexture (renderTexture)

Place a render texture back into the pool.

Name Type Description
renderTexture PIXI.RenderTexture

The renderTexture to free

setScreenSize (size)

If screen size was changed, drops all screen-sized textures, sets new screen size, sets enableFullScreen to true

Size is measured in pixels, renderer.view can be passed here, not renderer.screen

Name Type Description
size PIXI.ISize

Initial size of screen