Can do and it's pretty easy.
The
only requirement is having access to the HTML box. This is known as
*inline* Javascript (ProcessingJS is javascript). Check this example
here <
http://processingjs.org/learning/> and search for the
"Second Method"
. The guts of it I've shown below. The key points are
a)
script tag link to processing code (I've hijacked processing code from ProcessingJs. You could do put this file up at your site.
b) the data-processing-target must match the name of the canvas tag in the body tag. Otherwise it won't wire up.
c) add your code inside the script tag
d) the canvas tag in the body tag is where you will see your code work.
e)
Check the ProcessingJs site for specific examples of syntax and
techniques <
http://processingjs.org/learning/>. Most of Processing
code works with ProcessingJS.
Note the different comment styles of HTML comment and Processing comment.
Regs PR
<!-- --- start html --->
<html>
<HEAD>
<! --- point a) --->
<script src="http://processingjs.org/js/processing.min.js"></script>
<! --- point b) --->
<script type="text/processing" data-processing-target="MY-CANVAS">
// point c)
void setup()
{
size(200,200);
background(125);
fill(255);
noLoop();
PFont fontA = loadFont("courier");
textFont(fontA, 14);
}
void draw(){
text("Hello Web!",20,20);
//println("Hello ErrorLog!");
}
</script>
</HEAD>
<body>
<!-- point d) -->
<canvas id="MY-CANVAS"></canvas> </body>
</html>
<!-- --- end html --->