pygame / doc / src / sdlcursors.xml

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE module SYSTEM "api.dtd">

<module name="pygame2.sdl.cursors">
  <short>A module containing pre-defined mouse cursors</short>
    Set of cursor resources available for use. These cursors come in a
    sequence of values that are needed as the arguments for
    :meth:`pygame2.sdl.mouse.set_cursor`. To dereference the sequence in place
    and create the cursor in one step, call like this: ::

    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 :meth:`pygame2.sdl.cursors.compile` function can convert these
    string cursors into cursor byte data.

  <func name="compile">
    <call>compile (strings, black, white, xor) -> data, mask</call>
    <desc>Compile cursor strings into cursor data.

    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

  <func name="load_xbm">
    <call>load_xbm (cursorfile, maskfile) -> cursor_args</call>
    <desc>Reads a pair of XBM files into set_cursor arguments

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