Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Canvas Cookbook
  • Toc
  • feedback
Canvas Cookbook

Canvas Cookbook

By : Purushottam Joshi
close
Canvas Cookbook

Canvas Cookbook

By: Purushottam Joshi

Overview of this book

With the growing popularity of HTML5 Canvas, this book offers tailored recipes to help you develop portable applications, presentations, and games. The recipes are simple yet creative and build on each other. At every step, the book inspires the reader to develop his/her own recipe. From basic to advanced, every aspect of Canvas API has been covered to guide readers to develop their own application, presentation, or game.
Table of Contents (11 chapters)
close
10
Index

Chapter 1. Paths and Text

HTML5 Canvas is an element that provides the user with a workspace of a desired size for drawing. The Canvas API contains a rich set of drawing functions that can be accessed through JavaScript. The canvas element can be styled using CSS (Cascaded Style Sheet). CSS styling can improve performance and add interesting effects.

Thus, HTML5 Canvas programming can be done with the support of JavaScript and CSS.

Why HTML5 Canvas?

  • HTML5 Canvas is fully interactive.
  • Every object drawn on canvas can be animated.
  • Canvas is flexible enough to let you draw dynamic graphics. Also it allows adding audio and video.
  • All major browsers support canvas. However, the support and implementation differs from browser to browser.
  • It is a standard open technology.
  • Canvas is portable. Once created, an HTML5 Canvas application can run on almost all devices.
  • To develop Canvas programs you just need a code editor and a browser. You can use sublime (available on www, Text, or HTMLPad), and you can test your code on Google Chrome or Firefox. You can find sublime text at http://www.sublimetext.com/ and HTMLPad at http://www.htmlpad.net/. However, for the recipes in this book I have used Notepad.
  • HTML5 Canvas can be used for gaming, advertising, data representation, education and training, and art and decoration.
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete