SDL::Rect(3) User Contributed Perl Documentation SDL::Rect(3)NAME
SDL::Rect - raw object for storing rectangular coordinates
SYNOPSIS
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)DESCRIPTION
"SDL::Rect::new" creates a SDL_Rect structure which is used for specifying regions of pixels for filling, blitting, and updating. These
objects make it easy to cut and backfill.
By default, x, y, height and width are all set to 0.
METHODS
The four fields of a rectangle can be set simply by passing a value to the applicable method. These are:
x
left
sets and fetches the x (lefmost) position of the rectangle.
y
top
sets and fetches the y (topmost) position.
w
width
sets and fetches the width of the rectangle (in pixels).
h
height
sets and fetches the height of the rectangle (in pixels).
AUTHOR
David J. Goehrig
SEE ALSO perl(1)SDL::Surface(3)perl v5.12.1 2010-07-05 SDL::Rect(3)
Check Out this Related Man Page
pods::SDL::Rect(3pm) User Contributed Perl Documentation pods::SDL::Rect(3pm)NAME
SDL::Rect - Defines a rectangular area
CATEGORY
Core, Video, Structure
SYNOPSIS
my $rect = SDL::Rect->new(0, 0, 50, 4);
$rect->x(1);
$rect->y(2);
$rect->w(3);
my $x = $rect->x; # 1
my $y = $rect->y; # 2
my $w = $rect->w; # 3
my $h = $rect->h; # 4
DESCRIPTION
An "SDL_Rect" defines a rectangular area of pixels.
METHODS
new
my $rect = SDL::Rect->new( $x, $y, $w, $h );
The constructor creates a new rectangle with the specified x, y, width and height values.
x
my $x = $rect->x;
$rect->x(128);
If passed a value, this method sets the x component of the rectangle; if not, it returns the x component of the rectangle.
y
my $y = $rect->y;
$rect->y(128);
If passed a value, this method sets the y component of the rectangle; if not, it returns the y component of the rectangle.
w
my $w = $rect->w;
$rect->w(128);
If passed a value, this method sets the w component of the rectangle; if not, it returns the w component of the rectangle.
h
my $h = $rect->h;
$rect->h(128);
If passed a value, this method sets the h component of the rectangle; if not, it returns the h component of the rectangle.
SEE ALSO
SDL::Surface
AUTHORS
See "AUTHORS" in SDL.
perl v5.14.2 2012-05-28 pods::SDL::Rect(3pm)