Git Product home page Git Product logo

Comments (7)

andrewstart avatar andrewstart commented on June 15, 2024 1

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.

levymateus avatar levymateus commented on June 15, 2024 1

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.

andrewstart avatar andrewstart commented on June 15, 2024

Would you be able to share your project for me to look at?

from particle-emitter.

ben-randle-core avatar ben-randle-core commented on June 15, 2024

Hi @andrewstart i've made the project as a whole available here: https://github.com/BAUR0/ts-project

from particle-emitter.

andrewstart avatar andrewstart commented on June 15, 2024

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.

BAUR0 avatar BAUR0 commented on June 15, 2024

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.

andrewstart avatar andrewstart commented on June 15, 2024

Sounds like the same configuration issue, see above.

from particle-emitter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.