Skip to content

Commit 7844927

Browse files
committed
Image layers added to Tilemap
1 parent 0d02f7d commit 7844927

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

v3/src/gameobjects/tilemap/Tilemap.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ var Tilemap = new Class({
2929
this.widthInPixels = mapData.widthInPixels;
3030
this.heightInPixels = mapData.heightInPixels;
3131
this.imageCollections = mapData.imageCollections;
32+
this.images = mapData.images;
3233
this.collision = mapData.collision;
3334
this.layers = mapData.layers;
3435
this.tilesets = mapData.tilesets;
3536
this.tiles = mapData.tiles;
3637
this.objects = mapData.objects;
3738
this.currentLayerIndex = 0;
3839

39-
// TODO: images
4040
// TODO: debugging methods
4141
},
4242

@@ -237,6 +237,11 @@ var Tilemap = new Class({
237237
return this;
238238
},
239239

240+
getImageIndex: function (name)
241+
{
242+
return this.getIndex(this.images, name);
243+
},
244+
240245
getIndex: function (location, name)
241246
{
242247
for (var i = 0; i < location.length; i++)

v3/src/gameobjects/tilemap/parsers/parsetiledjson/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ var ParseJSONTiled = function (key, json, insertNull)
139139
y: GetFastValue(curi, 'offsety', 0) + curi.y,
140140
alpha: curi.opacity,
141141
visible: curi.visible,
142-
properties: GetFastValue(curi.properties, {})
142+
properties: GetFastValue(curi, "properties", {})
143143
});
144144
}
145145

0 commit comments

Comments
 (0)