How do I create a text box?
The viewer's can type even If they did not create the program. Like the title box for this forum. What Is the code so the viewer can continue? Can you help me?
I wish i knew the answer
I'm assuming you mean in Processing JS
The basic idea is to draw a box and then draw text on top of that box, with the text being a string that gets added to whenever the user types, the optional 4 and 5 parameters to the text command make it somewhat simple to restrict long text from going outside the box.
Here's one example I had in my browser history https://www.khanacademy.org/computer-programming/textbox/5947532824281088
Or here's one I did myself (along with a bunch of other things for demo purposes)
https://www.khanacademy.org/computer-programming/processing-js-examples/6464803188899840
They aren't all that advanced implementations, but they'll probably get the job done if you just need 1 or 2.....
you can do it in html like this
<input type="text" id="what ever you want" name="subject" placeholder=" subject"
id tag is optional i hope this helped!
Please sign in to leave a comment.