Home

class: CanvasExtract


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

Methods summary


Public methods
public image(target: PIXI.DisplayObject, PIXI.RenderTexture): HTMLImageElement
public base64(target: PIXI.DisplayObject, PIXI.RenderTexture): string
public canvas(target: PIXI.DisplayObject, PIXI.RenderTexture): HTMLCanvasElement
public pixels(target: PIXI.DisplayObject, PIXI.RenderTexture): Uint8ClampedArray
public destroy(): void
public image(target: PIXI.DisplayObject, PIXI.RenderTexture): HTMLImageElement
public base64(target: PIXI.DisplayObject, PIXI.RenderTexture): string
public canvas(target: PIXI.DisplayObject, PIXI.RenderTexture): HTMLCanvasElement
public pixels(target: PIXI.DisplayObject, PIXI.RenderTexture): Uint8ClampedArray
public destroy(): void

Methods


image(target: PIXI.DisplayObject, PIXI.RenderTexture): HTMLImageElement

Will return a HTML Image of the target

Params:

Name Type Attribute Description
target

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

Returns:

HTMLImageElement


base64(target: PIXI.DisplayObject, PIXI.RenderTexture): string

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

Params:

Name Type Attribute Description
target

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

Returns:

string


canvas(target: PIXI.DisplayObject, PIXI.RenderTexture): HTMLCanvasElement

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

Params:

Name Type Attribute Description
target

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

Returns:

HTMLCanvasElement


pixels(target: PIXI.DisplayObject, PIXI.RenderTexture): 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).

Params:

Name Type Attribute Description
target

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

Returns:

Uint8ClampedArray


destroy(): void

Destroys the extract

Returns:

void


image(target: PIXI.DisplayObject, PIXI.RenderTexture): HTMLImageElement

Will return a HTML Image of the target

Params:

Name Type Attribute Description
target

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

Returns:

HTMLImageElement


base64(target: PIXI.DisplayObject, PIXI.RenderTexture): string

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

Params:

Name Type Attribute Description
target

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

Returns:

string


canvas(target: PIXI.DisplayObject, PIXI.RenderTexture): HTMLCanvasElement

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

Params:

Name Type Attribute Description
target

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

Returns:

HTMLCanvasElement


pixels(target: PIXI.DisplayObject, PIXI.RenderTexture): 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).

Params:

Name Type Attribute Description
target

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

Returns:

Uint8ClampedArray


destroy(): void

Destroys the extract

Returns:

void


  {
    "comment": "/**\n * The extract manager provides functionality to export content from the renderers.\n *\n * An instance of this class is automatically created by default, and can be found at renderer.plugins.extract\n *\n * @class\n * @memberof PIXI\n */",
    "meta": {
        "range": [
            346,
            4979
        ],
        "filename": "CanvasExtract.js",
        "lineno": 15,
        "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\extract\\canvas",
        "code": {
            "id": "astnode100050291",
            "name": "CanvasExtract",
            "type": "ClassDeclaration",
            "paramnames": [
                "renderer"
            ]
        }
    },
    "classdesc": "

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

\n

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

", "kind": "class", "memberof": "PIXI", "name": "CanvasExtract", "longname": "PIXI.CanvasExtract", "scope": "static", "params": [ { "type": { "names": [ "PIXI.CanvasRenderer" ] }, "description": "

A reference to the current renderer

", "name": "renderer" } ], "___id": "T000002R004738", "___s": true, "$methods": [ { "comment": "/**\n * Will return a HTML Image of the target\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use use the main renderer\n * @return {HTMLImageElement} HTML Image of the target\n */", "meta": { "range": [ 1141, 1266 ], "filename": "CanvasExtract.js", "lineno": 40, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\extract\\canvas", "code": { "id": "astnode100050311", "name": "CanvasExtract#image", "type": "MethodDefinition", "paramnames": [ "target" ] }, "vars": { "": null } }, "description": "

Will return a HTML Image of the target

", "params": [ { "type": { "names": [ "PIXI.DisplayObject", "PIXI.RenderTexture" ] }, "description": "

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

", "name": "target" } ], "returns": [ { "type": { "names": [ "HTMLImageElement" ] }, "description": "

HTML Image of the target

" } ], "name": "image", "longname": "PIXI.CanvasExtract#image", "kind": "function", "memberof": "PIXI.CanvasExtract", "scope": "instance", "___id": "T000002R004743", "___s": true, "skip": true, "slug": "PIXI.CanvasExtractimage", "filepath": "extract\\canvas\\CanvasExtract.js" }, { "comment": "/**\n * Will return a a base64 encoded string of this target. It works by calling\n * `CanvasExtract.getCanvas` and then running toDataURL on that.\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use use the main renderer\n * @return {string} A base64 encoded string of the texture.\n */", "meta": { "range": [ 1671, 1745 ], "filename": "CanvasExtract.js", "lineno": 57, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\extract\\canvas", "code": { "id": "astnode100050333", "name": "CanvasExtract#base64", "type": "MethodDefinition", "paramnames": [ "target" ] }, "vars": { "": null } }, "description": "

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

