Namespace: app

app

The app module provides a set of classes to use as a starting point when building applications.

This module has a mixin for a TickerPlugin and a ResizePlugin. These will need to be imported if you are managing your own renderer. Usage:

import 'pixi.js/app';
import { Application } from 'pixi.js';

const app = new Application();
await app.init();
// Add the canvas to the DOM
document.body.appendChild(app.canvas);

Classes

Application
CullerPlugin
ResizePlugin
TickerPlugin

Interface Definitions

ApplicationOptions

Application options supplied to the applications init method.

Properties:
Name Type Default Description
autoStart boolean true

Automatically starts the rendering after the construction. Note: Setting this parameter to false does NOT stop the shared ticker even if you set options.sharedTicker to true in case that it is already started. Stop it by your own.

resizeTo Window | HTMLElement

Element to automatically resize stage to.

sharedTicker boolean false

Settrue to use Ticker.shared, false to create new ticker. If set to false, you cannot register a handler to occur before anything that runs on the shared ticker. The system ticker will always run before both the shared ticker and the app ticker.

ApplicationPlugin

Any plugin that's usable for Application should contain these methods.

Example
import { ApplicationPlugin } from 'pixi.js';
class MyPlugin implements ApplicationPlugin
{
   static init(options)
   {
     // do something with options
   }
   static destroy()
   {
    // destruction code here
   }
}

ResizePluginOptions

Options for the resize plugin

Properties:
Name Type Attributes Default Description
resizeTo Window | HTMLElement <optional>
window

Element to automatically resize stage to.

TickerPluginOptions

Application options for ticker plugin.

Properties:
Name Type Attributes Default Description
autoStart boolean <optional>
true

Automatically starts the rendering after the construction. Note: Setting this parameter to false does NOT stop the shared ticker even if you set options.sharedTicker to true in case that it is already started. Stop it by your own.

sharedTicker boolean <optional>
false

Settrue to use Ticker.shared, false to create new ticker. If set to false, you cannot register a handler to occur before anything that runs on the shared ticker. The system ticker will always run before both the shared ticker and the app ticker.