Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

I think you can do sprites within canvas.


You can, but it's quite a bit slower. IIRC I benchmarked drawing a 32x32 image on canvas at about 15ms, while setting the top and left properties of an img tag or div with a background image was under 1 ms. The absolute numbers mean nothing (it was on an old laptop under Linux), but the ratios indicate at least an order of magnitude different in performance.


You can use sprites within canvas, but excanvas doesn't support it. Therefore it will not work in Internet Explorer.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: