//Meredith Newman
//Section A
//mjnewman@andrew.cmu.edu
//Project-02-Dynamic-Drawing
function setup() {
createCanvas(640, 480);
}
function draw() {
//clean slate
background(255);
//sliding blue rectangle used for background when mouse is full width
fill(32, 24, 135);
noStroke();
rect(0, 0, mouseX, 480);
//white lines behind diagonal red lines
stroke(255);
strokeWeight(90);
if (mouseX <= width) {
line(0, 0, mouseX, 480);
line(0, 480, mouseX, 0);
}
//red diagonal lines
stroke(230, 24, 30);
strokeWeight(30);
if (mouseX <= width) {
line(0, 30, mouseX, 450);
line(30, 480, mouseX - 30, 0);
}
noStroke();
//white stripes on cross
fill(255);
rect(0, 150, mouseX, 180);
rect(270, 0, 100, mouseY);
//red stripes on cross
fill(230, 24, 30);
rect(0, 190, mouseX, 100);
rect(290, 0, 60, mouseY);
//changing of color to colour
if (mouseX < width* 0.75){
textSize(70);
fill(13, 202, 89);
textStyle(BOLD);
text("Color", 230, 265);
} else if (mouseX > width * 0.75){
textSize(70);
fill(32, 24, 135);
textStyle(BOLD);
text("Colour", 230, 265);
}
}
I wanted to approach my project not just with the idea of of dynamic drawings, but also of dynamic words. I also wanted to add a little humor (or humour) to the project, the changing of color from green is a slight nod to the “right way” of spelling the word. If I had more time, I would have found a way to incorporate more words that are translated differently from culture to culture, but in the same language.