4 # A package for manipulating SDL_Rect *
6 # Copyright (C) 2003 David J. Goehrig
16 my $class = ref($proto) || $proto;
19 verify (%options, qw/ -x -y -width -height -w -h / ) if $SDL::DEBUG;
21 my $x = $options{-x} || 0;
22 my $y = $options{-y} || 0;
23 my $w = $options{-width} || $options{-w} || 0;
24 my $h = $options{-height} || $options{-h} || 0;
26 my $self = \SDL::NewRect($x,$y,$w,$h);
32 SDL::FreeRect(${$_[0]});
37 SDL::RectX($$self,@_);
42 SDL::RectY($$self,@_);
47 SDL::RectW($$self,@_);
52 SDL::RectH($$self,@_);
64 SDL::Rect - a SDL perl extension
68 $rect = new SDL::Rect ( -height => 4, -width => 40 );
72 C<SDL::Rect::new> creates a SDL_Rect structure which is
73 used for specifying regions for filling, blitting, and updating.
74 These objects make it easy to cut and backfill.
75 By default, x, y, h, w are 0.
79 The four fields of a rectangle can be set simply
80 by passing a value to the applicable method. These are:
86 C<SDL::Rect::x> sets and fetches the x position.
90 C<SDL::Rect::y> sets and fetches the y position.
94 C<SDL::Rect::width> sets and fetched the width.
98 C<SDL::Rect::height> sets and fetched the height.
108 perl(1) SDL::Surface(3)