Friday, June 30, 2017

Example 7 - Line

// Example 7 - Line

function setup() {

  createCanvas(640, 480);
  // gray background
  background(128);

  // magenta stroke of 5
  stroke(255, 0, 255);
  strokeWeight(5);

  // 2 horizontal lines
  line(10, 10, width-10, 10);
  line(10, height-10, width-10, height-10);

  // 3 vertical lines
  line(10, 10, 10, height-10);
  line(width/2, 10, width/2, height-10);
  line(width-10, 10, width-10, height-10);
}

Output:


No comments:

Post a Comment