Friday, June 30, 2017

Example 10 - Text

// Example 10 - Text

function setup() {

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

  // black stroke of weight 2, green fill
  stroke(0);
  strokeWeight(2);
  fill(0, 255, 0)
  
  // Size of text, center in text box
  textSize(64);
  textAlign(CENTER, CENTER);
  
  // text box size of width/2, height/2
  // top left anchor at width/4, height/4
  text("Hello World!!!", 0.25*width, 0.25*height, 0.5*width, 0.5*height);

}

Output:


No comments:

Post a Comment