3 # Copyright (C) 2000,2002 David J. Goehrig
11 my $class = ref($proto) || $proto;
14 verify (%options, qw/ -data -mask -x -y /) if $SDL::DEBUG;
16 my $self = \SDL::NewCursor($options{-data},$options{-mask},
17 $options{-x},$options{-y});
24 SDL::FreeCursor($$self);
28 my ($self,$x,$y) = @_;
29 SDL::WarpMouse($x,$y);
34 SDL::SetCursor($$self);
42 my ($self,$toggle) = @_;
43 SDL::ShowCursor($toggle);
56 SDL::Cursor - a SDL perl extension
60 $cursor = SDL::Cursor->new(
61 -data => new SDL::Surface "cursor.png",
62 -mask => new SDL::Surface "mask.png",
68 the SDL::Cursor module handles mouse cursors, and provide the developer to
69 use custom made cursors. Note that the cursors can only be in black and
74 =head2 new( -data => $surface_data, -mask => $surface_mask, x => $x, y => $y)
76 Creates a new cursor. The <C>-data</C> and <C>-mask</C> parameters should be both black and white pictures. The height and width of these surfaces should be a multiple of 8. The <C>-x</C> and <C>-y</C> are the coordinates of the cursor 'hot spot'.
80 Set the position of the cursor at the <C>$x</C>, <C>$y</C> coordinates in the application window.
84 Set the cursor as the active cursor.
88 When used statically <C>SDL::Cursor::get()</C>, it will return the instance of the current cursor in use. Called as a method, it will return itself.
90 This method can be useful if you are dealing with several cursors.
94 Set the visibility of the cursor. A false value will make the cursor
95 invisible in the Application window. A true value will show it back.
103 L<perl> L<SDL::Surface>