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.