Dannflower

Members
  • Content count

    2
  • Joined

  • Last visited

  1. Hi all, First off, apologies if I'm jumping the gun a bit here since I'm not sure if Mike's work on the Tilemap API is still a WIP or if it's wrapping up. That being said, the Tilemap API is near and dear to my heart due to its role within my personal projects. After poking around the recent Tilemap commits I'm curious about one thing: Are there plans to maintain layer ordering of layers within a Tilemap object as they are within the Tiled JSON? For instance: In a particular map I have something like the above where layer 1 is beneath layer 2 and object layer 1 is between layers 2 and 3. In the current build of v3 as was the implementation in v2, we lose this relationship between layers once we parse in our JSON. Current parser for reference: https://github.com/photonstorm/phaser/blob/master/v3/src/gameobjects/tilemap/parsers/parsetiledjson/index.js Within the final Tilemap, we are given the properties "objects," "layers," and "images" (ignoring collision for time being). Is there any plan to include a property on a Tilemap object that contains the ordered (as they are in the JSON) array of all layer types that are currently supported? My first instinct would be to suggest having the "layers" property serve that purpose and instead rename the existing property to "tileLayers" for the sake of being specific. That being said, a shout-out to Mike for doing an excellent job cleaning up and improving the Tilemap API. I'm excited to put it through its paces!
  2. I'm currently working on automating the loading process of my tilesets/sprites/Tiled map data into my application and I've run into the following snag: When creating the layers of my map (i.e. invoking myTilemap.createLayer(...)) I cannot see any obvious way of preserving the order of tile layers and object layers as they were in the Tiled JSON. From what I can see in the Phaser docs and in Phaser.js itself, it appears that Phaser parses out the tile and object layers into separate groupings within the Tilemap object: layers[] & objects{} respectively. This is fine, but there's no way I can see to tell where my object layers are supposed to be relative to the tile layers. For instance, I have this in Tiled: Tile layer 1 Object layer 1 Tile layer 2 But in the Tilemap object, I get: layers = [Tile layer 1, Tile layer 2] Objects = {Object layer 1} Without relying on naming convention, I can't tell that object layer 1 is between the two tile layers. Am I missing something or is this just the way it is right now? I've got plans to refactor the Phaser.js code locally to address this, but I wanted to reach out here before getting my hands dirty to see if I am missing the easy solution. Thanks in advance for any pointers!