I’ve made a processing sketch that I had upload on my website (localhost). But the buttons that I programmed doesn’t work because i’m using the “selectInput” function that is not avaible in web. So, I guess I need to make that button in HTML, but i don’t know how to connect it with the processing sketch (I insert the sketch with echo script type etc.)
I have a second question, how do I connect that processing sketch with a data base? I need to save the last picture that a guy upload so the next guy that enters to the web can see it.
Thanks for reading!
Have you considered using p5.js rather than processing.js? It has p5.DOM and the third party p5.blizzard, which might enable you to work with html elements of all kinds.
If we use Pjs as a JS library, we can use any vanilla JS libraries on it as well.
For example, this is a Pjs sketch written in CoffeeScript transpiled to JS:
And now that same Pjs sketch written in Processing’s Java Mode:
But if we end up converting a Java Mode sketch to use the JS syntax (or another JS transpilable language), there’s little reason to target the old Pjs instead of the current p5js library though.