Fixed static function #4992

This commit is contained in:
Richard Davey 2020-10-02 10:19:13 +01:00
parent ba4be029be
commit 24437485af

View file

@ -56,27 +56,33 @@ var CONST = {
* Get the Tilemap orientation from the given string. * Get the Tilemap orientation from the given string.
* *
* @name Phaser.Tilemaps.fromOrientationString * @name Phaser.Tilemaps.fromOrientationString
* @const
* @type {function} * @type {function}
* @since 3.50.0 * @since 3.50.0
*
* @param {string} [orientation] - The orientation type as a string.
*
* @return {Phaser.Types.Tilemaps.TilemapOrientationType} The Tilemap Orientation type.
*/ */
fromOrientationString: function (orientation) fromOrientationString: function (orientation)
{ {
var constor = CONST.ORTHOGONAL; orientation = orientation.toLowerCase;
if (orientation === 'isometric') if (orientation === 'isometric')
{ {
constor = CONST.ISOMETRIC; return CONST.ISOMETRIC;
} }
else if (orientation === 'staggered') else if (orientation === 'staggered')
{ {
constor = CONST.STAGGERED; return CONST.STAGGERED;
} }
else if (orientation === 'hexagonal') else if (orientation === 'hexagonal')
{ {
constor = CONST.HEXAGONAL; return CONST.HEXAGONAL;
}
else
{
return CONST.ORTHOGONAL;
} }
return constor;
} }
}; };