pygame documentation | || Home || Help Contents || || pygame || cdrom || constants || display || draw || event || || font || image || joystick || key || mixer || mixer_music || || mouse || movie || sndarray || surfarray || time || transform || || CD || Channel || Clock || Font || Joystick || Movie || || Rect || Sound || Surface || || color || cursors || sprite ||

## pygame.cursors

Set of cursor resources available for use. These cursors come in a sequence of values that are needed as the arguments for pygame.mouse.set_cursor(). to dereference the sequence in place and create the cursor in one step, call like this; pygame.mouse.set_cursor(*pygame.cursors.arrow).
Here is a list of available cursors; arrow, diamond, ball, broken_x, tri_left, tri_right
There is also a sample string cursor named 'thickarrow_strings'. The compile() function can convert these string cursors into cursor byte data.

compile | - compile cursor strings into cursor data
load_xbm | - reads a pair of XBM files into set_cursor arguments

compile
`pygame.cursors.compile(strings, black, white) -> data, mask`

This takes a set of strings with equal length and computes the binary data for that cursor. The string widths must be divisible by 8.
The black and white arguments are single letter strings that tells which characters will represent black pixels, and which characters represent white pixels. All other characters are considered clear.
This returns a tuple containing the cursor data and cursor mask data. Both these arguments are used when setting a cursor with pygame.mouse.set_cursor().

load_xbm
`pygame.cursors.load_xbm(cursorfile, maskfile) -> cursor_args`

Arguments can either be filenames or filelike objects with the readlines method. Not largely tested, but should work with typical XBM files.