Skip to content

Latest commit

 

History

History
48 lines (34 loc) · 722 Bytes

Lesson1.md

File metadata and controls

48 lines (34 loc) · 722 Bytes

Lesson 1: The Canvas

function setup() {
}

function draw() {
} 

This sets up an empty file. Click on the index.html file to see it. But it looks blank!

function setup() {
  background('pink');
}

function draw() {
} 

That looks way smaller than it should. That's because we need to create a canvas to draw on.

function setup() {
  createCanvas(100, 100)
  background('pink');
}

function draw() {
} 

Better! Let's make it the size of the whole window:

function setup() {
  createCanvas(window.innerWidth, window.innerHeight)
  background('pink');
}

function draw() {
} 

Something to note: (0, 0) is actually in the top left corner.