In the 2.0.5 branch there is a method

SDL::Surface::rect ([x,y])

which retuns a SDL::Rect with the given x,y
(0,0) if not specified.

usage

my $app = new SDL::App;
my $image = new SDL::Surface -name => 'player.png';

$image->blit(0,$app,$image->rect(10,20));

Usually I subclass Surface into Sprite with a draw
method that does just this for single frame images.
For surfaces containing multiple frames, draw defined
differently, with a stored Rect for each frame.

You know this is one of those times I wish we had a
php.net style site


__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

Reply via email to