Allegro::Mouse - Allegro mouse object
use Allegro;
$al = Allegro->new() or die;
The Allegro::Mouse object provides an interface to the Allegro mouse routines. Allegro v4 only supports one mouse.
$mouse = $al->Mouse();
$b1 = $mouse->button(0); $b2 = $mouse->button(1);
If given a parameter, will return the status as a true/false value of whether that button is pressed.
@buttons = $mouse->button;
If no parameter is given, returns an array containing the status of each mouse button.
$x = $mouse->position('x');
$y = $mouse->position('y');
$z = $mouse->position('z');
If supplied a parameter, returns the position of the mouse for that axis.
@pos = $mouse->position;
If no parameter is given, returns an array containing the position for each axis.
$mouse->show($disp);
This will continuously update the mouse by drawing it onto the specified bitmap. This may lead to problems if you are drawing to the bitmap while the mouse pointer is being draw. See freeze and scare below.
$mouse->scare(x => $x, y => $y, width => $w, height => $h);
x, y, width, height are the area that is affected. Defaults to the entire screen. to the entire screen.
$mouse->clip(x => $x, y => $y, width => $w, height => $h);
$mouse->speed(x => 2, y => 2);
$mouse->set(x => 10, y => 10, z => -2);
The z parameter is optional.
$mouse->sprite(bitmap => $bitmap,
x => 0,
y => 0);
($xm, $ym) = $mouse->mickeys;
Colin O'Leary <colin@mx3.org>
Copyright 2003 by Colin O'Leary. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The Allegro library is copyright its authors, and is giftware. See http://alleg.sf.net for more information.