Search the Community
Showing results for tags 'sorting'.
-
I just found there is a function called sort(key, order) inside game.world inherited from Phaser.Group. I have a list of objects of type Phaser.Graphics inside my parent also of type Phaser.Graphics. The parent object is a wall and the children are shelves. I need to fake a 3D effect that the shelves sit on top of each other as the "y" coordinate increases. I can do this by setting the child index to descending order i.e from larger to smaller, but I need first to sort my shelves by "y" coordinate in ascending order. (The shelves which have the smallest "y" coord. have the highest z-index i.e sit on top of the other). Could I use this Phaser.Group.sort(key order) function for children of Phaser.Graphics or not? Or maybe there is a another way to sort graphical objects?
-
Hi again. I'm working with particle systems at the moment and have a specific effect that I need. Essentially it is a sun that has been created with one particle system inside of a nebula which is another particle system. The problem is that they are not depth sorted in anyway, so particles from one system will always be drawn in front of the other system. The order is determined by the particle system creation order; the last system is always drawn over the previous system. Does anyone know if BabylonJS has the ability to specify sorting for particles? I can't find anythin in the particle system code, but thought there might be something more generic elsewhere, or will I need to add support for that myself?
- 3 replies
-
- Particle system
- babylon.js
-
(and 1 more)
Tagged with: