2020-10-02 10:03:56 +00:00
|
|
|
/**
|
|
|
|
* @author Richard Davey <rich@photonstorm.com>
|
2023-01-02 17:36:27 +00:00
|
|
|
* @copyright 2013-2023 Photon Storm Ltd.
|
2020-10-02 10:03:56 +00:00
|
|
|
* @license {@link https://opensource.org/licenses/MIT|MIT License}
|
|
|
|
*/
|
|
|
|
|
2020-11-23 15:29:08 +00:00
|
|
|
var CONST = require('../const/ORIENTATION_CONST');
|
2020-10-02 10:03:56 +00:00
|
|
|
var NOOP = require('../../utils/NOOP');
|
|
|
|
var TileToWorldX = require('./TileToWorldX');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the correct function to use to translate tiles, based on the map orientation.
|
|
|
|
*
|
|
|
|
* @function Phaser.Tilemaps.Components.GetTileToWorldXFunction
|
|
|
|
* @since 3.50.0
|
|
|
|
*
|
|
|
|
* @param {number} orientation - The Tilemap orientation constant.
|
|
|
|
*
|
2020-11-23 15:06:45 +00:00
|
|
|
* @return {function} The function to use to translate tiles for the given map type.
|
2020-10-02 10:03:56 +00:00
|
|
|
*/
|
|
|
|
var GetTileToWorldXFunction = function (orientation)
|
|
|
|
{
|
|
|
|
if (orientation === CONST.ORTHOGONAL)
|
|
|
|
{
|
|
|
|
return TileToWorldX;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return NOOP;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = GetTileToWorldXFunction;
|