/* For this project, I wanted to make something that can draw
pawprints, since I love dogs. For Mouse left click, I decided
for the mouse to make pink strokes as the "background" color.
Then, mouse right click would make a pawprint. However, the
interesting part is when the mouse is NOT pressed, and moving across
the screen, it's making the background color of mouse pressed different
colors across the screen based on where the mouse location is. The
color values change.
*/
void setup()
{
background(255); //makes the background color white.
size(400,400);
}
void draw()
{
if(mousePressed) //when the mouse is pressed, makes a stroke of 50. the color of the stroke depends on where the mouse x and mouse y is. when the mouse is at 400, 400, the color is 200, 200, which is grey, because the function tells it to have a color that is mouse x/2, and mouse y/2.
{
strokeWeight(50);
stroke(mouseY/2,mouseX/2,mouseX/2);
point(mouseX,mouseY);
}
if(mousePressed)// if the mouse is pressed.
{
if(mouseButton==LEFT)// the left button makes a pink stroke
{
strokeWeight(75);
stroke(225,198,192);
point(mouseX,mouseY);
}
if(mouseButton==RIGHT)//the right mouse button makes a paw print.
{
strokeWeight(15);
stroke(79,39,0);
point(mouseX,mouseY);
stroke(128,64,0);
strokeWeight(12);
point(mouseX,mouseY-13);
point(mouseX-12,mouseY-11);
point(mouseX+12,mouseY-11);
}
}
}
Lena-E
on Wednesday, Oct 15, 2008 – 11:49 am