In this tutorial, we will present the html canvas and all its methods. For an alternative, the standard reference is the Mozilla canvas tutorial, although many other interesting tutorials can be found on the web.
This tutorial will focus on 2d drawings; 3d drawings will be done using WebGL and covered in other tutorials.
We assume that you are familiar with javascript. In all of our examples, we will use an embedded html canvas as described by the following html code
If you feel curious (and adventurous!),
you can view (and modify!) the actual code used to generate the window on the
right by clicking on the image
above.
However it will likely seem a bit overwhelming at this time ... but hopefully
the canvas-related methods used should become familiar by the time you complete this tutorial.
Keep your personal notes here. These notes are stored by your browser on your own computer, and will be available from any page on this site. You can choose to use html syntax for formatting.