Home

class: Application


Convenience class to create a new PIXI application.
This class automatically creates the renderer, ticker
and root container.

Methods summary


Public methods
public render(): void
public stop(): void
public start(): void
public view(): void
public screen(): void
public destroy(removeView: Boolean): void
public render(): void
public stop(): void
public start(): void
public view(): void
public screen(): void
public destroy(removeView: Boolean): void

Properties


Name Type Attribute Description
renderer PIXI.WebGLRenderer PIXI.CanvasRenderer public

WebGL renderer if available, otherwise CanvasRenderer

stage PIXI.Container public

The root display container that's rendered.

_ticker PIXI.ticker.Ticker private

Internal reference to the ticker

ticker PIXI.ticker.Ticker public

Ticker for doing render updates.

renderer PIXI.WebGLRenderer PIXI.CanvasRenderer public

WebGL renderer if available, otherwise CanvasRenderer

stage PIXI.Container public

The root display container that's rendered.

_ticker PIXI.ticker.Ticker private

Internal reference to the ticker

ticker PIXI.ticker.Ticker public

Ticker for doing render updates.

Methods


render(): void

Render the current stage.

Returns:

void


stop(): void

Convenience method for stopping the render.

Returns:

void


start(): void

Convenience method for starting the render.

Returns:

void


view(): void

Reference to the renderer's canvas element.

Returns:

void


screen(): void

Reference to the renderer's screen rectangle. Its safe to use as filterArea or hitArea for whole screen

Returns:

void


destroy(removeView: Boolean): void

Destroy and don't use after this.

Params:

Name Type Attribute Description
removeView

Automatically remove canvas from DOM.

Returns:

void


render(): void

Render the current stage.

Returns:

void


stop(): void

Convenience method for stopping the render.

Returns:

void


start(): void

Convenience method for starting the render.

Returns:

void


view(): void

Reference to the renderer's canvas element.

Returns:

void


screen(): void

Reference to the renderer's screen rectangle. Its safe to use as filterArea or hitArea for whole screen

Returns:

void


destroy(removeView: Boolean): void

Destroy and don't use after this.

Params:

Name Type Attribute Description
removeView

Automatically remove canvas from DOM.

Returns:

void


  {
    "comment": "/**\n * Convenience class to create a new PIXI application.\n * This class automatically creates the renderer, ticker\n * and root container.\n *\n * @example\n * // Create the application\n * const app = new PIXI.Application();\n *\n * // Add the view to the DOM\n * document.body.appendChild(app.view);\n *\n * // ex, add display objects\n * app.stage.addChild(PIXI.Sprite.fromImage('something.png'));\n *\n * @class\n * @memberof PIXI\n */",
    "meta": {
        "range": [
            681,
            5090
        ],
        "filename": "Application.js",
        "lineno": 27,
        "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\core",
        "code": {
            "id": "astnode100001561",
            "name": "Application",
            "type": "ClassDeclaration",
            "paramnames": [
                "options",
                "arg2",
                "arg3",
                "arg4",
                "arg5"
            ]
        }
    },
    "classdesc": "

Convenience class to create a new PIXI application.
This class automatically creates the renderer, ticker
and root container.

", "examples": [ "// Create the application\nconst app = new PIXI.Application();\n\n// Add the view to the DOM\ndocument.body.appendChild(app.view);\n\n// ex, add display objects\napp.stage.addChild(PIXI.Sprite.fromImage('something.png'));" ], "kind": "class", "memberof": "PIXI", "name": "Application", "longname": "PIXI.Application", "scope": "static", "params": [ { "type": { "names": [ "object" ] }, "optional": true, "description": "

The optional renderer parameters

", "name": "options" }, { "type": { "names": [ "number" ] }, "optional": true, "defaultvalue": 800, "description": "

the width of the renderers view

", "name": "options.width" }, { "type": { "names": [ "number" ] }, "optional": true, "defaultvalue": 600, "description": "

the height of the renderers view

", "name": "options.height" }, { "type": { "names": [ "HTMLCanvasElement" ] }, "optional": true, "description": "

the canvas to use as a view, optional

", "name": "options.view" }, { "type": { "names": [ "boolean" ] }, "optional": true, "defaultvalue": false, "description": "

If the render view is transparent, default false

", "name": "options.transparent" }, { "type": { "names": [ "boolean" ] }, "optional": true, "defaultvalue": false, "description": "

sets antialias (only applicable in chrome at the moment)

", "name": "options.antialias" }, { "type": { "names": [ "boolean" ] }, "optional": true, "defaultvalue": false, "description": "

enables drawing buffer preservation, enable this if you
need to call toDataUrl on the webgl context

", "name": "options.preserveDrawingBuffer" }, { "type": { "names": [ "number" ] }, "optional": true, "defaultvalue": 1, "description": "

The resolution / device pixel ratio of the renderer, retina would be 2

", "name": "options.resolution" }, { "type": { "names": [ "boolean" ] }, "optional": true, "defaultvalue": false, "description": "

prevents selection of WebGL renderer, even if such is present

", "name": "options.forceCanvas" }, { "type": { "names": [ "boolean" ] }, "optional": true, "defaultvalue": false, "description": "

If true Pixi will aim to ensure compatibility
with older / less advanced devices. If you experience unexplained flickering try setting this to true.

", "name": "options.legacy" }, { "type": { "names": [ "boolean" ] }, "optional": true, "defaultvalue": false, "description": "

true to use PIXI.ticker.shared, false to create new ticker.

", "name": "options.sharedTicker" } ], "___id": "T000002R000127", "___s": true, "$methods": [ { "comment": "/**\n * Render the current stage.\n */", "meta": { "range": [ 3953, 4015 ], "filename": "Application.js", "lineno": 114, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\core", "code": { "id": "astnode100001707", "name": "Application#render", "type": "MethodDefinition", "paramnames": [] }, "vars": { "": null } }, "description": "

