HTML5 Canvas

Author: Steve & Jeff Fulton
Publisher: O'Reilly, 2011
Pages: 652
ISBN: 978-1449393908
Aimed at: Javascript programmers
Rating: 3.5
Pros: Extensive treatment of games and beyond
Cons: Not focused on Canvas
Reviewed by: Ian Elliot

This is a big book and you can't help but wonder what it has to say about Canvas - which is a fairly simple graphics subsystem.

Chapters 1 and 2 tell you almost all you need to know about how Canvas works. Chapter 1 deals with the very basics and provides a simple guess a letter game. Chapter 2 pushes on into general 2D graphics where you find out about drawing arcs curves and so on. From this point the book goes into detail about other Canvas aspects and into more general graphics topics.

Chapter 3 explains everything you could possibly want to know about text and Canvas. It also goes into some non-text related ideas about dynamic resizing. Chapter 4 is about using images and goes well beyond the basics to consider animation and creating a tile map of images.


Banner

 

Chapter 4 is really the last chapter that deals with pure Canvas topics. That is, after page 169 we are into general programming topics which are being expressed using Canvas. Chapter 5 is about Math, Physics and Animation and if you know how to bounce a ball around the screen and use gravity you might not get much from it. Of course if you don't know the basics of sprite animation this is a very valuable chapter. Chapter 6 shows how to use Canvas and Video in HTML5 but a lot of the information is about how to use video and only later do you discover how to move a video frame to Canvas. Then the same treatment is given to audio and after we have looked at the general topic of HTML5 audio a sample space raiders game is provided to show how audio can be used within and animation.  Chapter 8 develops the game theme with a specific look at Canvas and games but in fact it is really just about HTML5 games and the chapter ends with a big example. Chapter 9 goes into more detail about adding sound to games. It is fair to sum up the bulk of the book, from Chapter 5 to 8 as a "how to create games in HTML5".

The final two chapters take us beyond Canvas in other ways. Chapter 10 is about using PhoneGap to create mobile apps and chapter 11 is about 3D using WebGL and multiplayer using ElectroServer.

If you are looking for a book focused on Canvas and how you use it then you might be disappointed that this book covers more than you would like. It is not a concise introduction to Canvas. The example programs are long and often run over many pages without any break for description. If you already know a lot of graphics and animation techniques then you probably don't need to have the wider picture explained to you. On the other hand if you are a beginner not only to Canvas but to the sorts of things you might use it for then this might be a good choice of book. For me the book could have spent longer on describing the available Canvas methods and properties rather than writing long games that demonstrate how animation and explosions work. If you are looking for serious non-game applications of Canvas you might also be disappointed.

The final verdict is that if you want to find out how to build 2D games using HTML5 this is a reasonable place to start.


Banner


The AWK Programming Language, 2nd Ed

Author: Alfred V. Aho, Brian W. Kernighan and Peter J. Weinberger
Publisher: Addison-Wesley
Pages: 240
ISBN: 978-0138269722
Print: 0138269726
Kindle: B0CCJ1N4X3
Audience: Developers interested in Awk
Rating: 5
Reviewer: Kay Ewbank

The name Brian Kernighan among the authors of this updated classic raises  [ ... ]



Learn Enough JavaScript to Be Dangerous

Author: Michael Hartl
Publisher: Addison-Wesley
Date: June 2022
Pages: 304
ISBN: 978-0137843749
Print: 0137843747
Kindle: B09RDSVV7N
Audience: Would-be JavaScript developers
Rating: 2
Reviewer: Mike James
To be dangerous? Is this a good ambition?


More Reviews

Last Updated ( Wednesday, 27 July 2011 )