new PIXI.Application(width, height, options, noWebGL, useSharedTicker)
Name | Type | Default | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
width |
number | 800 |
optional
the width of the renderers view |
||||||||||||||||||||||||
height |
number | 600 |
optional
the height of the renderers view |
||||||||||||||||||||||||
options |
object |
optional
The optional renderer parameters
|
|||||||||||||||||||||||||
noWebGL |
boolean | false |
optional
prevents selection of WebGL renderer, even if such is present |
||||||||||||||||||||||||
options.legacy |
boolean | false |
optional
If true Pixi will aim to ensure compatibility |
||||||||||||||||||||||||
useSharedTicker |
boolean | false |
optional
|
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.fromImage('something.png'));
Members
-
WebGL renderer if available, otherwise CanvasRenderer
-
readonlyscreenPIXI.Rectangle
-
Reference to the renderer's screen rectangle. Its safe to use as filterArea or hitArea for whole screen
-
stagePIXI.Container
-
The root display container that's rendered.
-
tickerPIXI.ticker.Ticker
-
Ticker for doing render updates.
- Default Value:
- PIXI.ticker.shared
-
readonlyviewHTMLCanvasElement
-
Reference to the renderer's canvas element.
Methods
-
destroy(removeView)
-
Destroy and don't use after this.
Name Type Default Description removeView
Boolean false optional Automatically remove canvas from DOM.
-
render()
-
Render the current stage.
-
start()
-
Convenience method for starting the render.
-
stop()
-
Convenience method for stopping the render.