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 element or window to resize the application to.
-
screen PIXI.Rectangle readonly
-
Reference to the renderer's screen rectangle. Its safe to use as
filterArea
orhitArea
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
-
Reference to the renderer's canvas element.
Methods
-
Register a middleware plugin for the application
Name Type Description plugin
PIXI.Application.Plugin Plugin being installed
-
Create the new renderer, this is here to overridden to support Canvas.
Name Type Description options
Object optional See constructor for complete arguments
-
Destroy and don't use after this.
Name Type Default Description removeView
Boolean false optional 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
Name Type Default Description children
boolean 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.
texture
boolean false optional Only used for child Sprites if stageOptions.children is set to true. Should it destroy the texture of the child sprite
baseTexture
boolean false optional 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.
-
If
resizeTo
is set, calling this function will resize to the width and height of that element. -
Convenience method for starting the render.
-
Convenience method for stopping the render.
Type Definitions
-
Properties:
Name Type Description init
function Called when Application is constructed, scoped to Application instance. Passes in
options
as the only argument, which are Application constructor options.destroy
function Called when destroying Application, scoped to Application instance