javascript - How to get pixi-filters working? - Stack Overflow

I have imported both pixi and pixi-filters like so:import 'pixi.js';import 'pixi-filter

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 badges
Add a ment  | 

2 Answers 2

Reset to default 7

Seems 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)

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744745326a4591259.html

相关推荐

  • javascript - How to get pixi-filters working? - Stack Overflow

    I have imported both pixi and pixi-filters like so:import 'pixi.js';import 'pixi-filter

    3天前
    90

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信