How to use the pixi-filters.AdvancedBloomFilter function in pixi-filters

To help you get started, we’ve selected a few pixi-filters examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github abagames / pixel-art-gen / src / samples / vader.ts View on Github external
function initScreen(size, padding, backgroundColor, edgeColor) {
  const appSize = size + padding * 2;
  app = new PIXI.Application({ width: appSize, height: appSize });
  app.view.setAttribute("id", "screen");
  document.body.appendChild(app.view);
  const filterContainer = new PIXI.Container();
  filterContainer.filterArea = new PIXI.Rectangle(0, 0, appSize, appSize);
  app.stage.addChild(filterContainer);
  const bloomFilter = new PIXIFilters.AdvancedBloomFilter({
    threshold: 0.1,
    bloomScale: 1,
    brightness: 1,
    blur: 5
  });
  filterContainer.filters = [bloomFilter];
  const backgroundContainer = new PIXI.Container();
  const background = new PIXI.Graphics();
  background.beginFill(backgroundColor);
  background.drawRect(padding, padding, size, size);
  background.endFill();
  backgroundContainer.addChild(background);
  filterContainer.addChild(backgroundContainer);
  initParticle(filterContainer, padding);
  screen = new PIXI.Container();
  screen.x = screen.y = padding;

pixi-filters

[![Node.js CI](https://github.com/pixijs/filters/workflows/Node.js%20CI/badge.svg)](https://github.com/pixijs/filters/actions/workflows/nodejs.yml?query=branch%3Amain) [![npm version](https://badge.fury.io/js/pixi-filters.svg)](https://www.npmjs.com/packa

MIT
Latest version published 2 months ago

Package Health Score

69 / 100
Full package analysis

Similar packages