Hi again!
For another part of my project I’m trying to figure out how to use a element in the HTML of my sketch to change a set variable in my Javascript. In specific I’m using it to change the background image variable of the Javascript, but I’m not finding anything in the documentation that helps me figure out what to put in the “onclick=” part of the element that can lead it to the variable in my javascript.
I’m wondering if it’s even a possibility at this point, but I’m very stumped at this part.
If your element is pre-defined in your HTML file, you can use select() to find it:
And then invoke method mousePressed() over the found element in order to add a callback to it:
2 Likes
I see, would it also be possible to use this to control a camera’s position?
You mean this 1: