> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://studio.sketchpad.cc/sp/pad/view/ro.i6rM9BIuW/rev.2524
 * 
 * authors: 
 *   Sebastian Rieger
 *   Lucas Diekmann
 *   TrobiiX

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



frauauswahlfeld f1 = new frauauswahlfeld();
mannauswahlfeld m1 = new mannauswahlfeld();
mann horst = new mann();
frau uschi = new frau();
titel t = new titel();
back ck = new back();
hose ho = new hose();
schuhe sch = new schuhe();
hut hu = new hut();
oberk ob = new oberk();
button tt = new button();
menu m = new menu();
PImage webImg;
PImage webImg2;
ArrayList<button> buttonSchrank = new ArrayList<button>();
 
 
void setup() {
    size (1000,700); 
    String url = "http://www.renovierung-baese.de/wp-content/uploads/moderner-begehbarer-kleiderschrank-mit-glastueren.jpg"; 
    webImg2 = loadImage("http://www.jackewiehose-xxl.de/WebRoot/Store9/Shops/63464798/54F4/80EB/3D08/E430/162D/C0A8/2AB8/A2C3/5H16_Kangaroo_Sundowner_tan.png", "png");   
    webImg = loadImage(url, "png");                           
}       
 
 
void draw() {
    image(webImg,0,0,1000,700);
       
     if (m.aktiv == true) {
      m.zeichne();  
      t.da(); 
     }
     if(m.mc.fa == true){
          m.mc.fenster();
      }
     if(m.mc.m2 == true){
          m.mc.menu2();
      } 
     if(ck.aktiv == true){
        ck.erzeugen();
        }
     if(uschi.fz2 == true){
        uschi.fz();
        }
     if(horst.fz2 == true){
        horst.fz();
        }
     if(hu.aktiv == true){
        hu.anzeigen();
        }
     if(ob.aktiv == true){
        ob.anzeigen();
        }
     if(ho.aktiv == true){
        ho.anzeigen();  
        }
     if(sch.aktiv == true){
        sch.anzeigen();
        }
   
   
   
   
    for (button bs : buttonSchrank) {
        bs.display();
    }    
}
 
 
class button {
    double x;
    double y;
    double breite;
    double hoch;
    String text;
    
    button(double s1, double s2, double s3, double s4, String s5) {
        x = s1; y=s2; breite=s3; hoch=s4; text = s5;    
    }
    
    void display() {
        rect(x,y,breite,hoch);
        text(text,x,y);
    }
    
    String mousedrauf() {
        if (x <  mouseX && mouseX < x+breite && y < mouseY && mouseY < y+hoch) {
            return text; 
        }
        else {
            return "ichnich"; 
        }
    }
}
 
 
buttonSchrank.add = new button(100,150,200,50,"Das ist ein Knopf");
 
 
void mouseReleased() {
    for (button bs : buttonSchrank) {
        if (schnellspeicher == "Frau") {
            String schnellspeicher = bs.mousedrauf();
            // hier steht was passiert wenn ein Knopf auf dem Frau steht gedrückt wird
        }
        else if (schnellspeicher == "Mann") {
           // hier steht was passiert wenn ein Knopf auf dem Mann steht gedrückt wird
        }
    }
}
 
 
void mouseReleased() {
    for (button bs : buttonSchrank) {
      String schnellspeicher = bs.mousedrauf();
        if (schnellspeicher == "Frau") {
            // hier steht was passiert wenn ein Knopf auf dem Frau steht gedrückt wird
        } else if (schnellspeicher == "Mann") {
           // hier steht was passiert wenn ein Knopf auf dem Mann steht gedrückt wird
        }
    }
}
 
 
class frau {
    boolean aktiv = false;
    boolean fz2 = false;
    
    void erzeugen() {
        if (mousePressed==true && 300 <  mouseX && mouseX   < 480 && 550 < mouseY && mouseY < 610) {
            if (mouseButton == LEFT) {
                m.mc.m2 = false;
                ck.aktiv = true;
                fz2 = true;
            }
        }   
    }
    
    void fz() {
        String url = "http://fs5.directupload.net/images/170704/ngdsaxpy.jpg";
        webImg = loadImage(url, "png");
        ck.erzeugen();
        hu.aktiv = true;
        ob.aktiv = true;
        ho.aktiv = true;
        sch.aktiv = true;
    }
}
 
 
class mann {
    boolean aktiv = false;
    boolean fz2 = false;
    
