@bloopjs/toodle 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mod.d.ts.map +1 -1
- package/dist/mod.js +12 -9
- package/dist/mod.js.map +4 -4
- package/dist/textures/Bundles.d.ts.map +1 -1
- package/dist/textures/util.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/mod.ts +0 -2
- package/src/textures/Bundles.ts +9 -4
- package/src/textures/util.ts +8 -4
package/dist/mod.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA,mBAAmB,iBAAiB,CAAC;AAErC,mBAAmB,kBAAkB,CAAC;AACtC,mBAAmB,mBAAmB,CAAC;AACvC,mBAAmB,kBAAkB,CAAC;AACtC,mBAAmB,2BAA2B,CAAC;AAC/C,mBAAmB,2BAA2B,CAAC;AAE/C,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AAEzB,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AACvC,OAAO,KAAK,OAAO,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;AACrC,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AACvC,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/mod.js
CHANGED
|
@@ -19720,6 +19720,8 @@ class Bundles {
|
|
|
19720
19720
|
const rightCrop = frame.sourceSize.w - frame.spriteSourceSize.x - frame.spriteSourceSize.w;
|
|
19721
19721
|
const topCrop = frame.spriteSourceSize.y;
|
|
19722
19722
|
const bottomCrop = frame.sourceSize.h - frame.spriteSourceSize.y - frame.spriteSourceSize.h;
|
|
19723
|
+
const halfTexelX = 0.5 / atlasWidth;
|
|
19724
|
+
const halfTexelY = 0.5 / atlasHeight;
|
|
19723
19725
|
return {
|
|
19724
19726
|
cropOffset: {
|
|
19725
19727
|
x: leftCrop - rightCrop,
|
|
@@ -19730,16 +19732,16 @@ class Bundles {
|
|
|
19730
19732
|
height: frame.sourceSize.h
|
|
19731
19733
|
},
|
|
19732
19734
|
uvOffset: {
|
|
19733
|
-
x: frame.frame.x / atlasWidth,
|
|
19734
|
-
y: frame.frame.y / atlasHeight
|
|
19735
|
+
x: frame.frame.x / atlasWidth + halfTexelX,
|
|
19736
|
+
y: frame.frame.y / atlasHeight + halfTexelY
|
|
19735
19737
|
},
|
|
19736
19738
|
uvScale: {
|
|
19737
19739
|
width: frame.sourceSize.w / atlasWidth,
|
|
19738
19740
|
height: frame.sourceSize.h / atlasHeight
|
|
19739
19741
|
},
|
|
19740
19742
|
uvScaleCropped: {
|
|
19741
|
-
width: frame.frame.w / atlasWidth,
|
|
19742
|
-
height: frame.frame.h / atlasHeight
|
|
19743
|
+
width: (frame.frame.w - 1) / atlasWidth,
|
|
19744
|
+
height: (frame.frame.h - 1) / atlasHeight
|
|
19743
19745
|
}
|
|
19744
19746
|
};
|
|
19745
19747
|
}
|
|
@@ -19849,18 +19851,19 @@ async function packBitmapsToAtlas(images, textureSize, device) {
|
|
|
19849
19851
|
height: space.height - texture.height
|
|
19850
19852
|
});
|
|
19851
19853
|
}
|
|
19854
|
+
const halfTexel = 0.5 / textureSize;
|
|
19852
19855
|
atlasRegionMap.set(id, {
|
|
19853
19856
|
uvOffset: {
|
|
19854
|
-
x: space.x / textureSize,
|
|
19855
|
-
y: space.y / textureSize
|
|
19857
|
+
x: space.x / textureSize + halfTexel,
|
|
19858
|
+
y: space.y / textureSize + halfTexel
|
|
19856
19859
|
},
|
|
19857
19860
|
uvScale: {
|
|
19858
19861
|
width: originalSize.width / textureSize,
|
|
19859
19862
|
height: originalSize.height / textureSize
|
|
19860
19863
|
},
|
|
19861
19864
|
uvScaleCropped: {
|
|
19862
|
-
width: texture.width / textureSize,
|
|
19863
|
-
height: texture.height / textureSize
|
|
19865
|
+
width: (texture.width - 1) / textureSize,
|
|
19866
|
+
height: (texture.height - 1) / textureSize
|
|
19864
19867
|
},
|
|
19865
19868
|
cropOffset: offset,
|
|
19866
19869
|
originalSize
|
|
@@ -20908,5 +20911,5 @@ export {
|
|
|
20908
20911
|
AssetManager
|
|
20909
20912
|
};
|
|
20910
20913
|
|
|
20911
|
-
//# debugId=
|
|
20914
|
+
//# debugId=18E70D7AC0F5250F64756E2164756E21
|
|
20912
20915
|
//# sourceMappingURL=mod.js.map
|