Skip to content

Application

Creates a PixiJS Application.

Creates a Pixi application where all Pixi elements and composition functions need to be inside the application to work properly. In v8, the application is initialized asynchronously via app.init().

Getting Instance Externally

You can obtain the Application instance by binding a ref externally, but it is generally recommended to use useApplication internally.

API

Application Props

NameTypeDefaultDescription
widthnumber stringundefinedThe width of the renderer
heightnumber stringundefinedThe height of the renderer
background

string|number|array|object

The background color of the renderer
backgroundColor

string|number|array|object

0x000000The background color of the renderer
backgroundAlphanumber1The background alpha of the renderer
resolutionnumber1The resolution / device pixel ratio of the renderer
preferencestring'webgl'Which rendering backend to prefer
antialiasbooleanundefinedWhether to enable antialiasing
autoDensitybooleanundefinedWhether to resize the CSS dimensions of the canvas to match the resolution
autoStartbooleantrueWhether to automatically start the ticker
clearBeforeRenderbooleanundefinedWhether to clear the canvas before each render
hellobooleanundefinedWhether to log the PixiJS version to the console
preserveDrawingBufferbooleanundefinedWhether to preserve the drawing buffer
roundPixelsbooleanundefinedWhether to round pixel values
resizeToHTMLElement WindowundefinedElement to auto-resize the renderer to

more props in PixiJS ApplicationOptions

Application Slots

NameDescription
defaultThe default slot is where you put all your Pixi elements.