Curious that Canvas rendering is so much slower / causes more load than the HTML backend, at least for me. Anyone know why?
Sprite.js: HTML5 framework for creating efficient animations in browsers
11–17 of 17 posts
Re: Sprite.js: HTML5 framework for creating efficient animations in browsers
#12Demo: http://batiste.dosimple.ch/sprite.js/test_input.html I like how he can fall off the ledge into an infinite drop.
Re: Sprite.js: HTML5 framework for creating efficient animations in browsers
#13Curious that Canvas rendering is so much slower / causes more load than the HTML backend, at least for me. Anyone know why?
Because using Canvas requires you to manage redrawing the entire scene each frame in javascript. When using DOM based sprites, the browser takes care of the redrawing whenever you move an element (e.g. a spite).
This downside of Canvas also means it may become a dead-end for high-performance 2D, unless we discover some way of making all manipulations go completely on-GPU. Canvas is presently best suited for creation of individual textures and sprites, while other methods(CSS, SVG, WebGL) are better to render and transform them.
Re: Sprite.js: HTML5 framework for creating efficient animations in browsers
#14Re: Sprite.js: HTML5 framework for creating efficient animations in browsers
#15I made a prototype a while ago just to demo some sprite movement while messing around with Node.js (it's concurrent multi-user): http://rpg.sleeperbot.com/
Re: Sprite.js: HTML5 framework for creating efficient animations in browsers
#16Curious that Canvas rendering is so much slower / causes more load than the HTML backend, at least for me. Anyone know why?
Performance
The HTML backend has received a particular attention to be as efficient as possible.Re: Sprite.js: HTML5 framework for creating efficient animations in browsers
#17Curious that Canvas rendering is so much slower / causes more load than the HTML backend, at least for me. Anyone know why?
Because using Canvas requires you to manage redrawing the entire scene each frame in javascript. When using DOM based sprites, the browser takes care of the redrawing whenever you move an element (e.g. a spite).