Just putting in a pull request for the toFront/toBack methods discussed in the ticket I raised here(https://github.com/batiste/sprite.js/issues/20). The code was revised in regards to batiste's feedback and now uses the z-index to order the sprites (which proved to be significantly faster when tested via a modified particle test). A setZIndex method was also added, which could be used to take more granular control over sprite z ordering within a layer if anyone wished to do so.
It would be great if you'd be willing to merge this in to the main branch, but no worries if its not deemed to be useful enough / you'd rather implement it yourselves in a different way.
Hello,
Just putting in a pull request for the toFront/toBack methods discussed in the ticket I raised here(https://github.com/batiste/sprite.js/issues/20). The code was revised in regards to batiste's feedback and now uses the z-index to order the sprites (which proved to be significantly faster when tested via a modified particle test). A setZIndex method was also added, which could be used to take more granular control over sprite z ordering within a layer if anyone wished to do so.
It would be great if you'd be willing to merge this in to the main branch, but no worries if its not deemed to be useful enough / you'd rather implement it yourselves in a different way.
Thanks, Carl