5 SDL::Rect - Defines a rectangular area
9 my $rect = SDL::Rect->new( 0, 0, 0, 0 );
21 An C<SDL_Rect> defines a rectangular area of pixels.
25 =head2 new ( $x, $y, $w, $h )
27 The constructor creates a new rectangle with the specified x, y, w, h
30 my $rect = SDL::Rect->new( 0, 0, 0, 0 );
34 If passed a value, this method sets the x component of the rectangle;
35 if not, it returns the x component of the rectangle:
37 my $x = $rect->x; # 255
42 If passed a value, this method sets the y component of the rectangle;
43 if not, it returns the y component of the rectangle:
45 my $y = $rect->y; # 255
50 If passed a value, this method sets the w component of the rectangle;
51 if not, it returns the w component of the rectangle:
53 my $w = $rect->w; # 255
58 If passed a value, this method sets the h component of the rectangle;
59 if not, it returns the h component of the rectangle:
61 my $h = $rect->h; # 255