Google News
logo
p5.js - Interview Questions
What is the strokeWeight() Function in p5.js?
The strokeWeight() function sets the width of a shape’s stroke to specified pixels. It must be called before drawing the shape. The default stroke weight is 1 pixel.
function draw(){
  // Draws a line of 5px thickness
    strokeWeight(5);
    line(50, 25, 50, 75);
}
Advertisement