Processing 按钮、文本字段、处理中的文本区域

Processing 按钮、文本字段、处理中的文本区域,processing,Processing,是否有任何简单的库来获取gui功能,如文本字段、处理中的文本区域。我在processing中编写了一个乒乓球游戏,我希望文本字段能够获得玩家的姓名。 在下面的代码中,我需要一个文本字段来获取玩家的名字 这是我的密码 int butt=0; float velx=-2; float vely=-2; float x=350,y=200; int s=150;

是否有任何简单的库来获取gui功能,如文本字段、处理中的文本区域。我在processing中编写了一个乒乓球游戏,我希望文本字段能够获得玩家的姓名。 在下面的代码中,我需要一个文本字段来获取玩家的名字 这是我的密码

            int butt=0;
            float velx=-2;
            float vely=-2;
            float x=350,y=200;

            int s=150;
            int score1=0,score2=0;
            float speed = 1;
            float speed_cont = 0.0001;

            void setup(){
              size(700,400);
              smooth();
              background(100,200,100);
            }

            void draw(){
                stroke(255);
                strokeWeight(15);
                fill(100,100,200);

                rect(175,100,340,100);
                fill(255);
                textSize(38);

                text("CLICK TO PALY",200,160);
                fill(0);
                textSize(30);

                text("Done By BOBO(TARUN GOVIND KESHAV)",50,300);
                textSize(18);
                text("mail: tarun.83581@gmail.com",50,330);
                noStroke();

                if (mousePressed && (mouseButton == LEFT)) {
                  butt=1;
                }

                if(butt==1){
                  background(210);
                  textSize(32);

                  text("score :", 100,30);
                  text(score1,300,30);
                  text(":",400,30);
                  text(score2,500,30);

                  x = x+velx*speed;
                  y = y+vely*speed;
                  speed = speed +speed_cont; // speed control value

                  if(x<=75){
                      x=350;y=200;score2+=1;
                  }
                  if((x>=625)){
                      x=350;y=200;score1+=1;
                  }
                  if((x<=80)&(y>s)&(y<(s+80))){ 
                      velx = -velx;
                  }
                  if((y>=380)||(y<=20)){
                      vely = -vely;
                  } 
                  if((x>=620)&(y>mouseY)&(y<(mouseY+80))){
                      velx = -velx;
                  }

                  ball(x,y);
                  slider(s);
                  slider1(mouseY);
                  }
            }
            void ball(float x,float y){
              fill(0);
              arc(x,y,40,40,0,2*PI);
            }

            void slider(int y){
              fill(200,100,100);
              rect(20,y,40,80);
            }

            void keyPressed(){
             if(keyCode == UP){s=s-15;}
              if(keyCode == DOWN){s = s+15;}
            }

            void slider1(int y){
              fill(200,100,100);
              rect(640,y,40,80);
            }
int-butt=0;
浮动幅度=-2;
浮动=2;
浮动x=350,y=200;
int s=150;
int评分1=0,评分2=0;
浮动速度=1;
浮动速度_cont=0.0001;
无效设置(){
规模(700400);
光滑的();
背景(100200100);
}
作废提款(){
中风(255);
冲程重量(15);
填充(100100200);
rect(175100340100);
填充(255);
文本大小(38);
文本(“点击播放”,200160);
填充(0);
文本大小(30);
文本(“由BOBO(TARUN GOVIND KESHAV)完成)”,50300;
文本大小(18);
文本(“邮件:tarun。83581@gmail.com",50,330);
仰泳();
如果(鼠标按下&(鼠标按钮==左)){
对接=1;
}
如果(对接=1){
背景(210);
文本大小(32);
文本(“分数:”,100,30);
案文(第1300,30段);
正文(“:”,400,30);
文本(2 500,30);
x=x+velx*速度;
y=y+y*速度;
速度=速度+速度\u cont;//速度控制值
如果(x=625)){
x=350;y=200;分数1+=1;
}

如果在processing.org网站上((xs)和(y=380)| |(y=620)和(y>mouseY)和(y),则库页面上列出了3个GUI库()

我以前和你一起工作过,跑步并不难,我会满足你的需求