Processing on a webpage

Hi Domnic, I took the liberty of putting a post on your blog about getting your processing code into a webpage. I took a look at it and there are a number of difficulties and restrictions which I couldn’t cover in any detail here.
The easiest solution I could find as far as WorPress is concerned is using the ProcessingJS plugin (look in your plugins section I installed it there). When you are in text mode writing a post you will see a processing button above the text field now. Click that on a blank new post and it will insert in code that you should recognise from using processing. Go to your processing sketch and copy your code in here and you should be able to see your artwork display in the post or page. There may be an issue if you are using external files such as images or audio; I haven’t looked at that yet.
Anyway take a look at the code in this post here and you will get a clear example about how to go about it.
Paul

//Info: http://processingjs.org/reference
int i = 0;
void setup() {
size(600, 150);
background(255);
smooth();
strokeWeight(2);
frameRate(24);
}
void draw() {
stroke(random(50), random(255), random(255), 100);
line(i, 0, random(0, width), height);
if (i < width) {
i++;
} else {
i = 0;
}
}

Leave a Reply

Your email address will not be published.