@pixi/sprite
Advanced tools
Comparing version 5.0.3 to 5.0.4
/*! | ||
* @pixi/sprite - v5.0.3 | ||
* Compiled Sun, 19 May 2019 19:03:31 UTC | ||
* @pixi/sprite - v5.0.4 | ||
* Compiled Fri, 07 Jun 2019 17:17:49 UTC | ||
* | ||
@@ -21,3 +21,3 @@ * @pixi/sprite is licensed under the MIT License. | ||
* ```js | ||
* let sprite = new PIXI.Sprite.from('assets/image.png'); | ||
* let sprite = PIXI.Sprite.from('assets/image.png'); | ||
* ``` | ||
@@ -118,9 +118,10 @@ * | ||
/** | ||
* An internal cached value of the tint. | ||
* Cached tint value so we can tell when the tint is changed. | ||
* Value is used for 2d CanvasRenderer. | ||
* | ||
* @private | ||
* @protected | ||
* @member {number} | ||
* @default 0xFFFFFF | ||
*/ | ||
this.cachedTint = 0xFFFFFF; | ||
this._cachedTint = 0xFFFFFF; | ||
@@ -199,3 +200,3 @@ this.uvs = null; | ||
this._textureTrimmedID = -1; | ||
this.cachedTint = 0xFFFFFF; | ||
this._cachedTint = 0xFFFFFF; | ||
@@ -506,3 +507,3 @@ this.uvs = this._texture._uvs.uvsFloat32; | ||
? source | ||
: new core.Texture.from(source, options); | ||
: core.Texture.from(source, options); | ||
@@ -635,3 +636,3 @@ return new Sprite(texture); | ||
this._texture = value || core.Texture.EMPTY; | ||
this.cachedTint = 0xFFFFFF; | ||
this._cachedTint = 0xFFFFFF; | ||
@@ -638,0 +639,0 @@ this._textureID = -1; |
/*! | ||
* @pixi/sprite - v5.0.3 | ||
* Compiled Sun, 19 May 2019 19:03:31 UTC | ||
* @pixi/sprite - v5.0.4 | ||
* Compiled Fri, 07 Jun 2019 17:17:49 UTC | ||
* | ||
@@ -8,3 +8,3 @@ * @pixi/sprite is licensed under the MIT License. | ||
*/ | ||
this.PIXI=this.PIXI||{};var _pixi_sprite=function(t,e,i,r,s,h,n){"use strict";var o=new e.Point,a=new Uint16Array([0,1,2,0,2,3]),u=function(t){function h(i){t.call(this),this._anchor=new e.ObservablePoint(this._onAnchorUpdate,this,i?i.defaultAnchor.x:0,i?i.defaultAnchor.y:0),this._texture=null,this._width=0,this._height=0,this._tint=null,this._tintRGB=null,this.tint=16777215,this.blendMode=s.BLEND_MODES.NORMAL,this.shader=null,this.cachedTint=16777215,this.uvs=null,this.texture=i||r.Texture.EMPTY,this.vertexData=new Float32Array(8),this.vertexTrimmedData=null,this._transformID=-1,this._textureID=-1,this._transformTrimmedID=-1,this._textureTrimmedID=-1,this.indices=a,this.size=4,this.start=0,this.pluginName="batch",this.isSprite=!0,this._roundPixels=n.settings.ROUND_PIXELS}t&&(h.__proto__=t),h.prototype=Object.create(t&&t.prototype),h.prototype.constructor=h;var u={roundPixels:{configurable:!0},width:{configurable:!0},height:{configurable:!0},anchor:{configurable:!0},tint:{configurable:!0},texture:{configurable:!0}};return h.prototype._onTextureUpdate=function(){this._textureID=-1,this._textureTrimmedID=-1,this.cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this._width&&(this.scale.x=i.sign(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=i.sign(this.scale.y)*this._height/this._texture.orig.height)},h.prototype._onAnchorUpdate=function(){this._transformID=-1,this._transformTrimmedID=-1},h.prototype.calculateVertices=function(){var t=this._texture;if(this._transformID!==this.transform._worldID||this._textureID!==t._updateID){this._transformID=this.transform._worldID,this._textureID=t._updateID;var e=this.transform.worldTransform,i=e.a,r=e.b,s=e.c,h=e.d,n=e.tx,o=e.ty,a=this.vertexData,u=t.trim,_=t.orig,c=this._anchor,d=0,l=0,x=0,f=0;if(u?(d=(l=u.x-c._x*_.width)+u.width,x=(f=u.y-c._y*_.height)+u.height):(d=(l=-c._x*_.width)+_.width,x=(f=-c._y*_.height)+_.height),a[0]=i*l+s*f+n,a[1]=h*f+r*l+o,a[2]=i*d+s*f+n,a[3]=h*f+r*d+o,a[4]=i*d+s*x+n,a[5]=h*x+r*d+o,a[6]=i*l+s*x+n,a[7]=h*x+r*l+o,this._roundPixels)for(var g=0;g<8;g++)a[g]=Math.round(a[g])}},h.prototype.calculateTrimmedVertices=function(){if(this.vertexTrimmedData){if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return}else this.vertexTrimmedData=new Float32Array(8);this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;var t=this._texture,e=this.vertexTrimmedData,i=t.orig,r=this._anchor,s=this.transform.worldTransform,h=s.a,n=s.b,o=s.c,a=s.d,u=s.tx,_=s.ty,c=-r._x*i.width,d=c+i.width,l=-r._y*i.height,x=l+i.height;e[0]=h*c+o*l+u,e[1]=a*l+n*c+_,e[2]=h*d+o*l+u,e[3]=a*l+n*d+_,e[4]=h*d+o*x+u,e[5]=a*x+n*d+_,e[6]=h*c+o*x+u,e[7]=a*x+n*c+_},h.prototype._render=function(t){this.calculateVertices(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this)},h.prototype._calculateBounds=function(){var t=this._texture.trim,e=this._texture.orig;!t||t.width===e.width&&t.height===e.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))},h.prototype.getLocalBounds=function(i){return 0===this.children.length?(this._bounds.minX=this._texture.orig.width*-this._anchor._x,this._bounds.minY=this._texture.orig.height*-this._anchor._y,this._bounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._bounds.maxY=this._texture.orig.height*(1-this._anchor._y),i||(this._localBoundsRect||(this._localBoundsRect=new e.Rectangle),i=this._localBoundsRect),this._bounds.getRectangle(i)):t.prototype.getLocalBounds.call(this,i)},h.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,o);var e=this._texture.orig.width,i=this._texture.orig.height,r=-e*this.anchor.x,s=0;return o.x>=r&&o.x<r+e&&(s=-i*this.anchor.y,o.y>=s&&o.y<s+i)},h.prototype.destroy=function(e){if(t.prototype.destroy.call(this,e),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null,"boolean"==typeof e?e:e&&e.texture){var i="boolean"==typeof e?e:e&&e.baseTexture;this._texture.destroy(!!i)}this._texture=null,this.shader=null},h.from=function(t,e){return new h(t instanceof r.Texture?t:new r.Texture.from(t,e))},u.roundPixels.set=function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},u.roundPixels.get=function(){return this._roundPixels},u.width.get=function(){return Math.abs(this.scale.x)*this._texture.orig.width},u.width.set=function(t){var e=i.sign(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t},u.height.get=function(){return Math.abs(this.scale.y)*this._texture.orig.height},u.height.set=function(t){var e=i.sign(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t},u.anchor.get=function(){return this._anchor},u.anchor.set=function(t){this._anchor.copyFrom(t)},u.tint.get=function(){return this._tint},u.tint.set=function(t){this._tint=t,this._tintRGB=(t>>16)+(65280&t)+((255&t)<<16)},u.texture.get=function(){return this._texture},u.texture.set=function(t){this._texture!==t&&(this._texture=t||r.Texture.EMPTY,this.cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},Object.defineProperties(h.prototype,u),h}(h.Container);return t.Sprite=u,t}({},PIXI,PIXI.utils,PIXI,PIXI,PIXI,PIXI);Object.assign(this.PIXI,_pixi_sprite); | ||
this.PIXI=this.PIXI||{};var _pixi_sprite=function(t,e,i,r,s,h,n){"use strict";var o=new e.Point,a=new Uint16Array([0,1,2,0,2,3]),u=function(t){function h(i){t.call(this),this._anchor=new e.ObservablePoint(this._onAnchorUpdate,this,i?i.defaultAnchor.x:0,i?i.defaultAnchor.y:0),this._texture=null,this._width=0,this._height=0,this._tint=null,this._tintRGB=null,this.tint=16777215,this.blendMode=s.BLEND_MODES.NORMAL,this.shader=null,this._cachedTint=16777215,this.uvs=null,this.texture=i||r.Texture.EMPTY,this.vertexData=new Float32Array(8),this.vertexTrimmedData=null,this._transformID=-1,this._textureID=-1,this._transformTrimmedID=-1,this._textureTrimmedID=-1,this.indices=a,this.size=4,this.start=0,this.pluginName="batch",this.isSprite=!0,this._roundPixels=n.settings.ROUND_PIXELS}t&&(h.__proto__=t),h.prototype=Object.create(t&&t.prototype),h.prototype.constructor=h;var u={roundPixels:{configurable:!0},width:{configurable:!0},height:{configurable:!0},anchor:{configurable:!0},tint:{configurable:!0},texture:{configurable:!0}};return h.prototype._onTextureUpdate=function(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this._width&&(this.scale.x=i.sign(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=i.sign(this.scale.y)*this._height/this._texture.orig.height)},h.prototype._onAnchorUpdate=function(){this._transformID=-1,this._transformTrimmedID=-1},h.prototype.calculateVertices=function(){var t=this._texture;if(this._transformID!==this.transform._worldID||this._textureID!==t._updateID){this._transformID=this.transform._worldID,this._textureID=t._updateID;var e=this.transform.worldTransform,i=e.a,r=e.b,s=e.c,h=e.d,n=e.tx,o=e.ty,a=this.vertexData,u=t.trim,_=t.orig,c=this._anchor,d=0,l=0,x=0,f=0;if(u?(d=(l=u.x-c._x*_.width)+u.width,x=(f=u.y-c._y*_.height)+u.height):(d=(l=-c._x*_.width)+_.width,x=(f=-c._y*_.height)+_.height),a[0]=i*l+s*f+n,a[1]=h*f+r*l+o,a[2]=i*d+s*f+n,a[3]=h*f+r*d+o,a[4]=i*d+s*x+n,a[5]=h*x+r*d+o,a[6]=i*l+s*x+n,a[7]=h*x+r*l+o,this._roundPixels)for(var g=0;g<8;g++)a[g]=Math.round(a[g])}},h.prototype.calculateTrimmedVertices=function(){if(this.vertexTrimmedData){if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return}else this.vertexTrimmedData=new Float32Array(8);this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;var t=this._texture,e=this.vertexTrimmedData,i=t.orig,r=this._anchor,s=this.transform.worldTransform,h=s.a,n=s.b,o=s.c,a=s.d,u=s.tx,_=s.ty,c=-r._x*i.width,d=c+i.width,l=-r._y*i.height,x=l+i.height;e[0]=h*c+o*l+u,e[1]=a*l+n*c+_,e[2]=h*d+o*l+u,e[3]=a*l+n*d+_,e[4]=h*d+o*x+u,e[5]=a*x+n*d+_,e[6]=h*c+o*x+u,e[7]=a*x+n*c+_},h.prototype._render=function(t){this.calculateVertices(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this)},h.prototype._calculateBounds=function(){var t=this._texture.trim,e=this._texture.orig;!t||t.width===e.width&&t.height===e.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))},h.prototype.getLocalBounds=function(i){return 0===this.children.length?(this._bounds.minX=this._texture.orig.width*-this._anchor._x,this._bounds.minY=this._texture.orig.height*-this._anchor._y,this._bounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._bounds.maxY=this._texture.orig.height*(1-this._anchor._y),i||(this._localBoundsRect||(this._localBoundsRect=new e.Rectangle),i=this._localBoundsRect),this._bounds.getRectangle(i)):t.prototype.getLocalBounds.call(this,i)},h.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,o);var e=this._texture.orig.width,i=this._texture.orig.height,r=-e*this.anchor.x,s=0;return o.x>=r&&o.x<r+e&&(s=-i*this.anchor.y,o.y>=s&&o.y<s+i)},h.prototype.destroy=function(e){if(t.prototype.destroy.call(this,e),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null,"boolean"==typeof e?e:e&&e.texture){var i="boolean"==typeof e?e:e&&e.baseTexture;this._texture.destroy(!!i)}this._texture=null,this.shader=null},h.from=function(t,e){return new h(t instanceof r.Texture?t:r.Texture.from(t,e))},u.roundPixels.set=function(t){this._roundPixels!==t&&(this._transformID=-1),this._roundPixels=t},u.roundPixels.get=function(){return this._roundPixels},u.width.get=function(){return Math.abs(this.scale.x)*this._texture.orig.width},u.width.set=function(t){var e=i.sign(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t},u.height.get=function(){return Math.abs(this.scale.y)*this._texture.orig.height},u.height.set=function(t){var e=i.sign(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t},u.anchor.get=function(){return this._anchor},u.anchor.set=function(t){this._anchor.copyFrom(t)},u.tint.get=function(){return this._tint},u.tint.set=function(t){this._tint=t,this._tintRGB=(t>>16)+(65280&t)+((255&t)<<16)},u.texture.get=function(){return this._texture},u.texture.set=function(t){this._texture!==t&&(this._texture=t||r.Texture.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},Object.defineProperties(h.prototype,u),h}(h.Container);return t.Sprite=u,t}({},PIXI,PIXI.utils,PIXI,PIXI,PIXI,PIXI);Object.assign(this.PIXI,_pixi_sprite); | ||
//# sourceMappingURL=sprite.min.js.map |
/*! | ||
* @pixi/sprite - v5.0.3 | ||
* Compiled Sun, 19 May 2019 19:03:31 UTC | ||
* @pixi/sprite - v5.0.4 | ||
* Compiled Fri, 07 Jun 2019 17:17:49 UTC | ||
* | ||
@@ -24,3 +24,3 @@ * @pixi/sprite is licensed under the MIT License. | ||
* ```js | ||
* let sprite = new PIXI.Sprite.from('assets/image.png'); | ||
* let sprite = PIXI.Sprite.from('assets/image.png'); | ||
* ``` | ||
@@ -121,9 +121,10 @@ * | ||
/** | ||
* An internal cached value of the tint. | ||
* Cached tint value so we can tell when the tint is changed. | ||
* Value is used for 2d CanvasRenderer. | ||
* | ||
* @private | ||
* @protected | ||
* @member {number} | ||
* @default 0xFFFFFF | ||
*/ | ||
this.cachedTint = 0xFFFFFF; | ||
this._cachedTint = 0xFFFFFF; | ||
@@ -202,3 +203,3 @@ this.uvs = null; | ||
this._textureTrimmedID = -1; | ||
this.cachedTint = 0xFFFFFF; | ||
this._cachedTint = 0xFFFFFF; | ||
@@ -509,3 +510,3 @@ this.uvs = this._texture._uvs.uvsFloat32; | ||
? source | ||
: new Texture.from(source, options); | ||
: Texture.from(source, options); | ||
@@ -638,3 +639,3 @@ return new Sprite(texture); | ||
this._texture = value || Texture.EMPTY; | ||
this.cachedTint = 0xFFFFFF; | ||
this._cachedTint = 0xFFFFFF; | ||
@@ -641,0 +642,0 @@ this._textureID = -1; |
/*! | ||
* @pixi/sprite - v5.0.3 | ||
* Compiled Sun, 19 May 2019 19:03:31 UTC | ||
* @pixi/sprite - v5.0.4 | ||
* Compiled Fri, 07 Jun 2019 17:17:49 UTC | ||
* | ||
@@ -28,3 +28,3 @@ * @pixi/sprite is licensed under the MIT License. | ||
* ```js | ||
* let sprite = new PIXI.Sprite.from('assets/image.png'); | ||
* let sprite = PIXI.Sprite.from('assets/image.png'); | ||
* ``` | ||
@@ -125,9 +125,10 @@ * | ||
/** | ||
* An internal cached value of the tint. | ||
* Cached tint value so we can tell when the tint is changed. | ||
* Value is used for 2d CanvasRenderer. | ||
* | ||
* @private | ||
* @protected | ||
* @member {number} | ||
* @default 0xFFFFFF | ||
*/ | ||
this.cachedTint = 0xFFFFFF; | ||
this._cachedTint = 0xFFFFFF; | ||
@@ -206,3 +207,3 @@ this.uvs = null; | ||
this._textureTrimmedID = -1; | ||
this.cachedTint = 0xFFFFFF; | ||
this._cachedTint = 0xFFFFFF; | ||
@@ -513,3 +514,3 @@ this.uvs = this._texture._uvs.uvsFloat32; | ||
? source | ||
: new core.Texture.from(source, options); | ||
: core.Texture.from(source, options); | ||
@@ -642,3 +643,3 @@ return new Sprite(texture); | ||
this._texture = value || core.Texture.EMPTY; | ||
this.cachedTint = 0xFFFFFF; | ||
this._cachedTint = 0xFFFFFF; | ||
@@ -645,0 +646,0 @@ this._textureID = -1; |
{ | ||
"name": "@pixi/sprite", | ||
"version": "5.0.3", | ||
"version": "5.0.4", | ||
"main": "lib/sprite.js", | ||
@@ -30,8 +30,8 @@ "module": "lib/sprite.es.js", | ||
"dependencies": { | ||
"@pixi/constants": "^5.0.3", | ||
"@pixi/core": "^5.0.3", | ||
"@pixi/display": "^5.0.3", | ||
"@pixi/math": "^5.0.3", | ||
"@pixi/settings": "^5.0.3", | ||
"@pixi/utils": "^5.0.3" | ||
"@pixi/constants": "^5.0.4", | ||
"@pixi/core": "^5.0.4", | ||
"@pixi/display": "^5.0.4", | ||
"@pixi/math": "^5.0.4", | ||
"@pixi/settings": "^5.0.4", | ||
"@pixi/utils": "^5.0.4" | ||
}, | ||
@@ -41,3 +41,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "ba03f57001cd8bae3ae3644911cd513c68184e7c" | ||
"gitHead": "7a771ca5f05eeba62222b53446d0c2bdfcac37f7" | ||
} |
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
186007
1730
Updated@pixi/constants@^5.0.4
Updated@pixi/core@^5.0.4
Updated@pixi/display@^5.0.4
Updated@pixi/math@^5.0.4
Updated@pixi/settings@^5.0.4
Updated@pixi/utils@^5.0.4