batiste / sprite.js

An efficient javascript sprite animation framework
MIT License
871 stars 97 forks source link

Implementation of toFront/toBack methods for controlling zIndex when using dom rendering. #21

Closed thybag closed 12 years ago

thybag commented 12 years ago

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