SDL::Cursor - a SDL perl extension
$cursor = new SDL::Cursor -data => new SDL::Surface "cursor.png", -mask => new SDL::Surface "mask.png", -x => 0, -y => 0;
To create a new cursor, create a new instance of the Cursor class passing it two surfaces as shown in the example. The x and y values indicate the position of the hot-spot for clicking.
To move the cursor to a position on the screen use the warp method passing the values of x and y. The warp function does not require an instance to have been created, and can be safely used directly.
Similary, to toggle the visible status of the cursor use the show method:
SDL::Cursor::show(0); # this hides the cursor $cursor->show(1); # make the cursor visible
If you have created a new Cursor, to set it as the active cursor use the method 'use':
Finally, if you are using more than one instance of a SDL_Cursor *, you may find the get method useful for finding out the current cursor.
NB: This will not return the value of that instance, but rather the instance currently in use;
David J. Goehrig