@pixi/particles
Advanced tools
Comparing version 5.2.0 to 5.2.1
/*! | ||
* @pixi/particles - v5.2.0 | ||
* Compiled Wed, 06 Nov 2019 02:32:43 UTC | ||
* @pixi/particles - v5.2.1 | ||
* Compiled Tue, 28 Jan 2020 23:33:11 UTC | ||
* | ||
@@ -623,2 +623,10 @@ * @pixi/particles is licensed under the MIT License. | ||
this.shader = core.Shader.from(vertex, fragment, {}); | ||
/** | ||
* The WebGL state in which this renderer will work. | ||
* | ||
* @member {PIXI.State} | ||
* @readonly | ||
*/ | ||
this.state = core.State.for2d(); | ||
} | ||
@@ -662,3 +670,4 @@ | ||
// if the uvs have not updated then no point rendering just yet! | ||
this.renderer.state.setBlendMode(utils.correctBlendMode(container.blendMode, baseTexture.alphaMode)); | ||
this.state.blendMode = utils.correctBlendMode(container.blendMode, baseTexture.alphaMode); | ||
renderer.state.set(this.state); | ||
@@ -665,0 +674,0 @@ var gl = renderer.gl; |
/*! | ||
* @pixi/particles - v5.2.0 | ||
* Compiled Wed, 06 Nov 2019 02:32:43 UTC | ||
* @pixi/particles - v5.2.1 | ||
* Compiled Tue, 28 Jan 2020 23:33:11 UTC | ||
* | ||
@@ -8,3 +8,3 @@ * @pixi/particles is licensed under the MIT License. | ||
*/ | ||
this.PIXI=this.PIXI||{};var _pixi_particles=function(t,e,i,r,s,o){"use strict";var a=function(t){function r(i,r,s,o){void 0===i&&(i=1500),void 0===s&&(s=16384),void 0===o&&(o=!1),t.call(this);s>16384&&(s=16384),this._properties=[!1,!0,!1,!1,!1],this._maxSize=i,this._batchSize=s,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=e.BLEND_MODES.NORMAL,this.autoResize=o,this.roundPixels=!0,this.baseTexture=null,this.setProperties(r),this._tint=0,this.tintRgb=new Float32Array(4),this.tint=16777215}t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r;var s={tint:{configurable:!0}};return r.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},r.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},s.tint.get=function(){return this._tint},s.tint.set=function(t){this._tint=t,i.hex2rgb(t,this.tintRgb)},r.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return e.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},r.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.length<e;)this._bufferUpdateIDs.push(0);this._bufferUpdateIDs[e]=++this._updateID},r.prototype.dispose=function(){if(this._buffers){for(var t=0;t<this._buffers.length;++t)this._buffers[t].destroy();this._buffers=null}},r.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.dispose(),this._properties=null,this._buffers=null,this._bufferUpdateIDs=null},Object.defineProperties(r.prototype,s),r}(r.Container),n=function(t,i,r){this.geometry=new s.Geometry,this.indexBuffer=null,this.size=r,this.dynamicProperties=[],this.staticProperties=[];for(var o=0;o<t.length;++o){var a=t[o];a={attributeName:a.attributeName,size:a.size,uploadFunction:a.uploadFunction,type:a.type||e.TYPES.FLOAT,offset:a.offset},i[o]?this.dynamicProperties.push(a):this.staticProperties.push(a)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this._updateID=0,this.initBuffers()};n.prototype.initBuffers=function(){var t=this.geometry,r=0;this.indexBuffer=new s.Buffer(i.createIndicesForQuads(this.size),!0,!0),t.addIndex(this.indexBuffer),this.dynamicStride=0;for(var o=0;o<this.dynamicProperties.length;++o){var a=this.dynamicProperties[o];a.offset=r,r+=a.size,this.dynamicStride+=a.size}var n=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(n),this.dynamicDataUint32=new Uint32Array(n),this.dynamicBuffer=new s.Buffer(this.dynamicData,!1,!1);var h=0;this.staticStride=0;for(var u=0;u<this.staticProperties.length;++u){var p=this.staticProperties[u];p.offset=h,h+=p.size,this.staticStride+=p.size}var d=new ArrayBuffer(this.size*this.staticStride*4*4);this.staticData=new Float32Array(d),this.staticDataUint32=new Uint32Array(d),this.staticBuffer=new s.Buffer(this.staticData,!0,!1);for(var c=0;c<this.dynamicProperties.length;++c){var l=this.dynamicProperties[c];t.addAttribute(l.attributeName,this.dynamicBuffer,0,l.type===e.TYPES.UNSIGNED_BYTE,l.type,4*this.dynamicStride,4*l.offset)}for(var f=0;f<this.staticProperties.length;++f){var y=this.staticProperties[f];t.addAttribute(y.attributeName,this.staticBuffer,0,y.type===e.TYPES.UNSIGNED_BYTE,y.type,4*this.staticStride,4*y.offset)}},n.prototype.uploadDynamic=function(t,i,r){for(var s=0;s<this.dynamicProperties.length;s++){var o=this.dynamicProperties[s];o.uploadFunction(t,i,r,o.type===e.TYPES.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,o.offset)}this.dynamicBuffer._updateID++},n.prototype.uploadStatic=function(t,i,r){for(var s=0;s<this.staticProperties.length;s++){var o=this.staticProperties[s];o.uploadFunction(t,i,r,o.type===e.TYPES.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,o.offset)}this.staticBuffer._updateID++},n.prototype.destroy=function(){this.indexBuffer=null,this.dynamicProperties=null,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this.staticProperties=null,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.geometry.destroy()};var h="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nattribute vec2 aPositionCoord;\nattribute float aRotation;\n\nuniform mat3 translationMatrix;\nuniform vec4 uColor;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void){\n float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);\n float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);\n\n vec2 v = vec2(x, y);\n v = v + aPositionCoord;\n\n gl_Position = vec4((translationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vColor = aColor * uColor;\n}\n",u="varying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n vec4 color = texture2D(uSampler, vTextureCoord) * vColor;\n gl_FragColor = color;\n}",p=function(t){function r(i){t.call(this,i),this.shader=null,this.properties=null,this.tempMatrix=new o.Matrix,this.properties=[{attributeName:"aVertexPosition",size:2,uploadFunction:this.uploadVertices,offset:0},{attributeName:"aPositionCoord",size:2,uploadFunction:this.uploadPosition,offset:0},{attributeName:"aRotation",size:1,uploadFunction:this.uploadRotation,offset:0},{attributeName:"aTextureCoord",size:2,uploadFunction:this.uploadUvs,offset:0},{attributeName:"aColor",size:1,type:e.TYPES.UNSIGNED_BYTE,uploadFunction:this.uploadTint,offset:0}],this.shader=s.Shader.from(h,u,{})}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.render=function(t){var e=t.children,r=t._maxSize,s=t._batchSize,o=this.renderer,a=e.length;if(0!==a){a>r&&!t.autoResize&&(a=r);var n=t._buffers;n||(n=t._buffers=this.generateBuffers(t));var h=e[0]._texture.baseTexture;this.renderer.state.setBlendMode(i.correctBlendMode(t.blendMode,h.alphaMode));var u=o.gl,p=t.worldTransform.copyTo(this.tempMatrix);p.prepend(o.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=p.toArray(!0),this.shader.uniforms.uColor=i.premultiplyRgba(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,h.alphaMode),this.shader.uniforms.uSampler=h,this.renderer.shader.bind(this.shader);for(var d=!1,c=0,l=0;c<a;c+=s,l+=1){var f=a-c;f>s&&(f=s),l>=n.length&&n.push(this._generateOneMoreBuffer(t));var y=n[l];y.uploadDynamic(e,c,f);var v=t._bufferUpdateIDs[l]||0;(d=d||y._updateID<v)&&(y._updateID=t._updateID,y.uploadStatic(e,c,f)),o.geometry.bind(y.geometry),u.drawElements(u.TRIANGLES,6*f,u.UNSIGNED_SHORT,0)}}},r.prototype.generateBuffers=function(t){for(var e=[],i=t._maxSize,r=t._batchSize,s=t._properties,o=0;o<i;o+=r)e.push(new n(this.properties,s,r));return e},r.prototype._generateOneMoreBuffer=function(t){var e=t._batchSize,i=t._properties;return new n(this.properties,i,e)},r.prototype.uploadVertices=function(t,e,i,r,s,o){for(var a=0,n=0,h=0,u=0,p=0;p<i;++p){var d=t[e+p],c=d._texture,l=d.scale.x,f=d.scale.y,y=c.trim,v=c.orig;y?(a=(n=y.x-d.anchor.x*v.width)+y.width,h=(u=y.y-d.anchor.y*v.height)+y.height):(a=v.width*(1-d.anchor.x),n=v.width*-d.anchor.x,h=v.height*(1-d.anchor.y),u=v.height*-d.anchor.y),r[o]=n*l,r[o+1]=u*f,r[o+s]=a*l,r[o+s+1]=u*f,r[o+2*s]=a*l,r[o+2*s+1]=h*f,r[o+3*s]=n*l,r[o+3*s+1]=h*f,o+=4*s}},r.prototype.uploadPosition=function(t,e,i,r,s,o){for(var a=0;a<i;a++){var n=t[e+a].position;r[o]=n.x,r[o+1]=n.y,r[o+s]=n.x,r[o+s+1]=n.y,r[o+2*s]=n.x,r[o+2*s+1]=n.y,r[o+3*s]=n.x,r[o+3*s+1]=n.y,o+=4*s}},r.prototype.uploadRotation=function(t,e,i,r,s,o){for(var a=0;a<i;a++){var n=t[e+a].rotation;r[o]=n,r[o+s]=n,r[o+2*s]=n,r[o+3*s]=n,o+=4*s}},r.prototype.uploadUvs=function(t,e,i,r,s,o){for(var a=0;a<i;++a){var n=t[e+a]._texture._uvs;n?(r[o]=n.x0,r[o+1]=n.y0,r[o+s]=n.x1,r[o+s+1]=n.y1,r[o+2*s]=n.x2,r[o+2*s+1]=n.y2,r[o+3*s]=n.x3,r[o+3*s+1]=n.y3,o+=4*s):(r[o]=0,r[o+1]=0,r[o+s]=0,r[o+s+1]=0,r[o+2*s]=0,r[o+2*s+1]=0,r[o+3*s]=0,r[o+3*s+1]=0,o+=4*s)}},r.prototype.uploadTint=function(t,e,r,s,o,a){for(var n=0;n<r;++n){var h=t[e+n],u=h._texture.baseTexture.alphaMode>0,p=h.alpha,d=p<1&&u?i.premultiplyTint(h._tintRGB,p):h._tintRGB+(255*p<<24);s[a]=d,s[a+o]=d,s[a+2*o]=d,s[a+3*o]=d,a+=4*o}},r.prototype.destroy=function(){t.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},r}(s.ObjectRenderer);return t.ParticleContainer=a,t.ParticleRenderer=p,t}({},PIXI,PIXI.utils,PIXI,PIXI,PIXI);Object.assign(this.PIXI,_pixi_particles); | ||
this.PIXI=this.PIXI||{};var _pixi_particles=function(t,e,i,r,s,o){"use strict";var a=function(t){function r(i,r,s,o){void 0===i&&(i=1500),void 0===s&&(s=16384),void 0===o&&(o=!1),t.call(this);s>16384&&(s=16384),this._properties=[!1,!0,!1,!1,!1],this._maxSize=i,this._batchSize=s,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=e.BLEND_MODES.NORMAL,this.autoResize=o,this.roundPixels=!0,this.baseTexture=null,this.setProperties(r),this._tint=0,this.tintRgb=new Float32Array(4),this.tint=16777215}t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r;var s={tint:{configurable:!0}};return r.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},r.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},s.tint.get=function(){return this._tint},s.tint.set=function(t){this._tint=t,i.hex2rgb(t,this.tintRgb)},r.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return e.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},r.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.length<e;)this._bufferUpdateIDs.push(0);this._bufferUpdateIDs[e]=++this._updateID},r.prototype.dispose=function(){if(this._buffers){for(var t=0;t<this._buffers.length;++t)this._buffers[t].destroy();this._buffers=null}},r.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.dispose(),this._properties=null,this._buffers=null,this._bufferUpdateIDs=null},Object.defineProperties(r.prototype,s),r}(r.Container),n=function(t,i,r){this.geometry=new s.Geometry,this.indexBuffer=null,this.size=r,this.dynamicProperties=[],this.staticProperties=[];for(var o=0;o<t.length;++o){var a=t[o];a={attributeName:a.attributeName,size:a.size,uploadFunction:a.uploadFunction,type:a.type||e.TYPES.FLOAT,offset:a.offset},i[o]?this.dynamicProperties.push(a):this.staticProperties.push(a)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this._updateID=0,this.initBuffers()};n.prototype.initBuffers=function(){var t=this.geometry,r=0;this.indexBuffer=new s.Buffer(i.createIndicesForQuads(this.size),!0,!0),t.addIndex(this.indexBuffer),this.dynamicStride=0;for(var o=0;o<this.dynamicProperties.length;++o){var a=this.dynamicProperties[o];a.offset=r,r+=a.size,this.dynamicStride+=a.size}var n=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(n),this.dynamicDataUint32=new Uint32Array(n),this.dynamicBuffer=new s.Buffer(this.dynamicData,!1,!1);var h=0;this.staticStride=0;for(var u=0;u<this.staticProperties.length;++u){var p=this.staticProperties[u];p.offset=h,h+=p.size,this.staticStride+=p.size}var d=new ArrayBuffer(this.size*this.staticStride*4*4);this.staticData=new Float32Array(d),this.staticDataUint32=new Uint32Array(d),this.staticBuffer=new s.Buffer(this.staticData,!0,!1);for(var c=0;c<this.dynamicProperties.length;++c){var l=this.dynamicProperties[c];t.addAttribute(l.attributeName,this.dynamicBuffer,0,l.type===e.TYPES.UNSIGNED_BYTE,l.type,4*this.dynamicStride,4*l.offset)}for(var f=0;f<this.staticProperties.length;++f){var y=this.staticProperties[f];t.addAttribute(y.attributeName,this.staticBuffer,0,y.type===e.TYPES.UNSIGNED_BYTE,y.type,4*this.staticStride,4*y.offset)}},n.prototype.uploadDynamic=function(t,i,r){for(var s=0;s<this.dynamicProperties.length;s++){var o=this.dynamicProperties[s];o.uploadFunction(t,i,r,o.type===e.TYPES.UNSIGNED_BYTE?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,o.offset)}this.dynamicBuffer._updateID++},n.prototype.uploadStatic=function(t,i,r){for(var s=0;s<this.staticProperties.length;s++){var o=this.staticProperties[s];o.uploadFunction(t,i,r,o.type===e.TYPES.UNSIGNED_BYTE?this.staticDataUint32:this.staticData,this.staticStride,o.offset)}this.staticBuffer._updateID++},n.prototype.destroy=function(){this.indexBuffer=null,this.dynamicProperties=null,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this.staticProperties=null,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.geometry.destroy()};var h="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nattribute vec2 aPositionCoord;\nattribute float aRotation;\n\nuniform mat3 translationMatrix;\nuniform vec4 uColor;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void){\n float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);\n float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);\n\n vec2 v = vec2(x, y);\n v = v + aPositionCoord;\n\n gl_Position = vec4((translationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vColor = aColor * uColor;\n}\n",u="varying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n vec4 color = texture2D(uSampler, vTextureCoord) * vColor;\n gl_FragColor = color;\n}",p=function(t){function r(i){t.call(this,i),this.shader=null,this.properties=null,this.tempMatrix=new o.Matrix,this.properties=[{attributeName:"aVertexPosition",size:2,uploadFunction:this.uploadVertices,offset:0},{attributeName:"aPositionCoord",size:2,uploadFunction:this.uploadPosition,offset:0},{attributeName:"aRotation",size:1,uploadFunction:this.uploadRotation,offset:0},{attributeName:"aTextureCoord",size:2,uploadFunction:this.uploadUvs,offset:0},{attributeName:"aColor",size:1,type:e.TYPES.UNSIGNED_BYTE,uploadFunction:this.uploadTint,offset:0}],this.shader=s.Shader.from(h,u,{}),this.state=s.State.for2d()}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.render=function(t){var e=t.children,r=t._maxSize,s=t._batchSize,o=this.renderer,a=e.length;if(0!==a){a>r&&!t.autoResize&&(a=r);var n=t._buffers;n||(n=t._buffers=this.generateBuffers(t));var h=e[0]._texture.baseTexture;this.state.blendMode=i.correctBlendMode(t.blendMode,h.alphaMode),o.state.set(this.state);var u=o.gl,p=t.worldTransform.copyTo(this.tempMatrix);p.prepend(o.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=p.toArray(!0),this.shader.uniforms.uColor=i.premultiplyRgba(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,h.alphaMode),this.shader.uniforms.uSampler=h,this.renderer.shader.bind(this.shader);for(var d=!1,c=0,l=0;c<a;c+=s,l+=1){var f=a-c;f>s&&(f=s),l>=n.length&&n.push(this._generateOneMoreBuffer(t));var y=n[l];y.uploadDynamic(e,c,f);var v=t._bufferUpdateIDs[l]||0;(d=d||y._updateID<v)&&(y._updateID=t._updateID,y.uploadStatic(e,c,f)),o.geometry.bind(y.geometry),u.drawElements(u.TRIANGLES,6*f,u.UNSIGNED_SHORT,0)}}},r.prototype.generateBuffers=function(t){for(var e=[],i=t._maxSize,r=t._batchSize,s=t._properties,o=0;o<i;o+=r)e.push(new n(this.properties,s,r));return e},r.prototype._generateOneMoreBuffer=function(t){var e=t._batchSize,i=t._properties;return new n(this.properties,i,e)},r.prototype.uploadVertices=function(t,e,i,r,s,o){for(var a=0,n=0,h=0,u=0,p=0;p<i;++p){var d=t[e+p],c=d._texture,l=d.scale.x,f=d.scale.y,y=c.trim,v=c.orig;y?(a=(n=y.x-d.anchor.x*v.width)+y.width,h=(u=y.y-d.anchor.y*v.height)+y.height):(a=v.width*(1-d.anchor.x),n=v.width*-d.anchor.x,h=v.height*(1-d.anchor.y),u=v.height*-d.anchor.y),r[o]=n*l,r[o+1]=u*f,r[o+s]=a*l,r[o+s+1]=u*f,r[o+2*s]=a*l,r[o+2*s+1]=h*f,r[o+3*s]=n*l,r[o+3*s+1]=h*f,o+=4*s}},r.prototype.uploadPosition=function(t,e,i,r,s,o){for(var a=0;a<i;a++){var n=t[e+a].position;r[o]=n.x,r[o+1]=n.y,r[o+s]=n.x,r[o+s+1]=n.y,r[o+2*s]=n.x,r[o+2*s+1]=n.y,r[o+3*s]=n.x,r[o+3*s+1]=n.y,o+=4*s}},r.prototype.uploadRotation=function(t,e,i,r,s,o){for(var a=0;a<i;a++){var n=t[e+a].rotation;r[o]=n,r[o+s]=n,r[o+2*s]=n,r[o+3*s]=n,o+=4*s}},r.prototype.uploadUvs=function(t,e,i,r,s,o){for(var a=0;a<i;++a){var n=t[e+a]._texture._uvs;n?(r[o]=n.x0,r[o+1]=n.y0,r[o+s]=n.x1,r[o+s+1]=n.y1,r[o+2*s]=n.x2,r[o+2*s+1]=n.y2,r[o+3*s]=n.x3,r[o+3*s+1]=n.y3,o+=4*s):(r[o]=0,r[o+1]=0,r[o+s]=0,r[o+s+1]=0,r[o+2*s]=0,r[o+2*s+1]=0,r[o+3*s]=0,r[o+3*s+1]=0,o+=4*s)}},r.prototype.uploadTint=function(t,e,r,s,o,a){for(var n=0;n<r;++n){var h=t[e+n],u=h._texture.baseTexture.alphaMode>0,p=h.alpha,d=p<1&&u?i.premultiplyTint(h._tintRGB,p):h._tintRGB+(255*p<<24);s[a]=d,s[a+o]=d,s[a+2*o]=d,s[a+3*o]=d,a+=4*o}},r.prototype.destroy=function(){t.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},r}(s.ObjectRenderer);return t.ParticleContainer=a,t.ParticleRenderer=p,t}({},PIXI,PIXI.utils,PIXI,PIXI,PIXI);Object.assign(this.PIXI,_pixi_particles); | ||
//# sourceMappingURL=particles.min.js.map |
/*! | ||
* @pixi/particles - v5.2.0 | ||
* Compiled Wed, 06 Nov 2019 02:32:43 UTC | ||
* @pixi/particles - v5.2.1 | ||
* Compiled Tue, 28 Jan 2020 23:33:11 UTC | ||
* | ||
@@ -11,3 +11,3 @@ * @pixi/particles is licensed under the MIT License. | ||
import { Container } from '@pixi/display'; | ||
import { Geometry, Buffer, ObjectRenderer, Shader } from '@pixi/core'; | ||
import { Geometry, Buffer, ObjectRenderer, Shader, State } from '@pixi/core'; | ||
import { Matrix } from '@pixi/math'; | ||
@@ -626,2 +626,10 @@ | ||
this.shader = Shader.from(vertex, fragment, {}); | ||
/** | ||
* The WebGL state in which this renderer will work. | ||
* | ||
* @member {PIXI.State} | ||
* @readonly | ||
*/ | ||
this.state = State.for2d(); | ||
} | ||
@@ -665,3 +673,4 @@ | ||
// if the uvs have not updated then no point rendering just yet! | ||
this.renderer.state.setBlendMode(correctBlendMode(container.blendMode, baseTexture.alphaMode)); | ||
this.state.blendMode = correctBlendMode(container.blendMode, baseTexture.alphaMode); | ||
renderer.state.set(this.state); | ||
@@ -668,0 +677,0 @@ var gl = renderer.gl; |
/*! | ||
* @pixi/particles - v5.2.0 | ||
* Compiled Wed, 06 Nov 2019 02:32:43 UTC | ||
* @pixi/particles - v5.2.1 | ||
* Compiled Tue, 28 Jan 2020 23:33:11 UTC | ||
* | ||
@@ -629,2 +629,10 @@ * @pixi/particles is licensed under the MIT License. | ||
this.shader = core.Shader.from(vertex, fragment, {}); | ||
/** | ||
* The WebGL state in which this renderer will work. | ||
* | ||
* @member {PIXI.State} | ||
* @readonly | ||
*/ | ||
this.state = core.State.for2d(); | ||
} | ||
@@ -668,3 +676,4 @@ | ||
// if the uvs have not updated then no point rendering just yet! | ||
this.renderer.state.setBlendMode(utils.correctBlendMode(container.blendMode, baseTexture.alphaMode)); | ||
this.state.blendMode = utils.correctBlendMode(container.blendMode, baseTexture.alphaMode); | ||
renderer.state.set(this.state); | ||
@@ -671,0 +680,0 @@ var gl = renderer.gl; |
{ | ||
"name": "@pixi/particles", | ||
"version": "5.2.0", | ||
"version": "5.2.1", | ||
"main": "lib/particles.js", | ||
@@ -27,9 +27,9 @@ "module": "lib/particles.es.js", | ||
"dependencies": { | ||
"@pixi/constants": "^5.2.0", | ||
"@pixi/core": "^5.2.0", | ||
"@pixi/display": "^5.2.0", | ||
"@pixi/math": "^5.2.0", | ||
"@pixi/utils": "^5.2.0" | ||
"@pixi/constants": "5.2.1", | ||
"@pixi/core": "5.2.1", | ||
"@pixi/display": "5.2.1", | ||
"@pixi/math": "5.2.1", | ||
"@pixi/utils": "5.2.1" | ||
}, | ||
"gitHead": "aaf96b460582b83a1fa73037ef2dd69dd9e84415" | ||
"gitHead": "b56b4fca1c169f0e6d2a0472251ba1f7399bb4a3" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
305288
2551
+ Added@pixi/constants@5.2.1(transitive)
+ Added@pixi/core@5.2.1(transitive)
+ Added@pixi/display@5.2.1(transitive)
+ Added@pixi/math@5.2.1(transitive)
+ Added@pixi/runner@5.2.1(transitive)
+ Added@pixi/settings@5.2.1(transitive)
+ Added@pixi/ticker@5.2.1(transitive)
+ Added@pixi/utils@5.2.1(transitive)
- Removed@pixi/constants@5.3.12(transitive)
- Removed@pixi/core@5.3.12(transitive)
- Removed@pixi/display@5.3.12(transitive)
- Removed@pixi/math@5.3.12(transitive)
- Removed@pixi/runner@5.3.12(transitive)
- Removed@pixi/settings@5.3.12(transitive)
- Removed@pixi/ticker@5.3.12(transitive)
- Removed@pixi/utils@5.3.12(transitive)
Updated@pixi/constants@5.2.1
Updated@pixi/core@5.2.1
Updated@pixi/display@5.2.1
Updated@pixi/math@5.2.1
Updated@pixi/utils@5.2.1