Thursday, June 29, 2017

Example 2 - Lime Rectangle on Red background

// Example 2 - Lime Rectangle on Red background

function setup() {

  createCanvas(640, 480);
  background('red');

  stroke('blue');
  strokeWeight(8);

  fill('lime');

  // rectangle is 50 pixels from the 4 sides
  // thus width and height is 100 less
  rect(50, 50, 640 - 100, 480 - 100);
}

Output:


No comments:

Post a Comment