-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpixi-particles.min.js
2 lines (2 loc) · 25 KB
/
pixi-particles.min.js
1
2
this.PIXI=this.PIXI||{},function(t,i){"use strict";var e,s=function(){function i(i,e,s){this.value=i,this.time=e,this.next=null,this.isStepped=!1,this.ease=s?"function"==typeof s?s:t.ParticleUtils.generateEase(s):null}return i.createList=function(e){if("list"in e){var s=e.list,a=void 0,n=void 0,r=s[0],o=r.value,h=r.time;if(n=a=new i("string"==typeof o?t.ParticleUtils.hexToRGB(o):o,h,e.ease),s.length>2||2===s.length&&s[1].value!==o)for(var l=1;l<s.length;++l){var p=s[l],c=p.value,u=p.time;a.next=new i("string"==typeof c?t.ParticleUtils.hexToRGB(c):c,u),a=a.next}return n.isStepped=!!e.isStepped,n}var m=new i("string"==typeof e.start?t.ParticleUtils.hexToRGB(e.start):e.start,0);return e.end!==e.start&&(m.next=new i("string"==typeof e.end?t.ParticleUtils.hexToRGB(e.end):e.end,1)),m},i}(),a=i;function n(t){return e(t)}e=parseInt(/^(\d+)\./.exec(i.VERSION)[1])<5?a.Texture.fromImage:a.Texture.from,function(t){t.verbose=!1,t.DEG_TO_RADS=Math.PI/180,t.rotatePoint=function(i,e){if(i){i*=t.DEG_TO_RADS;var s=Math.sin(i),a=Math.cos(i),n=e.x*a-e.y*s,r=e.x*s+e.y*a;e.x=n,e.y=r}},t.combineRGBComponents=function(t,i,e){return t<<16|i<<8|e},t.normalize=function(i){var e=1/t.length(i);i.x*=e,i.y*=e},t.scaleBy=function(t,i){t.x*=i,t.y*=i},t.length=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},t.hexToRGB=function(t,i){var e;return i||(i={}),"#"==t.charAt(0)?t=t.substr(1):0===t.indexOf("0x")&&(t=t.substr(2)),8==t.length&&(e=t.substr(0,2),t=t.substr(2)),i.r=parseInt(t.substr(0,2),16),i.g=parseInt(t.substr(2,2),16),i.b=parseInt(t.substr(4,2),16),e&&(i.a=parseInt(e,16)),i},t.generateEase=function(t){var i=t.length,e=1/i;return function(s){var a,n,r=i*s|0;return a=(s-r*e)*i,(n=t[r]||t[i-1]).s+a*(2*(1-a)*(n.cp-n.s)+a*(n.e-n.s))}},t.getBlendMode=function(t){if(!t)return i.BLEND_MODES.NORMAL;for(t=t.toUpperCase();t.indexOf(" ")>=0;)t=t.replace(" ","_");return i.BLEND_MODES[t]||i.BLEND_MODES.NORMAL},t.createSteppedGradient=function(i,e){void 0===e&&(e=10),("number"!=typeof e||e<=0)&&(e=10);var a=new s(t.hexToRGB(i[0].value),i[0].time);a.isStepped=!0;for(var n=a,r=i[0],o=1,h=i[o],l=1;l<e;++l){for(var p=l/e;p>h.time;)r=h,h=i[++o];p=(p-r.time)/(h.time-r.time);var c=t.hexToRGB(r.value),u=t.hexToRGB(h.value),m={r:(u.r-c.r)*p+c.r,g:(u.g-c.g)*p+c.g,b:(u.b-c.b)*p+c.b};n.next=new s(m,l/e),n=n.next}return a}}(t.ParticleUtils||(t.ParticleUtils={}));var r=function(t,i){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)i.hasOwnProperty(e)&&(t[e]=i[e])})(t,i)};function o(t,i){function e(){this.constructor=t}r(t,i),t.prototype=null===i?Object.create(i):(e.prototype=i.prototype,new e)}var h=function(){function t(t){void 0===t&&(t=!1),this.current=null,this.next=null,this.isColor=!!t,this.interpolate=null,this.ease=null}return t.prototype.reset=function(t){this.current=t,this.next=t.next,this.next&&this.next.time>=1?this.interpolate=this.isColor?p:l:t.isStepped?this.interpolate=this.isColor?d:m:this.interpolate=this.isColor?u:c,this.ease=this.current.ease},t}();function l(t){return this.ease&&(t=this.ease(t)),(this.next.value-this.current.value)*t+this.current.value}function p(i){this.ease&&(i=this.ease(i));var e=this.current.value,s=this.next.value,a=(s.r-e.r)*i+e.r,n=(s.g-e.g)*i+e.g,r=(s.b-e.b)*i+e.b;return t.ParticleUtils.combineRGBComponents(a,n,r)}function c(t){for(this.ease&&(t=this.ease(t));t>this.next.time;)this.current=this.next,this.next=this.next.next;return t=(t-this.current.time)/(this.next.time-this.current.time),(this.next.value-this.current.value)*t+this.current.value}function u(i){for(this.ease&&(i=this.ease(i));i>this.next.time;)this.current=this.next,this.next=this.next.next;i=(i-this.current.time)/(this.next.time-this.current.time);var e=this.current.value,s=this.next.value,a=(s.r-e.r)*i+e.r,n=(s.g-e.g)*i+e.g,r=(s.b-e.b)*i+e.b;return t.ParticleUtils.combineRGBComponents(a,n,r)}function m(t){for(this.ease&&(t=this.ease(t));this.next&&t>this.next.time;)this.current=this.next,this.next=this.next.next;return this.current.value}function d(i){for(this.ease&&(i=this.ease(i));this.next&&i>this.next.time;)this.current=this.next,this.next=this.next.next;var e=this.current.value;return t.ParticleUtils.combineRGBComponents(e.r,e.g,e.b)}var f,x=function(e){function s(t){var a=e.call(this)||this;return a.emitter=t,a.anchor.x=a.anchor.y=.5,a.velocity=new i.Point,a.rotationSpeed=0,a.rotationAcceleration=0,a.maxLife=0,a.age=0,a.ease=null,a.extraData=null,a.alphaList=new h,a.speedList=new h,a.speedMultiplier=1,a.acceleration=new i.Point,a.maxSpeed=NaN,a.scaleList=new h,a.scaleMultiplier=1,a.colorList=new h(!0),a._doAlpha=!1,a._doScale=!1,a._doSpeed=!1,a._doAcceleration=!1,a._doColor=!1,a._doNormalMovement=!1,a._oneOverLife=0,a.next=null,a.prev=null,a.init=a.init,a.Particle_init=s.prototype.init,a.update=a.update,a.Particle_update=s.prototype.update,a.Sprite_destroy=e.prototype.destroy,a.Particle_destroy=s.prototype.destroy,a.applyArt=a.applyArt,a.kill=a.kill,a}return o(s,e),s.prototype.init=function(){this.age=0,this.velocity.x=this.speedList.current.value*this.speedMultiplier,this.velocity.y=0,t.ParticleUtils.rotatePoint(this.rotation,this.velocity),this.noRotation?this.rotation=0:this.rotation*=t.ParticleUtils.DEG_TO_RADS,this.rotationSpeed*=t.ParticleUtils.DEG_TO_RADS,this.rotationAcceleration*=t.ParticleUtils.DEG_TO_RADS,this.alpha=this.alphaList.current.value,this.scale.x=this.scale.y=this.scaleList.current.value,this._doAlpha=!!this.alphaList.current.next,this._doSpeed=!!this.speedList.current.next,this._doScale=!!this.scaleList.current.next,this._doColor=!!this.colorList.current.next,this._doAcceleration=0!==this.acceleration.x||0!==this.acceleration.y,this._doNormalMovement=this._doSpeed||0!==this.speedList.current.value||this._doAcceleration,this._oneOverLife=1/this.maxLife;var i=this.colorList.current.value;this.tint=t.ParticleUtils.combineRGBComponents(i.r,i.g,i.b),this.visible=!0},s.prototype.applyArt=function(t){this.texture=t||i.Texture.EMPTY},s.prototype.update=function(i){if(this.age+=i,this.age>=this.maxLife||this.age<0)return this.kill(),-1;var e=this.age*this._oneOverLife;if(this.ease&&(e=4==this.ease.length?this.ease(e,0,1,1):this.ease(e)),this._doAlpha&&(this.alpha=this.alphaList.interpolate(e)),this._doScale){var s=this.scaleList.interpolate(e)*this.scaleMultiplier;this.scale.x=this.scale.y=s}if(this._doNormalMovement){var a=void 0,n=void 0;if(this._doSpeed){var r=this.speedList.interpolate(e)*this.speedMultiplier;t.ParticleUtils.normalize(this.velocity),t.ParticleUtils.scaleBy(this.velocity,r),a=this.velocity.x*i,n=this.velocity.y*i}else if(this._doAcceleration){var o=this.velocity.x,h=this.velocity.y;if(this.velocity.x+=this.acceleration.x*i,this.velocity.y+=this.acceleration.y*i,this.maxSpeed){var l=t.ParticleUtils.length(this.velocity);l>this.maxSpeed&&t.ParticleUtils.scaleBy(this.velocity,this.maxSpeed/l)}a=(o+this.velocity.x)/2*i,n=(h+this.velocity.y)/2*i}else a=this.velocity.x*i,n=this.velocity.y*i;this.position.x+=a,this.position.y+=n}if(this._doColor&&(this.tint=this.colorList.interpolate(e)),0!==this.rotationAcceleration){var p=this.rotationSpeed+this.rotationAcceleration*i;this.rotation+=(this.rotationSpeed+p)/2*i,this.rotationSpeed=p}else 0!==this.rotationSpeed?this.rotation+=this.rotationSpeed*i:this.acceleration&&!this.noRotation&&(this.rotation=Math.atan2(this.velocity.y,this.velocity.x));return e},s.prototype.kill=function(){this.emitter.recycle(this)},s.prototype.destroy=function(){this.parent&&this.parent.removeChild(this),this.Sprite_destroy(),this.emitter=this.velocity=this.colorList=this.scaleList=this.alphaList=this.speedList=this.ease=this.next=this.prev=null},s.parseArt=function(i){var e;for(e=i.length;e>=0;--e)"string"==typeof i[e]&&(i[e]=n(i[e]));if(t.ParticleUtils.verbose)for(e=i.length-1;e>0;--e)if(i[e].baseTexture!=i[e-1].baseTexture){window.console&&console.warn("PixiParticles: using particle textures from different images may hinder performance in WebGL");break}return i},s.parseData=function(t){return t},s}(i.Sprite),y=function(){function t(t){this.segments=[],this.countingLengths=[],this.totalLength=0,this.init(t)}return t.prototype.init=function(t){if(t&&t.length)if(Array.isArray(t[0]))for(var i=0;i<t.length;++i)for(var e=t[i],s=e[0],a=1;a<e.length;++a){var n=e[a];this.segments.push({p1:s,p2:n,l:0}),s=n}else for(s=t[0],i=1;i<t.length;++i){n=t[i];this.segments.push({p1:s,p2:n,l:0}),s=n}else this.segments.push({p1:{x:0,y:0},p2:{x:0,y:0},l:0});for(i=0;i<this.segments.length;++i){var r=this.segments[i],o=r.p1,h=r.p2,l=Math.sqrt((h.x-o.x)*(h.x-o.x)+(h.y-o.y)*(h.y-o.y));this.segments[i].l=l,this.totalLength+=l,this.countingLengths.push(this.totalLength)}},t.prototype.getRandomPoint=function(t){var i,e,s=Math.random()*this.totalLength;if(1===this.segments.length)i=this.segments[0],e=s;else for(var a=0;a<this.countingLengths.length;++a)if(s<this.countingLengths[a]){i=this.segments[a],e=0===a?s:s-this.countingLengths[a-1];break}e/=i.l||1;var n=i.p1,r=i.p2;t.x=n.x+e*(r.x-n.x),t.y=n.y+e*(r.y-n.y)},t}(),_=i;f=parseInt(/^(\d+)\./.exec(i.VERSION)[1])<5?_.ticker.shared:_.Ticker.shared;var v=new i.Point,P=function(){function e(t,i,e){this._currentImageIndex=-1,this._particleConstructor=x,this.particleImages=null,this.startAlpha=null,this.startSpeed=null,this.minimumSpeedMultiplier=1,this.acceleration=null,this.maxSpeed=NaN,this.startScale=null,this.minimumScaleMultiplier=1,this.startColor=null,this.minLifetime=0,this.maxLifetime=0,this.minStartRotation=0,this.maxStartRotation=0,this.noRotation=!1,this.minRotationSpeed=0,this.maxRotationSpeed=0,this.particleBlendMode=0,this.customEase=null,this.extraData=null,this._frequency=1,this.spawnChance=1,this.maxParticles=1e3,this.emitterLifetime=-1,this.spawnPos=null,this.spawnType=null,this._spawnFunc=null,this.spawnRect=null,this.spawnCircle=null,this.spawnPolygonalChain=null,this.particlesPerWave=1,this.particleSpacing=0,this.angleStart=0,this.rotation=0,this.ownerPos=null,this._prevEmitterPos=null,this._prevPosIsValid=!1,this._posChanged=!1,this._parent=null,this.addAtBack=!1,this.particleCount=0,this._emit=!1,this._spawnTimer=0,this._emitterLife=-1,this._activeParticlesFirst=null,this._activeParticlesLast=null,this._poolFirst=null,this._origConfig=null,this._origArt=null,this._autoUpdate=!1,this._currentImageIndex=-1,this._destroyWhenComplete=!1,this._completeCallback=null,this.parent=t,i&&e&&this.init(i,e),this.recycle=this.recycle,this.update=this.update,this.rotate=this.rotate,this.updateSpawnPos=this.updateSpawnPos,this.updateOwnerPos=this.updateOwnerPos}return Object.defineProperty(e.prototype,"orderedArt",{get:function(){return-1!==this._currentImageIndex},set:function(t){this._currentImageIndex=t?0:-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"frequency",{get:function(){return this._frequency},set:function(t){this._frequency="number"==typeof t&&t>0?t:1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"particleConstructor",{get:function(){return this._particleConstructor},set:function(t){if(t!=this._particleConstructor){this._particleConstructor=t,this.cleanup();for(var i=this._poolFirst;i;i=i.next)i.destroy();this._poolFirst=null,this._origConfig&&this._origArt&&this.init(this._origArt,this._origConfig)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},set:function(t){this.cleanup(),this._parent=t},enumerable:!0,configurable:!0}),e.prototype.init=function(e,a){if(e&&a){this.cleanup(),this._origConfig=a,this._origArt=e,e=Array.isArray(e)?e.slice():[e];var n=this._particleConstructor;this.particleImages=n.parseArt?n.parseArt(e):e,a.alpha?this.startAlpha=s.createList(a.alpha):this.startAlpha=new s(1,0),a.speed?(this.startSpeed=s.createList(a.speed),this.minimumSpeedMultiplier=("minimumSpeedMultiplier"in a?a.minimumSpeedMultiplier:a.speed.minimumSpeedMultiplier)||1):(this.minimumSpeedMultiplier=1,this.startSpeed=new s(0,0));var r=a.acceleration;r&&(r.x||r.y)?(this.startSpeed.next=null,this.acceleration=new i.Point(r.x,r.y),this.maxSpeed=a.maxSpeed||NaN):this.acceleration=new i.Point,a.scale?(this.startScale=s.createList(a.scale),this.minimumScaleMultiplier=("minimumScaleMultiplier"in a?a.minimumScaleMultiplier:a.scale.minimumScaleMultiplier)||1):(this.startScale=new s(1,0),this.minimumScaleMultiplier=1),a.color?this.startColor=s.createList(a.color):this.startColor=new s({r:255,g:255,b:255},0),a.startRotation?(this.minStartRotation=a.startRotation.min,this.maxStartRotation=a.startRotation.max):this.minStartRotation=this.maxStartRotation=0,a.noRotation&&(this.minStartRotation||this.maxStartRotation)?this.noRotation=!!a.noRotation:this.noRotation=!1,a.rotationSpeed?(this.minRotationSpeed=a.rotationSpeed.min,this.maxRotationSpeed=a.rotationSpeed.max):this.minRotationSpeed=this.maxRotationSpeed=0,this.rotationAcceleration=a.rotationAcceleration||0,this.minLifetime=a.lifetime.min,this.maxLifetime=a.lifetime.max,this.particleBlendMode=t.ParticleUtils.getBlendMode(a.blendMode),a.ease?this.customEase="function"==typeof a.ease?a.ease:t.ParticleUtils.generateEase(a.ease):this.customEase=null,n.parseData?this.extraData=n.parseData(a.extraData):this.extraData=a.extraData||null,this.spawnRect=this.spawnCircle=null,this.particlesPerWave=1,a.particlesPerWave&&a.particlesPerWave>1&&(this.particlesPerWave=a.particlesPerWave),this.particleSpacing=0,this.angleStart=0,this.parseSpawnType(a),this.frequency=a.frequency,this.spawnChance="number"==typeof a.spawnChance&&a.spawnChance>0?a.spawnChance:1,this.emitterLifetime=a.emitterLifetime||-1,this.maxParticles=a.maxParticles>0?a.maxParticles:1e3,this.addAtBack=!!a.addAtBack,this.rotation=0,this.ownerPos=new i.Point,this.spawnPos=new i.Point(a.pos.x,a.pos.y),this.initAdditional(e,a),this._prevEmitterPos=this.spawnPos.clone(),this._prevPosIsValid=!1,this._spawnTimer=0,this.emit=void 0===a.emit||!!a.emit,this.autoUpdate=!!a.autoUpdate,this.orderedArt=!!a.orderedArt}},e.prototype.initAdditional=function(t,i){},e.prototype.parseSpawnType=function(t){var e;switch(t.spawnType){case"rect":this.spawnType="rect",this._spawnFunc=this._spawnRect;var s=t.spawnRect;this.spawnRect=new i.Rectangle(s.x,s.y,s.w,s.h);break;case"circle":this.spawnType="circle",this._spawnFunc=this._spawnCircle,e=t.spawnCircle,this.spawnCircle=new i.Circle(e.x,e.y,e.r);break;case"ring":this.spawnType="ring",this._spawnFunc=this._spawnRing,e=t.spawnCircle,this.spawnCircle=new i.Circle(e.x,e.y,e.r),this.spawnCircle.minRadius=e.minR;break;case"burst":this.spawnType="burst",this._spawnFunc=this._spawnBurst,this.particleSpacing=t.particleSpacing,this.angleStart=t.angleStart?t.angleStart:0;break;case"point":this.spawnType="point",this._spawnFunc=this._spawnPoint;break;case"polygonalChain":this.spawnType="polygonalChain",this._spawnFunc=this._spawnPolygonalChain,this.spawnPolygonalChain=new y(t.spawnPolygon);break;default:this.spawnType="point",this._spawnFunc=this._spawnPoint}},e.prototype.recycle=function(t){t.next&&(t.next.prev=t.prev),t.prev&&(t.prev.next=t.next),t==this._activeParticlesLast&&(this._activeParticlesLast=t.prev),t==this._activeParticlesFirst&&(this._activeParticlesFirst=t.next),t.prev=null,t.next=this._poolFirst,this._poolFirst=t,t.parent&&t.parent.removeChild(t),--this.particleCount},e.prototype.rotate=function(i){if(this.rotation!=i){var e=i-this.rotation;this.rotation=i,t.ParticleUtils.rotatePoint(e,this.spawnPos),this._posChanged=!0}},e.prototype.updateSpawnPos=function(t,i){this._posChanged=!0,this.spawnPos.x=t,this.spawnPos.y=i},e.prototype.updateOwnerPos=function(t,i){this._posChanged=!0,this.ownerPos.x=t,this.ownerPos.y=i},e.prototype.resetPositionTracking=function(){this._prevPosIsValid=!1},Object.defineProperty(e.prototype,"emit",{get:function(){return this._emit},set:function(t){this._emit=!!t,this._emitterLife=this.emitterLifetime},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"autoUpdate",{get:function(){return this._autoUpdate},set:function(t){this._autoUpdate&&!t?f.remove(this.update,this):!this._autoUpdate&&t&&f.add(this.update,this),this._autoUpdate=!!t},enumerable:!0,configurable:!0}),e.prototype.playOnceAndDestroy=function(t){this.autoUpdate=!0,this.emit=!0,this._destroyWhenComplete=!0,this._completeCallback=t},e.prototype.playOnce=function(t){this.emit=!0,this._completeCallback=t},e.prototype.update=function(t){if(this._autoUpdate&&(t=t/i.settings.TARGET_FPMS/1e3),this._parent){var e,s,a,n,r;for(s=this._activeParticlesFirst;s;s=a)a=s.next,s.update(t);this._prevPosIsValid&&(n=this._prevEmitterPos.x,r=this._prevEmitterPos.y);var o=this.ownerPos.x+this.spawnPos.x,h=this.ownerPos.y+this.spawnPos.y;if(this._emit)for(this._spawnTimer-=t<0?0:t;this._spawnTimer<=0;){if(this._emitterLife>0&&(this._emitterLife-=this._frequency,this._emitterLife<=0)){this._spawnTimer=0,this._emitterLife=0,this.emit=!1;break}if(this.particleCount>=this.maxParticles)this._spawnTimer+=this._frequency;else{var l=void 0;if(l=this.minLifetime==this.maxLifetime?this.minLifetime:Math.random()*(this.maxLifetime-this.minLifetime)+this.minLifetime,-this._spawnTimer<l){var p=void 0,c=void 0;if(this._prevPosIsValid&&this._posChanged){var u=1+this._spawnTimer/t;p=(o-n)*u+n,c=(h-r)*u+r}else p=o,c=h;e=0;for(var m=Math.min(this.particlesPerWave,this.maxParticles-this.particleCount);e<m;++e)if(!(this.spawnChance<1&&Math.random()>=this.spawnChance)){var d=void 0;if(this._poolFirst?(d=this._poolFirst,this._poolFirst=this._poolFirst.next,d.next=null):d=new this.particleConstructor(this),this.particleImages.length>1?-1!==this._currentImageIndex?(d.applyArt(this.particleImages[this._currentImageIndex++]),(this._currentImageIndex<0||this._currentImageIndex>=this.particleImages.length)&&(this._currentImageIndex=0)):d.applyArt(this.particleImages[Math.floor(Math.random()*this.particleImages.length)]):d.applyArt(this.particleImages[0]),d.alphaList.reset(this.startAlpha),1!=this.minimumSpeedMultiplier&&(d.speedMultiplier=Math.random()*(1-this.minimumSpeedMultiplier)+this.minimumSpeedMultiplier),d.speedList.reset(this.startSpeed),d.acceleration.x=this.acceleration.x,d.acceleration.y=this.acceleration.y,d.maxSpeed=this.maxSpeed,1!=this.minimumScaleMultiplier&&(d.scaleMultiplier=Math.random()*(1-this.minimumScaleMultiplier)+this.minimumScaleMultiplier),d.scaleList.reset(this.startScale),d.colorList.reset(this.startColor),this.minRotationSpeed==this.maxRotationSpeed?d.rotationSpeed=this.minRotationSpeed:d.rotationSpeed=Math.random()*(this.maxRotationSpeed-this.minRotationSpeed)+this.minRotationSpeed,d.rotationAcceleration=this.rotationAcceleration,d.noRotation=this.noRotation,d.maxLife=l,d.blendMode=this.particleBlendMode,d.ease=this.customEase,d.extraData=this.extraData,this.applyAdditionalProperties(d),this._spawnFunc(d,p,c,e),d.init(),d.update(-this._spawnTimer),d.parent){var f=this._parent.children;if(f[0]==d)f.shift();else if(f[f.length-1]==d)f.pop();else{var x=f.indexOf(d);f.splice(x,1)}this.addAtBack?f.unshift(d):f.push(d)}else this.addAtBack?this._parent.addChildAt(d,0):this._parent.addChild(d);this._activeParticlesLast?(this._activeParticlesLast.next=d,d.prev=this._activeParticlesLast,this._activeParticlesLast=d):this._activeParticlesLast=this._activeParticlesFirst=d,++this.particleCount}}this._spawnTimer+=this._frequency}}if(this._posChanged&&(this._prevEmitterPos.x=o,this._prevEmitterPos.y=h,this._prevPosIsValid=!0,this._posChanged=!1),!this._emit&&!this._activeParticlesFirst){if(this._completeCallback){var y=this._completeCallback;this._completeCallback=null,y()}this._destroyWhenComplete&&this.destroy()}}},e.prototype.applyAdditionalProperties=function(t){},e.prototype._spawnPoint=function(t,i,e){this.minStartRotation==this.maxStartRotation?t.rotation=this.minStartRotation+this.rotation:t.rotation=Math.random()*(this.maxStartRotation-this.minStartRotation)+this.minStartRotation+this.rotation,t.position.x=i,t.position.y=e},e.prototype._spawnRect=function(i,e,s){this.minStartRotation==this.maxStartRotation?i.rotation=this.minStartRotation+this.rotation:i.rotation=Math.random()*(this.maxStartRotation-this.minStartRotation)+this.minStartRotation+this.rotation,v.x=Math.random()*this.spawnRect.width+this.spawnRect.x,v.y=Math.random()*this.spawnRect.height+this.spawnRect.y,0!==this.rotation&&t.ParticleUtils.rotatePoint(this.rotation,v),i.position.x=e+v.x,i.position.y=s+v.y},e.prototype._spawnCircle=function(i,e,s){this.minStartRotation==this.maxStartRotation?i.rotation=this.minStartRotation+this.rotation:i.rotation=Math.random()*(this.maxStartRotation-this.minStartRotation)+this.minStartRotation+this.rotation,v.x=Math.random()*this.spawnCircle.radius,v.y=0,t.ParticleUtils.rotatePoint(360*Math.random(),v),v.x+=this.spawnCircle.x,v.y+=this.spawnCircle.y,0!==this.rotation&&t.ParticleUtils.rotatePoint(this.rotation,v),i.position.x=e+v.x,i.position.y=s+v.y},e.prototype._spawnRing=function(i,e,s){var a=this.spawnCircle;this.minStartRotation==this.maxStartRotation?i.rotation=this.minStartRotation+this.rotation:i.rotation=Math.random()*(this.maxStartRotation-this.minStartRotation)+this.minStartRotation+this.rotation,a.minRadius!==a.radius?v.x=Math.random()*(a.radius-a.minRadius)+a.minRadius:v.x=a.radius,v.y=0;var n=360*Math.random();i.rotation+=n,t.ParticleUtils.rotatePoint(n,v),v.x+=this.spawnCircle.x,v.y+=this.spawnCircle.y,0!==this.rotation&&t.ParticleUtils.rotatePoint(this.rotation,v),i.position.x=e+v.x,i.position.y=s+v.y},e.prototype._spawnPolygonalChain=function(i,e,s){this.minStartRotation==this.maxStartRotation?i.rotation=this.minStartRotation+this.rotation:i.rotation=Math.random()*(this.maxStartRotation-this.minStartRotation)+this.minStartRotation+this.rotation,this.spawnPolygonalChain.getRandomPoint(v),0!==this.rotation&&t.ParticleUtils.rotatePoint(this.rotation,v),i.position.x=e+v.x,i.position.y=s+v.y},e.prototype._spawnBurst=function(t,i,e,s){0===this.particleSpacing?t.rotation=360*Math.random():t.rotation=this.angleStart+this.particleSpacing*s+this.rotation,t.position.x=i,t.position.y=e},e.prototype.cleanup=function(){var t,i;for(t=this._activeParticlesFirst;t;t=i)i=t.next,this.recycle(t),t.parent&&t.parent.removeChild(t);this._activeParticlesFirst=this._activeParticlesLast=null,this.particleCount=0},e.prototype.destroy=function(){var t;this.autoUpdate=!1,this.cleanup();for(var i=this._poolFirst;i;i=t)t=i.next,i.destroy();this._poolFirst=this._parent=this.particleImages=this.spawnPos=this.ownerPos=this.startColor=this.startScale=this.startAlpha=this.startSpeed=this.customEase=this._completeCallback=null},e}(),g=new i.Point,S=["pow","sqrt","abs","floor","round","ceil","E","PI","sin","cos","tan","asin","acos","atan","atan2","log"],w=new RegExp(["[01234567890\\.\\*\\-\\+\\/\\(\\)x ,]"].concat(S).join("|"),"g"),R=function(e){function s(t){var s=e.call(this,t)||this;return s.path=null,s.initialRotation=0,s.initialPosition=new i.Point,s.movement=0,s}return o(s,e),s.prototype.init=function(){this.initialRotation=this.rotation,this.Particle_init(),this.path=this.extraData.path,this._doNormalMovement=!this.path,this.movement=0,this.initialPosition.x=this.position.x,this.initialPosition.y=this.position.y},s.prototype.update=function(i){var e=this.Particle_update(i);if(e>=0&&this.path){var s=this.speedList.interpolate(e)*this.speedMultiplier;this.movement+=s*i,g.x=this.movement,g.y=this.path(this.movement),t.ParticleUtils.rotatePoint(this.initialRotation,g),this.position.x=this.initialPosition.x+g.x,this.position.y=this.initialPosition.y+g.y}return e},s.prototype.destroy=function(){this.Particle_destroy(),this.path=this.initialPosition=null},s.parseArt=function(t){return x.parseArt(t)},s.parseData=function(i){var e={};if(i&&i.path)try{e.path=function(t){for(var i=t.match(w),e=i.length-1;e>=0;--e)S.indexOf(i[e])>=0&&(i[e]="Math."+i[e]);return t=i.join(""),new Function("x","return "+t+";")}(i.path)}catch(i){t.ParticleUtils.verbose&&console.error("PathParticle: error in parsing path expression"),e.path=null}else t.ParticleUtils.verbose&&console.error("PathParticle requires a path string in extraData!"),e.path=null;return e},s}(x),C=function(t){function e(i){var e=t.call(this,i)||this;return e.textures=null,e.duration=0,e.framerate=0,e.elapsed=0,e.loop=!1,e}return o(e,t),e.prototype.init=function(){this.Particle_init(),this.elapsed=0,this.framerate<0&&(this.duration=this.maxLife,this.framerate=this.textures.length/this.duration)},e.prototype.applyArt=function(t){this.textures=t.textures,this.framerate=t.framerate,this.duration=t.duration,this.loop=t.loop},e.prototype.update=function(t){var e=this.Particle_update(t);if(e>=0){this.elapsed+=t,this.elapsed>this.duration&&(this.loop?this.elapsed=this.elapsed%this.duration:this.elapsed=this.duration-1e-6);var s=this.elapsed*this.framerate+1e-7|0;this.texture=this.textures[s]||i.Texture.EMPTY}return e},e.prototype.destroy=function(){this.Particle_destroy(),this.textures=null},e.parseArt=function(t){for(var e,s,a,r,o,h=[],l=0;l<t.length;++l){e=t[l],h[l]=s={},s.textures=o=[],a=e.textures;for(var p=0;p<a.length;++p)if("string"==typeof(r=a[p]))o.push(n(r));else if(r instanceof i.Texture)o.push(r);else{var c=r.count||1;for(r="string"==typeof r.texture?n(r.texture):r.texture;c>0;--c)o.push(r)}"matchLife"==e.framerate?(s.framerate=-1,s.duration=0,s.loop=!1):(s.loop=!!e.loop,s.framerate=e.framerate>0?e.framerate:60,s.duration=o.length/s.framerate)}return h},e}(x);t.GetTextureFromString=n,t.Particle=x,t.Emitter=P,t.PathParticle=R,t.AnimatedParticle=C,t.PolygonalChain=y,t.PropertyList=h,t.PropertyNode=s}(this.PIXI.particles=this.PIXI.particles||{},PIXI);
//# sourceMappingURL=pixi-particles.min.js.map