Render the current stage.

", "name": "render", "longname": "PIXI.Application#render", "kind": "function", "memberof": "PIXI.Application", "scope": "instance", "params": [], "___id": "T000002R000148", "___s": true, "skip": true, "slug": "PIXI.Applicationrender", "filepath": "core\\Application.js" }, { "comment": "/**\n * Convenience method for stopping the render.\n */", "meta": { "range": [ 4088, 4135 ], "filename": "Application.js", "lineno": 122, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\core", "code": { "id": "astnode100001721", "name": "Application#stop", "type": "MethodDefinition", "paramnames": [] }, "vars": { "": null } }, "description": "

Convenience method for stopping the render.

", "name": "stop", "longname": "PIXI.Application#stop", "kind": "function", "memberof": "PIXI.Application", "scope": "instance", "params": [], "___id": "T000002R000149", "___s": true, "skip": true, "slug": "PIXI.Applicationstop", "filepath": "core\\Application.js" }, { "comment": "/**\n * Convenience method for starting the render.\n */", "meta": { "range": [ 4208, 4257 ], "filename": "Application.js", "lineno": 130, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\core", "code": { "id": "astnode100001732", "name": "Application#start", "type": "MethodDefinition", "paramnames": [] }, "vars": { "": null } }, "description": "

Convenience method for starting the render.

", "name": "start", "longname": "PIXI.Application#start", "kind": "function", "memberof": "PIXI.Application", "scope": "instance", "params": [], "___id": "T000002R000150", "___s": true, "skip": true, "slug": "PIXI.Applicationstart", "filepath": "core\\Application.js" }, { "comment": "/**\n * Reference to the renderer's canvas element.\n * @member {HTMLCanvasElement}\n * @readonly\n */", "meta": { "range": [ 4382, 4439 ], "filename": "Application.js", "lineno": 140, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\core", "code": { "id": "astnode100001743", "name": "Application#view", "type": "MethodDefinition", "paramnames": [] }, "vars": { "": null } }, "description": "

Reference to the renderer's canvas element.

