pixijs / particle-emitter

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

upgradeConfig not working #215

Open phamtrantriem opened 1 month ago

phamtrantriem commented 1 month ago

I tried to use Particle-Emitter for Pixi v8, but I can't use upgradeConfig function, the code bellow: const emitter = new PIXI.particles.Emitter(app.stage, PIXI.particles.EmitterConfig.upgradeConfig(particleConfig, [texture])); I got an error Cannot read properties of undefined (reading 'upgradeConfig')

when i directly use JSON export from the editor, i get this message Cannot read properties of undefined (reading 'map') { "alpha": { "start": 1, "end": 0 }, "scale": { "start": 0.1, "end": 0.01, "minimumScaleMultiplier": 1 }, "color": { "start": "#e4f9ff", "end": "#3fcbff" }, "speed": { "start": 200, "end": 50, "minimumSpeedMultiplier": 1 }, "acceleration": { "x": 0, "y": 0 }, "maxSpeed": 0, "startRotation": { "min": 0, "max": 360 }, "noRotation": false, "rotationSpeed": { "min": 0, "max": 0 }, "lifetime": { "min": 0.2, "max": 0.8 }, "blendMode": "normal", "frequency": 0.001, "emitterLifetime": -1, "maxParticles": 500, "pos": { "x": 0, "y": 0 }, "addAtBack": false, "spawnType": "circle", "spawnCircle": { "x": 0, "y": 0, "r": 0 } }

andrewstart commented 1 month ago

EmitterConfig is not a class/namespace, PIXI.particles.upgradeConfig() should be the method you call.