In this chapter we looked at the HTML5 <canvas>
element and saw how it can be used to create simple, static images, basic animations, and even complex interactive games. It provides a rich API that allows us to interact with it programmatically and gives us complete pixel-level control over an area of the page.
We also saw that although current versions of Internet Explorer don't support the <canvas>
element natively, we can use a JavaScript library provided by Google to port most canvas functionality to this browser. Some animations however are still beyond IE8's capabilities even with Google's library. IE9 does support the <canvas>
element, so hopefully the requirement of this library will soon become a thing of the past.
In this chapter, we covered the following subjects:
The
<canvas>
script APIDrawing to the
<canvas>
Using the
<canvas>
with Internet ExplorerCreating animations on the
<canvas>
Creating interactive games with the
<canvas...