Closed endel closed 6 years ago
Oops! My bad. I've monkey-patched DisplayObject.prototype.updateTransform
to call update
methods automatically, and it turns out Particle
has an update
method, and it was causing an infinite loop.
//
// Call 'update' at every render step, if defined.
//
const DisplayObject_updateTransform = PIXI.DisplayObject.prototype.updateTransform;
PIXI.DisplayObject.prototype.updateTransform = function () {
if (this.update) { this.update(PIXI.ticker.shared.deltaTime); }
DisplayObject_updateTransform.apply(this, arguments);
}
const Container_updateTransform = PIXI.Container.prototype.updateTransform;
PIXI.Container.prototype.updateTransform = function () {
if (this.update) { this.update(PIXI.ticker.shared.deltaTime); }
Container_updateTransform.apply(this, arguments);
}
For now, I'm just checking if it's not a particle, like this:
//
// Call 'update' at every render step, if defined.
//
const DisplayObject_updateTransform = PIXI.DisplayObject.prototype.updateTransform;
PIXI.DisplayObject.prototype.updateTransform = function () {
if (this.update && !this.Particle_update) { this.update(PIXI.ticker.shared.deltaTime); }
DisplayObject_updateTransform.apply(this, arguments);
}
const Container_updateTransform = PIXI.Container.prototype.updateTransform;
PIXI.Container.prototype.updateTransform = function () {
if (this.update && !this.Particle_update) { this.update(PIXI.ticker.shared.deltaTime); }
Container_updateTransform.apply(this, arguments);
}
Cheers, and sorry to bother!
Hi there,
I'm not sure what might be causing this problem. When adding particles to the stage I'm having this error:
pixi.js version "4.6.2" pixi-particles version "2.1.9"