Core HTML5 Canvas: Graphics, Animation, and Game Development

David M. Geary

Language: English

Publisher: Prentice Hall

Published: Jan 2, 2012

Description:

Download the book's code and a free chapter at corehtml5canvas.com Read how David wrote Core HTML5 Canvas: corehtml5canvas.wordpress.com/2012/08/08/the-making-of-core-html5-canvas
Check out David's article series on
HTML5 2D Game Development at IBM's developerworks: ibm.com/developerworks/library/j-html5-game1
This book is a painstakingly crafted, expertly written, code-fueled, no-nonsense deep dive into HTML5 Canvas printed in full color with syntax-highlighted code listings throughout.
Core HTML5 Canvas is written for experienced software developers with an intermediate-level understanding of JavaScript.
The result of two years full-time work by a long-time best-selling author, this book shows you how to implement anything you can imagine with the Canvas 2D API, from text editors to video games. Geary meticulously covers every detail of the API with crystal-clear writing so that you not only understand advanced concepts, but most importantly, you can modify the book's examples for your own specific use cases.

Here are some of the things you will learn about in this book:

  • The canvas element --using it with other HTML elements, handling events, printing a canvas, and using offscreen canvases
  • Shapes --drawing, dragging, erasing, and editing lines, arcs, circles, curves, and polygons; using shadows, gradients, and patterns
  • Text --drawing, positioning, setting font properties; building text controls
  • Images --drawing, scaling, clipping, processing, and animating
  • Animations --creating smooth, efficient, and portable animations
  • Sprites --implementing animated objects that have painters and behaviors
  • Physics --modeling physical systems (falling bodies, pendulums, and projectiles), and implementing tweening for nonlinear motion and animation
  • Collision detection --advanced techniques, clearly explained
  • Game development --all aspects of game development, such as time-based motion and high score support, implemented in a game engine
  • Custom controls --infrastructure for implementing custom controls; implementing progress bars, sliders, and an image panner
  • Mobile applications --fitting Canvas apps on a mobile screen, using media queries, handling touch events, and specifying iOS5 artifacts, such as app icons

Throughout the book, Geary discusses high-quality, reusable code to help professional developers learn everything they really need to know, with absolutely no fluff. All the book's code and live demonstrations of key examples are available at CoreHTML5Canvas.com.

Review

"The HMTL5 canvas has long needed a thoughtful and thorough presentation -- and this is that book... In many ways, this book reminds me of the old-style tutorials we all miss: complete, approachable, with high production values in the publication process... An excellent volume." - Dr. Dobbs

" Core HTML5 Canvas: Graphics, Animation, and Game Development is a terrific guide to building HTML5 games using the Canvas object... It is a beautifully-presented guide to drawing using the Canvas object, with a focus on game development." - gamedev.net

"This comprehensive book covers all you need to know about the HTML5 canvas element so that you can build robust online games for desktop and mobile devices. I learned more about the canvas element from this book than I learned from any other resource, online or off. I have reviewed other canvas books, and most of them are very good, but this one is great." - About.com

"This was a delightful book that will help readers understand the finer points of developing games in HTML5's canvas element. While it doesn't get you to the point of developing three dimensional blockbuster games inside the browser, it does bite off a very manageable chunk for most readers. And, if you're a developer looking to get into HTML5 game design, I heavily recommend this text as an introduction". - slashdot.org

About the Author

David Geary is a long-time author who wrote the best-selling books on both Java component frameworks: Graphic Java 2: Swing, Third Edition (Prentice Hall, 1999), and (with Cay Horstmann) Core JavaServerâ„¢ Faces, Third Edition (Prentice Hall, 2010). In 2011, David co-founded the HTML5 Denver meetup group (meetup.com/HTML5-Denver-Users-Group), which has grown to over 1000 members.