new PIXI.Application(width, height, options, noWebGL)
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 |
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
-
stagePIXI.Container
-
The root display container that's renderered.
-
tickerPIXI.ticker.Ticker
-
Ticker for doing render updates.
-
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.