Jump to content

Bring a tiled map layer to the front


Recommended Posts

I have a Phaser.TilemapLayer that I want to bring to the front. I fill it like this.

   for (let layerData of map.layers) {      let layer = map.createLayer(layerData.name);      if (layerData.name === 'collisionLayer') layer.visible = false;      if (layerData.name === 'detailLayer') this._detailLayer = layer;      layer.resizeWorld();    }
Then, according to the TypeScript definitions I can do:
This does not work (bringToTop does not exist). When I do this:
The code will work, but TypeScript definitions specify this is not correct. What is the correct approach?
Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...