Create bookmark
HTML5 Canvas Cookbook
Do you like this document?
Notes
Please login to add notes
- Cover
- Copyright
- Credits
- About the Author
- About the Reviewers
- www.PacktPub.com
- Table of Contents
- + Preface
- + Chapter 1: Getting Started with Paths and Text
-
+
Chapter 2:
Shape Drawing and Composites
- Introduction
- Drawing a rectangle
- Drawing a circle
- Working with custom shapes and fill styles
- Fun with Bezier curves: drawing a cloud
- Drawing transparent shapes
- Working with the context state stack to save and restore styles
- Working with composite operations
- Creating patterns with loops: drawing a gear
- Randomizing shape properties: drawing a field of flowers
- Creating custom shape functions: playing card suits
- Putting it all together: drawing a jet
-
+
Chapter 3:
Working with Images and Videos
- Introduction
- Drawing an image
- Cropping an image
- Copying and pasting sections of the canvas
- Working with video
- Getting image data
- Introduction to pixel manipulation: inverting image colors
- Inverting video colors
- Converting image colors to grayscale
- Converting a canvas drawing into a data URL
- Saving a canvas drawing as an image
- Loading the canvas with a data URL
- Creating a pixelated image focus
-
+
Chapter 4: Mastering Transformations
- Introduction
- Translating the canvas context
- Rotating the canvas context
- Scaling the canvas context
- Creating a mirror transform
- Creating a custom transform
- Shearing the canvas context
- Handling multiple transforms with the state stack
- Transforming a circle into an oval
- Rotating an image
- Drawing a simple logo and randomizing its position, rotation, and scale
- + Chapter 5: Bringing the Canvas to Life with Animation
-
+
Chapter 6:
Interacting with the Canvas: Attaching Event Listeners to Shapes and Regions
- Introduction
- Creating an Events class
- Working with canvas mouse coordinates
- Attaching mouse event listeners to regions
- Attaching touch event listeners to regions on a mobile device
- Attaching event listeners to images
- Dragging-and-dropping shapes
- Dragging-and-dropping images
- Creating an image magnifier
- Creating a drawing application
- + Chapter 7: Creating Graphs and Charts
-
+
Chapter 8:
Saving the World with Game Development
- Introduction
- Creating sprite sheets for the heroes and enemies
- Creating level images and boundary maps
- Creating an Actor class for the hero and enemies
- Creating a Level class
- Creating a Health Bar class
- Creating a Controller class
- Creating a Model class
- Creating a View class
- Setting up the HTML document and starting the game
- + Chapter 9: Introducing WebGL
- Appendix A: Detecting Canvas Support
- Appendix B : Canvas Security
- + Appendix C : Additional Topics
- Index
Written in cookbook style, this book offers a wide array of techniques for building HTML5 Canvas applications. Each recipe contains step-by-step instructions followed by analysis of what was done in each task and other useful information. The book is designed so that you can read it chapter by chapter, or you can look at the list of recipes and refer to them in no particular order.This book is geared towards web developers who are familiar with HTML and JavaScript. It is written for both beginners and seasoned HTML5 developers with a good working knowledge of JavaScript.
Your free to read time expires in minutes. After that you have to pause for an hour.
Test the closed alpha on paperc.com
Book Details
Authors
Categories
Publishers
Publication year : 2011
License: All rights reserved ©
Times read: 857

