Jump to content

createLayer does not call setLayer


xompl
 Share

Recommended Posts

Not sure if this is intended so I write here instead of in github.

 

If I create a new layer with

 

  this.layer = this.map.createLayer('layer');
 
the new layer is shown on screen but subsequent calls to functions like
this.map.replace(a, B) without indicating explicitly the layer do not work on the layer that is being displayed on screen.
 
I need to create the layer and also set it to make .replace work.
 
  this.layer = this.map.createLayer('layer');
  this.layerName = this.map.getLayer('layer');
  this.map.setLayer(this.layerName);

 

It works for the first layer created (currentLayer's default value is 0) but I don't see where currentLayer is updated after creating a new Lawyer. I'm talking about http://docs.phaser.io/Tilemap.js.html function  createLayer (line 410 at this moment).

 

Is this the correct behaviour?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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