PIXI.filters

namespace filters

This namespace contains WebGL-only display filters that can be applied to DisplayObjects using the filters property.

Since PixiJS only had a handful of built-in filters, additional filters can be downloaded here from the PixiJS Filters repository.

All filters must extend PIXI.Filter.


 // Create a new application
 const app = new PIXI.Application();

 // Draw a green rectangle
 const rect = new PIXI.Graphics()
     .beginFill(0x00ff00)
     .drawRect(40, 40, 200, 200);

 // Add a blur filter
 rect.filters = [new PIXI.filters.BlurFilter()];

 // Display rectangle
 app.stage.addChild(rect);
 document.body.appendChild(app.view);

Summary



Powered by webdoc!