Merge branch 'master' of git.shadowcat.co.uk:SDL-Site
[sdlgit/SDL-Site.git] / pages / SDLx-Controller-State.html-inc
CommitLineData
1dbe1697 1<div class="pod">
2<!-- INDEX START -->
3<h3 id="TOP">Index</h3>
4
5<ul><li><a href="#NAME">NAME</a></li>
6<li><a href="#CATEGORY">CATEGORY</a></li>
7<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
8<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
9<li><a href="#METHODS">METHODS</a>
10<ul><li><a href="#new">new()</a></li>
11<li><a href="#new_x_y_v_x_v_y_rotation_ang_v">new( $x, $y, $v_x, $v_y, $rotation, $ang_v )</a></li>
12</ul>
13</li>
14<li><a href="#ACCESSORS">ACCESSORS</a>
15<ul><li><a href="#x">x</a></li>
16<li><a href="#y">y</a></li>
17<li><a href="#v_x">v_x</a></li>
18<li><a href="#v_y">v_y</a></li>
19<li><a href="#rotation">rotation</a></li>
20<li><a href="#ang_v">ang_v</a></li>
21<li><a href="#AUTHORS">AUTHORS</a>
22</li>
23</ul>
24</li>
25</ul><hr />
26<!-- INDEX END -->
27
28<h1 id="NAME">NAME</h1><p><a href="#TOP" class="toplink">Top</a></p>
29<div id="NAME_CONTENT">
30<p>SDLx::Controller::State - the state of a SDLx::Controller::Interface</p>
31
32</div>
33<h1 id="CATEGORY">CATEGORY</h1><p><a href="#TOP" class="toplink">Top</a></p>
34<div id="CATEGORY_CONTENT">
35<p>Extension, Controller</p>
36
37</div>
38<h1 id="SYNOPSIS">SYNOPSIS</h1><p><a href="#TOP" class="toplink">Top</a></p>
39<div id="SYNOPSIS_CONTENT">
40<pre> # you'll most likely get a State object from a SDLx::Controller::Interface
41 # object. Just in case, here's how you would construct one by hand:
42 my $state1 = SDLx::Controller::State-&gt;new;
43 my $state2 = SDLx::Controller::State-&gt;new( $x, $y, $v_x, $v_y, $rotation, $ang_v );
44
45 # attributes are just simple accessors:
46 $state-&gt;x(10);
47 $state-&gt;x; # 10
48
49 # same goes for the rest:
50 $state-&gt;y;
51 $state-&gt;ang_v;
52
53 # etc.
54
55</pre>
56
57</div>
58<h1 id="DESCRIPTION">DESCRIPTION</h1><p><a href="#TOP" class="toplink">Top</a></p>
59<div id="DESCRIPTION_CONTENT">
60<p>A state object is a simple container for any given state inside a running
61<a href="SDLx-Controller-Interface.html">SDLx::Controller::Interface</a> instance.</p>
62
63</div>
64<h1 id="METHODS">METHODS</h1><p><a href="#TOP" class="toplink">Top</a></p>
65<div id="METHODS_CONTENT">
66
67</div>
68<h2 id="new">new()</h2>
69<div id="new_CONTENT">
70
71</div>
72<h2 id="new_x_y_v_x_v_y_rotation_ang_v">new( $x, $y, $v_x, $v_y, $rotation, $ang_v )</h2>
73<div id="new_x_y_v_x_v_y_rotation_ang_v_CONTE">
74<p>Creates a new state container object. Can optionally set the initial value
75of all its attributes (see below).</p>
76
77</div>
78<h1 id="ACCESSORS">ACCESSORS</h1><p><a href="#TOP" class="toplink">Top</a></p>
79<div id="ACCESSORS_CONTENT">
80
81</div>
82<h2 id="x">x</h2>
83<div id="x_CONTENT">
84<p>Accessor to get/set the x value, usually used to position the item or check for collisions.</p>
85
86</div>
87<h2 id="y">y</h2>
88<div id="y_CONTENT">
89<p>Accessor to get/set the y value, usually used to position the item or check for collisions.</p>
90
91</div>
92<h2 id="v_x">v_x</h2>
93<div id="v_x_CONTENT">
94<p>Accessor to get/set the x velocity of the instance, for moving objects dynamically.</p>
95
96</div>
97<h2 id="v_y">v_y</h2>
98<div id="v_y_CONTENT">
99<p>Accessor to get/set the y velocity of the instance, for moving objects dynamically.</p>
100
101</div>
102<h2 id="rotation">rotation</h2>
103<div id="rotation_CONTENT">
104<p>Accessor to get/set the rotation of the object, in degrees (0..360).</p>
105
106</div>
107<h2 id="ang_v">ang_v</h2>
108<div id="ang_v_CONTENT">
109<p>Accessor to get/set the angular velocity, for rotating objects dynamically.</p>
110
111</div>
112<h2 id="AUTHORS">AUTHORS</h2>
113<div id="AUTHORS_CONTENT">
114<p>See <a href="/SDL.html#AUTHORS">/SDL.html#AUTHORS</a></p>
115
116</div>
117</div>