Skip to content

Instantly share code, notes, and snippets.

@mimetaur
Created October 24, 2019 18:58
Show Gist options
  • Save mimetaur/07c5b2549d720a6876e33bf936a67b70 to your computer and use it in GitHub Desktop.
Save mimetaur/07c5b2549d720a6876e33bf936a67b70 to your computer and use it in GitHub Desktop.
Code 1 2019: Assignment 4 sketch 3 - solution
function setup() {
createCanvas(400, 400);
}
function draw() {
// draw the frame
background("#E6E0E2");
stroke("#887987");
noFill();
rectMode(CENTER);
rect(width / 2, height / 2, width * 0.86, height * 0.86);
stroke("#9D2D35");
drawX(width/2,height/2,100)
}
function drawX(x, y, size) {
applyMatrix();
translate(x, y);
angleMode(DEGREES);
scale(1.65)
rotate(45);
line(0, -size, 0, size);
line(-size, 0, size, 0);
resetMatrix();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment