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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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