Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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;