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
| Name | Type | Default | Description |
|---|---|---|---|
| width | number string | undefined | The width of the renderer |
| height | number string | undefined | The height of the renderer |
| background |
| The background color of the renderer | |
| backgroundColor |
| 0x000000 | The background color of the renderer |
| backgroundAlpha | number | 1 | The background alpha of the renderer |
| resolution | number | 1 | The resolution / device pixel ratio of the renderer |
| preference | string | 'webgl' | Which rendering backend to prefer |
| antialias | boolean | undefined | Whether to enable antialiasing |
| autoDensity | boolean | undefined | Whether to resize the CSS dimensions of the canvas to match the resolution |
| autoStart | boolean | true | Whether to automatically start the ticker |
| clearBeforeRender | boolean | undefined | Whether to clear the canvas before each render |
| hello | boolean | undefined | Whether to log the PixiJS version to the console |
| preserveDrawingBuffer | boolean | undefined | Whether to preserve the drawing buffer |
| roundPixels | boolean | undefined | Whether to round pixel values |
| resizeTo | HTMLElement Window | undefined | Element to auto-resize the renderer to |
more props in PixiJS ApplicationOptions
Application Slots
| Name | Description |
|---|---|
| default | The default slot is where you put all your Pixi elements. |