Name

cursor()

Examples
# Move the mouse left and right across the image
# to see the cursor change from a cross to a hand

def draw(): 
    if mouseX < 50:
        cursor(CROSS)
    else:
        cursor(HAND)
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. It is not possible to load an image as the cursor if you are exporting your program for the Web, and not all MODES work with all browsers. The values for parameters x and y must be less than the dimensions of the image.

Setting or hiding the cursor does not generally work with "Present" mode (when running full-screen).
Syntax
cursor(kind)
cursor(img)
cursor(img, x, y)
cursor()
Parameters
kindint: either ARROW, CROSS, HAND, MOVE, TEXT, or WAIT
imgPImage: any variable of type PImage
xint: the horizontal active spot of the cursor
yint: the vertical active spot of the cursor
Related noCursor()

Updated on Tue Feb 27 14:07:12 2024.

If you see any errors or have comments, please let us know.