Comments (7)
PixiJS doesn't have a new way of exporting textures - your Typescript config combined with newer module features in Node/Webpack/etc were resulting in your imports of pixi.js
pulling in the .js (CommonJS) version of the entire library while particle-emitter
was pulling in the .mjs (ESModule) version of the dependencies it needed - thus the particle sprites were not configured with interaction, and if (x instanceof Texture)
failed because everything was from different copies of the library.
Using these settings seems to fix it.
"module": "ES2022",
"moduleResolution": "NodeNext",
``` seems to fix it.
from particle-emitter.
i have an issue similar to this when i use particle-emitter and an mouse event occur.
When i click in any area of the scene when the particles-emitter is running ... I get the error:
currentTarget.isInteractive is not a function
TypeError: currentTarget.isInteractive is not a function
I'm using pixi.js@^7.3.1
and @pixi/particle-emitter@^5.0.8
.
With pixi.js@^7.2.4
i have the same problem.
I solve the problem defining the eventMode
to "none"
in the particles container. But the config above not works for me.
from particle-emitter.
Would you be able to share your project for me to look at?
from particle-emitter.
Hi @andrewstart i've made the project as a whole available here: https://github.com/BAUR0/ts-project
from particle-emitter.
The isInteractive stuff I have no idea about, but probably stems from a similar issue that the Texture
class that this library imports from @pixi/core
isn't the same as the one exported by pixi.js
- this was not the case in previous versions of pixi.js
, as far as I know, and looking at the installed node modules doesn't seem to be an issue where everything got its own copy of the dependency - is it an issue with webpack?
If you are able to fix the interaction thing and the particle visibility is still a problem, a workaround of {texture: PIXI.Texture.from('coin-anim-01.png')}
for each texture will do the trick.
from particle-emitter.
Thanks for the workaround Andrew, I've put that into my project and the coins are animating now. It hasn't had any affect on the interactivity error coming from pixi.js
, I do suspect this is something weird with webpack/TS. Do you plan to add support into @pixi/particle-emitter
for the new way in which pixi.js
is exporting its Textures?
from particle-emitter.
Sounds like the same configuration issue, see above.
from particle-emitter.
Related Issues (20)
- IntColorComplex throws null exception HOT 2
- LinkedListContainer doesn't play nice with Destroy method HOT 1
- The particle emitter can encounter undefined particles which casues it to choke and break HOT 3
- particle systems run slower after migration from 4.3.x to 5.0.7 HOT 4
- Artifacts when using `playOnce` HOT 4
- can not use editor export json file HOT 4
- When to support pixi 7.0 HOT 1
- npm install errors upgrading to Pixi 7 HOT 3
- Can not use editor export json file - Format seems different HOT 1
- emitter.updateOwnerPos throws an error if emitter is destroyed HOT 2
- It extends Container, not ParticleContainer HOT 1
- Classes not invoked with new? HOT 3
- [inquiry] does Pixi particles use instanced rendering? HOT 3
- Need to interact with particular particle on mouse touch and destroy it HOT 2
- Alpha interpolating doesn't work for images HOT 2
- Is the project will keep update? HOT 4
- Where can I find a CDN link to new version ? HOT 1
- Bug: PropertyNode.createList leads to errors if there are two points with same value HOT 2
- Best practice for continuous trail on a fast-moving object? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from particle-emitter.