", "kind": "member", "type": { "names": [ "HTMLCanvasElement" ] }, "readonly": true, "name": "view", "longname": "PIXI.Application#view", "memberof": "PIXI.Application", "scope": "instance", "params": [], "___id": "T000002R000151", "___s": true, "skip": true, "slug": "PIXI.Applicationview", "filepath": "core\\Application.js" }, { "comment": "/**\n * Reference to the renderer's screen rectangle. Its safe to use as filterArea or hitArea for whole screen\n * @member {PIXI.Rectangle}\n * @readonly\n */", "meta": { "range": [ 4621, 4682 ], "filename": "Application.js", "lineno": 150, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\core", "code": { "id": "astnode100001753", "name": "Application#screen", "type": "MethodDefinition", "paramnames": [] }, "vars": { "": null } }, "description": "

Reference to the renderer's screen rectangle. Its safe to use as filterArea or hitArea for whole screen

", "kind": "member", "type": { "names": [ "PIXI.Rectangle" ] }, "readonly": true, "name": "screen", "longname": "PIXI.Application#screen", "memberof": "PIXI.Application", "scope": "instance", "params": [], "___id": "T000002R000152", "___s": true, "skip": true, "slug": "PIXI.Applicationscreen", "filepath": "core\\Application.js" }, { "comment": "/**\n * Destroy and don't use after this.\n * @param {Boolean} [removeView=false] Automatically remove canvas from DOM.\n */", "meta": { "range": [ 4826, 5088 ], "filename": "Application.js", "lineno": 159, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\core", "code": { "id": "astnode100001763", "name": "Application#destroy", "type": "MethodDefinition", "paramnames": [ "removeView" ] }, "vars": { "": null } }, "description": "

Destroy and don't use after this.

", "params": [ { "type": { "names": [ "Boolean" ] }, "optional": true, "defaultvalue": false, "description": "

Automatically remove canvas from DOM.

", "name": "removeView" } ], "name": "destroy", "longname": "PIXI.Application#destroy", "kind": "function", "memberof": "PIXI.Application", "scope": "instance", "___id": "T000002R000153", "___s": true, "skip": true, "slug": "PIXI.Applicationdestroy", "filepath": "core\\Application.js" }, { "comment": "/**\n * Render the current stage.\n */", "meta": { "range": [ 3953, 4015 ], "filename": "Application.js", "lineno": 114, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\core", "code": { "id": "astnode100076386", "name": "Application#render", "type": "MethodDefinition", "paramnames": [] }, "vars": { "": null } }, "description": "

Render the current stage.

", "name": "render", "longname": "PIXI.Application#render", "kind": "function", "memberof": "PIXI.Application", "scope": "instance", "params": [], "___id": "T000002R007082", "___s": true, "skip": true, "slug": "PIXI.Applicationrender", "filepath": "core\\Application.js" }, { "comment": "/**\n * Convenience method for stopping the render.\n */", "meta": { "range": [ 4088, 4135 ], "filename": "Application.js", "lineno": 122, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\core", "code": { "id": "astnode100076400", "name": "Application#stop", "type": "MethodDefinition", "paramnames": [] }, "vars": { "": null } }, "description": "

Convenience method for stopping the render.

", "name": "stop", "longname": "PIXI.Application#stop", "kind": "function", "memberof": "PIXI.Application", "scope": "instance", "params": [], "___id": "T000002R007083", "___s": true, "skip": true, "slug": "PIXI.Applicationstop", "filepath": "core\\Application.js" }, { "comment": "/**\n * Convenience method for starting the render.\n */", "meta": { "range": [ 4208, 4257 ], "filename": "Application.js", "lineno": 130, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\core", "code": { "id": "astnode100076411", "name": "Application#start", "type": "MethodDefinition", "paramnames": [] }, "vars": { "": null } }, "description": "

Convenience method for starting the render.

", "name": "start", "longname": "PIXI.Application#start", "kind": "function", "memberof": "PIXI.Application", "scope": "instance", "params": [], "___id": "T000002R007084", "___s": true, "skip": true, "slug": "PIXI.Applicationstart", "filepath": "core\\Application.js" }, { "comment": "/**\n * Reference to the renderer's canvas element.\n * @member {HTMLCanvasElement}\n * @readonly\n */", "meta": { "range": [ 4382, 4439 ], "filename": "Application.js", "lineno": 140, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\core", "code": { "id": "astnode100076422", "name": "Application#view", "type": "MethodDefinition", "paramnames": [] }, "vars": { "": null } }, "description": "

