How Drawing in the Real World Works

Putting pixels on the canvas is really no different than how you would sketch or doodle using a pencil:

widget

Using a pencil, let's say you want to draw a funny four-sided shape that looks as follows:

widget

The way you would do this is as follows:

  1. Find a spot on a piece of paper or a sketchpad
  2. Pick up the pencil
  3. Move pencil to the point you want to start your drawing
  4. Press pencil down and draw a line to create one side of this shape
  5. Press pencil down from where your last line ended to draw another line to create another side of this shape
  6. Keep drawing lines until your shape is complete. Your last line will end at the point you started from to create a closed shape
  7. Adjust the thickness and color of the outline by going over it a few times with a different and thicker pencil
  8. Color the insides of your shape yellow

These steps seem really simple, right? Some of them you perform without even thinking about it! There is a reason why I am pointing out the obvious here. Drawing on the canvas is very similar to drawing manually using a pencil. The only difference is that your pencil in the canvas world is powered by lines of JavaScript as opposed to your actual hands. It’s time to get familiar with what these lines of JavaScript entail.