Thursday, June 29, 2017

Example 4 - Lime Rectangle on Red background using width and height

// Example 4 - Lime Rectangle on Red background using width and height


function setup() {

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

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

  // width and height are p5 variables
  // created from createCanvas
  rect(50, 50, width - 100, height - 100);
}


No comments:

Post a Comment