Class: WebGLExtract

PIXI.extract.WebGLExtract

The extract manager provides functionality to export content from the renderers.

An instance of this class is automatically created by default, and can be found at renderer.plugins.extract

new PIXI.extract.WebGLExtract (renderer)

Name Type Description
renderer PIXI.WebGLRenderer

A reference to the current renderer

Methods

base64 (target)string

Will return a a base64 encoded string of this target. It works by calling WebGLExtract.getCanvas and then running toDataURL on that.

Name Type Description
target PIXI.DisplayObject | PIXI.RenderTexture

A displayObject or renderTexture to convert. If left empty will use use the main renderer

Returns:
Type Description
string A base64 encoded string of the texture.

canvas (target)HTMLCanvasElement

Creates a Canvas element, renders this target to it and then returns it.

Name Type Description
target PIXI.DisplayObject | PIXI.RenderTexture

A displayObject or renderTexture to convert. If left empty will use use the main renderer

Returns:
Type Description
HTMLCanvasElement A Canvas element with the texture rendered on.

destroy ()

Destroys the extract

image (target)HTMLImageElement

Will return a HTML Image of the target

Name Type Description
target PIXI.DisplayObject | PIXI.RenderTexture

A displayObject or renderTexture to convert. If left empty will use use the main renderer

Returns:
Type Description
HTMLImageElement HTML Image of the target

pixels (target)Uint8ClampedArray

Will return a one-dimensional array containing the pixel data of the entire texture in RGBA order, with integer values between 0 and 255 (included).

Name Type Description
target PIXI.DisplayObject | PIXI.RenderTexture

A displayObject or renderTexture to convert. If left empty will use use the main renderer

Returns:
Type Description
Uint8ClampedArray One-dimensional array containing the pixel data of the entire texture