From 24437485af7813d8cab12d5571a3635677249568 Mon Sep 17 00:00:00 2001 From: Richard Davey Date: Fri, 2 Oct 2020 10:19:13 +0100 Subject: [PATCH] Fixed static function #4992 --- src/tilemaps/const.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/tilemaps/const.js b/src/tilemaps/const.js index dc4b35fae..3927428c9 100644 --- a/src/tilemaps/const.js +++ b/src/tilemaps/const.js @@ -56,27 +56,33 @@ var CONST = { * Get the Tilemap orientation from the given string. * * @name Phaser.Tilemaps.fromOrientationString - * @const * @type {function} * @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) { - var constor = CONST.ORTHOGONAL; + orientation = orientation.toLowerCase; if (orientation === 'isometric') { - constor = CONST.ISOMETRIC; + return CONST.ISOMETRIC; } else if (orientation === 'staggered') { - constor = CONST.STAGGERED; + return CONST.STAGGERED; } else if (orientation === 'hexagonal') { - constor = CONST.HEXAGONAL; + return CONST.HEXAGONAL; + } + else + { + return CONST.ORTHOGONAL; } - return constor; } };