mirror of
https://github.com/photonstorm/phaser
synced 2024-12-24 03:53:28 +00:00
b406a61262
The description of the method stated that you could pass a string to look up an object layer based on its name, but the original code only looked for a gui property, regardless of type. I'm using Tiled 0.11.0 on OSX, and my exported json-file doesn't contain a gui property on the object layers. Here's a snippet of my file: ``` { "layers":[ { "draworder":"topdown", "height":0, "name":"Objects", "objects":[ { "height":48, "id":1, "name":"pier", "properties": { }, "rotation":0, "type":"", "visible":true, "width":64, "x":208, "y":240 }], "opacity":1, "properties": { "type":"pier" }, "type":"objectgroup", "visible":true, "width":0, "x":0, "y":0 }] }] } ``` The property in my file is called id and not uid. This might be due to changes in one of the later releases of Tiled. I kept the check for uid to avoid possibly breaking compatibility with older versions of Tiled. I also added scaling of the sprite. Feel free to make formatting changes, or rewrite the function to better fit the programming style of Phaser. |
||
---|---|---|
.. | ||
Tile.js | ||
Tilemap.js | ||
TilemapLayer.js | ||
TilemapParser.js | ||
Tileset.js |