Name | Type | Attributes | Description |
---|---|---|---|
options |
Partial<PIXI.IApplicationOptions> |
<optional> |
The optional application and renderer parameters. |
Example
import { Application, Sprite } from 'pixi.js';
// Create the application
const app = new Application();
// Add the view to the DOM
document.body.appendChild(app.view);
// ex, add display objects
app.stage.addChild(Sprite.from('something.png'));
Members
PIXI.Application._plugins PIXI.IApplicationPlugin[] static
Collection of installed plugins.
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 filterArea
or hitArea
for 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
view PIXI.ICanvas readonly
Reference to the renderer's canvas element.
Methods
Destroy and don't use after this.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
removeView |
boolean |
<optional> |
false |
Automatically remove canvas from DOM. |
stageOptions |
object | boolean |
<optional> |
Options parameter. A boolean will act as if all options have been set to that value |
|
stageOptions.children |
boolean |
<optional> |
false |
if set to true, all the children will have their destroy method called as well. 'stageOptions' will be passed on to those calls. |
stageOptions.texture |
boolean |
<optional> |
false |
Only used for child Sprites if stageOptions.children is set to true. Should it destroy the texture of the child sprite |
stageOptions.baseTexture |
boolean |
<optional> |
false |
Only used for child Sprites if stageOptions.children is set to true. Should it destroy the base texture of the child sprite |
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 resizeTo
property is set.
Convenience method for starting the render.
Convenience method for stopping the render.