diff --git a/library/p5.clickable.js b/library/p5.clickable.js index 525fd35..12d5fc6 100644 --- a/library/p5.clickable.js +++ b/library/p5.clickable.js @@ -11,11 +11,14 @@ var cl_clickables = []; //each draw cycle. p5.prototype.runGUI = function () { for (i = 0; i < cl_clickables.length; ++i) { - if (cl_lastHovered != cl_clickables[i]) + if (cl_lastHovered != cl_clickables[i]){ + cursor("initial"); // Reset the cursor as it is no longer hovering the clickable. cl_clickables[i].onOutside(); + } } if (cl_lastHovered != null) { if (cl_lastClicked != cl_lastHovered) { + cursor(cl_lastHovered.hoverCursorStyle); cl_lastHovered.onHover(); } } @@ -69,6 +72,7 @@ function Clickable(x,y) { this.textSize = 12; //Size for the text shown this.textFont = "sans-serif"; //Font for the text shown this.textScaled = false; //Scale the text with the size of the clickable + this.hoverCursorStyle = "pointer" //The cursor style when clickable is hovered // image options this.image = null; // image object from p5loadimage()