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.
- 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
About the Author
David Geary is a prominent author, speaker, and consultant who teaches developers how to implement web applications. He 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). David is a prolific speaker who is a three-time JavaOne rock star. In 2011, David co-founded the HTML5 Denver meetup group.