pixijs / particle-emitter

A particle system for PixiJS
http://pixijs.io/particle-emitter/docs
MIT License
793 stars 125 forks source link

Z-ordering of particles (foreground/background particles) #89

Closed Cristy94 closed 5 years ago

Cristy94 commented 5 years ago

I am using one ParticleContainer for all the particles, is there any way to enforce some z-ordering in the particles?

I want to have, for example, the smoke ground particles always below the clouds particles, this could be easily done by always adding the ground particles as the first children of the particles array, instead of adding them at the end.

Cristy94 commented 5 years ago

Oh, I think I can just use the addAtBack property.

andrewstart commented 5 years ago

Yeah, any ordering fancier than just the addAtBack toggle probably needs emitters to add particles to separate containers, because sorting hundreds/thousands of particles probably isn't great.