Check out this JavaScript file I have stored on GitHub.
// Remember to define the function before setup() and call it under draw()
function pointCoord() {
stroke(255,0,0);
line(mouseX,0, mouseX, height);
line(0,mouseY, width, mouseY);
if (mouseIsPressed){console.log(`x = ${mouseX}, y = ${mouseY}`);}
}
Here is the link to access it through jsdelivr:
// Make sure to define the function before setup() and call it under draw()
function pointCoord() {
stroke(255,0,0);
line(mouseX,0, mouseX, height);
line(0,mouseY, width, mouseY);
if (mouseIsPressed){print("x = "+ mouseX+ ", y = "+mouseY);}
}
(By the way, this JavaScript doesn't follow Vanilla JS standards. It's designed to work with the p5.js library.)
Interestingly, the code on the jsdelivr page isn't reflecting the recent updates from the last 2 commits on GitHub, even though it has been more than 10 hours since the changes were made.
So, the burning question is: how can I get the updated code to show on the jsdelivr CDN?