What this is a drawing tool, and you can draw with a variety of lines. You can draw with a triangle, rectangle, and ellipse. In my sketch, I put text in the bottom right showing how you could change the lines. 1-5 buttons change the lines and all you need to do is change the lines. There are also letters to control the lines! Find them all!
A fork of Drawing Tool by MarcusD45
xxxxxxxxxx
//Intilization Variables
int lineType=0;
//Float Variables
float c; //For random color
void setup(){
size(550,550);//Size of Sketch
}
void draw(){ //All the lines below with the variables
if(lineType==0){ line(pmouseX,pmouseY,mouseX,mouseY);
stroke(52,106,231);
strokeWeight(4);//Stroke of all the lines
}
if(lineType==1){ //Ellipse Line
stroke(184,107,193);
ellipse(mouseX,mouseY,10,10);
}
if(lineType==2){ //Rect Line
stroke(201,203,64);
rect(mouseX,mouseY,20,20);
}
if(lineType==3){//Triangle Line
stroke(203,37,37);
triangle(pmouseX-20,mouseY-40,pmouseX-10,mouseY-30,pmouseX-20,mouseY-20);
}
if(lineType==4){//RAINBOW LINE :)
frameRate(255);
stroke(c=random(255),c=random(255),c=random(255));
line(pmouseX,pmouseY,mouseX,mouseY);
}
if(lineType==5){//To Turn it Off
}
textSize(32); //Text to show how to change lines
text("Lines", 450, 480);
textSize(12);
text("1,l Line", 450, 500);
text("2,e Circle", 450, 510);
text("3,r Rectangle", 450, 520);
text("4,g Triangle", 450, 530);
text("5,f Special :)", 450, 540);
text("6,o Turn it off", 450, 550);
}
void keyPressed(){ //Keys to press to change lines
if(key=='1'||key=='l'){//Regular Line
lineType=0;}
if(key=='2'||key=='e'){//Ellipse Line
lineType=1;}
if(key=='3'||key=='r'){//Rect Line
lineType=2;}
if(key=='4'||key=='g'){//Triangle Line
lineType=3;}
if(key=='5'||key=='f'){//RAINBOW LINE :)
lineType=4;}
if(key=='6'||key=='o'){//To turn it off
lineType=5;}
}