", "params": [ { "type": { "names": [ "PIXI.DisplayObject", "PIXI.RenderTexture" ] }, "description": "

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

", "name": "target" } ], "returns": [ { "type": { "names": [ "string" ] }, "description": "

A base64 encoded string of the texture.

" } ], "name": "base64", "longname": "PIXI.CanvasExtract#base64", "kind": "function", "memberof": "PIXI.CanvasExtract", "scope": "instance", "___id": "T000002R004746", "___s": true, "skip": true, "slug": "PIXI.CanvasExtractbase64", "filepath": "extract\\canvas\\CanvasExtract.js" }, { "comment": "/**\n * Creates a Canvas element, renders this target to it and then returns it.\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use use the main renderer\n * @return {HTMLCanvasElement} A Canvas element with the texture rendered on.\n */", "meta": { "range": [ 2097, 3396 ], "filename": "CanvasExtract.js", "lineno": 69, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\extract\\canvas", "code": { "id": "astnode100050347", "name": "CanvasExtract#canvas", "type": "MethodDefinition", "paramnames": [ "target" ] }, "vars": { "": null } }, "description": "

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

", "params": [ { "type": { "names": [ "PIXI.DisplayObject", "PIXI.RenderTexture" ] }, "description": "

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

", "name": "target" } ], "returns": [ { "type": { "names": [ "HTMLCanvasElement" ] }, "description": "

A Canvas element with the texture rendered on.

" } ], "name": "canvas", "longname": "PIXI.CanvasExtract#canvas", "kind": "function", "memberof": "PIXI.CanvasExtract", "scope": "instance", "___id": "T000002R004747", "___s": true, "skip": true, "slug": "PIXI.CanvasExtractcanvas", "filepath": "extract\\canvas\\CanvasExtract.js" }, { "comment": "/**\n * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA\n * order, with integer values between 0 and 255 (included).\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use use the main renderer\n * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture\n */", "meta": { "range": [ 3854, 4831 ], "filename": "CanvasExtract.js", "lineno": 124, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\extract\\canvas", "code": { "id": "astnode100050511", "name": "CanvasExtract#pixels", "type": "MethodDefinition", "paramnames": [ "target" ] }, "vars": { "": null } }, "description": "

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).

", "params": [ { "type": { "names": [ "PIXI.DisplayObject", "PIXI.RenderTexture" ] }, "description": "

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

", "name": "target" } ], "returns": [ { "type": { "names": [ "Uint8ClampedArray" ] }, "description": "

One-dimensional array containing the pixel data of the entire texture

" } ], "name": "pixels", "longname": "PIXI.CanvasExtract#pixels", "kind": "function", "memberof": "PIXI.CanvasExtract", "scope": "instance", "___id": "T000002R004766", "___s": true, "skip": true, "slug": "PIXI.CanvasExtractpixels", "filepath": "extract\\canvas\\CanvasExtract.js" }, { "comment": "/**\n * Destroys the extract\n *\n */", "meta": { "range": [ 4888, 4977 ], "filename": "CanvasExtract.js", "lineno": 166, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\extract\\canvas", "code": { "id": "astnode100050632", "name": "CanvasExtract#destroy", "type": "MethodDefinition", "paramnames": [] }, "vars": { "": null } }, "description": "

Destroys the extract

", "name": "destroy", "longname": "PIXI.CanvasExtract#destroy", "kind": "function", "memberof": "PIXI.CanvasExtract", "scope": "instance", "params": [], "___id": "T000002R004781", "___s": true, "skip": true, "slug": "PIXI.CanvasExtractdestroy", "filepath": "extract\\canvas\\CanvasExtract.js" }, { "comment": "/**\n * Will return a HTML Image of the target\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use use the main renderer\n * @return {HTMLImageElement} HTML Image of the target\n */", "meta": { "range": [ 1141, 1266 ], "filename": "CanvasExtract.js", "lineno": 40, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\extract\\canvas", "code": { "id": "astnode100124990", "name": "CanvasExtract#image", "type": "MethodDefinition", "paramnames": [ "target" ] }, "vars": { "": null } }, "description": "

Will return a HTML Image of the target

", "params": [ { "type": { "names": [ "PIXI.DisplayObject", "PIXI.RenderTexture" ] }, "description": "

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

", "name": "target" } ], "returns": [ { "type": { "names": [ "HTMLImageElement" ] }, "description": "

HTML Image of the target

