Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pixi/sprite-tiling

Package Overview
Dependencies
Maintainers
1
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pixi/sprite-tiling - npm Package Compare versions

Comparing version 5.4.0-rc.3 to 6.0.0-rc

36

dist/browser/sprite-tiling.js
/*!
* @pixi/sprite-tiling - v5.4.0-rc.3
* Compiled Thu, 10 Dec 2020 03:22:17 UTC
* @pixi/sprite-tiling - v6.0.0-rc
* Compiled Tue, 29 Dec 2020 19:58:03 UTC
*

@@ -9,3 +9,3 @@ * @pixi/sprite-tiling is licensed under the MIT License.

this.PIXI = this.PIXI || {};
var _pixi_sprite_tiling = (function (exports, core, math, sprite, utils, constants) {
var _pixi_sprite_tiling = (function (exports, core, math, sprite, constants, utils) {
'use strict';

@@ -206,3 +206,3 @@

/**
* A tiling sprite is a fast way of rendering a tiling image
* A tiling sprite is a fast way of rendering a tiling image.
*

@@ -259,4 +259,8 @@ * @class

/**
* Whether or not anchor affects uvs
* Flags whether the tiling pattern should originate from the origin instead of the top-left corner in
* local space.
*
* This will make the texture coordinates assigned to each vertex dependent on the value of the anchor. Without
* this, the top-left corner always gets the (0, 0) texture coordinate.
*
* @member {boolean}

@@ -423,8 +427,2 @@ * @default false

TilingSprite.from = function (source, options) {
// Deprecated
if (typeof options === 'number') {
utils.deprecation('5.3.0', 'TilingSprite.from use options instead of width and height args');
// eslint-disable-next-line prefer-rest-params
options = { width: options, height: arguments[2] };
}
return new TilingSprite(core.Texture.from(source, options), options.width, options.height);

@@ -513,9 +511,9 @@ };

vertices[5] = vertices[7] = ts._height * (1.0 - ts.anchor.y);
if (ts.uvRespectAnchor) {
vertices = quad.uvs;
vertices[0] = vertices[6] = -ts.anchor.x;
vertices[1] = vertices[3] = -ts.anchor.y;
vertices[2] = vertices[4] = 1.0 - ts.anchor.x;
vertices[5] = vertices[7] = 1.0 - ts.anchor.y;
}
var anchorX = ts.uvRespectAnchor ? ts.anchor.x : 0;
var anchorY = ts.uvRespectAnchor ? ts.anchor.y : 0;
vertices = quad.uvs;
vertices[0] = vertices[6] = -anchorX;
vertices[1] = vertices[3] = -anchorY;
vertices[2] = vertices[4] = 1.0 - anchorX;
vertices[5] = vertices[7] = 1.0 - anchorY;
quad.invalidate();

@@ -577,4 +575,4 @@ var tex = ts._texture;

}({}, PIXI, PIXI, PIXI, PIXI.utils, PIXI));
}({}, PIXI, PIXI, PIXI, PIXI, PIXI.utils));
Object.assign(this.PIXI, _pixi_sprite_tiling);
//# sourceMappingURL=sprite-tiling.js.map
/*!
* @pixi/sprite-tiling - v5.4.0-rc.3
* Compiled Thu, 10 Dec 2020 03:22:17 UTC
* @pixi/sprite-tiling - v6.0.0-rc
* Compiled Tue, 29 Dec 2020 19:58:03 UTC
*

@@ -8,3 +8,3 @@ * @pixi/sprite-tiling is licensed under the MIT License.

*/
this.PIXI=this.PIXI||{};var _pixi_sprite_tiling=function(t,r,e,n,o,i){"use strict";var a=function(t,r){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(t,r)};function s(t,r){function e(){this.constructor=t}a(t,r),t.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)}var u=new e.Point,h=function(t){function n(n,o,i){void 0===o&&(o=100),void 0===i&&(i=100);var a=t.call(this,n)||this;return a.tileTransform=new e.Transform,a._width=o,a._height=i,a.uvMatrix=a.texture.uvMatrix||new r.TextureMatrix(n),a.pluginName="tilingSprite",a.uvRespectAnchor=!1,a}return s(n,t),Object.defineProperty(n.prototype,"clampMargin",{get:function(){return this.uvMatrix.clampMargin},set:function(t){this.uvMatrix.clampMargin=t,this.uvMatrix.update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"tileScale",{get:function(){return this.tileTransform.scale},set:function(t){this.tileTransform.scale.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"tilePosition",{get:function(){return this.tileTransform.position},set:function(t){this.tileTransform.position.copyFrom(t)},enumerable:!1,configurable:!0}),n.prototype._onTextureUpdate=function(){this.uvMatrix&&(this.uvMatrix.texture=this._texture),this._cachedTint=16777215},n.prototype._render=function(t){var r=this._texture;r&&r.valid&&(this.tileTransform.updateLocalTransform(),this.uvMatrix.update(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this))},n.prototype._calculateBounds=function(){var t=this._width*-this._anchor._x,r=this._height*-this._anchor._y,e=this._width*(1-this._anchor._x),n=this._height*(1-this._anchor._y);this._bounds.addFrame(this.transform,t,r,e,n)},n.prototype.getLocalBounds=function(r){return 0===this.children.length?(this._bounds.minX=this._width*-this._anchor._x,this._bounds.minY=this._height*-this._anchor._y,this._bounds.maxX=this._width*(1-this._anchor._x),this._bounds.maxY=this._height*(1-this._anchor._y),r||(this._localBoundsRect||(this._localBoundsRect=new e.Rectangle),r=this._localBoundsRect),this._bounds.getRectangle(r)):t.prototype.getLocalBounds.call(this,r)},n.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,u);var r=this._width,e=this._height,n=-r*this.anchor._x;if(u.x>=n&&u.x<n+r){var o=-e*this.anchor._y;if(u.y>=o&&u.y<o+e)return!0}return!1},n.prototype.destroy=function(r){t.prototype.destroy.call(this,r),this.tileTransform=null,this.uvMatrix=null},n.from=function(t,e){return"number"==typeof e&&(e={width:e,height:arguments[2]}),new n(r.Texture.from(t,e),e.width,e.height)},Object.defineProperty(n.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!1,configurable:!0}),n}(n.Sprite),c="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n",l="varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n vec4 texSample = texture2D(uSampler, coord);\n gl_FragColor = texSample * uColor;\n}\n",d="varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\n\nvoid main(void)\n{\n vec4 sample = texture2D(uSampler, vTextureCoord);\n gl_FragColor = sample * uColor;\n}\n",p=new e.Matrix,m=function(t){function e(e){var n=t.call(this,e)||this,o={globals:n.renderer.globalUniforms};return n.shader=r.Shader.from(c,l,o),n.simpleShader=r.Shader.from(c,d,o),n.quad=new r.QuadUv,n.state=r.State.for2d(),n}return s(e,t),e.prototype.render=function(t){var r=this.renderer,e=this.quad,n=e.vertices;n[0]=n[6]=t._width*-t.anchor.x,n[1]=n[3]=t._height*-t.anchor.y,n[2]=n[4]=t._width*(1-t.anchor.x),n[5]=n[7]=t._height*(1-t.anchor.y),t.uvRespectAnchor&&((n=e.uvs)[0]=n[6]=-t.anchor.x,n[1]=n[3]=-t.anchor.y,n[2]=n[4]=1-t.anchor.x,n[5]=n[7]=1-t.anchor.y),e.invalidate();var a=t._texture,s=a.baseTexture,u=t.tileTransform.localTransform,h=t.uvMatrix,c=s.isPowerOfTwo&&a.frame.width===s.width&&a.frame.height===s.height;c&&(s._glTextures[r.CONTEXT_UID]?c=s.wrapMode!==o.WRAP_MODES.CLAMP:s.wrapMode===o.WRAP_MODES.CLAMP&&(s.wrapMode=o.WRAP_MODES.REPEAT));var l=c?this.simpleShader:this.shader,d=a.width,m=a.height,f=t._width,_=t._height;p.set(u.a*d/f,u.b*d/_,u.c*m/f,u.d*m/_,u.tx/f,u.ty/_),p.invert(),c?p.prepend(h.mapCoord):(l.uniforms.uMapCoord=h.mapCoord.toArray(!0),l.uniforms.uClampFrame=h.uClampFrame,l.uniforms.uClampOffset=h.uClampOffset),l.uniforms.uTransform=p.toArray(!0),l.uniforms.uColor=i.premultiplyTintToRgba(t.tint,t.worldAlpha,l.uniforms.uColor,s.alphaMode),l.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),l.uniforms.uSampler=a,r.shader.bind(l),r.geometry.bind(e),this.state.blendMode=i.correctBlendMode(t.blendMode,s.alphaMode),r.state.set(this.state),r.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},e}(r.ObjectRenderer);return t.TilingSprite=h,t.TilingSpriteRenderer=m,t}({},PIXI,PIXI,PIXI,PIXI,PIXI.utils);Object.assign(this.PIXI,_pixi_sprite_tiling);
this.PIXI=this.PIXI||{};var _pixi_sprite_tiling=function(t,r,e,n,o,i){"use strict";var a=function(t,r){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(t,r)};function s(t,r){function e(){this.constructor=t}a(t,r),t.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)}var u=new e.Point,h=function(t){function n(n,o,i){void 0===o&&(o=100),void 0===i&&(i=100);var a=t.call(this,n)||this;return a.tileTransform=new e.Transform,a._width=o,a._height=i,a.uvMatrix=a.texture.uvMatrix||new r.TextureMatrix(n),a.pluginName="tilingSprite",a.uvRespectAnchor=!1,a}return s(n,t),Object.defineProperty(n.prototype,"clampMargin",{get:function(){return this.uvMatrix.clampMargin},set:function(t){this.uvMatrix.clampMargin=t,this.uvMatrix.update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"tileScale",{get:function(){return this.tileTransform.scale},set:function(t){this.tileTransform.scale.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"tilePosition",{get:function(){return this.tileTransform.position},set:function(t){this.tileTransform.position.copyFrom(t)},enumerable:!1,configurable:!0}),n.prototype._onTextureUpdate=function(){this.uvMatrix&&(this.uvMatrix.texture=this._texture),this._cachedTint=16777215},n.prototype._render=function(t){var r=this._texture;r&&r.valid&&(this.tileTransform.updateLocalTransform(),this.uvMatrix.update(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this))},n.prototype._calculateBounds=function(){var t=this._width*-this._anchor._x,r=this._height*-this._anchor._y,e=this._width*(1-this._anchor._x),n=this._height*(1-this._anchor._y);this._bounds.addFrame(this.transform,t,r,e,n)},n.prototype.getLocalBounds=function(r){return 0===this.children.length?(this._bounds.minX=this._width*-this._anchor._x,this._bounds.minY=this._height*-this._anchor._y,this._bounds.maxX=this._width*(1-this._anchor._x),this._bounds.maxY=this._height*(1-this._anchor._y),r||(this._localBoundsRect||(this._localBoundsRect=new e.Rectangle),r=this._localBoundsRect),this._bounds.getRectangle(r)):t.prototype.getLocalBounds.call(this,r)},n.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,u);var r=this._width,e=this._height,n=-r*this.anchor._x;if(u.x>=n&&u.x<n+r){var o=-e*this.anchor._y;if(u.y>=o&&u.y<o+e)return!0}return!1},n.prototype.destroy=function(r){t.prototype.destroy.call(this,r),this.tileTransform=null,this.uvMatrix=null},n.from=function(t,e){return new n(r.Texture.from(t,e),e.width,e.height)},Object.defineProperty(n.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!1,configurable:!0}),n}(n.Sprite),c="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n",l="varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n vec4 texSample = texture2D(uSampler, coord);\n gl_FragColor = texSample * uColor;\n}\n",d="varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\n\nvoid main(void)\n{\n vec4 sample = texture2D(uSampler, vTextureCoord);\n gl_FragColor = sample * uColor;\n}\n",p=new e.Matrix,m=function(t){function e(e){var n=t.call(this,e)||this,o={globals:n.renderer.globalUniforms};return n.shader=r.Shader.from(c,l,o),n.simpleShader=r.Shader.from(c,d,o),n.quad=new r.QuadUv,n.state=r.State.for2d(),n}return s(e,t),e.prototype.render=function(t){var r=this.renderer,e=this.quad,n=e.vertices;n[0]=n[6]=t._width*-t.anchor.x,n[1]=n[3]=t._height*-t.anchor.y,n[2]=n[4]=t._width*(1-t.anchor.x),n[5]=n[7]=t._height*(1-t.anchor.y);var a=t.uvRespectAnchor?t.anchor.x:0,s=t.uvRespectAnchor?t.anchor.y:0;(n=e.uvs)[0]=n[6]=-a,n[1]=n[3]=-s,n[2]=n[4]=1-a,n[5]=n[7]=1-s,e.invalidate();var u=t._texture,h=u.baseTexture,c=t.tileTransform.localTransform,l=t.uvMatrix,d=h.isPowerOfTwo&&u.frame.width===h.width&&u.frame.height===h.height;d&&(h._glTextures[r.CONTEXT_UID]?d=h.wrapMode!==o.WRAP_MODES.CLAMP:h.wrapMode===o.WRAP_MODES.CLAMP&&(h.wrapMode=o.WRAP_MODES.REPEAT));var m=d?this.simpleShader:this.shader,f=u.width,_=u.height,v=t._width,g=t._height;p.set(c.a*f/v,c.b*f/g,c.c*_/v,c.d*_/g,c.tx/v,c.ty/g),p.invert(),d?p.prepend(l.mapCoord):(m.uniforms.uMapCoord=l.mapCoord.toArray(!0),m.uniforms.uClampFrame=l.uClampFrame,m.uniforms.uClampOffset=l.uClampOffset),m.uniforms.uTransform=p.toArray(!0),m.uniforms.uColor=i.premultiplyTintToRgba(t.tint,t.worldAlpha,m.uniforms.uColor,h.alphaMode),m.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),m.uniforms.uSampler=u,r.shader.bind(m),r.geometry.bind(e),this.state.blendMode=i.correctBlendMode(t.blendMode,h.alphaMode),r.state.set(this.state),r.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},e}(r.ObjectRenderer);return t.TilingSprite=h,t.TilingSpriteRenderer=m,t}({},PIXI,PIXI,PIXI,PIXI,PIXI.utils);Object.assign(this.PIXI,_pixi_sprite_tiling);
//# sourceMappingURL=sprite-tiling.min.js.map
/*!
* @pixi/sprite-tiling - v5.4.0-rc.3
* Compiled Thu, 10 Dec 2020 03:22:17 UTC
* @pixi/sprite-tiling - v6.0.0-rc
* Compiled Tue, 29 Dec 2020 19:58:03 UTC
*

@@ -15,4 +15,4 @@ * @pixi/sprite-tiling is licensed under the MIT License.

var sprite = require('@pixi/sprite');
var constants = require('@pixi/constants');
var utils = require('@pixi/utils');
var constants = require('@pixi/constants');

@@ -50,3 +50,3 @@ /*! *****************************************************************************

/**
* A tiling sprite is a fast way of rendering a tiling image
* A tiling sprite is a fast way of rendering a tiling image.
*

@@ -103,4 +103,8 @@ * @class

/**
* Whether or not anchor affects uvs
* Flags whether the tiling pattern should originate from the origin instead of the top-left corner in
* local space.
*
* This will make the texture coordinates assigned to each vertex dependent on the value of the anchor. Without
* this, the top-left corner always gets the (0, 0) texture coordinate.
*
* @member {boolean}

@@ -267,8 +271,2 @@ * @default false

TilingSprite.from = function (source, options) {
// Deprecated
if (typeof options === 'number') {
utils.deprecation('5.3.0', 'TilingSprite.from use options instead of width and height args');
// eslint-disable-next-line prefer-rest-params
options = { width: options, height: arguments[2] };
}
return new TilingSprite(core.Texture.from(source, options), options.width, options.height);

@@ -357,9 +355,9 @@ };

vertices[5] = vertices[7] = ts._height * (1.0 - ts.anchor.y);
if (ts.uvRespectAnchor) {
vertices = quad.uvs;
vertices[0] = vertices[6] = -ts.anchor.x;
vertices[1] = vertices[3] = -ts.anchor.y;
vertices[2] = vertices[4] = 1.0 - ts.anchor.x;
vertices[5] = vertices[7] = 1.0 - ts.anchor.y;
}
var anchorX = ts.uvRespectAnchor ? ts.anchor.x : 0;
var anchorY = ts.uvRespectAnchor ? ts.anchor.y : 0;
vertices = quad.uvs;
vertices[0] = vertices[6] = -anchorX;
vertices[1] = vertices[3] = -anchorY;
vertices[2] = vertices[4] = 1.0 - anchorX;
vertices[5] = vertices[7] = 1.0 - anchorY;
quad.invalidate();

@@ -366,0 +364,0 @@ var tex = ts._texture;

/*!
* @pixi/sprite-tiling - v5.4.0-rc.3
* Compiled Thu, 10 Dec 2020 03:22:17 UTC
* @pixi/sprite-tiling - v6.0.0-rc
* Compiled Tue, 29 Dec 2020 19:58:03 UTC
*

@@ -8,3 +8,3 @@ * @pixi/sprite-tiling is licensed under the MIT License.

*/
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@pixi/core"),math=require("@pixi/math"),sprite=require("@pixi/sprite"),constants=require("@pixi/constants"),utils=require("@pixi/utils"),extendStatics=function(t,e){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function __extends(t,e){function r(){this.constructor=t}extendStatics(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var tempPoint=new math.Point,TilingSprite=function(t){function e(e,r,i){void 0===r&&(r=100),void 0===i&&(i=100);var n=t.call(this,e)||this;return n.tileTransform=new math.Transform,n._width=r,n._height=i,n.uvMatrix=n.texture.uvMatrix||new core.TextureMatrix(e),n.pluginName="tilingSprite",n.uvRespectAnchor=!1,n}return __extends(e,t),Object.defineProperty(e.prototype,"clampMargin",{get:function(){return this.uvMatrix.clampMargin},set:function(t){this.uvMatrix.clampMargin=t,this.uvMatrix.update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tileScale",{get:function(){return this.tileTransform.scale},set:function(t){this.tileTransform.scale.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tilePosition",{get:function(){return this.tileTransform.position},set:function(t){this.tileTransform.position.copyFrom(t)},enumerable:!1,configurable:!0}),e.prototype._onTextureUpdate=function(){this.uvMatrix&&(this.uvMatrix.texture=this._texture),this._cachedTint=16777215},e.prototype._render=function(t){var e=this._texture;e&&e.valid&&(this.tileTransform.updateLocalTransform(),this.uvMatrix.update(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this))},e.prototype._calculateBounds=function(){var t=this._width*-this._anchor._x,e=this._height*-this._anchor._y,r=this._width*(1-this._anchor._x),i=this._height*(1-this._anchor._y);this._bounds.addFrame(this.transform,t,e,r,i)},e.prototype.getLocalBounds=function(e){return 0===this.children.length?(this._bounds.minX=this._width*-this._anchor._x,this._bounds.minY=this._height*-this._anchor._y,this._bounds.maxX=this._width*(1-this._anchor._x),this._bounds.maxY=this._height*(1-this._anchor._y),e||(this._localBoundsRect||(this._localBoundsRect=new math.Rectangle),e=this._localBoundsRect),this._bounds.getRectangle(e)):t.prototype.getLocalBounds.call(this,e)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,tempPoint);var e=this._width,r=this._height,i=-e*this.anchor._x;if(tempPoint.x>=i&&tempPoint.x<i+e){var n=-r*this.anchor._y;if(tempPoint.y>=n&&tempPoint.y<n+r)return!0}return!1},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.tileTransform=null,this.uvMatrix=null},e.from=function(t,r){return"number"==typeof r&&(r={width:r,height:arguments[2]}),new e(core.Texture.from(t,r),r.width,r.height)},Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!1,configurable:!0}),e}(sprite.Sprite),vertex="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n",fragment="varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n vec4 texSample = texture2D(uSampler, coord);\n gl_FragColor = texSample * uColor;\n}\n",fragmentSimple="varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\n\nvoid main(void)\n{\n vec4 sample = texture2D(uSampler, vTextureCoord);\n gl_FragColor = sample * uColor;\n}\n",tempMat=new math.Matrix,TilingSpriteRenderer=function(t){function e(e){var r=t.call(this,e)||this,i={globals:r.renderer.globalUniforms};return r.shader=core.Shader.from(vertex,fragment,i),r.simpleShader=core.Shader.from(vertex,fragmentSimple,i),r.quad=new core.QuadUv,r.state=core.State.for2d(),r}return __extends(e,t),e.prototype.render=function(t){var e=this.renderer,r=this.quad,i=r.vertices;i[0]=i[6]=t._width*-t.anchor.x,i[1]=i[3]=t._height*-t.anchor.y,i[2]=i[4]=t._width*(1-t.anchor.x),i[5]=i[7]=t._height*(1-t.anchor.y),t.uvRespectAnchor&&((i=r.uvs)[0]=i[6]=-t.anchor.x,i[1]=i[3]=-t.anchor.y,i[2]=i[4]=1-t.anchor.x,i[5]=i[7]=1-t.anchor.y),r.invalidate();var n=t._texture,o=n.baseTexture,a=t.tileTransform.localTransform,s=t.uvMatrix,u=o.isPowerOfTwo&&n.frame.width===o.width&&n.frame.height===o.height;u&&(o._glTextures[e.CONTEXT_UID]?u=o.wrapMode!==constants.WRAP_MODES.CLAMP:o.wrapMode===constants.WRAP_MODES.CLAMP&&(o.wrapMode=constants.WRAP_MODES.REPEAT));var h=u?this.simpleShader:this.shader,c=n.width,p=n.height,l=t._width,m=t._height;tempMat.set(a.a*c/l,a.b*c/m,a.c*p/l,a.d*p/m,a.tx/l,a.ty/m),tempMat.invert(),u?tempMat.prepend(s.mapCoord):(h.uniforms.uMapCoord=s.mapCoord.toArray(!0),h.uniforms.uClampFrame=s.uClampFrame,h.uniforms.uClampOffset=s.uClampOffset),h.uniforms.uTransform=tempMat.toArray(!0),h.uniforms.uColor=utils.premultiplyTintToRgba(t.tint,t.worldAlpha,h.uniforms.uColor,o.alphaMode),h.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),h.uniforms.uSampler=n,e.shader.bind(h),e.geometry.bind(r),this.state.blendMode=utils.correctBlendMode(t.blendMode,o.alphaMode),e.state.set(this.state),e.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},e}(core.ObjectRenderer);exports.TilingSprite=TilingSprite,exports.TilingSpriteRenderer=TilingSpriteRenderer;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var core=require("@pixi/core"),math=require("@pixi/math"),sprite=require("@pixi/sprite"),constants=require("@pixi/constants"),utils=require("@pixi/utils"),extendStatics=function(t,e){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function __extends(t,e){function r(){this.constructor=t}extendStatics(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var tempPoint=new math.Point,TilingSprite=function(t){function e(e,r,i){void 0===r&&(r=100),void 0===i&&(i=100);var n=t.call(this,e)||this;return n.tileTransform=new math.Transform,n._width=r,n._height=i,n.uvMatrix=n.texture.uvMatrix||new core.TextureMatrix(e),n.pluginName="tilingSprite",n.uvRespectAnchor=!1,n}return __extends(e,t),Object.defineProperty(e.prototype,"clampMargin",{get:function(){return this.uvMatrix.clampMargin},set:function(t){this.uvMatrix.clampMargin=t,this.uvMatrix.update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tileScale",{get:function(){return this.tileTransform.scale},set:function(t){this.tileTransform.scale.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tilePosition",{get:function(){return this.tileTransform.position},set:function(t){this.tileTransform.position.copyFrom(t)},enumerable:!1,configurable:!0}),e.prototype._onTextureUpdate=function(){this.uvMatrix&&(this.uvMatrix.texture=this._texture),this._cachedTint=16777215},e.prototype._render=function(t){var e=this._texture;e&&e.valid&&(this.tileTransform.updateLocalTransform(),this.uvMatrix.update(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this))},e.prototype._calculateBounds=function(){var t=this._width*-this._anchor._x,e=this._height*-this._anchor._y,r=this._width*(1-this._anchor._x),i=this._height*(1-this._anchor._y);this._bounds.addFrame(this.transform,t,e,r,i)},e.prototype.getLocalBounds=function(e){return 0===this.children.length?(this._bounds.minX=this._width*-this._anchor._x,this._bounds.minY=this._height*-this._anchor._y,this._bounds.maxX=this._width*(1-this._anchor._x),this._bounds.maxY=this._height*(1-this._anchor._y),e||(this._localBoundsRect||(this._localBoundsRect=new math.Rectangle),e=this._localBoundsRect),this._bounds.getRectangle(e)):t.prototype.getLocalBounds.call(this,e)},e.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,tempPoint);var e=this._width,r=this._height,i=-e*this.anchor._x;if(tempPoint.x>=i&&tempPoint.x<i+e){var n=-r*this.anchor._y;if(tempPoint.y>=n&&tempPoint.y<n+r)return!0}return!1},e.prototype.destroy=function(e){t.prototype.destroy.call(this,e),this.tileTransform=null,this.uvMatrix=null},e.from=function(t,r){return new e(core.Texture.from(t,r),r.width,r.height)},Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!1,configurable:!0}),e}(sprite.Sprite),vertex="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n",fragment="varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n vec4 texSample = texture2D(uSampler, coord);\n gl_FragColor = texSample * uColor;\n}\n",fragmentSimple="varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\n\nvoid main(void)\n{\n vec4 sample = texture2D(uSampler, vTextureCoord);\n gl_FragColor = sample * uColor;\n}\n",tempMat=new math.Matrix,TilingSpriteRenderer=function(t){function e(e){var r=t.call(this,e)||this,i={globals:r.renderer.globalUniforms};return r.shader=core.Shader.from(vertex,fragment,i),r.simpleShader=core.Shader.from(vertex,fragmentSimple,i),r.quad=new core.QuadUv,r.state=core.State.for2d(),r}return __extends(e,t),e.prototype.render=function(t){var e=this.renderer,r=this.quad,i=r.vertices;i[0]=i[6]=t._width*-t.anchor.x,i[1]=i[3]=t._height*-t.anchor.y,i[2]=i[4]=t._width*(1-t.anchor.x),i[5]=i[7]=t._height*(1-t.anchor.y);var n=t.uvRespectAnchor?t.anchor.x:0,o=t.uvRespectAnchor?t.anchor.y:0;(i=r.uvs)[0]=i[6]=-n,i[1]=i[3]=-o,i[2]=i[4]=1-n,i[5]=i[7]=1-o,r.invalidate();var a=t._texture,s=a.baseTexture,u=t.tileTransform.localTransform,h=t.uvMatrix,c=s.isPowerOfTwo&&a.frame.width===s.width&&a.frame.height===s.height;c&&(s._glTextures[e.CONTEXT_UID]?c=s.wrapMode!==constants.WRAP_MODES.CLAMP:s.wrapMode===constants.WRAP_MODES.CLAMP&&(s.wrapMode=constants.WRAP_MODES.REPEAT));var p=c?this.simpleShader:this.shader,l=a.width,m=a.height,d=t._width,f=t._height;tempMat.set(u.a*l/d,u.b*l/f,u.c*m/d,u.d*m/f,u.tx/d,u.ty/f),tempMat.invert(),c?tempMat.prepend(h.mapCoord):(p.uniforms.uMapCoord=h.mapCoord.toArray(!0),p.uniforms.uClampFrame=h.uClampFrame,p.uniforms.uClampOffset=h.uClampOffset),p.uniforms.uTransform=tempMat.toArray(!0),p.uniforms.uColor=utils.premultiplyTintToRgba(t.tint,t.worldAlpha,p.uniforms.uColor,s.alphaMode),p.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),p.uniforms.uSampler=a,e.shader.bind(p),e.geometry.bind(r),this.state.blendMode=utils.correctBlendMode(t.blendMode,s.alphaMode),e.state.set(this.state),e.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},e}(core.ObjectRenderer);exports.TilingSprite=TilingSprite,exports.TilingSpriteRenderer=TilingSpriteRenderer;
//# sourceMappingURL=sprite-tiling.min.js.map
/*!
* @pixi/sprite-tiling - v5.4.0-rc.3
* Compiled Thu, 10 Dec 2020 03:22:17 UTC
* @pixi/sprite-tiling - v6.0.0-rc
* Compiled Tue, 29 Dec 2020 19:58:03 UTC
*

@@ -11,4 +11,4 @@ * @pixi/sprite-tiling is licensed under the MIT License.

import { Sprite } from '@pixi/sprite';
import { deprecation, premultiplyTintToRgba, correctBlendMode } from '@pixi/utils';
import { WRAP_MODES } from '@pixi/constants';
import { premultiplyTintToRgba, correctBlendMode } from '@pixi/utils';

@@ -46,3 +46,3 @@ /*! *****************************************************************************

/**
* A tiling sprite is a fast way of rendering a tiling image
* A tiling sprite is a fast way of rendering a tiling image.
*

@@ -99,4 +99,8 @@ * @class

/**
* Whether or not anchor affects uvs
* Flags whether the tiling pattern should originate from the origin instead of the top-left corner in
* local space.
*
* This will make the texture coordinates assigned to each vertex dependent on the value of the anchor. Without
* this, the top-left corner always gets the (0, 0) texture coordinate.
*
* @member {boolean}

@@ -263,8 +267,2 @@ * @default false

TilingSprite.from = function (source, options) {
// Deprecated
if (typeof options === 'number') {
deprecation('5.3.0', 'TilingSprite.from use options instead of width and height args');
// eslint-disable-next-line prefer-rest-params
options = { width: options, height: arguments[2] };
}
return new TilingSprite(Texture.from(source, options), options.width, options.height);

@@ -353,9 +351,9 @@ };

vertices[5] = vertices[7] = ts._height * (1.0 - ts.anchor.y);
if (ts.uvRespectAnchor) {
vertices = quad.uvs;
vertices[0] = vertices[6] = -ts.anchor.x;
vertices[1] = vertices[3] = -ts.anchor.y;
vertices[2] = vertices[4] = 1.0 - ts.anchor.x;
vertices[5] = vertices[7] = 1.0 - ts.anchor.y;
}
var anchorX = ts.uvRespectAnchor ? ts.anchor.x : 0;
var anchorY = ts.uvRespectAnchor ? ts.anchor.y : 0;
vertices = quad.uvs;
vertices[0] = vertices[6] = -anchorX;
vertices[1] = vertices[3] = -anchorY;
vertices[2] = vertices[4] = 1.0 - anchorX;
vertices[5] = vertices[7] = 1.0 - anchorY;
quad.invalidate();

@@ -362,0 +360,0 @@ var tex = ts._texture;

/*!
* @pixi/sprite-tiling - v5.4.0-rc.3
* Compiled Thu, 10 Dec 2020 03:22:17 UTC
* @pixi/sprite-tiling - v6.0.0-rc
* Compiled Tue, 29 Dec 2020 19:58:03 UTC
*

@@ -8,3 +8,3 @@ * @pixi/sprite-tiling is licensed under the MIT License.

*/
import{Texture as t,TextureMatrix as r,Shader as e,QuadUv as o,State as i,ObjectRenderer as n}from"@pixi/core";import{Point as a,Rectangle as s,Transform as u,Matrix as h}from"@pixi/math";import{Sprite as c}from"@pixi/sprite";import{WRAP_MODES as l}from"@pixi/constants";import{premultiplyTintToRgba as p,correctBlendMode as m}from"@pixi/utils";var d=function(t,r){return(d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(t,r)};function f(t,r){function e(){this.constructor=t}d(t,r),t.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)}var _=new a,v=function(e){function o(t,o,i){void 0===o&&(o=100),void 0===i&&(i=100);var n=e.call(this,t)||this;return n.tileTransform=new u,n._width=o,n._height=i,n.uvMatrix=n.texture.uvMatrix||new r(t),n.pluginName="tilingSprite",n.uvRespectAnchor=!1,n}return f(o,e),Object.defineProperty(o.prototype,"clampMargin",{get:function(){return this.uvMatrix.clampMargin},set:function(t){this.uvMatrix.clampMargin=t,this.uvMatrix.update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"tileScale",{get:function(){return this.tileTransform.scale},set:function(t){this.tileTransform.scale.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"tilePosition",{get:function(){return this.tileTransform.position},set:function(t){this.tileTransform.position.copyFrom(t)},enumerable:!1,configurable:!0}),o.prototype._onTextureUpdate=function(){this.uvMatrix&&(this.uvMatrix.texture=this._texture),this._cachedTint=16777215},o.prototype._render=function(t){var r=this._texture;r&&r.valid&&(this.tileTransform.updateLocalTransform(),this.uvMatrix.update(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this))},o.prototype._calculateBounds=function(){var t=this._width*-this._anchor._x,r=this._height*-this._anchor._y,e=this._width*(1-this._anchor._x),o=this._height*(1-this._anchor._y);this._bounds.addFrame(this.transform,t,r,e,o)},o.prototype.getLocalBounds=function(t){return 0===this.children.length?(this._bounds.minX=this._width*-this._anchor._x,this._bounds.minY=this._height*-this._anchor._y,this._bounds.maxX=this._width*(1-this._anchor._x),this._bounds.maxY=this._height*(1-this._anchor._y),t||(this._localBoundsRect||(this._localBoundsRect=new s),t=this._localBoundsRect),this._bounds.getRectangle(t)):e.prototype.getLocalBounds.call(this,t)},o.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,_);var r=this._width,e=this._height,o=-r*this.anchor._x;if(_.x>=o&&_.x<o+r){var i=-e*this.anchor._y;if(_.y>=i&&_.y<i+e)return!0}return!1},o.prototype.destroy=function(t){e.prototype.destroy.call(this,t),this.tileTransform=null,this.uvMatrix=null},o.from=function(r,e){return"number"==typeof e&&(e={width:e,height:arguments[2]}),new o(t.from(r,e),e.width,e.height)},Object.defineProperty(o.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!1,configurable:!0}),o}(c),x="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n",g="varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n vec4 texSample = texture2D(uSampler, coord);\n gl_FragColor = texSample * uColor;\n}\n",y="varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\n\nvoid main(void)\n{\n vec4 sample = texture2D(uSampler, vTextureCoord);\n gl_FragColor = sample * uColor;\n}\n",b=new h,w=function(t){function r(r){var n=t.call(this,r)||this,a={globals:n.renderer.globalUniforms};return n.shader=e.from(x,g,a),n.simpleShader=e.from(x,y,a),n.quad=new o,n.state=i.for2d(),n}return f(r,t),r.prototype.render=function(t){var r=this.renderer,e=this.quad,o=e.vertices;o[0]=o[6]=t._width*-t.anchor.x,o[1]=o[3]=t._height*-t.anchor.y,o[2]=o[4]=t._width*(1-t.anchor.x),o[5]=o[7]=t._height*(1-t.anchor.y),t.uvRespectAnchor&&((o=e.uvs)[0]=o[6]=-t.anchor.x,o[1]=o[3]=-t.anchor.y,o[2]=o[4]=1-t.anchor.x,o[5]=o[7]=1-t.anchor.y),e.invalidate();var i=t._texture,n=i.baseTexture,a=t.tileTransform.localTransform,s=t.uvMatrix,u=n.isPowerOfTwo&&i.frame.width===n.width&&i.frame.height===n.height;u&&(n._glTextures[r.CONTEXT_UID]?u=n.wrapMode!==l.CLAMP:n.wrapMode===l.CLAMP&&(n.wrapMode=l.REPEAT));var h=u?this.simpleShader:this.shader,c=i.width,d=i.height,f=t._width,_=t._height;b.set(a.a*c/f,a.b*c/_,a.c*d/f,a.d*d/_,a.tx/f,a.ty/_),b.invert(),u?b.prepend(s.mapCoord):(h.uniforms.uMapCoord=s.mapCoord.toArray(!0),h.uniforms.uClampFrame=s.uClampFrame,h.uniforms.uClampOffset=s.uClampOffset),h.uniforms.uTransform=b.toArray(!0),h.uniforms.uColor=p(t.tint,t.worldAlpha,h.uniforms.uColor,n.alphaMode),h.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),h.uniforms.uSampler=i,r.shader.bind(h),r.geometry.bind(e),this.state.blendMode=m(t.blendMode,n.alphaMode),r.state.set(this.state),r.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},r}(n);export{v as TilingSprite,w as TilingSpriteRenderer};
import{Texture as t,TextureMatrix as r,Shader as e,QuadUv as o,State as i,ObjectRenderer as n}from"@pixi/core";import{Point as a,Rectangle as s,Transform as u,Matrix as h}from"@pixi/math";import{Sprite as c}from"@pixi/sprite";import{WRAP_MODES as l}from"@pixi/constants";import{premultiplyTintToRgba as p,correctBlendMode as m}from"@pixi/utils";var d=function(t,r){return(d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(t,r)};function f(t,r){function e(){this.constructor=t}d(t,r),t.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)}var _=new a,v=function(e){function o(t,o,i){void 0===o&&(o=100),void 0===i&&(i=100);var n=e.call(this,t)||this;return n.tileTransform=new u,n._width=o,n._height=i,n.uvMatrix=n.texture.uvMatrix||new r(t),n.pluginName="tilingSprite",n.uvRespectAnchor=!1,n}return f(o,e),Object.defineProperty(o.prototype,"clampMargin",{get:function(){return this.uvMatrix.clampMargin},set:function(t){this.uvMatrix.clampMargin=t,this.uvMatrix.update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"tileScale",{get:function(){return this.tileTransform.scale},set:function(t){this.tileTransform.scale.copyFrom(t)},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"tilePosition",{get:function(){return this.tileTransform.position},set:function(t){this.tileTransform.position.copyFrom(t)},enumerable:!1,configurable:!0}),o.prototype._onTextureUpdate=function(){this.uvMatrix&&(this.uvMatrix.texture=this._texture),this._cachedTint=16777215},o.prototype._render=function(t){var r=this._texture;r&&r.valid&&(this.tileTransform.updateLocalTransform(),this.uvMatrix.update(),t.batch.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this))},o.prototype._calculateBounds=function(){var t=this._width*-this._anchor._x,r=this._height*-this._anchor._y,e=this._width*(1-this._anchor._x),o=this._height*(1-this._anchor._y);this._bounds.addFrame(this.transform,t,r,e,o)},o.prototype.getLocalBounds=function(t){return 0===this.children.length?(this._bounds.minX=this._width*-this._anchor._x,this._bounds.minY=this._height*-this._anchor._y,this._bounds.maxX=this._width*(1-this._anchor._x),this._bounds.maxY=this._height*(1-this._anchor._y),t||(this._localBoundsRect||(this._localBoundsRect=new s),t=this._localBoundsRect),this._bounds.getRectangle(t)):e.prototype.getLocalBounds.call(this,t)},o.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,_);var r=this._width,e=this._height,o=-r*this.anchor._x;if(_.x>=o&&_.x<o+r){var i=-e*this.anchor._y;if(_.y>=i&&_.y<i+e)return!0}return!1},o.prototype.destroy=function(t){e.prototype.destroy.call(this,t),this.tileTransform=null,this.uvMatrix=null},o.from=function(r,e){return new o(t.from(r,e),e.width,e.height)},Object.defineProperty(o.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!1,configurable:!0}),o}(c),x="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n",g="varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n vec4 texSample = texture2D(uSampler, coord);\n gl_FragColor = texSample * uColor;\n}\n",y="varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\n\nvoid main(void)\n{\n vec4 sample = texture2D(uSampler, vTextureCoord);\n gl_FragColor = sample * uColor;\n}\n",b=new h,w=function(t){function r(r){var n=t.call(this,r)||this,a={globals:n.renderer.globalUniforms};return n.shader=e.from(x,g,a),n.simpleShader=e.from(x,y,a),n.quad=new o,n.state=i.for2d(),n}return f(r,t),r.prototype.render=function(t){var r=this.renderer,e=this.quad,o=e.vertices;o[0]=o[6]=t._width*-t.anchor.x,o[1]=o[3]=t._height*-t.anchor.y,o[2]=o[4]=t._width*(1-t.anchor.x),o[5]=o[7]=t._height*(1-t.anchor.y);var i=t.uvRespectAnchor?t.anchor.x:0,n=t.uvRespectAnchor?t.anchor.y:0;(o=e.uvs)[0]=o[6]=-i,o[1]=o[3]=-n,o[2]=o[4]=1-i,o[5]=o[7]=1-n,e.invalidate();var a=t._texture,s=a.baseTexture,u=t.tileTransform.localTransform,h=t.uvMatrix,c=s.isPowerOfTwo&&a.frame.width===s.width&&a.frame.height===s.height;c&&(s._glTextures[r.CONTEXT_UID]?c=s.wrapMode!==l.CLAMP:s.wrapMode===l.CLAMP&&(s.wrapMode=l.REPEAT));var d=c?this.simpleShader:this.shader,f=a.width,_=a.height,v=t._width,x=t._height;b.set(u.a*f/v,u.b*f/x,u.c*_/v,u.d*_/x,u.tx/v,u.ty/x),b.invert(),c?b.prepend(h.mapCoord):(d.uniforms.uMapCoord=h.mapCoord.toArray(!0),d.uniforms.uClampFrame=h.uClampFrame,d.uniforms.uClampOffset=h.uClampOffset),d.uniforms.uTransform=b.toArray(!0),d.uniforms.uColor=p(t.tint,t.worldAlpha,d.uniforms.uColor,s.alphaMode),d.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),d.uniforms.uSampler=a,r.shader.bind(d),r.geometry.bind(e),this.state.blendMode=m(t.blendMode,s.alphaMode),r.state.set(this.state),r.geometry.draw(this.renderer.gl.TRIANGLES,6,0)},r}(n);export{v as TilingSprite,w as TilingSpriteRenderer};
//# sourceMappingURL=sprite-tiling.min.js.map

