Moved Video to SMPGEG. Maybe move this to SDL::Game::Video later
[sdlgit/SDL_perl.git] / lib / SDL / Rect.pm
CommitLineData
bfd90409 1package SDL::Rect;
a1b835c1 2use strict;
3use warnings;
e4ab5b2e 4require Exporter;
5require DynaLoader;
a1b835c1 6our @ISA = qw(Exporter DynaLoader);
e4ab5b2e 7bootstrap SDL::Rect;
8
e4ab5b2e 91;
05eb21df 10
e4ab5b2e 11__END__
05eb21df 12
13=pod
14
15=head1 NAME
16
17SDL::Rect - Defines a rectangular area
18
19=head1 SYNOPSIS
20
21 my $rect = SDL::Rect->new( 0, 0, 0, 0 );
22 $rect->x(1);
23 $rect->y(2);
24 $rect->w(3);
25 $rect->h(4);
26 my $x = $rect->x; # 1
27 my $y = $rect->y; # 2
28 my $w = $rect->w; # 3
29 my $h = $rect->h; # 4
30
31=head1 DESCRIPTION
32
33An C<SDL_Rect> defines a rectangular area of pixels.
34
35=head1 METHODS
36
37=head2 new ( $x, $y, $w, $h )
38
39The constructor creates a new rectangle with the specified x, y, w, h
40values:
41
42 my $rect = SDL::Rect->new( 0, 0, 0, 0 );
43
44=head2 x
45
46If passed a value, this method sets the x component of the rectangle;
47if not, it returns the x component of the rectangle:
48
49 my $x = $rect->x; # 255
50 $rect->x(128);
51
52=head2 y
53
54If passed a value, this method sets the y component of the rectangle;
55if not, it returns the y component of the rectangle:
56
57 my $y = $rect->y; # 255
58 $rect->y(128);
59
60=head2 w
61
62If passed a value, this method sets the w component of the rectangle;
63if not, it returns the w component of the rectangle:
64
65 my $w = $rect->w; # 255
66 $rect->w(128);
67
68=head2 h
69
70If passed a value, this method sets the h component of the rectangle;
71if not, it returns the h component of the rectangle:
72
73 my $h = $rect->h; # 255
74 $rect->h(128);
75
76=head1 SEE ALSO
77
78L<SDL::Surface>
79
80=cut