    void erzeugen() {
        if (mousePressed==true && 517< mouseX && mouseX   < 667&& 550 < mouseY && mouseY < 610) {
            if (mouseButton == LEFT) {
                m.mc.m2 = false;
                ck.aktiv = true;
                fz2 = true;
            }
        }
    }
    
    void fz() {
            String url = "http://fs5.directupload.net/images/170704/a2lwl52b.jpg";
            webImg = loadImage(url, "png");
            ck.erzeugen();
            hu.aktiv = true;
            ob.aktiv = true;
            ho.aktiv = true;
            sch.aktiv = true;  
    }
}
 
 
class back {
    boolean aktiv = false;
    
    void erzeugen() {
        textSize (15);
        text("Restart",15, 35); 
        strokeWeight(2);
        fill(255);
        noFill();
        stroke(255);
        rect(10,10,60,40,2);
        if (mousePressed == true && 9 <  mouseX && mouseX < 72 && 10 < mouseY && mouseY < 48) {
            if (mouseButton == LEFT) {
                String url = "http://www.renovierung-baese.de/wp-content/uploads/moderner-begehbarer-kleiderschrank-mit-glastueren.jpg";    
                webImg = loadImage(url, "png");
                ck.aktiv = false;
                hu.anzeige  = false;
                m.mc.m2 = false;
                m.aktiv = true;
                uschi.fz2 = false;
                horst.fz2 = false;
                hu.aktiv = false;
                ob.aktiv = false;
                ho.aktiv = false;
                sch.aktiv = false;
            }
        }   
    }
}
 
 
class frauauswahlfeld {
    void anzeigen() {
        textSize(50);
        text("Frau",350, 600); 
        fill(255);
        noFill();
        stroke(255);
        strokeWeight(6);
        rect(330,550,150,60,8);
    }   
}
 
 
class mannauswahlfeld {
    void anzeigen() {
        textSize(50);
        fill(255);
        text("Mann",530, 600); 
        fill(255);
        noFill();
        stroke(255);
        strokeWeight(6);
        rect(517,550,150,60,8);
    }   
}
 
 
class hut {
    boolean aktiv = false;
    boolean anzeige = false;
    int x;
    int y;
    boolean selected = false;
    void anzeigen() {
        textSize(50);
        fill(255);
        text("Hut",797, 100);
        fill(255);
        noFill();
        stroke(255);
        strokeWeight(3);
        rect(740,50,200,60,8);
        
        if(selected == true){
            x = mouseX;
            y = mouseY;
            if (mousePressed==true && mouseButton == LEFT){
                selected = false;
                }
            }
        
        if(anzeige == true){
            image(webImg2,x-100,y-100,200,200);
            }
          if (mousePressed==true && 740< mouseX && mouseX   < 940&& 50 < mouseY && mouseY < 110) {
              if (mouseButton == LEFT) { 
                  anzeige = true;
                  selected = true;
           String url = "http://www.jackewiehose-xxl.de/WebRoot/Store9/Shops/63464798/54F4/80EB/3D08/E430/162D/C0A8/2AB8/A2C3/5H16_Kangaroo_Sundowner_tan.png";
           webImg= loadImage(url, "png");
               aktiv = true;
               ob.aktiv = false;
               ho.aktiv = false;
               sch.aktiv = false;
            }
        }
    }
}
 
 
class oberk {
    boolean aktiv = false;
    
    void anzeigen() {
        textSize(50);
        fill(255);
        text("Body",783, 250);
        fill(0);
        noFill();
        stroke(255);
        strokeWeight(3);
        rect(740,200,200,60,8);
        if (mousePressed==true && 740< mouseX && mouseX   < 940&& 200< mouseY && mouseY < 260) {
             if (mouseButton == LEFT) { 
                 String url = "http://smartportal.info/thumbs/clothes/tshirt/tshirt-04.png";
                 webImg= loadImage(url, "png");
                 aktiv = true;
                 hu.aktiv = false;
                 ho.aktiv = false;
                 sch.aktiv = false;
             }
        }
    }
} 
 
 
class hose {
    boolean aktiv = false;
    
