admin管理员组文章数量:1391937
I have imported both pixi
and pixi-filters
like so:
import 'pixi.js';
import 'pixi-filters';
However, after running the code:
const outlineFilterRed = new PIXI.filters.GlowFilter(15, 2, 1, 0xff9999, 0.5);
Following error is thrown:
Property 'GlowFilter' does not exist on type 'typeof filters'.
What am I doing wrong?
P.S
I'm following this example: .js
I have imported both pixi
and pixi-filters
like so:
import 'pixi.js';
import 'pixi-filters';
However, after running the code:
const outlineFilterRed = new PIXI.filters.GlowFilter(15, 2, 1, 0xff9999, 0.5);
Following error is thrown:
Property 'GlowFilter' does not exist on type 'typeof filters'.
What am I doing wrong?
P.S
I'm following this example: https://pixijs.github.io/examples/#/filters/outline-filter.js
Share Improve this question edited Oct 2, 2019 at 15:32 user128511 asked Sep 2, 2017 at 14:48 Alex LomiaAlex Lomia 7,23513 gold badges58 silver badges94 bronze badges2 Answers
Reset to default 7Seems like every filter needs to be imported individually, like it's written in the GlowFilter's README.md on Github.
Install:
npm install @pixi/filter-glow
Import:
import { GlowFilter } from '@pixi/filter-glow';
According to the definitions file, the GlowFilter (And other filters) do not exit. And according to the original js library they should exist.
This simply means that the definitions files are out-dated.
You have two options:
- Add a local definitions to the PIXI.filters.
- Create a PR to the definitions repository. (BEST)
本文标签: javascriptHow to get pixifilters workingStack Overflow
版权声明:本文标题:javascript - How to get pixi-filters working? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744745325a2622841.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论