pub static cursor: CursorInternalTypeExpand description
Sets the cursor to a predefined symbol or an image, or makes it visible if already hidden. If you are trying to set an image as the cursor, the recommended size is 16x16 or 32x32 pixels. The values for parameters x and y must be less than the dimensions of the image.
Examples
// Move the mouse across the quadrants
// to see the cursor change
function draw() {
line(width / 2, 0, width / 2, height);
line(0, height / 2, width, height / 2);
if (mouseX < 50 && mouseY < 50) {
cursor(CROSS);
} else if (mouseX > 50 && mouseY < 50) {
cursor('progress');
} else if (mouseX > 50 && mouseY > 50) {
cursor('https://avatars0.githubusercontent.com/u/1617169?s=16');
} else {
cursor('grab');
}
}Parameters
type Built-In: either ARROW, CROSS, HAND, MOVE, TEXT and WAIT
Native CSS properties: ‘grab’, ‘progress’, ‘cell’ etc.
External: path for cursor’s images
(Allowed File extensions: .cur, .gif, .jpg, .jpeg, .png)
For more information on Native CSS cursors and url visit:
https://developer.mozilla.org/en-US/docs/Web/CSS/cursor
x? the horizontal active spot of the cursor (must be less than 32)
y? the vertical active spot of the cursor (must be less than 32)