> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://designuniandes.sketchpad.cc/sp/pad/view/ro.oD2gq-nl2fB/rev.1
 * 
 * authors: 
 *   Victor Mahecha

 * license (unless otherwise specified): 
 *   creative commons attribution-share alike 3.0 license.
 *   https://creativecommons.org/licenses/by-sa/3.0/ 
 */ 



// This sketch builds on a prior work, "Modified clone of 'Assignment 4: Interaction'", created by Victor Mahecha
// http://designuniandes.sketchpad.cc/sp/pad/view/ro.BuPs8XfP9Kl5aT/rev.1



// This sketch builds on a prior work, "Assignment 4: Interaction", created by Hernando Barragan
// http://designuniandes.sketchpad.cc/sp/pad/view/ro.B4VbtZTzKDqjC4/rev.3



PFont f;
float herramienta = 0;

void setup()
{
  background(0);
size(500,500);
f = createFont("Helvetica",50,true);
}

void draw()
{
  fill(50);
  rect (5,5,40,40);  
  rect (45,5,40,40);  
  rect (85,5,40,40);  
 rect (125,5,40,40);
 //
  rect (165,15,40,20);  
  rect (205,15,40,20);  
  rect (245,15,40,20);  
 
 
 noStroke();
fill(255);
  rect (175,15,20,20);  
  ellipse(225,25,20,20);  
  triangle (30+207+15, 35, 58+207, 15, 86+207-15, 35);  
  stroke(0);

if (mouseX >=5 && mouseX <=45 && mouseY >=5 && mouseY<= 45 && mousePressed == true){
 herramienta = 1;
}
if (mouseX >45 && mouseX <=85 && mouseY >=5 && mouseY<= 45 && mousePressed == true){
 herramienta = 2;
}
if (mouseX >85 && mouseX <=125 && mouseY >=5 && mouseY<= 45 && mousePressed == true){
 herramienta = 3;
}

if (mouseX >125 && mouseX <=165 && mouseY >=5 && mouseY<= 45 && mousePressed == true){
 herramienta = 4;
}
 ////complemento

if (mouseX >165 && mouseX <=205 && mouseY >=15&& mouseY<= 35 && mousePressed == true){
 herramienta = 5;
}
if (mouseX >205 && mouseX <=245 && mouseY >=15 && mouseY<= 35 && mousePressed == true){
 herramienta = 6;
}
if (mouseX >245 && mouseX <=285 && mouseY >=15&& mouseY<= 35 && mousePressed == true){
 herramienta = 7;
}

if (herramienta == 1)
{
background(0);
stroke(0);
fill(50);
  rect (5,5,40,40);  
  rect (45,5,40,40);  
  rect (85,5,40,40);  
  rect (125,5,40,40); 
  //
   rect (165,15,40,20);  
  rect (205,15,40,20);  
  rect (245,15,40,20);  
 
 
 noStroke(); 
 fill(255);
 rect (175,15,20,20);  
  ellipse(225,25,20,20);  
  triangle (30+207+15, 35, 58+207, 15, 86+207-15, 35);  
  stroke(0);
  
}

if (herramienta == 2)
{
 if (mousePressed == true)
  {fill(mouseX,mouseY, random(0,250));
  noStroke();
  rect (mouseX,mouseY,20,20);  
  rect (mouseY,mouseX,20,20);  
  stroke(1);
  }
}
if (herramienta == 3)
{
 if (mousePressed == true)
 
  { stroke (255);
  fill(mouseX,mouseY, random(0,250));
 line(mouseX,mouseY,mouseX-20,mouseY+10);
 line(mouseY,mouseX,mouseX-20,mouseY+10);  
 line(mouseX,mouseY,-mouseX-20,mouseY+10);
 line(mouseY,mouseX,mouseX-20,-mouseY+10); 
 stroke (0);
  }
}




if (herramienta == 4)
{
 if (mousePressed == true)
 {
   strokeWeight(random(0,1));
   stroke(255);
   line(pmouseX,pmouseY,mouseX,mouseY);
     stroke(0);
     strokeWeight(0);
}
}

if (herramienta == 5)
{
 if (mousePressed == true)
 {
  noStroke();
   fill(mouseX,mouseY, random(0,250));
   arc(mouseX,mouseY,2*cos(pmouseX) * 50,2*cos(pmouseX) * 50, -sin(pmouseX), PI+QUARTER_PI+ sin(pmouseX)); 
   arc(mouseX-20,mouseY+20,2*sin(pmouseX) * 30,2*sin(pmouseX) *30, cos(pmouseX), (PI+QUARTER_PI+ cos(pmouseX))); 
     stroke(0);
    
}
}

if (herramienta == 6)
{
 if (mousePressed == true)
 {
   strokeWeight(random(0,1));
   stroke(255,random(0,255),random(0,255));
   line(pmouseX,pmouseY,random(0,400),random(0,400));
     stroke(0);
     strokeWeight(0);
}
}

if (herramienta == 7)
{
 if (mousePressed == true)
 {
   noStroke();
   fill(mouseX,mouseY, random(0,250));
   strokeWeight(random(0,1));
   bezier(pmouseX,pmouseY,mouseX,mouseY, random(0,400),cos(mouseX)+mouseX,random(0,400),sin(mouseY)+mouseY);
     stroke(0);
     strokeWeight(0);
}

}

stroke(0);
fill(50);
  rect (5,5,40,40);  
  rect (45,5,40,40);  
  rect (85,5,40,40);  
  rect (125,5,40,40); 
  //
   rect (165,15,40,20);  
  rect (205,15,40,20);  
  rect (245,15,40,20);  
  noStroke(); 
 fill(255);
 rect (175,15,20,20);  
  ellipse(225,25,20,20);  
  triangle (30+207+15, 35, 58+207, 15, 86+207-15, 35);  
  stroke(0);
  
 
 
 
textFont(f,40);                 
fill(255);                        
text("B",10,40);
textFont(f,40);                                       
text("C",50,40);
textFont(f,40);                                       
text("L",90,40);
textFont(f,40);                                       
text("R",130,40);

 

}