Jump to content

Bring a tiled map layer to the front


Deathspike
 Share

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._detailLayer.bringToTop();
This does not work (bringToTop does not exist). When I do this:
this.world.bringToTop(this._detailLayer);
The code will work, but TypeScript definitions specify this is not correct. What is the correct approach?
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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