Merge branch 'master' of git.shadowcat.co.uk:SDL-Site
[sdlgit/SDL-Site.git] / pages / SDL-Rect.html-inc
CommitLineData
162a0989 1<div class="pod">
2<!-- INDEX START -->
3<h3 id="TOP">Index</h3>
4
60f74f6f 5<ul><li><a href="#NAME">NAME</a>
6<ul><li><a href="#CATEGORY">CATEGORY</a></li>
7</ul>
8</li>
162a0989 9<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
10<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
11<li><a href="#METHODS">METHODS</a>
801213bd 12<ul><li><a href="#new">new</a></li>
162a0989 13<li><a href="#x">x</a></li>
14<li><a href="#y">y</a></li>
15<li><a href="#w">w</a></li>
16<li><a href="#h">h</a></li>
17</ul>
18</li>
c7e8d3c6 19<li><a href="#SEE_ALSO">SEE ALSO</a></li>
20<li><a href="#AUTHORS">AUTHORS</a>
162a0989 21</li>
22</ul><hr />
23<!-- INDEX END -->
24
25<h1 id="NAME">NAME</h1><p><a href="#TOP" class="toplink">Top</a></p>
26<div id="NAME_CONTENT">
27<p>SDL::Rect - Defines a rectangular area</p>
28
29</div>
60f74f6f 30<h2 id="CATEGORY">CATEGORY</h2>
31<div id="CATEGORY_CONTENT">
32<p>Core, Video, Structure</p>
33
34</div>
162a0989 35<h1 id="SYNOPSIS">SYNOPSIS</h1><p><a href="#TOP" class="toplink">Top</a></p>
36<div id="SYNOPSIS_CONTENT">
801213bd 37<pre> my $rect = SDL::Rect-&gt;new(0, 0, 50, 4);
38 $rect-&gt;x(1);
39 $rect-&gt;y(2);
40 $rect-&gt;w(3);
41 my $x = $rect-&gt;x; # 1
42 my $y = $rect-&gt;y; # 2
43 my $w = $rect-&gt;w; # 3
44 my $h = $rect-&gt;h; # 4
162a0989 45
46</pre>
47
48</div>
49<h1 id="DESCRIPTION">DESCRIPTION</h1><p><a href="#TOP" class="toplink">Top</a></p>
50<div id="DESCRIPTION_CONTENT">
51<p>An <code>SDL_Rect</code> defines a rectangular area of pixels.</p>
52
53</div>
54<h1 id="METHODS">METHODS</h1><p><a href="#TOP" class="toplink">Top</a></p>
55<div id="METHODS_CONTENT">
56
57</div>
801213bd 58<h2 id="new">new</h2>
59<div id="new_CONTENT">
60<pre> my $rect = SDL::Rect-&gt;new( $x, $y, $w, $h );
162a0989 61
62</pre>
801213bd 63<p>The constructor creates a new rectangle with the specified x, y, width and height values.</p>
162a0989 64
65</div>
66<h2 id="x">x</h2>
67<div id="x_CONTENT">
801213bd 68<pre> my $x = $rect-&gt;x;
69 $rect-&gt;x(128);
162a0989 70
71</pre>
801213bd 72<p>If passed a value, this method sets the x component of the rectangle;
73if not, it returns the x component of the rectangle.</p>
162a0989 74
75</div>
76<h2 id="y">y</h2>
77<div id="y_CONTENT">
801213bd 78<pre> my $y = $rect-&gt;y;
79 $rect-&gt;y(128);
162a0989 80
81</pre>
801213bd 82<p>If passed a value, this method sets the y component of the rectangle;
83if not, it returns the y component of the rectangle.</p>
162a0989 84
85</div>
86<h2 id="w">w</h2>
87<div id="w_CONTENT">
801213bd 88<pre> my $w = $rect-&gt;w;
89 $rect-&gt;w(128);
162a0989 90
91</pre>
801213bd 92<p>If passed a value, this method sets the w component of the rectangle;
93if not, it returns the w component of the rectangle.</p>
162a0989 94
95</div>
96<h2 id="h">h</h2>
97<div id="h_CONTENT">
801213bd 98<pre> my $h = $rect-&gt;h;
99 $rect-&gt;h(128);
162a0989 100
101</pre>
801213bd 102<p>If passed a value, this method sets the h component of the rectangle;
103if not, it returns the h component of the rectangle.</p>
162a0989 104
105</div>
106<h1 id="SEE_ALSO">SEE ALSO</h1><p><a href="#TOP" class="toplink">Top</a></p>
107<div id="SEE_ALSO_CONTENT">
55bbf7a2 108<p><a href="SDL-Surface.html">SDL::Surface</a></p>
162a0989 109
110</div>
c7e8d3c6 111<h1 id="AUTHORS">AUTHORS</h1><p><a href="#TOP" class="toplink">Top</a></p>
112<div id="AUTHORS_CONTENT">
1dbe1697 113<p>See <a href="/SDL.html#AUTHORS">/SDL.html#AUTHORS</a>.</p>
c7e8d3c6 114
115</div>
162a0989 116</div>