Class: TexturePoolClass

TexturePoolClass

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 TexturePoolClass (textureOptions)

Name Type Attributes Description
textureOptions TextureSourceOptions <optional>

options that will be passed to BaseRenderTexture constructor

textureOptions.scaleMode SCALE_MODE <optional>

See SCALE_MODE for possible values.

Members

enableFullScreen boolean

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

Automatically sets to true after setScreenSize

Default Value:
  • false

Methods

clear (destroyTextures) void

Clears the pool.

Name Type Attributes Description
destroyTextures boolean <optional>

Destroy all stored textures.

createTexture (pixelWidth, pixelHeight, antialias) core

Creates texture with params that were specified in pool constructor.

Name Type Description
pixelWidth number

Width of texture in pixels.

pixelHeight number

Height of texture in pixels.

antialias boolean
Returns:
Type Description
core

getOptimalTexture (frameWidth, frameHeight, resolution, antialias) core

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

Name Type Default Description
frameWidth number

The minimum width of the render texture.

frameHeight number

The minimum height of the render texture.

resolution number 1

The resolution of the render texture.

antialias boolean
Returns:
Type Description
core The new render texture.

returnTexture (renderTexture) void

Place a render texture back into the pool.

Name Type Description
renderTexture core

The renderTexture to free