mirror of
https://github.com/wassname/phaser.git
synced 2026-07-17 11:31:30 +08:00
And Tilemaps are rendering again - and much better than ever before :) Just one final optimisation pass to do and then it's on to collision.
This commit is contained in:
+4
-4
@@ -156,9 +156,9 @@ Phaser.Cache.prototype = {
|
||||
*/
|
||||
addTilemap: function (key, url, mapData, format) {
|
||||
|
||||
this._tilemaps[key] = { url: url, mapData: mapData, format: format };
|
||||
this._tilemaps[key] = { url: url, data: mapData, format: format };
|
||||
|
||||
this._tilemaps[key].mapData = Phaser.TilemapParser.parse(this.game, mapData, format);
|
||||
this._tilemaps[key].layers = Phaser.TilemapParser.parse(this.game, mapData, format);
|
||||
|
||||
},
|
||||
|
||||
@@ -453,9 +453,9 @@ Phaser.Cache.prototype = {
|
||||
*
|
||||
* @method Phaser.Cache#getTilemap
|
||||
* @param {string} key - Asset key of the tilemap you want.
|
||||
* @return {Phaser.Tilemap} The tilemap data. The tileset image is in the data property, the map data in mapData.
|
||||
* @return {Object} The tilemap data. The tileset image is in the data property, the map data in mapData.
|
||||
*/
|
||||
getTilemap: function (key) {
|
||||
getTilemapData: function (key) {
|
||||
|
||||
if (this._tilemaps[key])
|
||||
{
|
||||
|
||||
@@ -371,7 +371,7 @@ Phaser.Loader.prototype = {
|
||||
break;
|
||||
|
||||
// An xml string or object has been given
|
||||
case Phaser.Tilemap.JSON:
|
||||
case Phaser.Tilemap.TILED_JSON:
|
||||
|
||||
if (typeof mapData === 'string')
|
||||
{
|
||||
@@ -710,7 +710,7 @@ Phaser.Loader.prototype = {
|
||||
this._xhr.open("GET", this.baseURL + file.url, true);
|
||||
this._xhr.responseType = "text";
|
||||
|
||||
if (file.format == Phaser.Tilemap.JSON)
|
||||
if (file.format == Phaser.Tilemap.TILED_JSON)
|
||||
{
|
||||
this._xhr.onload = function () {
|
||||
return _this.jsonLoadComplete(file.key);
|
||||
|
||||
Reference in New Issue
Block a user