diff --git a/src/p5.learn.js b/src/p5.learn.js index 664df45..82e4bee 100644 --- a/src/p5.learn.js +++ b/src/p5.learn.js @@ -1020,12 +1020,13 @@ p5.prototype.loadFont = function (path, name) { * @param fontSize size of the text */ p5.prototype.crosshair = function ( + spacing = 1, color = "white", thickness = 1, fontSize = 20 ) { - let x = this.mouseX; - let y = this.mouseY; + let x = spacing*Math.round(this.mouseX/spacing); + let y = spacing*Math.round(this.mouseY/spacing); this.push(); this.cursor("NONE");