pixijs / particle-emitter

A particle system for PixiJS
http://pixijs.io/particle-emitter/docs
MIT License
786 stars 124 forks source link

cannot read `length` of `undefined` in `parseArt` #159

Closed hood closed 2 years ago

hood commented 2 years ago

I'm setting up an emitter like:

    const e = new Emitter(
      container,
      textures, // <- aray of `PIXI.Texture`s
      config
    );

    e.particleConstructor = AnimatedParticle;

And getting the following runtime exception thrown at me: Uncaught (in promise) TypeError: Cannot read property 'length' of undefined

Actual example of usage: here

andrewstart commented 2 years ago

AnimatedParticle doesn't take an array of textures - see the docs for AnimatedParticle on how the art should be formed.

hood commented 2 years ago

Oh thanks, I had read that piece of code a trillion times, but I always overlooked the fact that textures was a property of an object. Better typing should be applied to Emitter tho.