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

Z-Index change has no effect #102

Open
EpicDiceStudio opened this issue Jul 11, 2023 · 1 comment
Open

Z-Index change has no effect #102

EpicDiceStudio opened this issue Jul 11, 2023 · 1 comment

Comments

@EpicDiceStudio
Copy link

Hello,

I have the impression that the ZIndex property doesn't work at all.

No matter what value is set, it's the order of addition to the Stage that matters, not the ZIndex.

I thought it worked like this:

  • Application creation
  • Creation of layers / groups (with ZIndexes)
  • Sprite creation etc.
  • Add sprites to groups (parentGroup)

I tested with two groups, the first with a ZIndex of 20 and the second with a ZIndex of 1. The first should naturally be displayed above the first.
Obviously, this isn't the case: I have to add the first layer to the stage last so that it appears in the foreground.

In my application, I use Pixi/Viewport, but I've tested it without and I get the same behavior.

I'm in Pixi v7, here's a Fork of an example (not in V7):
https://replit.com/join/ytxdmaalua-pierrebouvet1

I've moved the editLayer so that it's added first, but when I change the ZIndex nothing happens. So I don't really understand the purpose of this property... In my application I need to be able to add/edit layers, which would require me to manually manage the order of the layers in the stage stack, is this normal?

@ivanpopelyshev
Copy link
Collaborator

ivanpopelyshev commented Jul 11, 2023

zIndex works only inside one single group.

Group zIndex prop isnt used currently ) You can sort your layers by it manually

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