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">
var sketchProc = function(processingInstance) {
with (processingInstance) {
size(400, 400);
frameRate(30);
// This is what I want to be able to change by a text box
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);
//End of what I want to change with a text box
}};
var canvas = document.getElementById("mycanvas");
constructor.
var processingInstance = new Processing(canvas, sketchProc);