" } ], "name": "image", "longname": "PIXI.CanvasExtract#image", "kind": "function", "memberof": "PIXI.CanvasExtract", "scope": "instance", "___id": "T000002R011677", "___s": true, "skip": true, "slug": "PIXI.CanvasExtractimage", "filepath": "extract\\canvas\\CanvasExtract.js" }, { "comment": "/**\n * Will return a a base64 encoded string of this target. It works by calling\n * `CanvasExtract.getCanvas` and then running toDataURL on that.\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use use the main renderer\n * @return {string} A base64 encoded string of the texture.\n */", "meta": { "range": [ 1671, 1745 ], "filename": "CanvasExtract.js", "lineno": 57, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\extract\\canvas", "code": { "id": "astnode100125012", "name": "CanvasExtract#base64", "type": "MethodDefinition", "paramnames": [ "target" ] }, "vars": { "": null } }, "description": "

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

", "params": [ { "type": { "names": [ "PIXI.DisplayObject", "PIXI.RenderTexture" ] }, "description": "

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

", "name": "target" } ], "returns": [ { "type": { "names": [ "string" ] }, "description": "

A base64 encoded string of the texture.

" } ], "name": "base64", "longname": "PIXI.CanvasExtract#base64", "kind": "function", "memberof": "PIXI.CanvasExtract", "scope": "instance", "___id": "T000002R011680", "___s": true, "skip": true, "slug": "PIXI.CanvasExtractbase64", "filepath": "extract\\canvas\\CanvasExtract.js" }, { "comment": "/**\n * Creates a Canvas element, renders this target to it and then returns it.\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use use the main renderer\n * @return {HTMLCanvasElement} A Canvas element with the texture rendered on.\n */", "meta": { "range": [ 2097, 3396 ], "filename": "CanvasExtract.js", "lineno": 69, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\extract\\canvas", "code": { "id": "astnode100125026", "name": "CanvasExtract#canvas", "type": "MethodDefinition", "paramnames": [ "target" ] }, "vars": { "": null } }, "description": "

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

", "params": [ { "type": { "names": [ "PIXI.DisplayObject", "PIXI.RenderTexture" ] }, "description": "

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

", "name": "target" } ], "returns": [ { "type": { "names": [ "HTMLCanvasElement" ] }, "description": "

A Canvas element with the texture rendered on.

" } ], "name": "canvas", "longname": "PIXI.CanvasExtract#canvas", "kind": "function", "memberof": "PIXI.CanvasExtract", "scope": "instance", "___id": "T000002R011681", "___s": true, "skip": true, "slug": "PIXI.CanvasExtractcanvas", "filepath": "extract\\canvas\\CanvasExtract.js" }, { "comment": "/**\n * Will return a one-dimensional array containing the pixel data of the entire texture in RGBA\n * order, with integer values between 0 and 255 (included).\n *\n * @param {PIXI.DisplayObject|PIXI.RenderTexture} target - A displayObject or renderTexture\n * to convert. If left empty will use use the main renderer\n * @return {Uint8ClampedArray} One-dimensional array containing the pixel data of the entire texture\n */", "meta": { "range": [ 3854, 4831 ], "filename": "CanvasExtract.js", "lineno": 124, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\extract\\canvas", "code": { "id": "astnode100125190", "name": "CanvasExtract#pixels", "type": "MethodDefinition", "paramnames": [ "target" ] }, "vars": { "": null } }, "description": "

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).

", "params": [ { "type": { "names": [ "PIXI.DisplayObject", "PIXI.RenderTexture" ] }, "description": "

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

", "name": "target" } ], "returns": [ { "type": { "names": [ "Uint8ClampedArray" ] }, "description": "

One-dimensional array containing the pixel data of the entire texture

" } ], "name": "pixels", "longname": "PIXI.CanvasExtract#pixels", "kind": "function", "memberof": "PIXI.CanvasExtract", "scope": "instance", "___id": "T000002R011700", "___s": true, "skip": true, "slug": "PIXI.CanvasExtractpixels", "filepath": "extract\\canvas\\CanvasExtract.js" }, { "comment": "/**\n * Destroys the extract\n *\n */", "meta": { "range": [ 4888, 4977 ], "filename": "CanvasExtract.js", "lineno": 166, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\extract\\canvas", "code": { "id": "astnode100125311", "name": "CanvasExtract#destroy", "type": "MethodDefinition", "paramnames": [] }, "vars": { "": null } }, "description": "

Destroys the extract

", "name": "destroy", "longname": "PIXI.CanvasExtract#destroy", "kind": "function", "memberof": "PIXI.CanvasExtract", "scope": "instance", "params": [], "___id": "T000002R011715", "___s": true, "skip": true, "slug": "PIXI.CanvasExtractdestroy", "filepath": "extract\\canvas\\CanvasExtract.js" } ], "$attributes": [], "$staticmethods": [], "$staticproperties": [], "$augments": [], "$augmentedBy": [], "filepath": "extract\\canvas\\CanvasExtract.js" }