Input text Areas

In p5.js, how can I do text area with enters and lines and how Can I split every line to part of array?

Answers

  • RazRaz
    edited March 2016

    but GoToLoop: see! I cant do enters, and if I change the size the text doesn't start from the upper corner, it starts ant the center. I want to do enters (the ability to do many lines at the text box), and I cant. this is my code:

    var textB,button,para;
    var y=170;
    function setup() {
    
    
      textB=createInput("Type a text");
      textB.size(150,100);
      textB.position(50,50);
    
      button=createButton("Click");
      button.mousePressed(writeText);
      button.position(50,160);
    
    }
    
    function draw() {
    
    }
    function writeText(){
      y+=20;
      para=createP(textB.value());
      para.position(50,y);
    
    }
    
  • RazRaz
    Answer ✓

    oh I succeed. no matter.

    closed I think :)

  • Hi, Raz. I'm having the same problem. How did you solved it?

Sign In or Register to comment.