New unified Tiled loader.

This commit is contained in:
photonstorm
2013-12-18 04:40:10 +00:00
parent 4ada28ba81
commit b2c680811b
13 changed files with 3806 additions and 3391 deletions
+2
View File
@@ -47,6 +47,7 @@ Version 1.1.4 - "Kandor" - In development
Significant API changes:
* Loader.tileset has a new method signature. Please use the new format: load.tileset(key, url, tileWidth, tileHeight, tileMargin, tileSpacing, rows, columns, total).
* TilemapLayers are now created via the Tilemap object itself: map.createLayer(x, y, width, height, tileset, layer, group) and no longer via the GameObjectFactory.
New features:
@@ -56,6 +57,7 @@ New features:
* Added Device.vibration to check if the Vibration API is available or not.
* Added Device.trident and Device.tridentVersion for testing IE11.
* Added Device.silk for detecting a Kindle Fire and updated desktop OS check to exclude Kindles (thanks LuckieLordie)
* TilemapLayers now have debug and debugAlpha values, this turns on the drawing of the collision edges (very handy for debugging, as the name implies!)
New Examples:
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

File diff suppressed because it is too large Load Diff
+229 -3
View File
@@ -1,5 +1,20 @@
{ "height":18,
"layers":[
{
"height":18,
"image":"..\/sprites\/bunny.png",
"name":"Image Layer 1",
"opacity":1,
"properties":
{
"alpha":"0.8"
},
"type":"imagelayer",
"visible":true,
"width":50,
"x":0,
"y":0
},
{
"data":[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
"height":18,
"name":"Tile Layer 2",
"opacity":1,
"properties":
{
"collides":"false"
},
"type":"tilelayer",
"visible":false,
"visible":true,
"width":50,
"x":0,
"y":0
},
{
"height":18,
"name":"Object Layer 1",
"objects":[
{
"height":114,
"name":"exit",
"properties":
{
"open":"false"
},
"type":"door",
"visible":true,
"width":44,
"x":475,
"y":430
},
{
"ellipse":true,
"height":70,
"name":"sun",
"properties":
{
},
"type":"collision",
"visible":true,
"width":77,
"x":793,
"y":340
},
{
"gid":34,
"height":0,
"name":"",
"properties":
{
},
"type":"",
"visible":true,
"width":0,
"x":454,
"y":307
},
{
"gid":34,
"height":0,
"name":"",
"properties":
{
},
"type":"",
"visible":true,
"width":0,
"x":483,
"y":267
},
{
"gid":34,
"height":0,
"name":"",
"properties":
{
},
"type":"",
"visible":true,
"width":0,
"x":513,
"y":237
},
{
"gid":34,
"height":0,
"name":"",
"properties":
{
},
"type":"",
"visible":true,
"width":0,
"x":549,
"y":229
},
{
"gid":34,
"height":0,
"name":"",
"properties":
{
},
"type":"",
"visible":true,
"width":0,
"x":580,
"y":249
},
{
"gid":34,
"height":0,
"name":"",
"properties":
{
},
"type":"",
"visible":true,
"width":0,
"x":610,
"y":278
},
{
"gid":34,
"height":0,
"name":"",
"properties":
{
},
"type":"",
"visible":true,
"width":0,
"x":639,
"y":309
},
{
"gid":34,
"height":0,
"name":"",
"properties":
{
},
"type":"",
"visible":true,
"width":0,
"x":662,
"y":342
},
{
"height":0,
"name":"ramp",
"polyline":[
{
"x":-28,
"y":2
},
{
"x":52,
"y":-55
},
{
"x":189,
"y":-21
},
{
"x":91,
"y":-21
},
{
"x":75,
"y":78
},
{
"x":-40,
"y":79
},
{
"x":-30,
"y":3
}],
"properties":
{
},
"type":"",
"visible":true,
"width":0,
"x":158,
"y":462
}],
"opacity":1,
"type":"objectgroup",
"visible":true,
"width":50,
"x":0,
"y":0
@@ -69,6 +280,21 @@
"spacing":0,
"tileheight":64,
"tilewidth":32
},
{
"firstgid":34,
"image":"..\/sprites\/coin.png",
"imageheight":32,
"imagewidth":192,
"margin":0,
"name":"coin",
"properties":
{
},
"spacing":0,
"tileheight":32,
"tilewidth":32
}],
"tilewidth":32,
"version":1,
+37 -3
View File
@@ -11,17 +11,51 @@
<tileset firstgid="26" name="walls_1x2" tilewidth="32" tileheight="64">
<image source="walls_1x2.png" width="256" height="64"/>
</tileset>
<layer name="Tile Layer 1" width="50" height="18">
<tileset firstgid="34" name="coin" tilewidth="32" tileheight="32">
<image source="../sprites/coin.png" width="192" height="32"/>
</tileset>
<imagelayer name="Image Layer 1" width="50" height="18">
<image source="../sprites/bunny.png" trans="55ffff"/>
<properties>
<property name="bob" value="eat's cheese"/>
<property name="alpha" value="0.8"/>
<property name="x" value="300"/>
</properties>
</imagelayer>
<layer name="Tile Layer 1" width="50" height="18" visible="0">
<properties>
<property name="collides" value="true"/>
</properties>
<data encoding="base64">
AQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAACQAAAAEAAAABAAAAAQAAAAEAAAABAAAACQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAA
</data>
</layer>
<layer name="Tile Layer 2" width="50" height="18" visible="0">
<properties>
<property name="collides" value="false"/>
</properties>
<data encoding="base64">
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
</data>
</layer>
<objectgroup name="Object Layer 1" width="50" height="18" visible="0">
<object name="exit" type="door" x="475" y="430" width="44" height="114">
<properties>
<property name="open" value="false"/>
</properties>
</object>
<object name="sun" type="collision" x="793" y="340" width="77" height="70">
<ellipse/>
</object>
<object gid="34" x="454" y="307"/>
<object gid="34" x="483" y="267"/>
<object gid="34" x="513" y="237"/>
<object gid="34" x="549" y="229"/>
<object gid="34" x="580" y="249"/>
<object gid="34" x="610" y="278"/>
<object gid="34" x="639" y="309"/>
<object gid="34" x="662" y="342"/>
<object name="ramp" x="158" y="462">
<polyline points="-28,2 52,-55 189,-21 91,-21 75,78 -40,79 -30,3"/>
</object>
</objectgroup>
</map>
File diff suppressed because one or more lines are too long
+2 -7
View File
@@ -24,7 +24,7 @@ var sprite;
function create() {
map = game.add.tilemap('map');
map = game.add.tilemap('map', 'tiles');
map.setCollisionByIndex(15);
map.setCollisionByIndex(40);
@@ -32,13 +32,8 @@ function create() {
map.setCollisionByIndexRange(20, 25);
map.setCollisionByIndexRange(27, 29);
// Phaser.TilemapLayer = function (game, x, y, renderWidth, renderHeight, tileset, tilemap, layer) {
// Need to get the x,y values working (adjust cameraOffset values)
layer = game.add.tilemapLayer(0, 0, 800, 600, 'tiles', map, 0);
layer = map.createLayer(0, 0, 800, 600, 'ShoeBox Tile Grab');
layer.debug = true;
layer.debugAlpha = 0.3;
+28 -46
View File
@@ -93,7 +93,7 @@ Phaser.GameObjectFactory.prototype = {
* A Group is a container for display objects that allows for fast pooling, recycling and collision checks.
*
* @method Phaser.GameObjectFactory#group
* @param {*} parent - The parent Group or DisplayObjectContainer that will hold this group, if any.
* @param {any} parent - The parent Group or DisplayObjectContainer that will hold this group, if any.
* @param {string} [name='group'] - A name for this Group. Not used internally but useful for debugging.
* @return {Phaser.Group} The newly created group.
*/
@@ -104,7 +104,7 @@ Phaser.GameObjectFactory.prototype = {
},
/**
* Creates a new instance of the Sound class.
* Creates a new Sound object.
*
* @method Phaser.GameObjectFactory#audio
* @param {string} key - The Game.cache key of the sound that this object will use.
@@ -120,7 +120,23 @@ Phaser.GameObjectFactory.prototype = {
},
/**
* Creates a new <code>TileSprite</code>.
* Creates a new Sound object.
*
* @method Phaser.GameObjectFactory#sound
* @param {string} key - The Game.cache key of the sound that this object will use.
* @param {number} [volume=1] - The volume at which the sound will be played.
* @param {boolean} [loop=false] - Whether or not the sound will loop.
* @param {boolean} [connect=true] - Controls if the created Sound object will connect to the master gainNode of the SoundManager when running under WebAudio.
* @return {Phaser.Sound} The newly created text object.
*/
sound: function (key, volume, loop, connect) {
return this.game.sound.add(key, volume, loop, connect);
},
/**
* Creates a new TileSprite object.
*
* @method Phaser.GameObjectFactory#tileSprite
* @param {number} x - X position of the new tileSprite.
@@ -141,7 +157,7 @@ Phaser.GameObjectFactory.prototype = {
},
/**
* Creates a new <code>Text</code>.
* Creates a new Text object.
*
* @method Phaser.GameObjectFactory#text
* @param {number} x - X position of the new text object.
@@ -160,7 +176,7 @@ Phaser.GameObjectFactory.prototype = {
},
/**
* Creates a new <code>Button</code> object.
* Creates a new Button object.
*
* @method Phaser.GameObjectFactory#button
* @param {number} [x] X position of the new button object.
@@ -183,7 +199,7 @@ Phaser.GameObjectFactory.prototype = {
},
/**
* Creates a new <code>Graphics</code> object.
* Creates a new Graphics object.
*
* @method Phaser.GameObjectFactory#graphics
* @param {number} x - X position of the new graphics object.
@@ -217,7 +233,7 @@ Phaser.GameObjectFactory.prototype = {
},
/**
* * Create a new <code>BitmapText</code>.
* * Create a new BitmapText object.
*
* @method Phaser.GameObjectFactory#bitmapText
* @param {number} x - X position of the new bitmapText object.
@@ -239,47 +255,13 @@ Phaser.GameObjectFactory.prototype = {
* Creates a new Tilemap object.
*
* @method Phaser.GameObjectFactory#tilemap
* @param {string} key - Asset key for the JSON file.
* @param {string} key - Asset key for the JSON or CSV map data in the cache.
* @param {object|string} tilesets - An object mapping Cache.tileset keys with the tileset names in the JSON file. If a string is provided that will be used.
* @return {Phaser.Tilemap} The newly created tilemap object.
*/
tilemap: function (key) {
tilemap: function (key, tilesets) {
return new Phaser.Tilemap(this.game, key);
},
/**
* Creates a new Tileset object.
*
* @method Phaser.GameObjectFactory#tileset
* @param {string} key - The image key as defined in the Game.Cache to use as the tileset.
* @return {Phaser.Tileset} The newly created tileset object.
*/
tileset: function (key) {
return this.game.cache.getTileset(key);
},
/**
* Creates a new Tilemap Layer object. By default TilemapLayers are fixed to the camera.
*
* @method Phaser.GameObjectFactory#tilemapLayer
* @param {number} x - X position of the new tilemapLayer.
* @param {number} y - Y position of the new tilemapLayer.
* @param {number} width - the width of the tilemapLayer.
* @param {number} height - the height of the tilemapLayer.
* @param {Phaser.Tileset|string} tileset - The tile set used for rendering.
* @param {Phaser.Tilemap} tilemap - The tilemap to which this layer belongs.
* @param {number|string} [layer=0] - The layer within the tilemap this TilemapLayer represents.
* @param {Phaser.Group} [group] - Optional Group to add the object to. If not specified it will be added to the World group.
* @return {Phaser.TilemapLayer} The newly created tilemaplayer object.
*/
tilemapLayer: function (x, y, width, height, tileset, tilemap, layer, group) {
if (typeof group === 'undefined') { group = this.world; }
return group.add(new Phaser.TilemapLayer(this.game, x, y, width, height, tileset, tilemap, layer));
return new Phaser.Tilemap(this.game, key, tilesets);
},
@@ -303,7 +285,7 @@ Phaser.GameObjectFactory.prototype = {
},
/**
* A BitmapData object which can be manipulated and drawn to like a traditional Canvas object and used to texture Sprites.
* Experimental: A BitmapData object which can be manipulated and drawn to like a traditional Canvas object and used to texture Sprites.
*
* @method Phaser.GameObjectFactory#bitmapData
* @param {number} [width=256] - The width of the BitmapData in pixels.
+26 -20
View File
@@ -5,28 +5,21 @@
*/
/**
* Create a new `Tile` object. Tiles live inside of Tilesets and are rendered via TilemapLayers.
* Create a new `Tile` object.
*
* @class Phaser.Tile
* @classdesc A Tile is a single representation of a tile within a Tilemap.
* @classdesc A Tile is a representation of a single tile within the Tilemap.
* @constructor
* @param {Phaser.Tileset} tileset - The tileset this tile belongs to.
* @param {number} index - The index of this tile type in the core map data.
* @param {number} x - The x coordinate of this tile.
* @param {number} y - The y coordinate of this tile.
* @param {number} width - Width of the tile.
* @param {number} height - Height of the tile.
*/
// Phaser.Tile = function (tileset, index, x, y, width, height) {
Phaser.Tile = function (index, x, y, width, height) {
/**
* @property {Phaser.Tileset} tileset - The tileset this tile belongs to.
*/
// this.tileset = tileset;
/**
* @property {number} index - The index of this tile within the tileset.
* @property {number} index - The index of this tile within the map.
*/
this.index = index;
@@ -55,25 +48,36 @@ Phaser.Tile = function (index, x, y, width, height) {
*/
this.alpha = 1;
// Any extra meta data info we need here
/**
* @property {object} properties - Tile specific properties.
*/
this.properties = {};
/**
* @property {number} mass - The virtual mass of the tile.
* @default
* @property {boolean} faceTop - Is the top of this tile an interesting edge?
*/
// this.mass = 1.0;
// Keep track of our interesting faces
this.faceTop = false;
/**
* @property {boolean} faceBottom - Is the bottom of this tile an interesting edge?
*/
this.faceBottom = false;
/**
* @property {boolean} faceLeft - Is the left of this tile an interesting edge?
*/
this.faceLeft = false;
/**
* @property {boolean} faceRight - Is the right of this tile an interesting edge?
*/
this.faceRight = false;
/**
* @property {boolean} collides - Does this tile collide at all?
*/
this.collides = false;
/**
* @property {boolean} collideNone - Indicating this Tile doesn't collide at all.
* @default
@@ -152,7 +156,9 @@ Phaser.Tile.prototype = {
*/
destroy: function () {
this.tileset = null;
this.collisionCallback = null;
this.collisionCallbackContext = null;
this.properties = null;
},
+59 -18
View File
@@ -12,8 +12,9 @@
* @constructor
* @param {Phaser.Game} game - Game reference to the currently running game.
* @param {string} [key] - The key of the tilemap data as stored in the Cache.
* @param {object|string} tilesets - An object mapping Cache.tileset keys with the tileset names in the JSON file. If a string is provided that will be used.
*/
Phaser.Tilemap = function (game, key) {
Phaser.Tilemap = function (game, key, tilesets) {
/**
* @property {Phaser.Game} game - A reference to the currently running Game.
@@ -23,7 +24,7 @@ Phaser.Tilemap = function (game, key) {
/**
* @property {array} layers - An array of Tilemap layer data.
*/
this.layers = null;
this.layers = [];
if (typeof key === 'string')
{
@@ -31,16 +32,17 @@ Phaser.Tilemap = function (game, key) {
this.layers = game.cache.getTilemapData(key).layers;
}
else
{
this.layers = [];
}
/**
* @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.
*/
@@ -64,6 +66,11 @@ Phaser.Tilemap = function (game, key) {
*/
this._tempB = 0;
if (this.layers.length > 0)
{
this.addTilesets(tilesets);
}
};
/**
@@ -80,6 +87,14 @@ Phaser.Tilemap.TILED_JSON = 1;
Phaser.Tilemap.prototype = {
addTilesets: function (tilesets) {
// parse the tilesets array and set-up gid mappings
},
/**
* Creates an empty map of the given dimensions.
*
@@ -123,22 +138,44 @@ Phaser.Tilemap.prototype = {
},
/**
* Sets collision values on a range of tiles in the set.
* Creates a new TilemapLayer object. By default TilemapLayers are fixed to the camera.
*
* @method Phaser.Tileset#createTilemapLayer
* @param {number} x - X position of the new tilemapLayer.
* @param {number} y - Y position of the new tilemapLayer.
* @param {number} width - the width of the tilemapLayer.
* @param {number} height - the height of the tilemapLayer.
* @param {Phaser.Tileset|string} tileset - The tile set used for rendering.
* @param {number|string} [layer=0] - The layer within the tilemap this TilemapLayer represents.
* @method Phaser.Tileset#createLayer
* @param {number} x - Camera Offset X position of the layer.
* @param {number} y - Camera Offset Y position of the layer.
* @param {number} width - The rendered width of the layer, should never be wider than Game.width.
* @param {number} height - The rendered height of the layer, should never be wider than Game.height.
* @param {number|string} layer - The layer number, or if a string is given the layer name, within the map data that this TilemapLayer represents.
* @param {Phaser.Tileset|string} [tileset] - The Phaser.Tileset this layer will use for rendering. If none given it will render using rectangles.
* @param {Phaser.Group} [group] - Optional Group to add the object to. If not specified it will be added to the World group.
* @return {Phaser.TilemapLayer} The TilemapLayer object. This is an extension of Phaser.Sprite and can be moved around the display list accordingly.
*/
createTilemapLayer: function (x, y, renderWidth, renderHeight, tileset, layer, group) {
createLayer: function (x, y, width, height, layer, tileset, group) {
if (typeof group === 'undefined') { group = this.game.world; }
return group.add(new Phaser.TilemapLayer(this.game, x, y, renderWidth, renderHeight, tileset, this, layer));
return group.add(new Phaser.TilemapLayer(this.game, x, y, width, height, this, layer, tileset));
},
/**
* Gets the layer index based on a layer name.
*
* @method Phaser.Tileset#getLayerIndex
* @param {string} name - The name of the layer to get.
* @return {number} The index of the layer in this tilemap, or null if not found.
*/
getLayerIndex: function (name) {
for (var i = 0; i < this.layers.length; i++)
{
if (this.layers[i].name === name)
{
return i;
}
}
return null;
},
@@ -222,9 +259,9 @@ Phaser.Tilemap.prototype = {
// console.log(this.layers[layer].width, 'x', this.layers[layer].height);
for (var y = 0; y < this.layers[layer].height; y++)
for (var y = 0, h = this.layers[layer].height; y < h; y++)
{
for (var x = 0; x < this.layers[layer].width; x++)
for (var x = 0, w = this.layers[layer].width; x < w; x++)
{
var tile = this.layers[layer].data[y][x];
@@ -371,6 +408,7 @@ Phaser.Tilemap.prototype = {
{
this.layers[layer].data[y][x] = index;
this.layers[layer].dirty = true;
this.calculateFaces(layer);
}
},
@@ -437,6 +475,7 @@ Phaser.Tilemap.prototype = {
{
this.layers[layer].data[y][x] = index;
this.layers[layer].dirty = true;
this.calculateFaces(layer);
}
},
@@ -531,6 +570,8 @@ Phaser.Tilemap.prototype = {
}
this.layers[layer].dirty = true;
this.calculateFaces(layer);
},
/**
+98 -64
View File
@@ -14,11 +14,11 @@
* @param {number} y - The y coordinate of this layer.
* @param {number} renderWidth - Width of the renderable area of the layer.
* @param {number} renderHeight - Height of the renderable area of the layer.
* @param {Phaser.Tileset|string} tileset - The tile set used for rendering.
* @param {Phaser.Tilemap} tilemap - The tilemap to which this layer belongs.
* @param {number|string} [layer=0] - The layer within the tilemap this TilemapLayer represents.
* @param {number|string} layer - The layer within the tilemap this TilemapLayer represents.
* @param {Phaser.Tileset|string} [tileset] - The Tileset used for rendering. If none given the tiles are drawn as rectangles.
*/
Phaser.TilemapLayer = function (game, x, y, renderWidth, renderHeight, tileset, tilemap, layer) {
Phaser.TilemapLayer = function (game, x, y, renderWidth, renderHeight, tilemap, layer, tileset) {
/**
* @property {Phaser.Game} game - A reference to the currently running Game.
@@ -95,6 +95,12 @@ Phaser.TilemapLayer = function (game, x, y, renderWidth, renderHeight, tileset,
*/
this.tileSpacing = 0;
/**
* @property {string} tileColor - If no tile set is given the tiles will be rendered as rectangles in this color. Provide in hex or rgb/rgba string format.
* @default
*/
this.tileColor = 'rgb(255, 255, 255)';
/**
* @property {boolean} debug - If set to true the collideable tile edges path will be rendered.
* @default
@@ -107,6 +113,24 @@ Phaser.TilemapLayer = function (game, x, y, renderWidth, renderHeight, tileset,
*/
this.debugAlpha = 0.5;
/**
* @property {string} debugColor - If debug is true this is the color used to outline the edges of collidable tiles. Provide in hex or rgb/rgba string format.
* @default
*/
this.debugColor = 'rgba(0, 255, 0, 1)';
/**
* @property {boolean} debugFill - If true the debug tiles are filled with debugFillColor AND stroked around.
* @default
*/
this.debugFill = false;
/**
* @property {string} debugFillColor - If debugFill is true this is the color used to fill the tiles. Provide in hex or rgb/rgba string format.
* @default
*/
this.debugFillColor = 'rgba(0, 255, 0, 0.2)';
/**
* @property {number} widthInPixels - Do NOT recommend changing after the map is loaded!
* @readonly
@@ -129,6 +153,42 @@ Phaser.TilemapLayer = function (game, x, y, renderWidth, renderHeight, tileset,
*/
this.renderHeight = renderHeight;
/**
* @property {number} scrollFactorX - speed at which this layer scrolls
* horizontally, relative to the camera (e.g. scrollFactorX of 0.5 scrolls
* half as quickly as the 'normal' camera-locked layers do)
* @default 1
*/
this.scrollFactorX = 1;
/**
* @property {number} scrollFactorY - speed at which this layer scrolls
* vertically, relative to the camera (e.g. scrollFactorY of 0.5 scrolls
* half as quickly as the 'normal' camera-locked layers do)
* @default 1
*/
this.scrollFactorY = 1;
/**
* @property {Phaser.Tilemap} tilemap - The Tilemap to which this layer is bound.
*/
this.tilemap = tilemap;
/**
* @property {object} layer - The layer object within the Tilemap that this layer represents.
*/
this.layer = null;
/**
* @property {number} index - The index of this layer within the Tilemap.
*/
this.index = 0;
/**
* @property {boolean} dirty - Flag controlling when to re-render the layer.
*/
this.dirty = true;
/**
* @property {number} _ga - Local render loop var to help avoid gc spikes.
* @private
@@ -243,52 +303,13 @@ Phaser.TilemapLayer = function (game, x, y, renderWidth, renderHeight, tileset,
*/
this._prevY = 0;
/**
* @property {number} scrollFactorX - speed at which this layer scrolls
* horizontally, relative to the camera (e.g. scrollFactorX of 0.5 scrolls
* half as quickly as the 'normal' camera-locked layers do)
* @default 1
*/
this.scrollFactorX = 1;
/**
* @property {number} scrollFactorY - speed at which this layer scrolls
* vertically, relative to the camera (e.g. scrollFactorY of 0.5 scrolls
* half as quickly as the 'normal' camera-locked layers do)
* @default 1
*/
this.scrollFactorY = 1;
/**
* @property {Phaser.Tilemap} tilemap - The Tilemap to which this layer is bound.
*/
this.tilemap = null;
/**
* @property {object} layer - The layer object within the Tilemap that this layer represents.
*/
this.layer = null;
/**
* @property {number} index - The index of this layer within the Tilemap.
*/
this.index = 0;
/**
* @property {boolean} dirty - Flag controlling when to re-render the layer.
*/
this.dirty = true;
this.updateMapData(layer);
if (tileset instanceof Phaser.Tileset || typeof tileset === 'string')
{
this.updateTileset(tileset);
}
if (tilemap instanceof Phaser.Tilemap)
{
this.updateMapData(tilemap, layer);
}
};
Phaser.TilemapLayer.prototype = Object.create(Phaser.Sprite.prototype);
@@ -340,7 +361,7 @@ Phaser.TilemapLayer.prototype.updateTileset = function (tileset) {
}
else if (typeof tileset === 'string')
{
this.tileset = this.game.cache.getTileset('tiles');
this.tileset = this.game.cache.getTileset(tileset);
}
else
{
@@ -352,6 +373,8 @@ Phaser.TilemapLayer.prototype.updateTileset = function (tileset) {
this.tileMargin = this.tileset.tileMargin;
this.tileSpacing = this.tileset.tileSpacing;
// Need to work out the firstgid
this.updateMax();
}
@@ -361,27 +384,22 @@ Phaser.TilemapLayer.prototype.updateTileset = function (tileset) {
*
* @method Phaser.TilemapLayer#updateMapData
* @memberof Phaser.TilemapLayer
* @param {Phaser.Tilemap} tilemap - The tilemap to which this layer belongs.
* @param {number} layer - The layer index within the map.
* @param {number} layerIndex - The layer index within the map.
*/
Phaser.TilemapLayer.prototype.updateMapData = function (tilemap, layer) {
Phaser.TilemapLayer.prototype.updateMapData = function (layerIndex) {
if (tilemap instanceof Phaser.Tilemap)
if (typeof layerIndex === 'string')
{
if (typeof layer === 'undefined')
{
layer = 0;
}
this.tilemap = tilemap;
this.layer = this.tilemap.layers[layer];
this.tileWidth = this.layer.tileWidth;
this.tileHeight = this.layer.tileHeight;
this.index = layer;
this.updateMax();
this.tilemap.layers[layer].dirty = true;
layerIndex = tilemap.getLayerIndex(layerIndex);
}
this.layer = this.tilemap.layers[layerIndex];
this.tileWidth = this.layer.tileWidth;
this.tileHeight = this.layer.tileHeight;
this.index = layerIndex;
this.updateMax();
this.tilemap.layers[layerIndex].dirty = true;
}
/**
@@ -818,6 +836,11 @@ Phaser.TilemapLayer.prototype.render = function () {
this.context.globalAlpha = this.debugAlpha;
}
if (!this.tileset)
{
this.context.fillStyle = this.tileColor;
}
for (var y = this._startY, lenY = this._startY + this._maxY; y < lenY; y++)
{
this._column = this.layer.data[y];
@@ -840,6 +863,10 @@ Phaser.TilemapLayer.prototype.render = function () {
this.tileHeight
);
}
else if (tile)
{
this.context.fillRect(Math.floor(this._tx), Math.floor(this._ty), this.tileWidth, this.tileHeight);
}
this._tx += this.tileWidth;
@@ -873,13 +900,18 @@ Phaser.TilemapLayer.prototype.render = function () {
}
/**
* Renders a collision debug overlay on-top of the canvas. Called automatically by render when debug = true.
* @method Phaser.TilemapLayer#renderDebug
* @memberof Phaser.TilemapLayer
*/
Phaser.TilemapLayer.prototype.renderDebug = function () {
this._tx = this._dx;
this._ty = this._dy;
this.context.fillStyle = 'rgba(0, 255, 0, 0.3)';
this.context.strokeStyle = 'rgb(0, 255, 0)';
this.context.strokeStyle = this.debugColor;
this.context.fillStyle = this.debugFillColor;
for (var y = this._startY, lenY = this._startY + this._maxY; y < lenY; y++)
{
@@ -893,7 +925,10 @@ Phaser.TilemapLayer.prototype.renderDebug = function () {
{
this._tx = Math.floor(this._tx);
// this.context.fillRect(this._tx, this._ty, this.tileWidth, this.tileHeight);
if (this.debugFill)
{
this.context.fillRect(this._tx, this._ty, this.tileWidth, this.tileHeight);
}
this.context.beginPath();
@@ -922,7 +957,6 @@ Phaser.TilemapLayer.prototype.renderDebug = function () {
}
this.context.stroke();
// this.context.strokeRect(this._tx, this._ty, this.tileWidth, this.tileHeight);
}
this._tx += this.tileWidth;
+111 -39
View File
@@ -133,27 +133,19 @@ Phaser.TilemapParser = {
*/
parseTiledJSON: function (json) {
// Let's work out which tilesets are in here
var tilesets = [];
for (var i = 0; i < json.tilesets.length; i++)
{
tilesets.push(json.tilesets[i].firstgid);
}
// Map data will consist of: layers, objects, images, tilesets
var map = {};
// Tile Layers
var layers = [];
for (var i = 0; i < json.layers.length; i++)
{
// Check it's a data layer
if (!json.layers[i].data)
if (json.layers[i].type !== 'tilelayer')
{
continue;
}
// json.tilewidth
// json.tileheight
var layer = {
name: json.layers[i].name,
@@ -169,10 +161,6 @@ Phaser.TilemapParser = {
indexes: [],
// tileset specific
// tileMargin: json.tilesets[0].margin,
// tileSpacing: json.tilesets[0].spacing
};
if (json.layers[i].properties)
@@ -190,7 +178,7 @@ Phaser.TilemapParser = {
// If the map contains multiple tilesets then the indexes are relative to that which the set starts from
// Need to set which tileset in the cache = which tileset in the JSON, if you do this manually it means you can use the same map data but a new tileset.
for (var t = 0; t < json.layers[i].data.length; t++)
for (var t = 0, len = json.layers[i].data.length; t < len; t++)
{
// index, x, y, width, height
if (json.layers[i].data[t] > 0)
@@ -210,36 +198,120 @@ Phaser.TilemapParser = {
x = 0;
row = [];
}
/*
if (c === 0)
{
row = [];
}
row.push(json.layers[i].data[t]);
c++;
if (c == json.layers[i].width)
{
output.push(row);
c = 0;
}
*/
}
layer.data = output;
// Build collision map
// console.log(output);
layers.push(layer);
}
return layers;
map.layers = layers;
// Images
var images = [];
for (var i = 0; i < json.layers.length; i++)
{
if (json.layers[i].type !== 'imagelayer')
{
continue;
}
var image = {
name: json.layers[i].name,
image: json.layers[i].image,
x: json.layers[i].x,
y: json.layers[i].y,
alpha: json.layers[i].opacity,
visible: json.layers[i].visible,
properties: {}
};
if (json.layers[i].properties)
{
image.properties = json.layers[i].properties;
}
images.push(image);
}
map.images = images;
// Objects
var objects = [];
for (var i = 0; i < json.layers.length; i++)
{
if (json.layers[i].type !== 'objectgroup')
{
continue;
}
for (var v = 0; v < json.layers[i].objects.length; v++)
{
// For now we'll just support object tiles
if (json.layers[i].objects[v].gid)
{
var object = {
gid: json.layers[i].objects[v].gid,
name: json.layers[i].objects[v].name,
x: json.layers[i].objects[v].x,
y: json.layers[i].objects[v].y,
visible: json.layers[i].objects[v].visible,
properties: json.layers[i].objects[v].properties
};
objects.push(object);
}
}
}
map.objects = objects;
// Tilesets
var tilesets = [];
/*
{
"firstgid":1,
"image":"ground_1x1.png",
"imageheight":32,
"imagewidth":800,
"margin":0,
"name":"ground_1x1",
"properties":
{
},
"spacing":0,
"tileheight":32,
"tileproperties":
{
"1":
{
"bounce":"1"
}
},
"tilewidth":32
},
*/
for (var i = 0; i < json.tilesets.length; i++)
{
}
// Lets build our super tileset index
map.tilesets = tilesets;
return map;
}
+2 -1
View File
@@ -100,7 +100,8 @@ Phaser.Tileset.prototype = {
console.log('Building tileset', this.rows, 'x', this.columns, 'total', this.total);
for (var i = this.firstgid; i < this.firstgid + this.total; i++)
// for (var i = this.firstgid; i < this.firstgid + this.total; i++)
for (var i = 0; i < this.total; i++)
{
// Can add extra properties here as needed
this.tiles[i] = [x, y];