ICC
< back to sketch

Button1 bt1;
int act;
Text1 tx1;
String str="";
TField1 tf1;

void setup(){
  size(300,300);
  framerate(15);
  textMode(ALIGN_CENTER);
  bt1=new Button1();
  tx1=new Text1();
  tf1=new TField1();
  act=0;
}

void loop(){
  background(255,255,255);
  fill(128);
  bt1.draw();

  if(act==1){
    /*
    if(aaa=width/2-bw/2&&mouseX<=width/2+bw/2)&&(mouseY>=by-bh/2&&mouseY<=by+bh/2)){
      if(act==1){
        act=0;
      }
      else{
        act=1;
      }
    }
  }
}

class Text1{
  int tx, ty;
String[] far={"Univers55.vlw","Century_schoolbook.vlw","FranklinGothic-Book.vlw","Futura_book.vlw","Garamond_book.vlw","GillSan.vlw","Meta.vlw","OCR-A.VLW","RotisSanSer.vlw","Slabserif_medium.vlw","BauerBodoni.vlw"};
  BFont[] bfar;
  Text1(){
    bfar=new BFont[far.length];
    for(int i=0;i72){
      fsize=(int)random(millis());
    }
    fill(random(millis())%127,random(millis())%127,random(millis())%127);
    textFont(bfar[(int)random(millis())%bfar.length],fsize);
    px=random(millis())%300;
    py=random(millis())%300;
    push();
    translate(px,py);
    rotate(random(millis()));
    text(str,0,0);
    pop();
  }
}

class TField1{
  BFont ff;
  TField1(){
    str="Hi";
  }
  void draw(){

    ff=loadFont("Univers55.vlw");
    textFont(ff, 18);
    fill(0);
    text(str, width/2, 230);
  }
  void keyPressed(){
    if(key==8){
      str=str.substring(0,str.length()-1);
    }
    else{
      str+=(char)key;
    }
  }
}

< back to sketch