File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,20 @@ define(function(require) {
6969 * WAIT, or path for image
7070 * @param {Number } [x] the horizontal active spot of the cursor
7171 * @param {Number } [y] the vertical active spot of the cursor
72+ * @example
73+ * <div><code>
74+ * // Move the mouse left and right across the image
75+ * // to see the cursor change from a cross to a hand
76+ *
77+ * function draw() {
78+ * line(width/2, 0, width/2, height);
79+ * if (mouseX < 50) {
80+ * cursor(CROSS);
81+ * } else {
82+ * cursor(HAND);
83+ * }
84+ * }
85+ * </code></div>
7286 */
7387 p5 . prototype . cursor = function ( type , x , y ) {
7488 var cursor = 'auto' ;
@@ -149,6 +163,16 @@ define(function(require) {
149163 * Hides the cursor from view.
150164 *
151165 * @method noCursor
166+ * @example
167+ * <div><code>
168+ * function setup() {
169+ * noCursor();
170+ * }
171+ *
172+ * function draw() {
173+ * ellipse(mouseX, mouseY, 10, 10);
174+ * }
175+ * </code></div>
152176 */
153177 p5 . prototype . noCursor = function ( ) {
154178 this . _curElement . elt . style . cursor = 'none' ;
You can’t perform that action at this time.
0 commit comments