PIXI.RenderTexturePool

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

Constructor


new PIXI.RenderTexturePool(textureOptions: IBaseTextureOptions) → {}
Parameters:
Name Type Attributes Description
textureOptions IBaseTextureOptions

<optional>

options that will be passed to BaseRenderTexture constructor

textureOptions.scaleMode PIXI.SCALE_MODES

<optional>

See PIXI.SCALE_MODES for possible values.

Public Properties


SCREEN_KEY RenderTexturePool.ts:221
static SCREEN_KEY: number = -1

Key that is used to store fullscreen renderTextures in a pool

enableFullScreen RenderTexturePool.ts:22
enableFullScreen: boolean = false

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

Automatically sets to true after setScreenSize

Public Methods


clear RenderTexturePool.ts:154
clear(destroyTextures: boolean) → {void}

Clears the pool.

Parameters:
Name Type Attributes Description
destroyTextures boolean

<optional>

Destroy all stored textures.

Returns:
Type Description
void
createTexture RenderTexturePool.ts:47
createTexture(realWidth: number, realHeight: number, multisample) → {PIXI.RenderTexture}

Creates texture with params that were specified in pool constructor.

Parameters:
Name Type Description
realWidth number

Width of texture in pixels.

realHeight number

Height of texture in pixels.

multisample

Number of samples of the framebuffer.

Returns:
Type Description
PIXI.RenderTexture
getFilterTexture RenderTexturePool.ts:114
getFilterTexture(input: PIXI.RenderTexture, resolution: number, multisample: PIXI.MSAA_QUALITY) → {PIXI.RenderTexture}

Gets extra texture of the same size as input renderTexture

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

Parameters:
Name Type Attributes 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

multisample PIXI.MSAA_QUALITY

<optional>

number of samples of the renderTexture

Returns:
Type Description
PIXI.RenderTexture
getOptimalTexture RenderTexturePool.ts:65
getOptimalTexture(minWidth: number, minHeight: number, resolution: number, multisample) → {PIXI.RenderTexture}

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

Parameters:
Name Type Default Description
minWidth number

The minimum width of the render texture.

minHeight number

The minimum height of the render texture.

resolution number 1

The resolution of the render texture.

multisample

Number of samples of the render texture.

Returns:
Type Description
PIXI.RenderTexture

The new render texture.

returnFilterTexture RenderTexturePool.ts:145
returnFilterTexture(renderTexture: PIXI.RenderTexture) → {void}

Alias for returnTexture, to be compliant with FilterSystem interface.

Parameters:
Name Type Description
renderTexture PIXI.RenderTexture

The renderTexture to free

Returns:
Type Description
void
returnTexture RenderTexturePool.ts:133
returnTexture(renderTexture: PIXI.RenderTexture) → {void}

Place a render texture back into the pool.

Parameters:
Name Type Description
renderTexture PIXI.RenderTexture

The renderTexture to free

Returns:
Type Description
void
setScreenSize RenderTexturePool.ts:180
setScreenSize(size: ISize) → {void}

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

Parameters:
Name Type Description
size ISize

Initial size of screen.

Returns:
Type Description
void

Powered by webdoc!