Processing on the web questions
in
Processing with Other Languages
•
3 months ago
There are two things I want to do:
1) Use the mouse location from the html to draw on the processing sketch. I curently have the sketch drawng when the cursor is inside the sketch, but I want to draw regardless of where on the web page the cursor is. Can the sketch draw even when the cursor is not inside of the sketch? Is there a good way to pass the mouse x/y from the html as a variable into a processing sketch?
I know the below will grab the mouse location, would it work to name the .pde file in the function?
$("html") .mousemove(processingVariables);
function processingVariables(e) {
$("name of processing applet?").html(e.pageX);
$("name of processing applet?").html(e.pageY);
}
2) I want to have the sketch as a project in a portfolio site. Can the sketch receive the mouse data and draw even when it's not the selected project and visible?
I'm new to processing and looking for some guidance and advice. Thank You!
1