@pixi/particles
Advanced tools
Comparing version 5.0.0-alpha.3 to 5.0.0-rc
/*! | ||
* @pixi/particles - v5.0.0-alpha.3 | ||
* Compiled Tue, 03 Jul 2018 04:08:21 UTC | ||
* @pixi/particles - v5.0.0-rc | ||
* Compiled Fri, 01 Feb 2019 04:50:10 UTC | ||
* | ||
@@ -9,5 +9,5 @@ * @pixi/particles is licensed under the MIT License. | ||
import { BLEND_MODES, TYPES } from '@pixi/constants'; | ||
import { correctBlendMode, createIndicesForQuads, hex2rgb, premultiplyRgba, premultiplyTint } from '@pixi/utils'; | ||
import { hex2rgb, createIndicesForQuads, correctBlendMode, premultiplyRgba, premultiplyTint } from '@pixi/utils'; | ||
import { Container } from '@pixi/display'; | ||
import { Buffer, Geometry, ObjectRenderer, Shader } from '@pixi/core'; | ||
import { Geometry, Buffer, ObjectRenderer, Shader } from '@pixi/core'; | ||
import { Matrix } from '@pixi/math'; | ||
@@ -17,9 +17,11 @@ | ||
* The ParticleContainer class is a really fast version of the Container built solely for speed, | ||
* so use when you need a lot of sprites or particles. The tradeoff of the ParticleContainer is that most advanced | ||
* functionality will not work. ParticleContainer implements the basic object transform (position, scale, rotation) | ||
* so use when you need a lot of sprites or particles. | ||
* | ||
* The tradeoff of the ParticleContainer is that most advanced functionality will not work. | ||
* ParticleContainer implements the basic object transform (position, scale, rotation) | ||
* and some advanced functionality like tint (as of v4.5.6). | ||
* | ||
* Other more advanced functionality like masking, children, filters, etc will not work on sprites in this batch. | ||
* | ||
* It's extremely easy to use : | ||
* | ||
* It's extremely easy to use: | ||
* ```js | ||
@@ -41,3 +43,3 @@ * let container = new ParticleContainer(); | ||
*/ | ||
var ParticleContainer = (function (Container$$1) { | ||
var ParticleContainer = /*@__PURE__*/(function (Container$$1) { | ||
function ParticleContainer(maxSize, properties, batchSize, autoResize) | ||
@@ -130,7 +132,9 @@ { | ||
/** | ||
* Used for canvas rendering. If true then the elements will be positioned at the | ||
* nearest pixel. This provides a nice speed boost. | ||
* If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation. | ||
* Advantages can include sharper image quality (like text) and faster rendering on canvas. | ||
* The main disadvantage is movement of objects may appear less smooth. | ||
* Default to true here as performance is usually the priority for particles. | ||
* | ||
* @member {boolean} | ||
* @default true; | ||
* @default true | ||
*/ | ||
@@ -202,3 +206,3 @@ this.roundPixels = true; | ||
* A value of 0xFFFFFF will remove any tint effect. | ||
** IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. | ||
** IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer. | ||
* @member {number} | ||
@@ -254,4 +258,2 @@ * @default 0xFFFFFF | ||
{ | ||
var this$1 = this; | ||
var bufferIndex = Math.floor(smallestChildIndex / this._batchSize); | ||
@@ -261,3 +263,3 @@ | ||
{ | ||
this$1._bufferUpdateIDs.push(0); | ||
this._bufferUpdateIDs.push(0); | ||
} | ||
@@ -269,4 +271,2 @@ this._bufferUpdateIDs[bufferIndex] = ++this._updateID; | ||
{ | ||
var this$1 = this; | ||
if (this._buffers) | ||
@@ -276,3 +276,3 @@ { | ||
{ | ||
this$1._buffers[i].destroy(); | ||
this._buffers[i].destroy(); | ||
} | ||
@@ -333,4 +333,2 @@ | ||
{ | ||
var this$1 = this; | ||
this.geometry = new Geometry(); | ||
@@ -343,2 +341,3 @@ | ||
* | ||
* @private | ||
* @member {number} | ||
@@ -351,2 +350,3 @@ */ | ||
* | ||
* @private | ||
* @member {object[]} | ||
@@ -359,2 +359,3 @@ */ | ||
* | ||
* @private | ||
* @member {object[]} | ||
@@ -380,7 +381,7 @@ */ | ||
{ | ||
this$1.dynamicProperties.push(property); | ||
this.dynamicProperties.push(property); | ||
} | ||
else | ||
{ | ||
this$1.staticProperties.push(property); | ||
this.staticProperties.push(property); | ||
} | ||
@@ -411,4 +412,2 @@ } | ||
{ | ||
var this$1 = this; | ||
var geometry = this.geometry; | ||
@@ -422,2 +421,3 @@ | ||
* @member {Uint16Array} | ||
* @private | ||
*/ | ||
@@ -431,7 +431,7 @@ this.indexBuffer = new Buffer(createIndicesForQuads(this.size), true, true); | ||
{ | ||
var property = this$1.dynamicProperties[i]; | ||
var property = this.dynamicProperties[i]; | ||
property.offset = dynamicOffset; | ||
dynamicOffset += property.size; | ||
this$1.dynamicStride += property.size; | ||
this.dynamicStride += property.size; | ||
} | ||
@@ -452,7 +452,7 @@ | ||
{ | ||
var property$1 = this$1.staticProperties[i$1]; | ||
var property$1 = this.staticProperties[i$1]; | ||
property$1.offset = staticOffset; | ||
staticOffset += property$1.size; | ||
this$1.staticStride += property$1.size; | ||
this.staticStride += property$1.size; | ||
} | ||
@@ -468,11 +468,11 @@ | ||
{ | ||
var property$2 = this$1.dynamicProperties[i$2]; | ||
var property$2 = this.dynamicProperties[i$2]; | ||
geometry.addAttribute( | ||
property$2.attributeName, | ||
this$1.dynamicBuffer, | ||
this.dynamicBuffer, | ||
0, | ||
property$2.type === TYPES.UNSIGNED_BYTE, | ||
property$2.type, | ||
this$1.dynamicStride * 4, | ||
this.dynamicStride * 4, | ||
property$2.offset * 4 | ||
@@ -484,11 +484,11 @@ ); | ||
{ | ||
var property$3 = this$1.staticProperties[i$3]; | ||
var property$3 = this.staticProperties[i$3]; | ||
geometry.addAttribute( | ||
property$3.attributeName, | ||
this$1.staticBuffer, | ||
this.staticBuffer, | ||
0, | ||
property$3.type === TYPES.UNSIGNED_BYTE, | ||
property$3.type, | ||
this$1.staticStride * 4, | ||
this.staticStride * 4, | ||
property$3.offset * 4 | ||
@@ -502,2 +502,3 @@ ); | ||
* | ||
* @private | ||
* @param {PIXI.DisplayObject[]} children - The children to upload. | ||
@@ -509,11 +510,9 @@ * @param {number} startIndex - The index to start at. | ||
{ | ||
var this$1 = this; | ||
for (var i = 0; i < this.dynamicProperties.length; i++) | ||
{ | ||
var property = this$1.dynamicProperties[i]; | ||
var property = this.dynamicProperties[i]; | ||
property.uploadFunction(children, startIndex, amount, | ||
property.type === TYPES.UNSIGNED_BYTE ? this$1.dynamicDataUint32 : this$1.dynamicData, | ||
this$1.dynamicStride, property.offset); | ||
property.type === TYPES.UNSIGNED_BYTE ? this.dynamicDataUint32 : this.dynamicData, | ||
this.dynamicStride, property.offset); | ||
} | ||
@@ -527,2 +526,3 @@ | ||
* | ||
* @private | ||
* @param {PIXI.DisplayObject[]} children - The children to upload. | ||
@@ -534,11 +534,9 @@ * @param {number} startIndex - The index to start at. | ||
{ | ||
var this$1 = this; | ||
for (var i = 0; i < this.staticProperties.length; i++) | ||
{ | ||
var property = this$1.staticProperties[i]; | ||
var property = this.staticProperties[i]; | ||
property.uploadFunction(children, startIndex, amount, | ||
property.type === TYPES.UNSIGNED_BYTE ? this$1.staticDataUint32 : this$1.staticData, | ||
this$1.staticStride, property.offset); | ||
property.type === TYPES.UNSIGNED_BYTE ? this.staticDataUint32 : this.staticData, | ||
this.staticStride, property.offset); | ||
} | ||
@@ -552,2 +550,3 @@ | ||
* | ||
* @private | ||
*/ | ||
@@ -590,2 +589,3 @@ ParticleBuffer.prototype.destroy = function destroy () | ||
/** | ||
* Renderer for Particles that is designer for speed over feature set. | ||
* | ||
@@ -595,3 +595,3 @@ * @class | ||
*/ | ||
var ParticleRenderer = (function (ObjectRenderer$$1) { | ||
var ParticleRenderer = /*@__PURE__*/(function (ObjectRenderer$$1) { | ||
function ParticleRenderer(renderer) | ||
@@ -670,4 +670,2 @@ { | ||
{ | ||
var this$1 = this; | ||
var children = container.children; | ||
@@ -733,3 +731,3 @@ var maxSize = container._maxSize; | ||
} | ||
buffers.push(this$1._generateOneMoreBuffer(container)); | ||
buffers.push(this._generateOneMoreBuffer(container)); | ||
} | ||
@@ -763,7 +761,6 @@ | ||
* @return {PIXI.ParticleBuffer[]} The buffers | ||
* @private | ||
*/ | ||
ParticleRenderer.prototype.generateBuffers = function generateBuffers (container) | ||
{ | ||
var this$1 = this; | ||
var buffers = []; | ||
@@ -776,3 +773,3 @@ var size = container._maxSize; | ||
{ | ||
buffers.push(new ParticleBuffer(this$1.properties, dynamicPropertyFlags, batchSize)); | ||
buffers.push(new ParticleBuffer(this.properties, dynamicPropertyFlags, batchSize)); | ||
} | ||
@@ -860,2 +857,3 @@ | ||
/** | ||
* Uploads the position. | ||
* | ||
@@ -892,2 +890,3 @@ * @param {PIXI.DisplayObject[]} children - the array of display objects to render | ||
/** | ||
* Uploads the rotiation. | ||
* | ||
@@ -917,2 +916,3 @@ * @param {PIXI.DisplayObject[]} children - the array of display objects to render | ||
/** | ||
* Uploads the Uvs | ||
* | ||
@@ -969,2 +969,3 @@ * @param {PIXI.DisplayObject[]} children - the array of display objects to render | ||
/** | ||
* Uploads the tint. | ||
* | ||
@@ -1000,3 +1001,2 @@ * @param {PIXI.DisplayObject[]} children - the array of display objects to render | ||
* Destroys the ParticleRenderer. | ||
* | ||
*/ | ||
@@ -1003,0 +1003,0 @@ ParticleRenderer.prototype.destroy = function destroy () |
/*! | ||
* @pixi/particles - v5.0.0-alpha.3 | ||
* Compiled Tue, 03 Jul 2018 04:08:21 UTC | ||
* @pixi/particles - v5.0.0-rc | ||
* Compiled Fri, 01 Feb 2019 04:50:10 UTC | ||
* | ||
@@ -20,9 +20,11 @@ * @pixi/particles is licensed under the MIT License. | ||
* The ParticleContainer class is a really fast version of the Container built solely for speed, | ||
* so use when you need a lot of sprites or particles. The tradeoff of the ParticleContainer is that most advanced | ||
* functionality will not work. ParticleContainer implements the basic object transform (position, scale, rotation) | ||
* so use when you need a lot of sprites or particles. | ||
* | ||
* The tradeoff of the ParticleContainer is that most advanced functionality will not work. | ||
* ParticleContainer implements the basic object transform (position, scale, rotation) | ||
* and some advanced functionality like tint (as of v4.5.6). | ||
* | ||
* Other more advanced functionality like masking, children, filters, etc will not work on sprites in this batch. | ||
* | ||
* It's extremely easy to use : | ||
* | ||
* It's extremely easy to use: | ||
* ```js | ||
@@ -44,3 +46,3 @@ * let container = new ParticleContainer(); | ||
*/ | ||
var ParticleContainer = (function (Container$$1) { | ||
var ParticleContainer = /*@__PURE__*/(function (Container) { | ||
function ParticleContainer(maxSize, properties, batchSize, autoResize) | ||
@@ -52,3 +54,3 @@ { | ||
Container$$1.call(this); | ||
Container.call(this); | ||
@@ -134,7 +136,9 @@ // Making sure the batch size is valid | ||
/** | ||
* Used for canvas rendering. If true then the elements will be positioned at the | ||
* nearest pixel. This provides a nice speed boost. | ||
* If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation. | ||
* Advantages can include sharper image quality (like text) and faster rendering on canvas. | ||
* The main disadvantage is movement of objects may appear less smooth. | ||
* Default to true here as performance is usually the priority for particles. | ||
* | ||
* @member {boolean} | ||
* @default true; | ||
* @default true | ||
*/ | ||
@@ -166,4 +170,4 @@ this.roundPixels = true; | ||
if ( Container$$1 ) ParticleContainer.__proto__ = Container$$1; | ||
ParticleContainer.prototype = Object.create( Container$$1 && Container$$1.prototype ); | ||
if ( Container ) ParticleContainer.__proto__ = Container; | ||
ParticleContainer.prototype = Object.create( Container && Container.prototype ); | ||
ParticleContainer.prototype.constructor = ParticleContainer; | ||
@@ -207,3 +211,3 @@ | ||
* A value of 0xFFFFFF will remove any tint effect. | ||
** IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer. | ||
** IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer. | ||
* @member {number} | ||
@@ -259,4 +263,2 @@ * @default 0xFFFFFF | ||
{ | ||
var this$1 = this; | ||
var bufferIndex = Math.floor(smallestChildIndex / this._batchSize); | ||
@@ -266,3 +268,3 @@ | ||
{ | ||
this$1._bufferUpdateIDs.push(0); | ||
this._bufferUpdateIDs.push(0); | ||
} | ||
@@ -274,4 +276,2 @@ this._bufferUpdateIDs[bufferIndex] = ++this._updateID; | ||
{ | ||
var this$1 = this; | ||
if (this._buffers) | ||
@@ -281,3 +281,3 @@ { | ||
{ | ||
this$1._buffers[i].destroy(); | ||
this._buffers[i].destroy(); | ||
} | ||
@@ -303,3 +303,3 @@ | ||
{ | ||
Container$$1.prototype.destroy.call(this, options); | ||
Container.prototype.destroy.call(this, options); | ||
@@ -339,4 +339,2 @@ this.dispose(); | ||
{ | ||
var this$1 = this; | ||
this.geometry = new core.Geometry(); | ||
@@ -349,2 +347,3 @@ | ||
* | ||
* @private | ||
* @member {number} | ||
@@ -357,2 +356,3 @@ */ | ||
* | ||
* @private | ||
* @member {object[]} | ||
@@ -365,2 +365,3 @@ */ | ||
* | ||
* @private | ||
* @member {object[]} | ||
@@ -386,7 +387,7 @@ */ | ||
{ | ||
this$1.dynamicProperties.push(property); | ||
this.dynamicProperties.push(property); | ||
} | ||
else | ||
{ | ||
this$1.staticProperties.push(property); | ||
this.staticProperties.push(property); | ||
} | ||
@@ -417,4 +418,2 @@ } | ||
{ | ||
var this$1 = this; | ||
var geometry = this.geometry; | ||
@@ -428,2 +427,3 @@ | ||
* @member {Uint16Array} | ||
* @private | ||
*/ | ||
@@ -437,7 +437,7 @@ this.indexBuffer = new core.Buffer(utils.createIndicesForQuads(this.size), true, true); | ||
{ | ||
var property = this$1.dynamicProperties[i]; | ||
var property = this.dynamicProperties[i]; | ||
property.offset = dynamicOffset; | ||
dynamicOffset += property.size; | ||
this$1.dynamicStride += property.size; | ||
this.dynamicStride += property.size; | ||
} | ||
@@ -458,7 +458,7 @@ | ||
{ | ||
var property$1 = this$1.staticProperties[i$1]; | ||
var property$1 = this.staticProperties[i$1]; | ||
property$1.offset = staticOffset; | ||
staticOffset += property$1.size; | ||
this$1.staticStride += property$1.size; | ||
this.staticStride += property$1.size; | ||
} | ||
@@ -474,11 +474,11 @@ | ||
{ | ||
var property$2 = this$1.dynamicProperties[i$2]; | ||
var property$2 = this.dynamicProperties[i$2]; | ||
geometry.addAttribute( | ||
property$2.attributeName, | ||
this$1.dynamicBuffer, | ||
this.dynamicBuffer, | ||
0, | ||
property$2.type === constants.TYPES.UNSIGNED_BYTE, | ||
property$2.type, | ||
this$1.dynamicStride * 4, | ||
this.dynamicStride * 4, | ||
property$2.offset * 4 | ||
@@ -490,11 +490,11 @@ ); | ||
{ | ||
var property$3 = this$1.staticProperties[i$3]; | ||
var property$3 = this.staticProperties[i$3]; | ||
geometry.addAttribute( | ||
property$3.attributeName, | ||
this$1.staticBuffer, | ||
this.staticBuffer, | ||
0, | ||
property$3.type === constants.TYPES.UNSIGNED_BYTE, | ||
property$3.type, | ||
this$1.staticStride * 4, | ||
this.staticStride * 4, | ||
property$3.offset * 4 | ||
@@ -508,2 +508,3 @@ ); | ||
* | ||
* @private | ||
* @param {PIXI.DisplayObject[]} children - The children to upload. | ||
@@ -515,11 +516,9 @@ * @param {number} startIndex - The index to start at. | ||
{ | ||
var this$1 = this; | ||
for (var i = 0; i < this.dynamicProperties.length; i++) | ||
{ | ||
var property = this$1.dynamicProperties[i]; | ||
var property = this.dynamicProperties[i]; | ||
property.uploadFunction(children, startIndex, amount, | ||
property.type === constants.TYPES.UNSIGNED_BYTE ? this$1.dynamicDataUint32 : this$1.dynamicData, | ||
this$1.dynamicStride, property.offset); | ||
property.type === constants.TYPES.UNSIGNED_BYTE ? this.dynamicDataUint32 : this.dynamicData, | ||
this.dynamicStride, property.offset); | ||
} | ||
@@ -533,2 +532,3 @@ | ||
* | ||
* @private | ||
* @param {PIXI.DisplayObject[]} children - The children to upload. | ||
@@ -540,11 +540,9 @@ * @param {number} startIndex - The index to start at. | ||
{ | ||
var this$1 = this; | ||
for (var i = 0; i < this.staticProperties.length; i++) | ||
{ | ||
var property = this$1.staticProperties[i]; | ||
var property = this.staticProperties[i]; | ||
property.uploadFunction(children, startIndex, amount, | ||
property.type === constants.TYPES.UNSIGNED_BYTE ? this$1.staticDataUint32 : this$1.staticData, | ||
this$1.staticStride, property.offset); | ||
property.type === constants.TYPES.UNSIGNED_BYTE ? this.staticDataUint32 : this.staticData, | ||
this.staticStride, property.offset); | ||
} | ||
@@ -558,2 +556,3 @@ | ||
* | ||
* @private | ||
*/ | ||
@@ -596,2 +595,3 @@ ParticleBuffer.prototype.destroy = function destroy () | ||
/** | ||
* Renderer for Particles that is designer for speed over feature set. | ||
* | ||
@@ -601,6 +601,6 @@ * @class | ||
*/ | ||
var ParticleRenderer = (function (ObjectRenderer$$1) { | ||
var ParticleRenderer = /*@__PURE__*/(function (ObjectRenderer) { | ||
function ParticleRenderer(renderer) | ||
{ | ||
ObjectRenderer$$1.call(this, renderer); | ||
ObjectRenderer.call(this, renderer); | ||
@@ -665,4 +665,4 @@ // 65535 is max vertex index in the index buffer (see ParticleRenderer) | ||
if ( ObjectRenderer$$1 ) ParticleRenderer.__proto__ = ObjectRenderer$$1; | ||
ParticleRenderer.prototype = Object.create( ObjectRenderer$$1 && ObjectRenderer$$1.prototype ); | ||
if ( ObjectRenderer ) ParticleRenderer.__proto__ = ObjectRenderer; | ||
ParticleRenderer.prototype = Object.create( ObjectRenderer && ObjectRenderer.prototype ); | ||
ParticleRenderer.prototype.constructor = ParticleRenderer; | ||
@@ -677,4 +677,2 @@ | ||
{ | ||
var this$1 = this; | ||
var children = container.children; | ||
@@ -740,3 +738,3 @@ var maxSize = container._maxSize; | ||
} | ||
buffers.push(this$1._generateOneMoreBuffer(container)); | ||
buffers.push(this._generateOneMoreBuffer(container)); | ||
} | ||
@@ -770,7 +768,6 @@ | ||
* @return {PIXI.ParticleBuffer[]} The buffers | ||
* @private | ||
*/ | ||
ParticleRenderer.prototype.generateBuffers = function generateBuffers (container) | ||
{ | ||
var this$1 = this; | ||
var buffers = []; | ||
@@ -783,3 +780,3 @@ var size = container._maxSize; | ||
{ | ||
buffers.push(new ParticleBuffer(this$1.properties, dynamicPropertyFlags, batchSize)); | ||
buffers.push(new ParticleBuffer(this.properties, dynamicPropertyFlags, batchSize)); | ||
} | ||
@@ -867,2 +864,3 @@ | ||
/** | ||
* Uploads the position. | ||
* | ||
@@ -899,2 +897,3 @@ * @param {PIXI.DisplayObject[]} children - the array of display objects to render | ||
/** | ||
* Uploads the rotiation. | ||
* | ||
@@ -924,2 +923,3 @@ * @param {PIXI.DisplayObject[]} children - the array of display objects to render | ||
/** | ||
* Uploads the Uvs | ||
* | ||
@@ -976,2 +976,3 @@ * @param {PIXI.DisplayObject[]} children - the array of display objects to render | ||
/** | ||
* Uploads the tint. | ||
* | ||
@@ -1007,7 +1008,6 @@ * @param {PIXI.DisplayObject[]} children - the array of display objects to render | ||
* Destroys the ParticleRenderer. | ||
* | ||
*/ | ||
ParticleRenderer.prototype.destroy = function destroy () | ||
{ | ||
ObjectRenderer$$1.prototype.destroy.call(this); | ||
ObjectRenderer.prototype.destroy.call(this); | ||
@@ -1014,0 +1014,0 @@ if (this.shader) |
{ | ||
"name": "@pixi/particles", | ||
"version": "5.0.0-alpha.3", | ||
"version": "5.0.0-rc", | ||
"main": "lib/particles.js", | ||
"module": "lib/particles.es.js", | ||
"description": "Support for legacy browser JavaScript environments", | ||
"description": "Render many sprite particles as efficiently as possible", | ||
"author": "Mat Groves", | ||
@@ -25,11 +25,12 @@ "contributors": [ | ||
"dependencies": { | ||
"@pixi/constants": "^5.0.0-alpha.3", | ||
"@pixi/core": "^5.0.0-alpha.3", | ||
"@pixi/display": "^5.0.0-alpha.3", | ||
"@pixi/math": "^5.0.0-alpha.3", | ||
"@pixi/utils": "^5.0.0-alpha.3" | ||
"@pixi/constants": "^5.0.0-rc", | ||
"@pixi/core": "^5.0.0-rc", | ||
"@pixi/display": "^5.0.0-rc", | ||
"@pixi/math": "^5.0.0-rc", | ||
"@pixi/utils": "^5.0.0-rc" | ||
}, | ||
"devDependencies": { | ||
"floss": "^2.1.3" | ||
} | ||
"floss": "^2.1.5" | ||
}, | ||
"gitHead": "9026a1bbca9a9d86b7a3b6d5eb4fa2c3145c2b85" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
166165
1671
Updated@pixi/constants@^5.0.0-rc
Updated@pixi/core@^5.0.0-rc
Updated@pixi/display@^5.0.0-rc
Updated@pixi/math@^5.0.0-rc
Updated@pixi/utils@^5.0.0-rc