X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pages%2FSDL-Joystick.html-inc;h=deb97b754cb05fb5a085e32386eaf2493afdf664;hb=411e0b6a19b323b88847fbffe2323afe98e9f8dc;hp=bf306f3a14e95de80b19076fccc53c5644125852;hpb=a9a9aa21353bebf509e63620aac4346ba5d9b030;p=sdlgit%2FSDL-Site.git diff --git a/pages/SDL-Joystick.html-inc b/pages/SDL-Joystick.html-inc index bf306f3..deb97b7 100644 --- a/pages/SDL-Joystick.html-inc +++ b/pages/SDL-Joystick.html-inc @@ -8,7 +8,7 @@
object SDL::Joystick::open( index ); +new
++object SDL::Joystick->new( index );Opens a joystick for use within SDL. The
if(SDL::Joystick::num_joysticks() > 0) { # Open joystick - my $joystick = SDL::Joystick::open(0); + my $joystick = SDL::Joystick->new(0); if($joystick) { @@ -131,7 +131,7 @@ A joystick must be opened before it can be used.index
refers to the N'th joystick in the system. @@ -95,7 +95,7 @@ A joystick must be opened before it can be used.int SDL::Joystick::index( object );-Returns the
+index
of a givenSDL_Joystick
structure. See SDL::Joystick::openReturns the
index
of a givenSDL_Joystick
structure. See SDL::Joystick::newnum_axes
@@ -139,7 +139,7 @@ A joystick must be opened before it can be used.int SDL::Joystick::num_axes( object );-Return the number of axes available from a previously opened joystick. See SDL::Joystick::open
+Return the number of axes available from a previously opened joystick. See SDL::Joystick::new
int SDL::Joystick::num_balls( object );-
Return the number of trackballs available from a previously opened joystick. See SDL::Joystick::open
+Return the number of trackballs available from a previously opened joystick. See SDL::Joystick::new
int SDL::Joystick::num_hats( object );-
Gets the number of joystick hats from a previously opened joystick. See SDL::Joystick::open
+Gets the number of joystick hats from a previously opened joystick. See SDL::Joystick::new
int SDL::Joystick::num_buttons( object );-
Gets the number of joystick buttons from a previously opened joystick. See SDL::Joystick::open
+Gets the number of joystick buttons from a previously opened joystick. See SDL::Joystick::new
get_axis
is a signed integer (-32768 to 32767
it may be necessary to impose certain tolerances on these values to account for jitter.
Note: Some joysticks use axes 2 and 3 for extra buttons.
Returns a 16-bit signed integer representing the current position of the axis.
-my $joystick = SDL::Joystick::open(0); +my $joystick = SDL::Joystick->new(0); my $x_move = SDL::Joystick::get_axis($joystick, 0); my $y_move = SDL::Joystick::get_axis($joystick, 1); @@ -210,7 +210,7 @@ it may be necessary to impose certain tolerances on these values to account for
SDL_HAT_LEFTDOWN
my $joystick = SDL::Joystick::open(0); +my $joystick = SDL::Joystick->new(0); my $position = SDL::Joystick::get_hat($joystick, 0); @@ -226,7 +226,7 @@ it may be necessary to impose certain tolerances on these values to account for
get_button
returns the current state of the given button on the given joystick.Returns 1 if the button is pressed. Otherwise, 0.
-my $joystick = SDL::Joystick::open(0); +my $joystick = SDL::Joystick->new(0); my $num_buttons = SDL::Joystick::num_buttons($joystick); @@ -250,7 +250,7 @@ it may be necessary to impose certain tolerances on these values to account forReturns 0 on success or -1 on failure
my $delta_x = 0; my $delta_y = 0; - my $joystick = SDL::Joystick::open(0); + my $joystick = SDL::Joystick->new(0); SDL::Joystick::update(); @@ -265,7 +265,7 @@ it may be necessary to impose certain tolerances on these values to account forvoid SDL::Joystick::close( object );-Closes a previously opened joystick. See SDL::Joystick::open
+Closes a previously opened joystick. See SDL::Joystick::new
SDL::Joystick::close($joystick) if SDL::Joystick::opened(0);