Skip to content

Groups always had zero z index #1291

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

Merged
merged 2 commits into from
Nov 14, 2014
Merged

Groups always had zero z index #1291

merged 2 commits into from
Nov 14, 2014

Conversation

spayton
Copy link
Contributor

@spayton spayton commented Nov 3, 2014

Newly added groups were always initialising their z index to zero, instead of their position in the parent child list.

@spayton
Copy link
Contributor Author

spayton commented Nov 14, 2014

How to replicate.

Go to Group vs Group example

http://examples.phaser.io/_site/view_full.html?d=arcade%20physics&f=group+vs+group.js&t=group%20vs%20group

Open up console and type the following 2 entries:
bullets.z
veggies.z

They will both return 0, the problem here is they are both reporting the same z index in the world group.

Now type the following into console:
game.world.updateZ()

and repeat the bullets.z and veggies.z console commands, this time they are now different and correct.

This pull request automatically sets the correct z index of a group added to another group, just like all the other game objects do.

photonstorm added a commit that referenced this pull request Nov 14, 2014
Groups always had zero z index
@photonstorm photonstorm merged commit cbaa36f into phaserjs:dev Nov 14, 2014
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

Successfully merging this pull request may close these issues.

2 participants