Sets the cursor to a predefined symbol or an image, or makes it visible if already hidden.
1# move the mouse left and right across the image 2# to see the cursor change from_ a cross to a hand 3 4def draw(): 5 if py5.mouse_x < 50: 6 py5.cursor(py5.CROSS) 7 else: 8 py5.cursor(py5.HAND)
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
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).
P3D renderers, a generic set of cursors are used because the OpenGL renderer doesn’t have access to the default cursor images for each platform (Processing Issue 3791).
Underlying Processing method: cursor
cursor() -> None cursor(img: Py5Image, /) -> None cursor(img: Py5Image, x: int, y: int, /) -> None cursor(kind: int, /) -> None
img: Py5Image - any variable of type Py5Image
kind: int - either ARROW, CROSS, HAND, MOVE, TEXT, or WAIT
x: int - the horizontal active spot of the cursor
y: int - the vertical active spot of the cursor
Updated on November 12, 2021 11:30:58am UTC