More TypeScript updates.

This commit is contained in:
photonstorm
2013-12-18 16:56:14 +00:00
parent f991f9cee8
commit 5cf7ed4fdb
6 changed files with 207 additions and 116 deletions
+23 -17
View File
@@ -21,28 +21,38 @@ Phaser.Tilemap = function (game, key, tilesets) {
*/
this.game = game;
/**
* @property {string} key - The key of this map data in the Phaser.Cache.
*/
this.key = key;
var data = Phaser.TilemapParser.parse(this.game, key);
/**
* @property {array} layers - An array of Tilemap layer data.
*/
this.layers = [];
this.layers = data.layers;
if (typeof key === 'string')
{
this.key = key;
/**
* @property {array} tilesets - An array of Tilesets.
*/
this.tilesets = data.tilesets;
this.layers = game.cache.getTilemapData(key).layers;
}
/**
* @property {array} objects - An array of Tiled Object Layers.
*/
this.objects = data.objects;
/**
* @property {array} images - An array of Tiled Image Layers.
*/
this.images = data.images;
/**
* @property {number} currentLayer - The current layer.
*/
this.currentLayer = 0;
/**
* @property {array} tilesets - An array of Tilesets.
*/
this.tilesets = [];
/**
* @property {array} debugMap - Map data used for debug values only.
*/
@@ -66,11 +76,6 @@ Phaser.Tilemap = function (game, key, tilesets) {
*/
this._tempB = 0;
if (this.layers.length > 0)
{
this.addTilesets(tilesets);
}
};
/**
@@ -87,6 +92,8 @@ Phaser.Tilemap.TILED_JSON = 1;
Phaser.Tilemap.prototype = {
addTilesets: function (tilesets) {
// { "TiledKey": "TilesetKey" }
@@ -128,7 +135,6 @@ Phaser.Tilemap.prototype = {
},
/**
* Creates an empty map of the given dimensions.
*