Commit | Line | Data |
896b04ee |
1 | =pod |
2 | |
3 | =head1 NAME |
4 | |
5 | SDL::Rect - Defines a rectangular area |
6 | |
7 | =head1 SYNOPSIS |
8 | |
9 | my $rect = SDL::Rect->new( 0, 0, 0, 0 ); |
10 | $rect->x(1); |
11 | $rect->y(2); |
12 | $rect->w(3); |
13 | $rect->h(4); |
14 | my $x = $rect->x; # 1 |
15 | my $y = $rect->y; # 2 |
16 | my $w = $rect->w; # 3 |
17 | my $h = $rect->h; # 4 |
18 | |
19 | =head1 DESCRIPTION |
20 | |
21 | An C<SDL_Rect> defines a rectangular area of pixels. |
22 | |
23 | =head1 METHODS |
24 | |
25 | =head2 new ( $x, $y, $w, $h ) |
26 | |
27 | The constructor creates a new rectangle with the specified x, y, w, h |
28 | values: |
29 | |
30 | my $rect = SDL::Rect->new( 0, 0, 0, 0 ); |
31 | |
32 | =head2 x |
33 | |
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: |
36 | |
37 | my $x = $rect->x; # 255 |
38 | $rect->x(128); |
39 | |
40 | =head2 y |
41 | |
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: |
44 | |
45 | my $y = $rect->y; # 255 |
46 | $rect->y(128); |
47 | |
48 | =head2 w |
49 | |
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: |
52 | |
53 | my $w = $rect->w; # 255 |
54 | $rect->w(128); |
55 | |
56 | =head2 h |
57 | |
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: |
60 | |
61 | my $h = $rect->h; # 255 |
62 | $rect->h(128); |
63 | |
64 | =head1 SEE ALSO |
65 | |
66 | L<SDL::Surface> |
67 | |
68 | =cut |