diff --git a/packages/particles/src/ParticleContainer.js b/packages/particles/src/ParticleContainer.js index e99c833..0590155 100644 --- a/packages/particles/src/ParticleContainer.js +++ b/packages/particles/src/ParticleContainer.js @@ -33,7 +33,8 @@ * @param {number} [maxSize=1500] - The maximum number of particles that can be rendered by the container. * Affects size of allocated buffers. * @param {object} [properties] - The properties of children that should be uploaded to the gpu and applied. - * @param {boolean} [properties.scale=false] - When true, scale be uploaded and applied. + * @param {boolean} [properties.vertices=false] - When true, vertices be uploaded and applied. + * if sprite's ` scale/anchor/trim/frame/orig` is dynamic, please set `true`. * @param {boolean} [properties.position=true] - When true, position be uploaded and applied. * @param {boolean} [properties.rotation=false] - When true, rotation be uploaded and applied. * @param {boolean} [properties.uvs=false] - When true, uvs be uploaded and applied. @@ -157,12 +158,13 @@ { if (properties) { - this._properties[0] = 'scale' in properties ? !!properties.scale : this._properties[0]; + this._properties[0] = 'vertices' in properties || 'scale' in properties + ? !!properties.vertices || !!properties.scale : this._properties[0]; this._properties[1] = 'position' in properties ? !!properties.position : this._properties[1]; this._properties[2] = 'rotation' in properties ? !!properties.rotation : this._properties[2]; this._properties[3] = 'uvs' in properties ? !!properties.uvs : this._properties[3]; - this._properties[4] = 'alpha' in properties || 'tint' in properties - ? !!properties.alpha || !!properties.tint : this._properties[4]; + this._properties[4] = 'tint' in properties || 'alpha' in properties + ? !!properties.tint || !!properties.alpha : this._properties[4]; } } diff --git a/packages/particles/src/ParticleContainer.js b/packages/particles/src/ParticleContainer.js index e99c833..0590155 100644 --- a/packages/particles/src/ParticleContainer.js +++ b/packages/particles/src/ParticleContainer.js @@ -33,7 +33,8 @@ * @param {number} [maxSize=1500] - The maximum number of particles that can be rendered by the container. * Affects size of allocated buffers. * @param {object} [properties] - The properties of children that should be uploaded to the gpu and applied. - * @param {boolean} [properties.scale=false] - When true, scale be uploaded and applied. + * @param {boolean} [properties.vertices=false] - When true, vertices be uploaded and applied. + * if sprite's ` scale/anchor/trim/frame/orig` is dynamic, please set `true`. * @param {boolean} [properties.position=true] - When true, position be uploaded and applied. * @param {boolean} [properties.rotation=false] - When true, rotation be uploaded and applied. * @param {boolean} [properties.uvs=false] - When true, uvs be uploaded and applied. @@ -157,12 +158,13 @@ { if (properties) { - this._properties[0] = 'scale' in properties ? !!properties.scale : this._properties[0]; + this._properties[0] = 'vertices' in properties || 'scale' in properties + ? !!properties.vertices || !!properties.scale : this._properties[0]; this._properties[1] = 'position' in properties ? !!properties.position : this._properties[1]; this._properties[2] = 'rotation' in properties ? !!properties.rotation : this._properties[2]; this._properties[3] = 'uvs' in properties ? !!properties.uvs : this._properties[3]; - this._properties[4] = 'alpha' in properties || 'tint' in properties - ? !!properties.alpha || !!properties.tint : this._properties[4]; + this._properties[4] = 'tint' in properties || 'alpha' in properties + ? !!properties.tint || !!properties.alpha : this._properties[4]; } } diff --git a/packages/particles/src/particles.vert b/packages/particles/src/particles.vert index bd5401c..209e14d 100644 --- a/packages/particles/src/particles.vert +++ b/packages/particles/src/particles.vert @@ -3,7 +3,6 @@ attribute vec4 aColor; attribute vec2 aPositionCoord; -attribute vec2 aScale; attribute float aRotation; uniform mat3 projectionMatrix;