Wednesday, February 15, 2012

Project 1

This week we started working on Canvas. To include a canvas in the website we start by putting the canvas tags.

function drawShape(){
var canvas = document.getElementById('tutorial');
if (canvas.getContext){
var ctx = canvas.getContext('2d');

}
}
This creates the basic set up for a canvas. In order to be able to draw you need to add
ctx.fillStyle
ctx.fillRect
ctx.beginPath
ctx.arc(
ctx.lineTo
ctx.moveTo
ctx.lineTo
ctx.stroke

To view a example click here.

1 comment:

  1. The assignment this week had two parts: create a blog (done) and summarize your work with the Canvas so far.

    ReplyDelete