Created
September 2, 2019 15:13
-
-
Save mimetaur/cea2716dadcff6a9a545919faeafb138 to your computer and use it in GitHub Desktop.
Strokes example in p5 js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setup() { | |
createCanvas(600, 600); | |
background(0); | |
} | |
function draw() { | |
background(0); | |
strokeWeight(9); // this sets a thick stroke width | |
// rectMode(CENTER); | |
rect(0, 300, width / 2, height / 2); | |
noStroke(); // this removes the stroke altogether | |
rect(300, 0, width / 2, height / 2); | |
stroke(0); // this sets a black stroke | |
// rect to create rectangle | |
rect(20, 30, 45, 250); | |
rect(90, 30, 45, 250); | |
rect(160, 30, 45, 250); | |
rect(230, 30, 45, 250); | |
// line diagonal | |
strokeWeight(1); // this makes a thinner weight line | |
line(0, 360, 60, 300); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment