You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying this project out for a PIXIjs v4.3.0 project. I'm using pixi-particles 2.0.0.
I'm loading a rain system, taken from your interactive generator with some tweaks from the base config.
Following the example on the readme, I've initialized the emitter with my container and emitter config, set emit = true and am calling the update method.
Yet with just these few steps, it's breaking with the error:
Cannot read property 'x' of null:
node_modules/pixi-particles/dist/pixi-particles.js:1519
var curX = this.ownerPos.x + this.spawnPos.x;
Here's an example of my class:
constrain=require('../particles/rain.json');// Load pixi particles, which patches PIXIrequire('pixi-particles/dist/pixi-particles');module.exports=classWeather{constructor(){// Initialize a render containerthis.container=newPIXI.Container();this.emitter=this.initRainEmitter();PIXI.ticker.shared.add(this.tick,this);}initRainEmitter(){returnnewPIXI.particles.Emitter(this.container,rain);}start(){this.raining=true;this.emitter.emit=true;}tick(delta){if(this.raining){this.emitter.update(delta);}}};
This class is then loaded in my game by a parent container, like this:
Sorry, this one fell through the cracks while I was on vacation. amrelhady is correct - the 2nd parameter of the Emitter constructor is one of or an array of PIXI.Texture instances you have prepared, or urls to images to load (passed to PIXI.Texture.fromImage()).
Trying this project out for a PIXIjs v4.3.0 project. I'm using pixi-particles 2.0.0.
I'm loading a rain system, taken from your interactive generator with some tweaks from the base config.
Following the example on the readme, I've initialized the emitter with my container and emitter config, set
emit = true
and am calling theupdate
method.Yet with just these few steps, it's breaking with the error:
Here's an example of my class:
This class is then loaded in my game by a parent container, like this:
The text was updated successfully, but these errors were encountered: