Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not add a layer to another layer. #5595

Closed
tringcooler opened this issue Mar 8, 2021 · 3 comments
Closed

Can not add a layer to another layer. #5595

tringcooler opened this issue Mar 8, 2021 · 3 comments

Comments

@tringcooler
Copy link

tringcooler commented Mar 8, 2021

Version

  • Phaser Version: 3.53.1
  • Operating system: win7
  • Browser: chrome

Description

Add a layer to another layer cause an error:
gameObject.removeFromDisplayList is not a function

This method is called at the start of Layer#addChildCallback for reset the displayList.
But, this method is not exist.

Example Test Code

let main_layer = this.scene.add.layer();
let sub_layer = this.scene.make.layer();
main_layer.add(sub_layer);   // <- Error Here

Additional Information

This code is OK in v3.52.0

@photonstorm
Copy link
Collaborator

Hmm, I'm happy to fix this to make it work, however, Layers were never intended to be added to other Layers, so it's a bit of fluke it ever worked at all really.

@tringcooler
Copy link
Author

Hmm, I'm happy to fix this to make it work, however, Layers were never intended to be added to other Layers, so it's a bit of fluke it ever worked at all really.

All right. I've removed all code that nested layers

@photonstorm
Copy link
Collaborator

Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants