问题描述
好的,在你试过了什么?是我目前的代码。我想知道是否有人可以帮助我这样做,所以出现一个文本框,当你粘贴一个processing.js代码时,它输出一个图纸。如果这是有道理的。
基本上,
fill(255,255,0);
ellipse(200,200,200,200);
noFill();
stroke(0,0,0);
strokeWeight(2);
arc(200,200,150,100,0,PI);
fill(0,0,0);
ellipse(250,200,10,10);
ellipse(153,200,10,10);
将是一个函数,它接受文本框的输出并运行该文本框的输出。
因此文本框会打开,你可以输入...
椭圆(200,200,200,200);
和圆圈会出现在点击上。请有人写这个或帮助那将是伟大的。 IDK如果你需要像jquery但可能会打破
我尝试过什么:
<!DOCTYPE html>
< canvas id =mycanvas>
Okay so in the "What have you tried?" is the code I currently have. I was wondering if anyone could help me make it so a text box appears and when you paste a processing.js code it outputs a drawing. If that makes sense.
Basically,
fill(255, 255, 0);
ellipse(200, 200, 200, 200);
noFill();
stroke(0, 0, 0);
strokeWeight(2);
arc(200, 200, 150, 100, 0, PI);
fill(0, 0, 0);
ellipse(250, 200, 10, 10);
ellipse(153, 200, 10, 10);
would be a function that takes the output of textbox and runs the output of that text box.
So a text box would open up and you could type in...
ellipse(200, 200, 200, 200);
and a circle would appear on a click. PLEASE someone write this or help that would be great. IDK if you need like jquery but that might break the
What I have tried:
<!DOCTYPE html>
<canvas id="mycanvas">
推荐答案
这篇关于如何获取文本框输出来操作JS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!