Alexander Farber Posted November 26, 2016 Share Posted November 26, 2016 Good evening, with pixi.js v3 I was using the following code to draw a shadow underneath a polygon (here full source code of Score.js): this.filters = [ new PIXI.filters.DropShadowFilter() ]; this.filters[0].alpha = .2; But with pixi.js v4 I can not use that filter anymore. Here are the two polygons I need to draw, blue and red: Instead of using drop shadow filer, I would like to draw the same polygon in translucent gray, offset by few pixels. Could someone please help me, how to offset the polygon, I can not find anything in the pixi js docs. Here my current code: Score.POLY_1 = [ new PIXI.Point(0, 0), new PIXI.Point(Score.WIDTH + 2, 0), new PIXI.Point(Score.WIDTH - 2, Score.HEIGHT / 2), new PIXI.Point(Score.WIDTH + 2, Score.HEIGHT), new PIXI.Point(0, Score.HEIGHT) ]; // How to draw grey POLY_1 offset by few pixels here? this.bgGraphics.clear(); this.bgGraphics.beginFill(this.color, 1); this.bgGraphics.drawPolygon(Score.POLY_1); this.bgGraphics.endFill(); Regards Alex Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.