Reference to the renderer's canvas element.

", "kind": "member", "type": { "names": [ "HTMLCanvasElement" ] }, "readonly": true, "name": "view", "longname": "PIXI.Application#view", "memberof": "PIXI.Application", "scope": "instance", "params": [], "___id": "T000002R007085", "___s": true, "skip": true, "slug": "PIXI.Applicationview", "filepath": "core\\Application.js" }, { "comment": "/**\n * Reference to the renderer's screen rectangle. Its safe to use as filterArea or hitArea for whole screen\n * @member {PIXI.Rectangle}\n * @readonly\n */", "meta": { "range": [ 4621, 4682 ], "filename": "Application.js", "lineno": 150, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\core", "code": { "id": "astnode100076432", "name": "Application#screen", "type": "MethodDefinition", "paramnames": [] }, "vars": { "": null } }, "description": "

Reference to the renderer's screen rectangle. Its safe to use as filterArea or hitArea for whole screen

", "kind": "member", "type": { "names": [ "PIXI.Rectangle" ] }, "readonly": true, "name": "screen", "longname": "PIXI.Application#screen", "memberof": "PIXI.Application", "scope": "instance", "params": [], "___id": "T000002R007086", "___s": true, "skip": true, "slug": "PIXI.Applicationscreen", "filepath": "core\\Application.js" }, { "comment": "/**\n * Destroy and don't use after this.\n * @param {Boolean} [removeView=false] Automatically remove canvas from DOM.\n */", "meta": { "range": [ 4826, 5088 ], "filename": "Application.js", "lineno": 159, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\core", "code": { "id": "astnode100076442", "name": "Application#destroy", "type": "MethodDefinition", "paramnames": [ "removeView" ] }, "vars": { "": null } }, "description": "

Destroy and don't use after this.

", "params": [ { "type": { "names": [ "Boolean" ] }, "optional": true, "defaultvalue": false, "description": "

Automatically remove canvas from DOM.

", "name": "removeView" } ], "name": "destroy", "longname": "PIXI.Application#destroy", "kind": "function", "memberof": "PIXI.Application", "scope": "instance", "___id": "T000002R007087", "___s": true, "skip": true, "slug": "PIXI.Applicationdestroy", "filepath": "core\\Application.js" } ], "$attributes": [ { "comment": "/**\n * WebGL renderer if available, otherwise CanvasRenderer\n * @member {PIXI.WebGLRenderer|PIXI.CanvasRenderer} PIXI.Application#renderer\n */", "meta": { "range": [ 2618, 2784 ], "filename": "Application.js", "lineno": 64, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\core", "code": {} }, "description": "

WebGL renderer if available, otherwise CanvasRenderer

", "kind": "member", "name": "renderer", "type": { "names": [ "PIXI.WebGLRenderer", "PIXI.CanvasRenderer" ] }, "memberof": "PIXI.Application", "longname": "PIXI.Application#renderer", "scope": "instance", "___id": "T000002R000137", "___s": true, "skip": true, "slug": "PIXI.Applicationrenderer", "filepath": "core\\Application.js" }, { "comment": "/**\n * The root display container that's rendered.\n * @member {PIXI.Container} PIXI.Application#stage\n */", "meta": { "range": [ 2847, 2976 ], "filename": "Application.js", "lineno": 70, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\core", "code": {} }, "description": "

The root display container that's rendered.

", "kind": "member", "name": "stage", "type": { "names": [ "PIXI.Container" ] }, "memberof": "PIXI.Application", "longname": "PIXI.Application#stage", "scope": "instance", "___id": "T000002R000139", "___s": true, "skip": true, "slug": "PIXI.Applicationstage", "filepath": "core\\Application.js" }, { "comment": "/**\n * Internal reference to the ticker\n * @member {PIXI.ticker.Ticker} PIXI.Application#_ticker\n * @private\n */", "meta": { "range": [ 3024, 3168 ], "filename": "Application.js", "lineno": 76, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\core", "code": {} }, "description": "

Internal reference to the ticker

