Parses raw data of a given Tilemap format into a new MapData object. If no recognized data format
is found, returns null
. When loading from CSV or a 2D array, you should specify the tileWidth &
tileHeight. When parsing from a map from Tiled, the tileWidth & tileHeight will be pulled from
the map data.
name | type | description |
---|---|---|
name | string |
The name of the tilemap, used to set the name on the MapData. |
mapFormat | number |
See ../Formats.js. |
data | Array.<Array.<number>> | string | object |
2D array, CSV string or Tiled JSON object. |
tileWidth | number |
The width of a tile in pixels. Required for 2D array and CSV, but ignored for Tiled JSON. |
tileHeight | number |
The height of a tile in pixels. Required for 2D array and CSV, but ignored for Tiled JSON. |
insertNull | boolean |
Controls how empty tiles, tiles with an index of -1, in the map
data are handled. If |
The created MapData
object.