    void anzeigen() {
        textSize(50);
        fill(255);
        text("Hose",783, 450);
        fill(255);
        noFill();
        stroke(255);
        strokeWeight(3);
        rect(740,400,200,60,8);
        if (mousePressed==true && 740< mouseX && mouseX   < 940&& 400< mouseY && mouseY < 460) {
       if (mouseButton == LEFT) { 
           String url = " http://www.martini-sportswear.com/website/var/tmp/image-thumbnails/0/8001/thumb__productdetail/front.png";
           webImg= loadImage(url, "png");
              aktiv = true;
              hu.aktiv = false;
        ob.aktiv = false;
        sch.aktiv = false;
            }
        }
    }
}
  
  
class schuhe {
    boolean aktiv = false;
    
    void anzeigen() {
        textSize(50);
        fill(255);
        text("Schuhe",755, 600);
        fill(0);
        noFill();
        stroke(255);
        strokeWeight(3);
        rect(740,550,200,60,8);
         if (mousePressed==true && 740< mouseX && mouseX   < 940&& 550< mouseY && mouseY < 610) {
       if (mouseButton == LEFT) { 
           String url = "http://holz-gentsch.de/wp-content/gallery/individuelles/schuhe.png";
           webImg= loadImage(url, "png");
              aktiv = true;
              hu.aktiv = false;
        ob.aktiv = false;
        ho.aktiv = false;
            }
        }
    }
}


class menu {
    boolean aktiv = true;
    menutitel mt;
    menuclick mc;
    menu() {
        mt = new menutitel();
        mc = new menuclick();
        }
    void zeichne(){
        mt.display();
        mc.display();
        }
}

class menutitel {
    void display(){
        textSize(50);
        fill(255);
        text("Play",475, 346); 
        fill(255);
        noFill();
        stroke(255);
        strokeWeight(6);
        rect(350,300,350,60,8);
        
        textSize(50);
        fill(255);
        text("How to play",395, 446); 
        fill(255);
        noFill();
        stroke(255);
        strokeWeight(6);
        rect(350,400,350,60,8);
        }
}   

class menuclick {
    boolean fa = false;
    boolean m2 = false;
    void display() {
        if (mousePressed == true && 347 < mouseX && mouseX < 703 && 297 < mouseY && mouseY < 363) {           // für play
            if (mouseButton == LEFT) {
                m.aktiv = false;
                m2 = true;
                }
            }
            
        if (mousePressed == true && 347 < mouseX && mouseX < 703 && 397 < mouseY && mouseY < 463) {           // für how to play
            if (mouseButton == LEFT) {
                fa = true;
                m.aktiv = false;
                }
            }
        }
        
    void fenster() {
            fill(255);
            stroke(255,0,255);
            strokeWeight(7);
            rect(100,100,800,500,7);
            
            strokeWeight(1.7);
            stroke(0);
            fill(155,0,0);
            ellipse(899,101,30,30);               // für gerade 879,121,30,30
            strokeWeight(2);
            stroke(255);
            line(894,96,904,106);
            line(894,106,904,96);
            
            if (mousePressed== true && 885< mouseX && mouseX < 912 && 88< mouseY && mouseY < 114) {           // für how to play
            if (mouseButton == LEFT) {
                m.aktiv = true;
                fa = false;
                }
            }
           textSize(50);
           fill(0);
           text("Do digital designing:",150, 230); 
           textSize(50);
           fill(0);
           text("Click on a piece of clothing",150, 320); 
           textSize(50);
           fill(0);
           text("for selecting it!",150,391);
           textSize(50);
           fill(0);
           text("Enjoy yourselve! ;-)",150,481); 

        }
         
    void menu2() {
        m1.anzeigen();
        f1.anzeigen();
        uschi.erzeugen();
        horst.erzeugen();
        ck.erzeugen();
        t.da();
        }
}  
    
    
class titel {
    void da(){
     textSize(90);
     fill(255,0,255);
        text("Designmaster3000",110, 92); 
        }
}
  
     
      
//https://st.depositphotos.com/1737105/3529/i/950/depositphotos_35290825-stock-photo-full-body-of-fit-muscular.jpg
//ein mann
//eine frau
//http://static2.bigstockphoto.com/thumbs/2/0/3/large1500/30247877.jpg