From: Breno G. de Oliveira Date: Sun, 30 Aug 2009 03:41:02 +0000 (-0300) Subject: improved documentation X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=23dbccd4299884e353920f14ea27a0a1ce1f4e07;p=sdlgit%2FSDL_perl.git improved documentation --- diff --git a/lib/SDL/Rect.pm b/lib/SDL/Rect.pm index d1d201b..25aa5a1 100644 --- a/lib/SDL/Rect.pm +++ b/lib/SDL/Rect.pm @@ -81,46 +81,53 @@ sub height { __END__; -=pod - - =head1 NAME -SDL::Rect - a SDL perl extension +SDL::Rect - raw object for storing rectangular coordinates =head1 SYNOPSIS - $rect = new SDL::Rect ( -height => 4, -width => 40 ); + my $rect = SDL::Rect->new( -height => 4, -width => 40 ); + + $rect->x(12); # same as $rect->left(12) + $rect->y(9); # same as $rect->top(9) =head1 DESCRIPTION C creates a SDL_Rect structure which is -used for specifying regions for filling, blitting, and updating. +used for specifying regions of pixels for filling, blitting, and updating. These objects make it easy to cut and backfill. -By default, x, y, h, w are 0. + +By default, x, y, height and width are all set to 0. =head2 METHODS The four fields of a rectangle can be set simply by passing a value to the applicable method. These are: -=over 4 +=head3 x + +=head3 left + +sets and fetches the x (lefmost) position of the rectangle. -=item * +=head3 y -C sets and fetches the x position. +=head3 top -=item * +sets and fetches the y (topmost) position. -C sets and fetches the y position. +=head3 w -=item * +=head3 width -C sets and fetched the width. +sets and fetched the width of the rectangle (in pixels). -=item * +=head3 h -C sets and fetched the height. +=head3 height + +sets and fetched the height of the rectangle (in pixels). =back @@ -131,7 +138,3 @@ David J. Goehrig =head1 SEE ALSO perl(1) SDL::Surface(3) - - -=cut -