LogoPixi’VN
pixi-jsClasses

Class: ResizePlugin

Defined in: node_modules/pixi.js/lib/app/ResizePlugin.d.ts:66

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 to
  • resize: Manually trigger a resize
  • queueResize: Queue a resize for the next animation frame
  • cancelResize: Cancel a queued resize

Example

import { Application, ResizePlugin } from 'pixi.js';

// Create application
const app = new Application();

// Example 1: Auto-resize to window
await app.init({ resizeTo: window });

// Example 2: Auto-resize to specific element
const container = document.querySelector('#game-container');
await app.init({ resizeTo: container });

// Example 3: Change resize target at runtime
app.resizeTo = window;                    // Enable auto-resize to window
app.resizeTo = null;                      // Disable auto-resize

Standard

Constructors

Constructor

> new ResizePlugin(): ResizePlugin

Returns

ResizePlugin

Properties

queueResize

> static queueResize: () => void

Defined in: node_modules/pixi.js/lib/app/ResizePlugin.d.ts:76

Internal

Returns

void


render

> static render: () => void

Defined in: node_modules/pixi.js/lib/app/ResizePlugin.d.ts:78

Internal

Returns

void


renderer

> static renderer: ResizeableRenderer

Defined in: node_modules/pixi.js/lib/app/ResizePlugin.d.ts:74

Internal


resize

> static resize: () => void

Defined in: node_modules/pixi.js/lib/app/ResizePlugin.d.ts:72

Internal

Returns

void


resizeTo

> static resizeTo: HTMLElement | Window

Defined in: node_modules/pixi.js/lib/app/ResizePlugin.d.ts:70

Internal