pixijs / layers

Separate the z-hierarchy of your scene tree from its canonical structure.
https://pixijs.io/layers/docs/
MIT License
222 stars 57 forks source link

Sharing sprite between two layers? #42

Closed sonal71 closed 5 years ago

sonal71 commented 5 years ago

I am trying to create a mesh that has layers of series of sprites both horizontal and vertical.

image

All the boxes are sprites. I have two layer L1 and L2. And there is one sprite shared between two layers.

But looks like the common sprite can only belong to either L1 or L2.

Is there a way to share sprite between two layers?

Thank you in advance! :)

ivanpopelyshev commented 5 years ago

That's a strange case. What will be behaviour of pixi-display in that case according to your idea? Suppose element has two parentLayers, how do you think it will be rendered?

sonal71 commented 5 years ago

Thinking this through it does seem a bit strange. More or less it looks like layers for fixed positions rather than specific sprites. Will work on it to see if I find something. Thank you!