23 lines
1.3 KiB
JavaScript
23 lines
1.3 KiB
JavaScript
shadow$provide.module$node_modules$pixi_DOT_js$lib$scene$sprite_tiling$utils$setUvs = function(global, require, module, exports) {
|
|
var Matrix = require("module$node_modules$pixi_DOT_js$lib$maths$matrix$Matrix"), applyMatrix = require("module$node_modules$pixi_DOT_js$lib$scene$sprite_tiling$utils$applyMatrix");
|
|
"use strict";
|
|
exports.setUvs = function(tilingSprite, uvs) {
|
|
var texture = tilingSprite.texture;
|
|
const width = texture.frame.width;
|
|
texture = texture.frame.height;
|
|
var anchorX = 0, anchorY = 0;
|
|
tilingSprite.applyAnchorToTexture && (anchorX = tilingSprite.anchor.x, anchorY = tilingSprite.anchor.y);
|
|
uvs[0] = uvs[6] = -anchorX;
|
|
uvs[2] = uvs[4] = 1 - anchorX;
|
|
uvs[1] = uvs[3] = -anchorY;
|
|
uvs[5] = uvs[7] = 1 - anchorY;
|
|
anchorX = tilingSprite._tileTransform.matrix;
|
|
anchorY = Matrix.Matrix.shared;
|
|
anchorY.set(anchorX.a * width / tilingSprite.width, anchorX.b * width / tilingSprite.height, anchorX.c * texture / tilingSprite.width, anchorX.d * texture / tilingSprite.height, anchorX.tx / tilingSprite.width, anchorX.ty / tilingSprite.height);
|
|
anchorY.invert();
|
|
applyMatrix.applyMatrix(uvs, 2, 0, anchorY);
|
|
};
|
|
};
|
|
|
|
//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$scene$sprite_tiling$utils$setUvs.js.map
|