Middleware for Application's resize functionality. This plugin handles automatic and manual resizing of your PixiJS application.
Adds the following features to Application:
resizeTo
resize
queueResize
cancelResize
import { Application, ResizePlugin } from 'pixi.js';// Create applicationconst app = new Application();// Example 1: Auto-resize to windowawait app.init({ resizeTo: window });// Example 2: Auto-resize to specific elementconst container = document.querySelector('#game-container');await app.init({ resizeTo: container });// Example 3: Change resize target at runtimeapp.resizeTo = window; // Enable auto-resize to windowapp.resizeTo = null; // Disable auto-resize Copy
import { Application, ResizePlugin } from 'pixi.js';// Create applicationconst app = new Application();// Example 1: Auto-resize to windowawait app.init({ resizeTo: window });// Example 2: Auto-resize to specific elementconst container = document.querySelector('#game-container');await app.init({ resizeTo: container });// Example 3: Change resize target at runtimeapp.resizeTo = window; // Enable auto-resize to windowapp.resizeTo = null; // Disable auto-resize
Middleware for Application's resize functionality. This plugin handles automatic and manual resizing of your PixiJS application.
Adds the following features to Application:
resizeTo
: Set an element to automatically resize toresize
: Manually trigger a resizequeueResize
: Queue a resize for the next animation framecancelResize
: Cancel a queued resizeExample