@@ -24,3 +24,3 @@ /// <reference path="./global.d.ts" />

/**
* A tiling sprite is a fast way of rendering a tiling image
* A tiling sprite is a fast way of rendering a tiling image.
*

@@ -27,0 +27,0 @@ * @class

{
"name": "@pixi/sprite-tiling",
"version": "5.4.0-rc.3",
"version": "6.0.0-rc",
"main": "dist/cjs/sprite-tiling.js",

@@ -28,10 +28,10 @@ "module": "dist/esm/sprite-tiling.js",

"dependencies": {
"@pixi/constants": "5.4.0-rc.3",
"@pixi/core": "5.4.0-rc.3",
"@pixi/display": "5.4.0-rc.3",
"@pixi/math": "5.4.0-rc.3",
"@pixi/sprite": "5.4.0-rc.3",
"@pixi/utils": "5.4.0-rc.3"
"@pixi/constants": "6.0.0-rc",
"@pixi/core": "6.0.0-rc",
"@pixi/display": "6.0.0-rc",
"@pixi/math": "6.0.0-rc",
"@pixi/sprite": "6.0.0-rc",
"@pixi/utils": "6.0.0-rc"
},
"gitHead": "0c48db94f0521d85cc226fc4b15f69c30d53c765"
"gitHead": "15513755f4d9f2112df5cc261b44f2dc1f05e00c"
}

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc