4 # A package for manipulating SDL_Rect *
6 # Copyright (C) 2003 David J. Goehrig
14 my $class = ref($proto) || $proto;
17 verify (%options, qw/ -x -y -width -height -w -h / ) if $SDL::DEBUG;
19 my $x = $options{-x} || 0;
20 my $y = $options{-y} || 0;
21 my $w = $options{-width} || $options{-w} || 0;
22 my $h = $options{-height} || $options{-h} || 0;
24 my $self = \SDL::NewRect($x,$y,$w,$h);
30 SDL::FreeRect(${$_[0]});
35 SDL::RectX($$self,@_);
40 SDL::RectY($$self,@_);
45 SDL::RectW($$self,@_);
50 SDL::RectH($$self,@_);
62 SDL::Rect - a SDL perl extension
66 $rect = new SDL::Rect ( -height => 4, -width => 40 );
70 C<SDL::Rect::new> creates a SDL_Rect structure which is
71 used for specifying regions for filling, blitting, and updating.
72 These objects make it easy to cut and backfill.
73 By default, x, y, h, w are 0.
77 The four fields of a rectangle can be set simply
78 by passing a value to the applicable method. These are:
84 C<SDL::Rect::x> sets and fetches the x position.
88 C<SDL::Rect::y> sets and fetches the y position.
92 C<SDL::Rect::width> sets and fetched the width.
96 C<SDL::Rect::height> sets and fetched the height.
106 perl(1) SDL::Surface(3)