@safe-engine/cocos 2.5.6 → 2.5.7
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/fasttiled/tield.js +3 -3
- package/package.json +1 -1
package/dist/fasttiled/tield.js
CHANGED
|
@@ -29,7 +29,7 @@ export function tileToPixel(map, tx, ty) {
|
|
|
29
29
|
const x0 = tx * (tw / 2);
|
|
30
30
|
const y0 = ty * th + offset;
|
|
31
31
|
const x = x0 + tw / 2;
|
|
32
|
-
const y =
|
|
32
|
+
const y = -y0 - th / 2;
|
|
33
33
|
return { x, y };
|
|
34
34
|
}
|
|
35
35
|
else {
|
|
@@ -38,7 +38,7 @@ export function tileToPixel(map, tx, ty) {
|
|
|
38
38
|
const x0 = tx * tw + offset;
|
|
39
39
|
const y0 = ty * (th / 2);
|
|
40
40
|
const x = x0 + tw / 2;
|
|
41
|
-
const y =
|
|
41
|
+
const y = -y0 - th / 2;
|
|
42
42
|
return { x, y };
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -79,7 +79,7 @@ export function loadIsometricMap(mapUrl) {
|
|
|
79
79
|
const frame = new cc.SpriteFrame(tilesetTexture, cc.rect(frameX, frameY, tileW, tileH));
|
|
80
80
|
const sprite = new cc.Sprite(frame);
|
|
81
81
|
sprite.x = x;
|
|
82
|
-
sprite.y = y
|
|
82
|
+
sprite.y = y;
|
|
83
83
|
// console.log('x,y', x, y)
|
|
84
84
|
tileLayer.addChild(sprite);
|
|
85
85
|
}
|