Skip to content

Commit 3352bd8

Browse files
committed
Restored previous version phaserjs#4992
1 parent 92b4316 commit 3352bd8

1 file changed

Lines changed: 2 additions & 26 deletions

File tree

src/tilemaps/components/WorldToTileX.js

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
* @license {@link https://opensource.org/licenses/MIT|MIT License}
55
*/
66

7-
var CONST = require('../../const.js');
8-
97
/**
10-
* Converts from world X coordinates (pixels) to orthogonal tile X coordinates (tile units), factoring in the
8+
* Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the
119
* layer's position, scale and scroll.
1210
*
1311
* @function Phaser.Tilemaps.Components.WorldToTileX
@@ -20,9 +18,8 @@ var CONST = require('../../const.js');
2018
*
2119
* @return {number} The X location in tile units.
2220
*/
23-
var OrthoWorldToTileX = function (worldX, snapToFloor, camera, layer)
21+
var WorldToTileX = function (worldX, snapToFloor, camera, layer)
2422
{
25-
2623
if (snapToFloor === undefined) { snapToFloor = true; }
2724

2825
var tileWidth = layer.baseTileWidth;
@@ -42,27 +39,6 @@ var OrthoWorldToTileX = function (worldX, snapToFloor, camera, layer)
4239
return snapToFloor
4340
? Math.floor(worldX / tileWidth)
4441
: worldX / tileWidth;
45-
46-
};
47-
48-
var nullFunc = function ()
49-
{
50-
console.warn('With the current map type you have to use the WorldToTileXY function.');
51-
return null;
52-
};
53-
54-
var WorldToTileX = function (orientation)
55-
{
56-
switch (orientation)
57-
{
58-
case CONST.ORTHOGONAL:
59-
return OrthoWorldToTileX;
60-
61-
default:
62-
return nullFunc;
63-
64-
}
65-
6642
};
6743

6844
module.exports = WorldToTileX;

0 commit comments

Comments
 (0)