sdfsdfs
This commit is contained in:
29
node_modules/pixi.js/lib/scene/sprite-tiling/utils/setUvs.mjs
generated
vendored
Normal file
29
node_modules/pixi.js/lib/scene/sprite-tiling/utils/setUvs.mjs
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
import { Matrix } from '../../../maths/matrix/Matrix.mjs';
|
||||
import { applyMatrix } from './applyMatrix.mjs';
|
||||
|
||||
"use strict";
|
||||
function setUvs(tilingSprite, uvs) {
|
||||
const texture = tilingSprite.texture;
|
||||
const width = texture.frame.width;
|
||||
const height = texture.frame.height;
|
||||
let anchorX = 0;
|
||||
let anchorY = 0;
|
||||
if (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;
|
||||
const textureMatrix = Matrix.shared;
|
||||
textureMatrix.copyFrom(tilingSprite._tileTransform.matrix);
|
||||
textureMatrix.tx /= tilingSprite.width;
|
||||
textureMatrix.ty /= tilingSprite.height;
|
||||
textureMatrix.invert();
|
||||
textureMatrix.scale(tilingSprite.width / width, tilingSprite.height / height);
|
||||
applyMatrix(uvs, 2, 0, textureMatrix);
|
||||
}
|
||||
|
||||
export { setUvs };
|
||||
//# sourceMappingURL=setUvs.mjs.map
|
Reference in New Issue
Block a user