Alexander Farber Posted April 17, 2020 Share Posted April 17, 2020 Hello and good evening, I am trying to use DropShadowFilter at a web page (please scroll down): <script type="text/javascript" src="//cdn.jsdelivr.net/npm/[email protected]/dist/pixi.min.js"></script> <script type="text/javascript" src="//cdn.jsdelivr.net/npm/[email protected]/dist/pixi-legacy.min.js"></script> <script type="text/javascript" src="//cdn.jsdelivr.net/npm/[email protected]/lib/pixi-filters.cjs.min.js"></script> When I use blur filter, it just works, but drop shadow not - //var blurFilter = new PIXI.filters.BlurFilter(); var shadowFilter = new PIXI.filters.DropShadowFilter(); shadowFilter.color = 0x000020; shadowFilter.alpha = 0.2; shadowFilter.blur = 6; shadowFilter.distance = 20; function onDragStart(ev) { var stagePoint = ev.data.getLocalPosition(app.stage); if (card.getBounds().contains(stagePoint.x, stagePoint.y)) { oldX = stagePoint.x; oldY = stagePoint.y; this.data = ev.data; card.filters = [ shadowFilter ]; } } function onDragEnd() { oldX = 0; oldY = 0; card.filters = []; } The erorr message in macOS Safari is (screenshot attached): [Error] ReferenceError: Can't find variable: exports Global Code (pixi-filters.cjs.min.js:7) [Error] SyntaxError: Unexpected string literal 'DropShadowFilter'. import call expects exactly one argument. (anonymous function) (raspasy:122) Does anybody please have a hint for me? Greetings from Germany Alex Quote Link to comment Share on other sites More sharing options...
Alexander Farber Posted April 17, 2020 Author Share Posted April 17, 2020 (edited) I have got it resolved and of course it was a silly mistake by me - when I use the following it works: <script type="text/javascript" src="//cdn.jsdelivr.net/npm/[email protected]/dist/pixi-filters.js"></script> I am not sure what was meant by the ".cjs" in the previously used URL Thank you Edited April 17, 2020 by Alexander Farber Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted April 17, 2020 Share Posted April 17, 2020 commonjs, for modules. Yes, you dont need it Alexander Farber 1 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.