how to add boxshadow to shapes in pixijs

Viewed 18

I am trying to add boxshadow to a rectangle in pixi js but dropshadowfilter doesn't work

var app = new PIXI.Application({
    width: 500,
    height: 500,
    autoDensity: true,
    backgroundColor: 0xf0fff0,
    resolution: devicePixelRatio,
});
document.body.appendChild(app.view);
var gc = new PIXI.Graphics();
gc.beginFill(0xf0f0a0, 1);
gc.drawRect(100, 100, 200, 200);
gc.endFill();
app.stage.addChild(gc);
var dropShadowFilter = new PIXI.filters.DropShadowFilter();
dropShadowFilter.color = 0xFF666666;
dropShadowFilter.alpha = 0.5;
dropShadowFilter.blur = 0;
dropShadowFilter.distance = 5;
dropShadowFilter.quality = 3;
gc.filters = [dropShadowFilter];

how can I add boxshadow to any shape in pixi?

0 Answers
Related