| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
optional
The optional renderer parameters.
|
Example
// Create the application
const app = new PIXI.Application();
// Add the view to the DOM
document.body.appendChild(app.view);
// ex, add display objects
app.stage.addChild(PIXI.Sprite.from('something.png'));
Members
-
loader PIXI.Loader readonly
-
Loader instance to help with asset loading.
-
renderer PIXI.Renderer | PIXI.CanvasRenderer
-
WebGL renderer if available, otherwise CanvasRenderer.
-
The HTML element or window to automatically resize the renderer's view element to match width and height.
-
screen PIXI.Rectangle readonly
-
Reference to the renderer's screen rectangle. Its safe to use as
filterAreaorhitAreafor the whole screen. -
stage PIXI.Container
-
The root display container that's rendered.
-
ticker PIXI.Ticker
-
Ticker for doing render updates.
- Default Value:
- PIXI.Ticker.shared
-
Reference to the renderer's canvas element.
Methods
-
Register a middleware plugin for the application
Name Type Description pluginPIXI.Application.Plugin Plugin being installed
-
Destroy and don't use after this.
Name Type Default Description removeViewBoolean false optional Automatically remove canvas from DOM.
stageOptionsobject | boolean optional Options parameter. A boolean will act as if all options have been set to that value
Name Type Default Description childrenboolean false optional if set to true, all the children will have their destroy method called as well. 'stageOptions' will be passed on to those calls.
textureboolean false optional Only used for child Sprites if stageOptions.children is set to true. Should it destroy the texture of the child sprite
baseTextureboolean false optional Only used for child Sprites if stageOptions.children is set to true. Should it destroy the base texture of the child sprite
-
Resize is throttled, so it's safe to call this multiple times per frame and it'll only be called once.
-
Render the current stage.
-
Execute an immediate resize on the renderer, this is not throttled and can be expensive to call many times in a row. Will resize only if
resizeToproperty is set. -
Convenience method for starting the render.
-
Convenience method for stopping the render.
Type Definitions
-
Properties:
Name Type Description initfunction Called when Application is constructed, scoped to Application instance. Passes in
optionsas the only argument, which are Application constructor options.destroyfunction Called when destroying Application, scoped to Application instance