Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get pixi-filters working?

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

like image 557
Alex Lomia Avatar asked Oct 17 '25 08:10

Alex Lomia


1 Answers

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';
like image 123
Alex Lomia Avatar answered Oct 18 '25 20:10

Alex Lomia



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!