", "kind": "member", "name": "_ticker", "type": { "names": [ "PIXI.ticker.Ticker" ] }, "access": "private", "memberof": "PIXI.Application", "longname": "PIXI.Application#_ticker", "scope": "instance", "___id": "T000002R000141", "___s": true, "skip": true, "slug": "PIXI.Application_ticker", "filepath": "core\\Application.js" }, { "comment": "/**\n * Ticker for doing render updates.\n * @member {PIXI.ticker.Ticker} PIXI.Application#ticker\n * @default PIXI.ticker.shared\n */", "meta": { "range": [ 3207, 3369 ], "filename": "Application.js", "lineno": 83, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\core", "code": {} }, "description": "

Ticker for doing render updates.

", "kind": "member", "name": "ticker", "type": { "names": [ "PIXI.ticker.Ticker" ] }, "defaultvalue": "PIXI.ticker.shared", "memberof": "PIXI.Application", "longname": "PIXI.Application#ticker", "scope": "instance", "___id": "T000002R000143", "___s": true, "skip": true, "slug": "PIXI.Applicationticker", "filepath": "core\\Application.js" }, { "comment": "/**\n * WebGL renderer if available, otherwise CanvasRenderer\n * @member {PIXI.WebGLRenderer|PIXI.CanvasRenderer} PIXI.Application#renderer\n */", "meta": { "range": [ 2618, 2784 ], "filename": "Application.js", "lineno": 64, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\core", "code": {} }, "description": "

WebGL renderer if available, otherwise CanvasRenderer

", "kind": "member", "name": "renderer", "type": { "names": [ "PIXI.WebGLRenderer", "PIXI.CanvasRenderer" ] }, "memberof": "PIXI.Application", "longname": "PIXI.Application#renderer", "scope": "instance", "___id": "T000002R007071", "___s": true, "skip": true, "slug": "PIXI.Applicationrenderer", "filepath": "core\\Application.js" }, { "comment": "/**\n * The root display container that's rendered.\n * @member {PIXI.Container} PIXI.Application#stage\n */", "meta": { "range": [ 2847, 2976 ], "filename": "Application.js", "lineno": 70, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\core", "code": {} }, "description": "

The root display container that's rendered.

", "kind": "member", "name": "stage", "type": { "names": [ "PIXI.Container" ] }, "memberof": "PIXI.Application", "longname": "PIXI.Application#stage", "scope": "instance", "___id": "T000002R007073", "___s": true, "skip": true, "slug": "PIXI.Applicationstage", "filepath": "core\\Application.js" }, { "comment": "/**\n * Internal reference to the ticker\n * @member {PIXI.ticker.Ticker} PIXI.Application#_ticker\n * @private\n */", "meta": { "range": [ 3024, 3168 ], "filename": "Application.js", "lineno": 76, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\core", "code": {} }, "description": "

Internal reference to the ticker

", "kind": "member", "name": "_ticker", "type": { "names": [ "PIXI.ticker.Ticker" ] }, "access": "private", "memberof": "PIXI.Application", "longname": "PIXI.Application#_ticker", "scope": "instance", "___id": "T000002R007075", "___s": true, "skip": true, "slug": "PIXI.Application_ticker", "filepath": "core\\Application.js" }, { "comment": "/**\n * Ticker for doing render updates.\n * @member {PIXI.ticker.Ticker} PIXI.Application#ticker\n * @default PIXI.ticker.shared\n */", "meta": { "range": [ 3207, 3369 ], "filename": "Application.js", "lineno": 83, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\pixi.js\\pixi.js-repo\\src\\core", "code": {} }, "description": "

Ticker for doing render updates.

", "kind": "member", "name": "ticker", "type": { "names": [ "PIXI.ticker.Ticker" ] }, "defaultvalue": "PIXI.ticker.shared", "memberof": "PIXI.Application", "longname": "PIXI.Application#ticker", "scope": "instance", "___id": "T000002R007077", "___s": true, "skip": true, "slug": "PIXI.Applicationticker", "filepath": "core\\Application.js" } ], "$staticmethods": [], "$staticproperties": [], "$augments": [], "$augmentedBy": [], "filepath": "core\\Application.js" }