motion-game 1.1.7 → 1.1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.yardopts +2 -0
- data/build/android/motion-cocos.jar +0 -0
- metadata +2 -66
- data/doc/MG.html +0 -131
- data/doc/MG/Action.html +0 -402
- data/doc/MG/Animate.html +0 -281
- data/doc/MG/Application.html +0 -335
- data/doc/MG/Audio.html +0 -1268
- data/doc/MG/Blink.html +0 -257
- data/doc/MG/Button.html +0 -725
- data/doc/MG/Color.html +0 -535
- data/doc/MG/DelayTime.html +0 -239
- data/doc/MG/Director.html +0 -1301
- data/doc/MG/Draw.html +0 -813
- data/doc/MG/Events.html +0 -129
- data/doc/MG/Events/Acceleration.html +0 -505
- data/doc/MG/Events/Touch.html +0 -235
- data/doc/MG/FadeIn.html +0 -240
- data/doc/MG/FadeOut.html +0 -240
- data/doc/MG/FadeTo.html +0 -256
- data/doc/MG/File.html +0 -219
- data/doc/MG/Follow.html +0 -241
- data/doc/MG/JumpBy.html +0 -292
- data/doc/MG/JumpTo.html +0 -287
- data/doc/MG/Layout.html +0 -516
- data/doc/MG/List.html +0 -1053
- data/doc/MG/Menu.html +0 -458
- data/doc/MG/MoveBy.html +0 -259
- data/doc/MG/MoveTo.html +0 -257
- data/doc/MG/Node.html +0 -2013
- data/doc/MG/Parallax.html +0 -297
- data/doc/MG/Particle.html +0 -1224
- data/doc/MG/Point.html +0 -543
- data/doc/MG/Repeat.html +0 -257
- data/doc/MG/RepeatForever.html +0 -239
- data/doc/MG/RotateBy.html +0 -259
- data/doc/MG/RotateTo.html +0 -257
- data/doc/MG/ScaleBy.html +0 -255
- data/doc/MG/ScaleTo.html +0 -255
- data/doc/MG/Scene.html +0 -1544
- data/doc/MG/Scroll.html +0 -533
- data/doc/MG/Sequence.html +0 -241
- data/doc/MG/Size.html +0 -741
- data/doc/MG/SkewBy.html +0 -273
- data/doc/MG/SkewTo.html +0 -273
- data/doc/MG/Slider.html +0 -338
- data/doc/MG/Spawn.html +0 -239
- data/doc/MG/Speed.html +0 -259
- data/doc/MG/Sprite.html +0 -2591
- data/doc/MG/Text.html +0 -921
- data/doc/MG/TintBy.html +0 -272
- data/doc/MG/TintTo.html +0 -274
- data/doc/MG/Web.html +0 -831
- data/doc/MG/Widget.html +0 -552
- data/doc/_index.html +0 -574
- data/doc/class_list.html +0 -51
- data/doc/css/common.css +0 -1
- data/doc/css/full_list.css +0 -58
- data/doc/css/style.css +0 -481
- data/doc/file.README.html +0 -192
- data/doc/file_list.html +0 -56
- data/doc/frames.html +0 -17
- data/doc/index.html +0 -192
- data/doc/js/app.js +0 -243
- data/doc/js/full_list.js +0 -216
- data/doc/js/jquery.js +0 -4
- data/doc/method_list.html +0 -1635
- data/doc/top-level-namespace.html +0 -112
data/doc/MG/Speed.html
DELETED
@@ -1,259 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta charset="utf-8">
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
-
<title>
|
7
|
-
Class: MG::Speed
|
8
|
-
|
9
|
-
— Documentation by YARD 0.9.5
|
10
|
-
|
11
|
-
</title>
|
12
|
-
|
13
|
-
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
-
|
15
|
-
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
|
-
|
17
|
-
<script type="text/javascript" charset="utf-8">
|
18
|
-
pathId = "MG::Speed";
|
19
|
-
relpath = '../';
|
20
|
-
</script>
|
21
|
-
|
22
|
-
|
23
|
-
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
-
|
25
|
-
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
-
|
27
|
-
|
28
|
-
</head>
|
29
|
-
<body>
|
30
|
-
<div class="nav_wrap">
|
31
|
-
<iframe id="nav" src="../class_list.html"></iframe>
|
32
|
-
<div id="resizer"></div>
|
33
|
-
</div>
|
34
|
-
|
35
|
-
<div id="main" tabindex="-1">
|
36
|
-
<div id="header">
|
37
|
-
<div id="menu">
|
38
|
-
|
39
|
-
<a href="../_index.html">Index (S)</a> »
|
40
|
-
<span class='title'><span class='object_link'><a href="../MG.html" title="MG (module)">MG</a></span></span>
|
41
|
-
»
|
42
|
-
<span class="title">Speed</span>
|
43
|
-
|
44
|
-
</div>
|
45
|
-
|
46
|
-
<div id="search">
|
47
|
-
|
48
|
-
<a class="full_list_link" id="class_list_link"
|
49
|
-
href="../class_list.html">
|
50
|
-
|
51
|
-
<svg width="24" height="24">
|
52
|
-
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
-
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
-
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
-
</svg>
|
56
|
-
</a>
|
57
|
-
|
58
|
-
</div>
|
59
|
-
<div class="clear"></div>
|
60
|
-
</div>
|
61
|
-
|
62
|
-
<iframe id="search_frame" src="../class_list.html"></iframe>
|
63
|
-
|
64
|
-
<div id="content"><h1>Class: MG::Speed
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
</h1>
|
69
|
-
<div class="box_info">
|
70
|
-
|
71
|
-
<dl>
|
72
|
-
<dt>Inherits:</dt>
|
73
|
-
<dd>
|
74
|
-
<span class="inheritName"><span class='object_link'><a href="Action.html" title="MG::Action (class)">Action</a></span></span>
|
75
|
-
|
76
|
-
<ul class="fullTree">
|
77
|
-
<li>Object</li>
|
78
|
-
|
79
|
-
<li class="next"><span class='object_link'><a href="Action.html" title="MG::Action (class)">Action</a></span></li>
|
80
|
-
|
81
|
-
<li class="next">MG::Speed</li>
|
82
|
-
|
83
|
-
</ul>
|
84
|
-
<a href="#" class="inheritanceTree">show all</a>
|
85
|
-
|
86
|
-
</dd>
|
87
|
-
</dl>
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
<dl>
|
100
|
-
<dt>Defined in:</dt>
|
101
|
-
<dd>motion-game</dd>
|
102
|
-
</dl>
|
103
|
-
|
104
|
-
</div>
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
<h2>Instance Attribute Summary</h2>
|
113
|
-
|
114
|
-
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Action.html" title="MG::Action (class)">Action</a></span></h3>
|
115
|
-
<p class="inherited"><span class='object_link'><a href="Action.html#done%3F-instance_method" title="MG::Action#done? (method)">#done?</a></span></p>
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
<h2>
|
120
|
-
Constructors
|
121
|
-
<small><a href="#" class="summary_toggle">collapse</a></small>
|
122
|
-
</h2>
|
123
|
-
|
124
|
-
<ul class="summary">
|
125
|
-
|
126
|
-
<li class="public ">
|
127
|
-
<span class="summary_signature">
|
128
|
-
|
129
|
-
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(target_action, speed) ⇒ Speed </a>
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
</span>
|
134
|
-
|
135
|
-
|
136
|
-
<span class="note title constructor">constructor</span>
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
<span class="summary_desc"><div class='inline'>
|
146
|
-
<p>Changes the speed of an action, making it take longer (speed>1) or less
|
147
|
-
(speed<1) time.</p>
|
148
|
-
</div></span>
|
149
|
-
|
150
|
-
</li>
|
151
|
-
|
152
|
-
|
153
|
-
</ul>
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Action.html" title="MG::Action (class)">Action</a></span></h3>
|
166
|
-
<p class="inherited"><span class='object_link'><a href="Action.html#clone-instance_method" title="MG::Action#clone (method)">#clone</a></span>, <span class='object_link'><a href="Action.html#reverse-instance_method" title="MG::Action#reverse (method)">#reverse</a></span></p>
|
167
|
-
<div id="constructor_details" class="method_details_list">
|
168
|
-
<h2>Constructor Details</h2>
|
169
|
-
|
170
|
-
<div class="method_details first">
|
171
|
-
<h3 class="signature first" id="initialize-instance_method">
|
172
|
-
|
173
|
-
#<strong>initialize</strong>(target_action, speed) ⇒ <tt><span class='object_link'><a href="" title="MG::Speed (class)">Speed</a></span></tt>
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
</h3><div class="docstring">
|
180
|
-
<div class="discussion">
|
181
|
-
|
182
|
-
<p>Changes the speed of an action, making it take longer (speed>1) or less
|
183
|
-
(speed<1) time. Useful to simulate 'slow motion' or 'fast
|
184
|
-
forward' effect. ** This action can't be Sequenceable because it is
|
185
|
-
not an IntervalAction.</p>
|
186
|
-
|
187
|
-
|
188
|
-
</div>
|
189
|
-
</div>
|
190
|
-
<div class="tags">
|
191
|
-
<p class="tag_title">Parameters:</p>
|
192
|
-
<ul class="param">
|
193
|
-
|
194
|
-
<li>
|
195
|
-
|
196
|
-
<span class='name'>target_action</span>
|
197
|
-
|
198
|
-
|
199
|
-
<span class='type'>(<tt><span class='object_link'><a href="Action.html" title="MG::Action (class)">Action</a></span></tt>)</span>
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
—
|
204
|
-
<div class='inline'>
|
205
|
-
<p>the action to adjust the speed of</p>
|
206
|
-
</div>
|
207
|
-
|
208
|
-
</li>
|
209
|
-
|
210
|
-
<li>
|
211
|
-
|
212
|
-
<span class='name'>speed</span>
|
213
|
-
|
214
|
-
|
215
|
-
<span class='type'>(<tt>Float</tt>)</span>
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
—
|
220
|
-
<div class='inline'>
|
221
|
-
<p>the adjustment to make to the speed (>1 longer, <1 shorter).</p>
|
222
|
-
</div>
|
223
|
-
|
224
|
-
</li>
|
225
|
-
|
226
|
-
</ul>
|
227
|
-
|
228
|
-
|
229
|
-
</div><table class="source_code">
|
230
|
-
<tr>
|
231
|
-
<td>
|
232
|
-
<pre class="lines">
|
233
|
-
|
234
|
-
|
235
|
-
297</pre>
|
236
|
-
</td>
|
237
|
-
<td>
|
238
|
-
<pre class="code"><span class="info file"># File 'motion-game', line 297</span>
|
239
|
-
|
240
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_target_action'>target_action</span><span class='comma'>,</span> <span class='id identifier rubyid_speed'>speed</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
241
|
-
</td>
|
242
|
-
</tr>
|
243
|
-
</table>
|
244
|
-
</div>
|
245
|
-
|
246
|
-
</div>
|
247
|
-
|
248
|
-
|
249
|
-
</div>
|
250
|
-
|
251
|
-
<div id="footer">
|
252
|
-
Generated on Sun Dec 11 16:38:29 2016 by
|
253
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
254
|
-
0.9.5 (ruby-2.3.3).
|
255
|
-
</div>
|
256
|
-
|
257
|
-
</div>
|
258
|
-
</body>
|
259
|
-
</html>
|
data/doc/MG/Sprite.html
DELETED
@@ -1,2591 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta charset="utf-8">
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
-
<title>
|
7
|
-
Class: MG::Sprite
|
8
|
-
|
9
|
-
— Documentation by YARD 0.9.5
|
10
|
-
|
11
|
-
</title>
|
12
|
-
|
13
|
-
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
-
|
15
|
-
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
|
-
|
17
|
-
<script type="text/javascript" charset="utf-8">
|
18
|
-
pathId = "MG::Sprite";
|
19
|
-
relpath = '../';
|
20
|
-
</script>
|
21
|
-
|
22
|
-
|
23
|
-
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
-
|
25
|
-
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
-
|
27
|
-
|
28
|
-
</head>
|
29
|
-
<body>
|
30
|
-
<div class="nav_wrap">
|
31
|
-
<iframe id="nav" src="../class_list.html"></iframe>
|
32
|
-
<div id="resizer"></div>
|
33
|
-
</div>
|
34
|
-
|
35
|
-
<div id="main" tabindex="-1">
|
36
|
-
<div id="header">
|
37
|
-
<div id="menu">
|
38
|
-
|
39
|
-
<a href="../_index.html">Index (S)</a> »
|
40
|
-
<span class='title'><span class='object_link'><a href="../MG.html" title="MG (module)">MG</a></span></span>
|
41
|
-
»
|
42
|
-
<span class="title">Sprite</span>
|
43
|
-
|
44
|
-
</div>
|
45
|
-
|
46
|
-
<div id="search">
|
47
|
-
|
48
|
-
<a class="full_list_link" id="class_list_link"
|
49
|
-
href="../class_list.html">
|
50
|
-
|
51
|
-
<svg width="24" height="24">
|
52
|
-
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
-
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
-
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
-
</svg>
|
56
|
-
</a>
|
57
|
-
|
58
|
-
</div>
|
59
|
-
<div class="clear"></div>
|
60
|
-
</div>
|
61
|
-
|
62
|
-
<iframe id="search_frame" src="../class_list.html"></iframe>
|
63
|
-
|
64
|
-
<div id="content"><h1>Class: MG::Sprite
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
</h1>
|
69
|
-
<div class="box_info">
|
70
|
-
|
71
|
-
<dl>
|
72
|
-
<dt>Inherits:</dt>
|
73
|
-
<dd>
|
74
|
-
<span class="inheritName"><span class='object_link'><a href="Node.html" title="MG::Node (class)">Node</a></span></span>
|
75
|
-
|
76
|
-
<ul class="fullTree">
|
77
|
-
<li>Object</li>
|
78
|
-
|
79
|
-
<li class="next"><span class='object_link'><a href="Node.html" title="MG::Node (class)">Node</a></span></li>
|
80
|
-
|
81
|
-
<li class="next">MG::Sprite</li>
|
82
|
-
|
83
|
-
</ul>
|
84
|
-
<a href="#" class="inheritanceTree">show all</a>
|
85
|
-
|
86
|
-
</dd>
|
87
|
-
</dl>
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
<dl>
|
100
|
-
<dt>Defined in:</dt>
|
101
|
-
<dd>motion-game</dd>
|
102
|
-
</dl>
|
103
|
-
|
104
|
-
</div>
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
<h2>Properties <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
111
|
-
<ul class="summary">
|
112
|
-
|
113
|
-
<li class="public ">
|
114
|
-
<span class="summary_signature">
|
115
|
-
|
116
|
-
<a href="#category_mask-instance_method" title="#category_mask (instance method)">#<strong>category_mask</strong> ⇒ Integer </a>
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
</span>
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
<span class="summary_desc"><div class='inline'>
|
134
|
-
<p>Physics category mask.</p>
|
135
|
-
</div></span>
|
136
|
-
|
137
|
-
</li>
|
138
|
-
|
139
|
-
|
140
|
-
<li class="public ">
|
141
|
-
<span class="summary_signature">
|
142
|
-
|
143
|
-
<a href="#collision_mask-instance_method" title="#collision_mask (instance method)">#<strong>collision_mask</strong> ⇒ Integer </a>
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
</span>
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
<span class="summary_desc"><div class='inline'>
|
161
|
-
<p>Physics collision mask.</p>
|
162
|
-
</div></span>
|
163
|
-
|
164
|
-
</li>
|
165
|
-
|
166
|
-
|
167
|
-
<li class="public ">
|
168
|
-
<span class="summary_signature">
|
169
|
-
|
170
|
-
<a href="#contact_mask-instance_method" title="#contact_mask (instance method)">#<strong>contact_mask</strong> ⇒ Integer </a>
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
</span>
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
<span class="summary_desc"><div class='inline'>
|
188
|
-
<p>Physics contact test mask.</p>
|
189
|
-
</div></span>
|
190
|
-
|
191
|
-
</li>
|
192
|
-
|
193
|
-
|
194
|
-
<li class="public ">
|
195
|
-
<span class="summary_signature">
|
196
|
-
|
197
|
-
<a href="#dynamic%3F-instance_method" title="#dynamic? (instance method)">#<strong>dynamic?</strong> ⇒ Boolean </a>
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
</span>
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
<span class="summary_desc"><div class='inline'>
|
215
|
-
<p>Whether the sprite body should be dynamic or not in the physics world.</p>
|
216
|
-
</div></span>
|
217
|
-
|
218
|
-
</li>
|
219
|
-
|
220
|
-
|
221
|
-
<li class="public ">
|
222
|
-
<span class="summary_signature">
|
223
|
-
|
224
|
-
<a href="#friction-instance_method" title="#friction (instance method)">#<strong>friction</strong> ⇒ Float </a>
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
</span>
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
<span class="summary_desc"><div class='inline'>
|
242
|
-
<p>The linear damping / air friction force on the sprite body.</p>
|
243
|
-
</div></span>
|
244
|
-
|
245
|
-
</li>
|
246
|
-
|
247
|
-
|
248
|
-
<li class="public ">
|
249
|
-
<span class="summary_signature">
|
250
|
-
|
251
|
-
<a href="#gravitates%3F-instance_method" title="#gravitates? (instance method)">#<strong>gravitates?</strong> ⇒ Boolean </a>
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
</span>
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
<span class="summary_desc"><div class='inline'>
|
269
|
-
<p>Whether the sprite should be affected by the scene's gravitational
|
270
|
-
force.</p>
|
271
|
-
</div></span>
|
272
|
-
|
273
|
-
</li>
|
274
|
-
|
275
|
-
|
276
|
-
<li class="public ">
|
277
|
-
<span class="summary_signature">
|
278
|
-
|
279
|
-
<a href="#inertia_moment-instance_method" title="#inertia_moment (instance method)">#<strong>inertia_moment</strong> ⇒ Float </a>
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
</span>
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
<span class="summary_desc"><div class='inline'>
|
297
|
-
<p>The moment of inertia of the body.</p>
|
298
|
-
</div></span>
|
299
|
-
|
300
|
-
</li>
|
301
|
-
|
302
|
-
|
303
|
-
<li class="public ">
|
304
|
-
<span class="summary_signature">
|
305
|
-
|
306
|
-
<a href="#mass-instance_method" title="#mass (instance method)">#<strong>mass</strong> ⇒ Float </a>
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
</span>
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
<span class="summary_desc"><div class='inline'>
|
324
|
-
<p>The body mass of the sprite.</p>
|
325
|
-
</div></span>
|
326
|
-
|
327
|
-
</li>
|
328
|
-
|
329
|
-
|
330
|
-
<li class="public ">
|
331
|
-
<span class="summary_signature">
|
332
|
-
|
333
|
-
<a href="#resting%3F-instance_method" title="#resting? (instance method)">#<strong>resting?</strong> ⇒ Boolean </a>
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
</span>
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
<span class="summary_desc"><div class='inline'>
|
351
|
-
<p>Whether the body is at rest.</p>
|
352
|
-
</div></span>
|
353
|
-
|
354
|
-
</li>
|
355
|
-
|
356
|
-
|
357
|
-
<li class="public ">
|
358
|
-
<span class="summary_signature">
|
359
|
-
|
360
|
-
<a href="#velocity-instance_method" title="#velocity (instance method)">#<strong>velocity</strong> ⇒ Point </a>
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
</span>
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
<span class="summary_desc"><div class='inline'>
|
378
|
-
<p>The velocity force on the sprite body.</p>
|
379
|
-
</div></span>
|
380
|
-
|
381
|
-
</li>
|
382
|
-
|
383
|
-
|
384
|
-
</ul>
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Node.html" title="MG::Node (class)">Node</a></span></h3>
|
391
|
-
<p class="inherited"><span class='object_link'><a href="Node.html#alpha-instance_method" title="MG::Node#alpha (method)">#alpha</a></span>, <span class='object_link'><a href="Node.html#anchor_point-instance_method" title="MG::Node#anchor_point (method)">#anchor_point</a></span>, <span class='object_link'><a href="Node.html#color-instance_method" title="MG::Node#color (method)">#color</a></span>, <span class='object_link'><a href="Node.html#name-instance_method" title="MG::Node#name (method)">#name</a></span>, <span class='object_link'><a href="Node.html#position-instance_method" title="MG::Node#position (method)">#position</a></span>, <span class='object_link'><a href="Node.html#rotation-instance_method" title="MG::Node#rotation (method)">#rotation</a></span>, <span class='object_link'><a href="Node.html#scale-instance_method" title="MG::Node#scale (method)">#scale</a></span>, <span class='object_link'><a href="Node.html#size-instance_method" title="MG::Node#size (method)">#size</a></span>, <span class='object_link'><a href="Node.html#visible%3F-instance_method" title="MG::Node#visible? (method)">#visible?</a></span>, <span class='object_link'><a href="Node.html#z_index-instance_method" title="MG::Node#z_index (method)">#z_index</a></span></p>
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
<h2>
|
396
|
-
Spritesheets
|
397
|
-
<small><a href="#" class="summary_toggle">collapse</a></small>
|
398
|
-
</h2>
|
399
|
-
|
400
|
-
<ul class="summary">
|
401
|
-
|
402
|
-
<li class="public ">
|
403
|
-
<span class="summary_signature">
|
404
|
-
|
405
|
-
<a href="#load-class_method" title="load (class method)">.<strong>load</strong>(file_name) ⇒ nil </a>
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
</span>
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
<span class="summary_desc"><div class='inline'>
|
420
|
-
<p>Loads all sprites from the content of <code>file_name</code>, which should
|
421
|
-
be the name of a property list spritesheet file in the application's
|
422
|
-
resource directory.</p>
|
423
|
-
</div></span>
|
424
|
-
|
425
|
-
</li>
|
426
|
-
|
427
|
-
|
428
|
-
</ul>
|
429
|
-
|
430
|
-
<h2>
|
431
|
-
Constructors
|
432
|
-
<small><a href="#" class="summary_toggle">collapse</a></small>
|
433
|
-
</h2>
|
434
|
-
|
435
|
-
<ul class="summary">
|
436
|
-
|
437
|
-
<li class="public ">
|
438
|
-
<span class="summary_signature">
|
439
|
-
|
440
|
-
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(sprite_name) ⇒ Sprite </a>
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
</span>
|
445
|
-
|
446
|
-
|
447
|
-
<span class="note title constructor">constructor</span>
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
<span class="summary_desc"><div class='inline'>
|
457
|
-
<p>Creates a new sprite object from <code>sprite_name</code>, which must be
|
458
|
-
either the name of a standalone image file in the application's
|
459
|
-
resource directory or the name of a sprite frame which was loaded from a
|
460
|
-
spritesheet using <span class='object_link'><a href="#load-class_method" title="MG::Sprite.load (method)">Sprite.load</a></span>.</p>
|
461
|
-
</div></span>
|
462
|
-
|
463
|
-
</li>
|
464
|
-
|
465
|
-
|
466
|
-
</ul>
|
467
|
-
|
468
|
-
<h2>
|
469
|
-
Actions
|
470
|
-
<small><a href="#" class="summary_toggle">collapse</a></small>
|
471
|
-
</h2>
|
472
|
-
|
473
|
-
<ul class="summary">
|
474
|
-
|
475
|
-
<li class="public ">
|
476
|
-
<span class="summary_signature">
|
477
|
-
|
478
|
-
<a href="#animate-instance_method" title="#animate (instance method)">#<strong>animate</strong>(frame_names, delay, loops = 1) ⇒ Sprite </a>
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
</span>
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
<span class="summary_desc"><div class='inline'>
|
493
|
-
<p>Starts an animation where the sprite display frame will be changed to the
|
494
|
-
given frames in <code>sprite_frames_names</code> based on the given
|
495
|
-
<code>delay</code> and repeated <code>loops</code> times.</p>
|
496
|
-
</div></span>
|
497
|
-
|
498
|
-
</li>
|
499
|
-
|
500
|
-
|
501
|
-
<li class="public ">
|
502
|
-
<span class="summary_signature">
|
503
|
-
|
504
|
-
<a href="#blink-instance_method" title="#blink (instance method)">#<strong>blink</strong>(number_of_blinks, interval) ⇒ Sprite </a>
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
</span>
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
<span class="summary_desc"><div class='inline'>
|
519
|
-
<p>Blinks the receiver.</p>
|
520
|
-
</div></span>
|
521
|
-
|
522
|
-
</li>
|
523
|
-
|
524
|
-
|
525
|
-
<li class="public ">
|
526
|
-
<span class="summary_signature">
|
527
|
-
|
528
|
-
<a href="#flipped_horizontally%3D-instance_method" title="#flipped_horizontally= (instance method)">#<strong>flipped_horizontally=</strong>(value) ⇒ Object </a>
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
</span>
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
<span class="summary_desc"><div class='inline'>
|
543
|
-
<p>Sets whether the sprite should be flipped horizontally or not.</p>
|
544
|
-
</div></span>
|
545
|
-
|
546
|
-
</li>
|
547
|
-
|
548
|
-
|
549
|
-
<li class="public ">
|
550
|
-
<span class="summary_signature">
|
551
|
-
|
552
|
-
<a href="#flipped_vertically%3D-instance_method" title="#flipped_vertically= (instance method)">#<strong>flipped_vertically=</strong>(value) ⇒ Object </a>
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
</span>
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
<span class="summary_desc"><div class='inline'>
|
567
|
-
<p>Sets whether the sprite should be flipped vertically or not.</p>
|
568
|
-
</div></span>
|
569
|
-
|
570
|
-
</li>
|
571
|
-
|
572
|
-
|
573
|
-
<li class="public ">
|
574
|
-
<span class="summary_signature">
|
575
|
-
|
576
|
-
<a href="#flipped_x%3D-instance_method" title="#flipped_x= (instance method)">#<strong>flipped_x=</strong>(value) ⇒ Object </a>
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
</span>
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
<span class="summary_desc"><div class='inline'>
|
591
|
-
<p>This is alias method of “#flipped_horizontally=”.</p>
|
592
|
-
</div></span>
|
593
|
-
|
594
|
-
</li>
|
595
|
-
|
596
|
-
|
597
|
-
<li class="public ">
|
598
|
-
<span class="summary_signature">
|
599
|
-
|
600
|
-
<a href="#flipped_y%3D-instance_method" title="#flipped_y= (instance method)">#<strong>flipped_y=</strong>(value) ⇒ Object </a>
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
</span>
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
<span class="summary_desc"><div class='inline'>
|
615
|
-
<p>This is alias method of “#flipped_vertically=”.</p>
|
616
|
-
</div></span>
|
617
|
-
|
618
|
-
</li>
|
619
|
-
|
620
|
-
|
621
|
-
<li class="public ">
|
622
|
-
<span class="summary_signature">
|
623
|
-
|
624
|
-
<a href="#move_by-instance_method" title="#move_by (instance method)">#<strong>move_by</strong>(delta_location, interval) ⇒ Sprite </a>
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
</span>
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
<span class="summary_desc"><div class='inline'>
|
639
|
-
<p>Moves the position of the receiver to a new location determined by the sum
|
640
|
-
of the current location and the given <code>delta_location</code> object.</p>
|
641
|
-
</div></span>
|
642
|
-
|
643
|
-
</li>
|
644
|
-
|
645
|
-
|
646
|
-
<li class="public ">
|
647
|
-
<span class="summary_signature">
|
648
|
-
|
649
|
-
<a href="#move_to-instance_method" title="#move_to (instance method)">#<strong>move_to</strong>(location, interval) ⇒ Sprite </a>
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
</span>
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
<span class="summary_desc"><div class='inline'>
|
664
|
-
<p>Moves the position of the receiver to a new given location.</p>
|
665
|
-
</div></span>
|
666
|
-
|
667
|
-
</li>
|
668
|
-
|
669
|
-
|
670
|
-
<li class="public ">
|
671
|
-
<span class="summary_signature">
|
672
|
-
|
673
|
-
<a href="#rotate_by-instance_method" title="#rotate_by (instance method)">#<strong>rotate_by</strong>(delta_angle, interval) ⇒ Sprite </a>
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
</span>
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
<span class="summary_desc"><div class='inline'>
|
688
|
-
<p>Rotates the position of the receiver to a new angle determined by the sum
|
689
|
-
of the current rotation and the given <code>delta_angle</code> object.</p>
|
690
|
-
</div></span>
|
691
|
-
|
692
|
-
</li>
|
693
|
-
|
694
|
-
|
695
|
-
<li class="public ">
|
696
|
-
<span class="summary_signature">
|
697
|
-
|
698
|
-
<a href="#rotate_to-instance_method" title="#rotate_to (instance method)">#<strong>rotate_to</strong>(angle, interval) ⇒ Sprite </a>
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
</span>
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
<span class="summary_desc"><div class='inline'>
|
713
|
-
<p>Rotates the angle of the receiver to a new angle certain angle by modifying
|
714
|
-
it's rotation attribute.</p>
|
715
|
-
</div></span>
|
716
|
-
|
717
|
-
</li>
|
718
|
-
|
719
|
-
|
720
|
-
</ul>
|
721
|
-
|
722
|
-
<h2>
|
723
|
-
Physics
|
724
|
-
<small><a href="#" class="summary_toggle">collapse</a></small>
|
725
|
-
</h2>
|
726
|
-
|
727
|
-
<ul class="summary">
|
728
|
-
|
729
|
-
<li class="public ">
|
730
|
-
<span class="summary_signature">
|
731
|
-
|
732
|
-
<a href="#apply_force-instance_method" title="#apply_force (instance method)">#<strong>apply_force</strong>(force) ⇒ Sprite </a>
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
</span>
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
<span class="summary_desc"><div class='inline'>
|
747
|
-
<p>Applies an immediate force to the sprite body.</p>
|
748
|
-
</div></span>
|
749
|
-
|
750
|
-
</li>
|
751
|
-
|
752
|
-
|
753
|
-
<li class="public ">
|
754
|
-
<span class="summary_signature">
|
755
|
-
|
756
|
-
<a href="#apply_impulse-instance_method" title="#apply_impulse (instance method)">#<strong>apply_impulse</strong>(force) ⇒ Sprite </a>
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
</span>
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
<span class="summary_desc"><div class='inline'>
|
771
|
-
<p>Applies a continuous force to the sprite body.</p>
|
772
|
-
</div></span>
|
773
|
-
|
774
|
-
</li>
|
775
|
-
|
776
|
-
|
777
|
-
<li class="public ">
|
778
|
-
<span class="summary_signature">
|
779
|
-
|
780
|
-
<a href="#attach_physics_box-instance_method" title="#attach_physics_box (instance method)">#<strong>attach_physics_box</strong>(size = nil) ⇒ Sprite </a>
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
</span>
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
<span class="summary_desc"><div class='inline'>
|
795
|
-
<p>Attaches a physics body with a box shape to the sprite.</p>
|
796
|
-
</div></span>
|
797
|
-
|
798
|
-
</li>
|
799
|
-
|
800
|
-
|
801
|
-
</ul>
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Node.html" title="MG::Node (class)">Node</a></span></h3>
|
814
|
-
<p class="inherited"><span class='object_link'><a href="Node.html#add-instance_method" title="MG::Node#add (method)">#add</a></span>, <span class='object_link'><a href="Node.html#children-instance_method" title="MG::Node#children (method)">#children</a></span>, <span class='object_link'><a href="Node.html#clear-instance_method" title="MG::Node#clear (method)">#clear</a></span>, <span class='object_link'><a href="Node.html#delete-instance_method" title="MG::Node#delete (method)">#delete</a></span>, <span class='object_link'><a href="Node.html#delete_from_parent-instance_method" title="MG::Node#delete_from_parent (method)">#delete_from_parent</a></span>, <span class='object_link'><a href="Node.html#intersects%3F-instance_method" title="MG::Node#intersects? (method)">#intersects?</a></span>, <span class='object_link'><a href="Node.html#parent-instance_method" title="MG::Node#parent (method)">#parent</a></span>, <span class='object_link'><a href="Node.html#run_action-instance_method" title="MG::Node#run_action (method)">#run_action</a></span>, <span class='object_link'><a href="Node.html#stop_action-instance_method" title="MG::Node#stop_action (method)">#stop_action</a></span>, <span class='object_link'><a href="Node.html#stop_all_actions-instance_method" title="MG::Node#stop_all_actions (method)">#stop_all_actions</a></span></p>
|
815
|
-
<div id="constructor_details" class="method_details_list">
|
816
|
-
<h2>Constructor Details</h2>
|
817
|
-
|
818
|
-
<div class="method_details first">
|
819
|
-
<h3 class="signature first" id="initialize-instance_method">
|
820
|
-
|
821
|
-
#<strong>initialize</strong>(sprite_name) ⇒ <tt><span class='object_link'><a href="" title="MG::Sprite (class)">Sprite</a></span></tt>
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
</h3><div class="docstring">
|
828
|
-
<div class="discussion">
|
829
|
-
|
830
|
-
<p>Creates a new sprite object from <code>sprite_name</code>, which must be
|
831
|
-
either the name of a standalone image file in the application's
|
832
|
-
resource directory or the name of a sprite frame which was loaded from a
|
833
|
-
spritesheet using <span class='object_link'><a href="#load-class_method" title="MG::Sprite.load (method)">load</a></span>.</p>
|
834
|
-
|
835
|
-
|
836
|
-
</div>
|
837
|
-
</div>
|
838
|
-
<div class="tags">
|
839
|
-
<p class="tag_title">Parameters:</p>
|
840
|
-
<ul class="param">
|
841
|
-
|
842
|
-
<li>
|
843
|
-
|
844
|
-
<span class='name'>sprite_name</span>
|
845
|
-
|
846
|
-
|
847
|
-
<span class='type'>(<tt>String</tt>)</span>
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
—
|
852
|
-
<div class='inline'>
|
853
|
-
<p>the name of the sprite to create.</p>
|
854
|
-
</div>
|
855
|
-
|
856
|
-
</li>
|
857
|
-
|
858
|
-
</ul>
|
859
|
-
|
860
|
-
|
861
|
-
</div><table class="source_code">
|
862
|
-
<tr>
|
863
|
-
<td>
|
864
|
-
<pre class="lines">
|
865
|
-
|
866
|
-
|
867
|
-
900</pre>
|
868
|
-
</td>
|
869
|
-
<td>
|
870
|
-
<pre class="code"><span class="info file"># File 'motion-game', line 900</span>
|
871
|
-
|
872
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_sprite_name'>sprite_name</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
873
|
-
</td>
|
874
|
-
</tr>
|
875
|
-
</table>
|
876
|
-
</div>
|
877
|
-
|
878
|
-
</div>
|
879
|
-
|
880
|
-
<div id="instance_attr_details" class="attr_details">
|
881
|
-
<h2>Instance Attribute Details</h2>
|
882
|
-
|
883
|
-
|
884
|
-
<span id="category_mask=-instance_method"></span>
|
885
|
-
<div class="method_details first">
|
886
|
-
<h3 class="signature first" id="category_mask-instance_method">
|
887
|
-
|
888
|
-
#<strong>category_mask</strong> ⇒ <tt>Integer</tt>
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
</h3><div class="docstring">
|
895
|
-
<div class="discussion">
|
896
|
-
|
897
|
-
<p>Returns physics category mask.</p>
|
898
|
-
|
899
|
-
|
900
|
-
</div>
|
901
|
-
</div>
|
902
|
-
<div class="tags">
|
903
|
-
|
904
|
-
<p class="tag_title">Returns:</p>
|
905
|
-
<ul class="return">
|
906
|
-
|
907
|
-
<li>
|
908
|
-
|
909
|
-
|
910
|
-
<span class='type'>(<tt>Integer</tt>)</span>
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
—
|
915
|
-
<div class='inline'>
|
916
|
-
<p>physics category mask.</p>
|
917
|
-
</div>
|
918
|
-
|
919
|
-
</li>
|
920
|
-
|
921
|
-
</ul>
|
922
|
-
|
923
|
-
</div><table class="source_code">
|
924
|
-
<tr>
|
925
|
-
<td>
|
926
|
-
<pre class="lines">
|
927
|
-
|
928
|
-
|
929
|
-
1018
|
930
|
-
1019
|
931
|
-
1020</pre>
|
932
|
-
</td>
|
933
|
-
<td>
|
934
|
-
<pre class="code"><span class="info file"># File 'motion-game', line 1018</span>
|
935
|
-
|
936
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_category_mask'>category_mask</span>
|
937
|
-
<span class='ivar'>@category_mask</span>
|
938
|
-
<span class='kw'>end</span></pre>
|
939
|
-
</td>
|
940
|
-
</tr>
|
941
|
-
</table>
|
942
|
-
</div>
|
943
|
-
|
944
|
-
|
945
|
-
<span id="collision_mask=-instance_method"></span>
|
946
|
-
<div class="method_details ">
|
947
|
-
<h3 class="signature " id="collision_mask-instance_method">
|
948
|
-
|
949
|
-
#<strong>collision_mask</strong> ⇒ <tt>Integer</tt>
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
</h3><div class="docstring">
|
956
|
-
<div class="discussion">
|
957
|
-
|
958
|
-
<p>Returns physics collision mask.</p>
|
959
|
-
|
960
|
-
|
961
|
-
</div>
|
962
|
-
</div>
|
963
|
-
<div class="tags">
|
964
|
-
|
965
|
-
<p class="tag_title">Returns:</p>
|
966
|
-
<ul class="return">
|
967
|
-
|
968
|
-
<li>
|
969
|
-
|
970
|
-
|
971
|
-
<span class='type'>(<tt>Integer</tt>)</span>
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
—
|
976
|
-
<div class='inline'>
|
977
|
-
<p>physics collision mask.</p>
|
978
|
-
</div>
|
979
|
-
|
980
|
-
</li>
|
981
|
-
|
982
|
-
</ul>
|
983
|
-
|
984
|
-
</div><table class="source_code">
|
985
|
-
<tr>
|
986
|
-
<td>
|
987
|
-
<pre class="lines">
|
988
|
-
|
989
|
-
|
990
|
-
1024
|
991
|
-
1025
|
992
|
-
1026</pre>
|
993
|
-
</td>
|
994
|
-
<td>
|
995
|
-
<pre class="code"><span class="info file"># File 'motion-game', line 1024</span>
|
996
|
-
|
997
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_collision_mask'>collision_mask</span>
|
998
|
-
<span class='ivar'>@collision_mask</span>
|
999
|
-
<span class='kw'>end</span></pre>
|
1000
|
-
</td>
|
1001
|
-
</tr>
|
1002
|
-
</table>
|
1003
|
-
</div>
|
1004
|
-
|
1005
|
-
|
1006
|
-
<span id="contact_mask=-instance_method"></span>
|
1007
|
-
<div class="method_details ">
|
1008
|
-
<h3 class="signature " id="contact_mask-instance_method">
|
1009
|
-
|
1010
|
-
#<strong>contact_mask</strong> ⇒ <tt>Integer</tt>
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
</h3><div class="docstring">
|
1017
|
-
<div class="discussion">
|
1018
|
-
|
1019
|
-
<p>Returns physics contact test mask.</p>
|
1020
|
-
|
1021
|
-
|
1022
|
-
</div>
|
1023
|
-
</div>
|
1024
|
-
<div class="tags">
|
1025
|
-
|
1026
|
-
<p class="tag_title">Returns:</p>
|
1027
|
-
<ul class="return">
|
1028
|
-
|
1029
|
-
<li>
|
1030
|
-
|
1031
|
-
|
1032
|
-
<span class='type'>(<tt>Integer</tt>)</span>
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
—
|
1037
|
-
<div class='inline'>
|
1038
|
-
<p>physics contact test mask.</p>
|
1039
|
-
</div>
|
1040
|
-
|
1041
|
-
</li>
|
1042
|
-
|
1043
|
-
</ul>
|
1044
|
-
|
1045
|
-
</div><table class="source_code">
|
1046
|
-
<tr>
|
1047
|
-
<td>
|
1048
|
-
<pre class="lines">
|
1049
|
-
|
1050
|
-
|
1051
|
-
1021
|
1052
|
-
1022
|
1053
|
-
1023</pre>
|
1054
|
-
</td>
|
1055
|
-
<td>
|
1056
|
-
<pre class="code"><span class="info file"># File 'motion-game', line 1021</span>
|
1057
|
-
|
1058
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_contact_mask'>contact_mask</span>
|
1059
|
-
<span class='ivar'>@contact_mask</span>
|
1060
|
-
<span class='kw'>end</span></pre>
|
1061
|
-
</td>
|
1062
|
-
</tr>
|
1063
|
-
</table>
|
1064
|
-
</div>
|
1065
|
-
|
1066
|
-
|
1067
|
-
<span id="dynamic?=-instance_method"></span>
|
1068
|
-
<div class="method_details ">
|
1069
|
-
<h3 class="signature " id="dynamic?-instance_method">
|
1070
|
-
|
1071
|
-
#<strong>dynamic?</strong> ⇒ <tt>Boolean</tt>
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1077
|
-
</h3><div class="docstring">
|
1078
|
-
<div class="discussion">
|
1079
|
-
|
1080
|
-
<p>Returns whether the sprite body should be dynamic or not in the physics
|
1081
|
-
world. The default is <code>true</code>, and a dynamic body will affect
|
1082
|
-
with gravity.</p>
|
1083
|
-
|
1084
|
-
|
1085
|
-
</div>
|
1086
|
-
</div>
|
1087
|
-
<div class="tags">
|
1088
|
-
|
1089
|
-
<p class="tag_title">Returns:</p>
|
1090
|
-
<ul class="return">
|
1091
|
-
|
1092
|
-
<li>
|
1093
|
-
|
1094
|
-
|
1095
|
-
<span class='type'>(<tt>Boolean</tt>)</span>
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
—
|
1100
|
-
<div class='inline'>
|
1101
|
-
<p>whether the sprite body should be dynamic or not in the physics world. The
|
1102
|
-
default is <code>true</code>, and a dynamic body will affect with gravity.</p>
|
1103
|
-
</div>
|
1104
|
-
|
1105
|
-
</li>
|
1106
|
-
|
1107
|
-
</ul>
|
1108
|
-
|
1109
|
-
</div><table class="source_code">
|
1110
|
-
<tr>
|
1111
|
-
<td>
|
1112
|
-
<pre class="lines">
|
1113
|
-
|
1114
|
-
|
1115
|
-
1003
|
1116
|
-
1004
|
1117
|
-
1005</pre>
|
1118
|
-
</td>
|
1119
|
-
<td>
|
1120
|
-
<pre class="code"><span class="info file"># File 'motion-game', line 1003</span>
|
1121
|
-
|
1122
|
-
def dynamic?
|
1123
|
-
@dynamic?
|
1124
|
-
end</pre>
|
1125
|
-
</td>
|
1126
|
-
</tr>
|
1127
|
-
</table>
|
1128
|
-
</div>
|
1129
|
-
|
1130
|
-
|
1131
|
-
<span id="friction=-instance_method"></span>
|
1132
|
-
<div class="method_details ">
|
1133
|
-
<h3 class="signature " id="friction-instance_method">
|
1134
|
-
|
1135
|
-
#<strong>friction</strong> ⇒ <tt>Float</tt>
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1141
|
-
</h3><div class="docstring">
|
1142
|
-
<div class="discussion">
|
1143
|
-
|
1144
|
-
<p>Returns the linear damping / air friction force on the sprite body.</p>
|
1145
|
-
|
1146
|
-
|
1147
|
-
</div>
|
1148
|
-
</div>
|
1149
|
-
<div class="tags">
|
1150
|
-
|
1151
|
-
<p class="tag_title">Returns:</p>
|
1152
|
-
<ul class="return">
|
1153
|
-
|
1154
|
-
<li>
|
1155
|
-
|
1156
|
-
|
1157
|
-
<span class='type'>(<tt>Float</tt>)</span>
|
1158
|
-
|
1159
|
-
|
1160
|
-
|
1161
|
-
—
|
1162
|
-
<div class='inline'>
|
1163
|
-
<p>the linear damping / air friction force on the sprite body.</p>
|
1164
|
-
</div>
|
1165
|
-
|
1166
|
-
</li>
|
1167
|
-
|
1168
|
-
</ul>
|
1169
|
-
|
1170
|
-
</div><table class="source_code">
|
1171
|
-
<tr>
|
1172
|
-
<td>
|
1173
|
-
<pre class="lines">
|
1174
|
-
|
1175
|
-
|
1176
|
-
1006
|
1177
|
-
1007
|
1178
|
-
1008</pre>
|
1179
|
-
</td>
|
1180
|
-
<td>
|
1181
|
-
<pre class="code"><span class="info file"># File 'motion-game', line 1006</span>
|
1182
|
-
|
1183
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_friction'>friction</span>
|
1184
|
-
<span class='ivar'>@friction</span>
|
1185
|
-
<span class='kw'>end</span></pre>
|
1186
|
-
</td>
|
1187
|
-
</tr>
|
1188
|
-
</table>
|
1189
|
-
</div>
|
1190
|
-
|
1191
|
-
|
1192
|
-
<span id="gravitates?=-instance_method"></span>
|
1193
|
-
<div class="method_details ">
|
1194
|
-
<h3 class="signature " id="gravitates?-instance_method">
|
1195
|
-
|
1196
|
-
#<strong>gravitates?</strong> ⇒ <tt>Boolean</tt>
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
1201
|
-
|
1202
|
-
</h3><div class="docstring">
|
1203
|
-
<div class="discussion">
|
1204
|
-
|
1205
|
-
<p>Returns whether the sprite should be affected by the scene's
|
1206
|
-
gravitational force. The default is <code>true</code>.</p>
|
1207
|
-
|
1208
|
-
|
1209
|
-
</div>
|
1210
|
-
</div>
|
1211
|
-
<div class="tags">
|
1212
|
-
|
1213
|
-
<p class="tag_title">Returns:</p>
|
1214
|
-
<ul class="return">
|
1215
|
-
|
1216
|
-
<li>
|
1217
|
-
|
1218
|
-
|
1219
|
-
<span class='type'>(<tt>Boolean</tt>)</span>
|
1220
|
-
|
1221
|
-
|
1222
|
-
|
1223
|
-
—
|
1224
|
-
<div class='inline'>
|
1225
|
-
<p>whether the sprite should be affected by the scene's gravitational
|
1226
|
-
force. The default is <code>true</code>.</p>
|
1227
|
-
</div>
|
1228
|
-
|
1229
|
-
</li>
|
1230
|
-
|
1231
|
-
</ul>
|
1232
|
-
|
1233
|
-
</div><table class="source_code">
|
1234
|
-
<tr>
|
1235
|
-
<td>
|
1236
|
-
<pre class="lines">
|
1237
|
-
|
1238
|
-
|
1239
|
-
998
|
1240
|
-
999
|
1241
|
-
1000</pre>
|
1242
|
-
</td>
|
1243
|
-
<td>
|
1244
|
-
<pre class="code"><span class="info file"># File 'motion-game', line 998</span>
|
1245
|
-
|
1246
|
-
def gravitates?
|
1247
|
-
@gravitates?
|
1248
|
-
end</pre>
|
1249
|
-
</td>
|
1250
|
-
</tr>
|
1251
|
-
</table>
|
1252
|
-
</div>
|
1253
|
-
|
1254
|
-
|
1255
|
-
<span id="inertia_moment=-instance_method"></span>
|
1256
|
-
<div class="method_details ">
|
1257
|
-
<h3 class="signature " id="inertia_moment-instance_method">
|
1258
|
-
|
1259
|
-
#<strong>inertia_moment</strong> ⇒ <tt>Float</tt>
|
1260
|
-
|
1261
|
-
|
1262
|
-
|
1263
|
-
|
1264
|
-
|
1265
|
-
</h3><div class="docstring">
|
1266
|
-
<div class="discussion">
|
1267
|
-
|
1268
|
-
<p>Returns the moment of inertia of the body.</p>
|
1269
|
-
|
1270
|
-
|
1271
|
-
</div>
|
1272
|
-
</div>
|
1273
|
-
<div class="tags">
|
1274
|
-
|
1275
|
-
<p class="tag_title">Returns:</p>
|
1276
|
-
<ul class="return">
|
1277
|
-
|
1278
|
-
<li>
|
1279
|
-
|
1280
|
-
|
1281
|
-
<span class='type'>(<tt>Float</tt>)</span>
|
1282
|
-
|
1283
|
-
|
1284
|
-
|
1285
|
-
—
|
1286
|
-
<div class='inline'>
|
1287
|
-
<p>the moment of inertia of the body.</p>
|
1288
|
-
</div>
|
1289
|
-
|
1290
|
-
</li>
|
1291
|
-
|
1292
|
-
</ul>
|
1293
|
-
|
1294
|
-
</div><table class="source_code">
|
1295
|
-
<tr>
|
1296
|
-
<td>
|
1297
|
-
<pre class="lines">
|
1298
|
-
|
1299
|
-
|
1300
|
-
1015
|
1301
|
-
1016
|
1302
|
-
1017</pre>
|
1303
|
-
</td>
|
1304
|
-
<td>
|
1305
|
-
<pre class="code"><span class="info file"># File 'motion-game', line 1015</span>
|
1306
|
-
|
1307
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_inertia_moment'>inertia_moment</span>
|
1308
|
-
<span class='ivar'>@inertia_moment</span>
|
1309
|
-
<span class='kw'>end</span></pre>
|
1310
|
-
</td>
|
1311
|
-
</tr>
|
1312
|
-
</table>
|
1313
|
-
</div>
|
1314
|
-
|
1315
|
-
|
1316
|
-
<span id="mass=-instance_method"></span>
|
1317
|
-
<div class="method_details ">
|
1318
|
-
<h3 class="signature " id="mass-instance_method">
|
1319
|
-
|
1320
|
-
#<strong>mass</strong> ⇒ <tt>Float</tt>
|
1321
|
-
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1325
|
-
|
1326
|
-
</h3><div class="docstring">
|
1327
|
-
<div class="discussion">
|
1328
|
-
|
1329
|
-
<p>Returns the body mass of the sprite.</p>
|
1330
|
-
|
1331
|
-
|
1332
|
-
</div>
|
1333
|
-
</div>
|
1334
|
-
<div class="tags">
|
1335
|
-
|
1336
|
-
<p class="tag_title">Returns:</p>
|
1337
|
-
<ul class="return">
|
1338
|
-
|
1339
|
-
<li>
|
1340
|
-
|
1341
|
-
|
1342
|
-
<span class='type'>(<tt>Float</tt>)</span>
|
1343
|
-
|
1344
|
-
|
1345
|
-
|
1346
|
-
—
|
1347
|
-
<div class='inline'>
|
1348
|
-
<p>the body mass of the sprite.</p>
|
1349
|
-
</div>
|
1350
|
-
|
1351
|
-
</li>
|
1352
|
-
|
1353
|
-
</ul>
|
1354
|
-
|
1355
|
-
</div><table class="source_code">
|
1356
|
-
<tr>
|
1357
|
-
<td>
|
1358
|
-
<pre class="lines">
|
1359
|
-
|
1360
|
-
|
1361
|
-
994
|
1362
|
-
995
|
1363
|
-
996</pre>
|
1364
|
-
</td>
|
1365
|
-
<td>
|
1366
|
-
<pre class="code"><span class="info file"># File 'motion-game', line 994</span>
|
1367
|
-
|
1368
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_mass'>mass</span>
|
1369
|
-
<span class='ivar'>@mass</span>
|
1370
|
-
<span class='kw'>end</span></pre>
|
1371
|
-
</td>
|
1372
|
-
</tr>
|
1373
|
-
</table>
|
1374
|
-
</div>
|
1375
|
-
|
1376
|
-
|
1377
|
-
<span id="resting?=-instance_method"></span>
|
1378
|
-
<div class="method_details ">
|
1379
|
-
<h3 class="signature " id="resting?-instance_method">
|
1380
|
-
|
1381
|
-
#<strong>resting?</strong> ⇒ <tt>Boolean</tt>
|
1382
|
-
|
1383
|
-
|
1384
|
-
|
1385
|
-
|
1386
|
-
|
1387
|
-
</h3><div class="docstring">
|
1388
|
-
<div class="discussion">
|
1389
|
-
|
1390
|
-
<p>Returns whether the body is at rest.</p>
|
1391
|
-
|
1392
|
-
|
1393
|
-
</div>
|
1394
|
-
</div>
|
1395
|
-
<div class="tags">
|
1396
|
-
|
1397
|
-
<p class="tag_title">Returns:</p>
|
1398
|
-
<ul class="return">
|
1399
|
-
|
1400
|
-
<li>
|
1401
|
-
|
1402
|
-
|
1403
|
-
<span class='type'>(<tt>Boolean</tt>)</span>
|
1404
|
-
|
1405
|
-
|
1406
|
-
|
1407
|
-
—
|
1408
|
-
<div class='inline'>
|
1409
|
-
<p>whether the body is at rest.</p>
|
1410
|
-
</div>
|
1411
|
-
|
1412
|
-
</li>
|
1413
|
-
|
1414
|
-
</ul>
|
1415
|
-
|
1416
|
-
</div><table class="source_code">
|
1417
|
-
<tr>
|
1418
|
-
<td>
|
1419
|
-
<pre class="lines">
|
1420
|
-
|
1421
|
-
|
1422
|
-
1012
|
1423
|
-
1013
|
1424
|
-
1014</pre>
|
1425
|
-
</td>
|
1426
|
-
<td>
|
1427
|
-
<pre class="code"><span class="info file"># File 'motion-game', line 1012</span>
|
1428
|
-
|
1429
|
-
def resting?
|
1430
|
-
@resting?
|
1431
|
-
end</pre>
|
1432
|
-
</td>
|
1433
|
-
</tr>
|
1434
|
-
</table>
|
1435
|
-
</div>
|
1436
|
-
|
1437
|
-
|
1438
|
-
<span id="velocity=-instance_method"></span>
|
1439
|
-
<div class="method_details ">
|
1440
|
-
<h3 class="signature " id="velocity-instance_method">
|
1441
|
-
|
1442
|
-
#<strong>velocity</strong> ⇒ <tt><span class='object_link'><a href="Point.html" title="MG::Point (class)">Point</a></span></tt>
|
1443
|
-
|
1444
|
-
|
1445
|
-
|
1446
|
-
|
1447
|
-
|
1448
|
-
</h3><div class="docstring">
|
1449
|
-
<div class="discussion">
|
1450
|
-
|
1451
|
-
<p>Returns the velocity force on the sprite body.</p>
|
1452
|
-
|
1453
|
-
|
1454
|
-
</div>
|
1455
|
-
</div>
|
1456
|
-
<div class="tags">
|
1457
|
-
|
1458
|
-
<p class="tag_title">Returns:</p>
|
1459
|
-
<ul class="return">
|
1460
|
-
|
1461
|
-
<li>
|
1462
|
-
|
1463
|
-
|
1464
|
-
<span class='type'>(<tt><span class='object_link'><a href="Point.html" title="MG::Point (class)">Point</a></span></tt>)</span>
|
1465
|
-
|
1466
|
-
|
1467
|
-
|
1468
|
-
—
|
1469
|
-
<div class='inline'>
|
1470
|
-
<p>the velocity force on the sprite body.</p>
|
1471
|
-
</div>
|
1472
|
-
|
1473
|
-
</li>
|
1474
|
-
|
1475
|
-
</ul>
|
1476
|
-
|
1477
|
-
</div><table class="source_code">
|
1478
|
-
<tr>
|
1479
|
-
<td>
|
1480
|
-
<pre class="lines">
|
1481
|
-
|
1482
|
-
|
1483
|
-
1009
|
1484
|
-
1010
|
1485
|
-
1011</pre>
|
1486
|
-
</td>
|
1487
|
-
<td>
|
1488
|
-
<pre class="code"><span class="info file"># File 'motion-game', line 1009</span>
|
1489
|
-
|
1490
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_velocity'>velocity</span>
|
1491
|
-
<span class='ivar'>@velocity</span>
|
1492
|
-
<span class='kw'>end</span></pre>
|
1493
|
-
</td>
|
1494
|
-
</tr>
|
1495
|
-
</table>
|
1496
|
-
</div>
|
1497
|
-
|
1498
|
-
</div>
|
1499
|
-
|
1500
|
-
|
1501
|
-
<div id="class_method_details" class="method_details_list">
|
1502
|
-
<h2>Class Method Details</h2>
|
1503
|
-
|
1504
|
-
|
1505
|
-
<div class="method_details first">
|
1506
|
-
<h3 class="signature first" id="load-class_method">
|
1507
|
-
|
1508
|
-
.<strong>load</strong>(file_name) ⇒ <tt>nil</tt>
|
1509
|
-
|
1510
|
-
|
1511
|
-
|
1512
|
-
|
1513
|
-
|
1514
|
-
</h3><div class="docstring">
|
1515
|
-
<div class="discussion">
|
1516
|
-
|
1517
|
-
<p>Loads all sprites from the content of <code>file_name</code>, which should
|
1518
|
-
be the name of a property list spritesheet file in the application's
|
1519
|
-
resource directory. Once a spritesheet file is loaded, individual sprites
|
1520
|
-
can be created using <span class='object_link'><a href="#initialize-instance_method" title="MG::Sprite#initialize (method)">#initialize</a></span> by providing the name of the
|
1521
|
-
frame. Sprite frames files can be created with a visual editor such as
|
1522
|
-
TexturePacker.</p>
|
1523
|
-
|
1524
|
-
|
1525
|
-
</div>
|
1526
|
-
</div>
|
1527
|
-
<div class="tags">
|
1528
|
-
<p class="tag_title">Parameters:</p>
|
1529
|
-
<ul class="param">
|
1530
|
-
|
1531
|
-
<li>
|
1532
|
-
|
1533
|
-
<span class='name'>file_name</span>
|
1534
|
-
|
1535
|
-
|
1536
|
-
<span class='type'>(<tt>String</tt>)</span>
|
1537
|
-
|
1538
|
-
|
1539
|
-
|
1540
|
-
—
|
1541
|
-
<div class='inline'>
|
1542
|
-
<p>the name of the sprite frames property list file.</p>
|
1543
|
-
</div>
|
1544
|
-
|
1545
|
-
</li>
|
1546
|
-
|
1547
|
-
</ul>
|
1548
|
-
|
1549
|
-
<p class="tag_title">Returns:</p>
|
1550
|
-
<ul class="return">
|
1551
|
-
|
1552
|
-
<li>
|
1553
|
-
|
1554
|
-
|
1555
|
-
<span class='type'>(<tt>nil</tt>)</span>
|
1556
|
-
|
1557
|
-
|
1558
|
-
|
1559
|
-
</li>
|
1560
|
-
|
1561
|
-
</ul>
|
1562
|
-
|
1563
|
-
</div><table class="source_code">
|
1564
|
-
<tr>
|
1565
|
-
<td>
|
1566
|
-
<pre class="lines">
|
1567
|
-
|
1568
|
-
|
1569
|
-
890</pre>
|
1570
|
-
</td>
|
1571
|
-
<td>
|
1572
|
-
<pre class="code"><span class="info file"># File 'motion-game', line 890</span>
|
1573
|
-
|
1574
|
-
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span><span class='lparen'>(</span><span class='id identifier rubyid_file_name'>file_name</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
1575
|
-
</td>
|
1576
|
-
</tr>
|
1577
|
-
</table>
|
1578
|
-
</div>
|
1579
|
-
|
1580
|
-
</div>
|
1581
|
-
|
1582
|
-
<div id="instance_method_details" class="method_details_list">
|
1583
|
-
<h2>Instance Method Details</h2>
|
1584
|
-
|
1585
|
-
|
1586
|
-
<div class="method_details first">
|
1587
|
-
<h3 class="signature first" id="animate-instance_method">
|
1588
|
-
|
1589
|
-
#<strong>animate</strong>(frame_names, delay, loops = 1) ⇒ <tt><span class='object_link'><a href="" title="MG::Sprite (class)">Sprite</a></span></tt>
|
1590
|
-
|
1591
|
-
|
1592
|
-
|
1593
|
-
|
1594
|
-
|
1595
|
-
</h3><div class="docstring">
|
1596
|
-
<div class="discussion">
|
1597
|
-
|
1598
|
-
<p>Starts an animation where the sprite display frame will be changed to the
|
1599
|
-
given frames in <code>sprite_frames_names</code> based on the given
|
1600
|
-
<code>delay</code> and repeated <code>loops</code> times.</p>
|
1601
|
-
|
1602
|
-
|
1603
|
-
</div>
|
1604
|
-
</div>
|
1605
|
-
<div class="tags">
|
1606
|
-
<p class="tag_title">Parameters:</p>
|
1607
|
-
<ul class="param">
|
1608
|
-
|
1609
|
-
<li>
|
1610
|
-
|
1611
|
-
<span class='name'>frame_names</span>
|
1612
|
-
|
1613
|
-
|
1614
|
-
<span class='type'>(<tt>Array<String></tt>)</span>
|
1615
|
-
|
1616
|
-
|
1617
|
-
|
1618
|
-
—
|
1619
|
-
<div class='inline'>
|
1620
|
-
<p>an array of sprite frames to load and use for the animation, which can be
|
1621
|
-
either the names of standalone image files in the application's
|
1622
|
-
resource directory or the names of sprite frames loaded from a spritesheet
|
1623
|
-
using <span class='object_link'><a href="#load-class_method" title="MG::Sprite.load (method)">load</a></span>.</p>
|
1624
|
-
</div>
|
1625
|
-
|
1626
|
-
</li>
|
1627
|
-
|
1628
|
-
<li>
|
1629
|
-
|
1630
|
-
<span class='name'>delay</span>
|
1631
|
-
|
1632
|
-
|
1633
|
-
<span class='type'>(<tt>Float</tt>)</span>
|
1634
|
-
|
1635
|
-
|
1636
|
-
|
1637
|
-
—
|
1638
|
-
<div class='inline'>
|
1639
|
-
<p>the delay in seconds between each frame animation.</p>
|
1640
|
-
</div>
|
1641
|
-
|
1642
|
-
</li>
|
1643
|
-
|
1644
|
-
<li>
|
1645
|
-
|
1646
|
-
<span class='name'>loops</span>
|
1647
|
-
|
1648
|
-
|
1649
|
-
<span class='type'>(<tt>Integer</tt>, <tt>Symbol</tt>)</span>
|
1650
|
-
|
1651
|
-
|
1652
|
-
<em class="default">(defaults to: <tt>1</tt>)</em>
|
1653
|
-
|
1654
|
-
|
1655
|
-
—
|
1656
|
-
<div class='inline'>
|
1657
|
-
<p>the number of times the animation should loop. If given the
|
1658
|
-
<code>:forever</code> symbol, the animation will loop forever.</p>
|
1659
|
-
</div>
|
1660
|
-
|
1661
|
-
</li>
|
1662
|
-
|
1663
|
-
</ul>
|
1664
|
-
|
1665
|
-
<p class="tag_title">Returns:</p>
|
1666
|
-
<ul class="return">
|
1667
|
-
|
1668
|
-
<li>
|
1669
|
-
|
1670
|
-
|
1671
|
-
<span class='type'>(<tt><span class='object_link'><a href="" title="MG::Sprite (class)">Sprite</a></span></tt>)</span>
|
1672
|
-
|
1673
|
-
|
1674
|
-
|
1675
|
-
—
|
1676
|
-
<div class='inline'>
|
1677
|
-
<p>the receiver.</p>
|
1678
|
-
</div>
|
1679
|
-
|
1680
|
-
</li>
|
1681
|
-
|
1682
|
-
</ul>
|
1683
|
-
|
1684
|
-
</div><table class="source_code">
|
1685
|
-
<tr>
|
1686
|
-
<td>
|
1687
|
-
<pre class="lines">
|
1688
|
-
|
1689
|
-
|
1690
|
-
951</pre>
|
1691
|
-
</td>
|
1692
|
-
<td>
|
1693
|
-
<pre class="code"><span class="info file"># File 'motion-game', line 951</span>
|
1694
|
-
|
1695
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_animate'>animate</span><span class='lparen'>(</span><span class='id identifier rubyid_frame_names'>frame_names</span><span class='comma'>,</span> <span class='id identifier rubyid_delay'>delay</span><span class='comma'>,</span> <span class='id identifier rubyid_loops'>loops</span><span class='op'>=</span><span class='int'>1</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
1696
|
-
</td>
|
1697
|
-
</tr>
|
1698
|
-
</table>
|
1699
|
-
</div>
|
1700
|
-
|
1701
|
-
<div class="method_details ">
|
1702
|
-
<h3 class="signature " id="apply_force-instance_method">
|
1703
|
-
|
1704
|
-
#<strong>apply_force</strong>(force) ⇒ <tt><span class='object_link'><a href="" title="MG::Sprite (class)">Sprite</a></span></tt>
|
1705
|
-
|
1706
|
-
|
1707
|
-
|
1708
|
-
|
1709
|
-
|
1710
|
-
</h3><div class="docstring">
|
1711
|
-
<div class="discussion">
|
1712
|
-
|
1713
|
-
<p>Applies an immediate force to the sprite body.</p>
|
1714
|
-
|
1715
|
-
|
1716
|
-
</div>
|
1717
|
-
</div>
|
1718
|
-
<div class="tags">
|
1719
|
-
<p class="tag_title">Parameters:</p>
|
1720
|
-
<ul class="param">
|
1721
|
-
|
1722
|
-
<li>
|
1723
|
-
|
1724
|
-
<span class='name'>force</span>
|
1725
|
-
|
1726
|
-
|
1727
|
-
<span class='type'>(<tt><span class='object_link'><a href="Point.html" title="MG::Point (class)">Point</a></span></tt>)</span>
|
1728
|
-
|
1729
|
-
|
1730
|
-
|
1731
|
-
—
|
1732
|
-
<div class='inline'>
|
1733
|
-
<p>the force to apply.</p>
|
1734
|
-
</div>
|
1735
|
-
|
1736
|
-
</li>
|
1737
|
-
|
1738
|
-
</ul>
|
1739
|
-
|
1740
|
-
<p class="tag_title">Returns:</p>
|
1741
|
-
<ul class="return">
|
1742
|
-
|
1743
|
-
<li>
|
1744
|
-
|
1745
|
-
|
1746
|
-
<span class='type'>(<tt><span class='object_link'><a href="" title="MG::Sprite (class)">Sprite</a></span></tt>)</span>
|
1747
|
-
|
1748
|
-
|
1749
|
-
|
1750
|
-
—
|
1751
|
-
<div class='inline'>
|
1752
|
-
<p>the receiver.</p>
|
1753
|
-
</div>
|
1754
|
-
|
1755
|
-
</li>
|
1756
|
-
|
1757
|
-
</ul>
|
1758
|
-
|
1759
|
-
</div><table class="source_code">
|
1760
|
-
<tr>
|
1761
|
-
<td>
|
1762
|
-
<pre class="lines">
|
1763
|
-
|
1764
|
-
|
1765
|
-
988</pre>
|
1766
|
-
</td>
|
1767
|
-
<td>
|
1768
|
-
<pre class="code"><span class="info file"># File 'motion-game', line 988</span>
|
1769
|
-
|
1770
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_apply_force'>apply_force</span><span class='lparen'>(</span><span class='id identifier rubyid_force'>force</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
1771
|
-
</td>
|
1772
|
-
</tr>
|
1773
|
-
</table>
|
1774
|
-
</div>
|
1775
|
-
|
1776
|
-
<div class="method_details ">
|
1777
|
-
<h3 class="signature " id="apply_impulse-instance_method">
|
1778
|
-
|
1779
|
-
#<strong>apply_impulse</strong>(force) ⇒ <tt><span class='object_link'><a href="" title="MG::Sprite (class)">Sprite</a></span></tt>
|
1780
|
-
|
1781
|
-
|
1782
|
-
|
1783
|
-
|
1784
|
-
|
1785
|
-
</h3><div class="docstring">
|
1786
|
-
<div class="discussion">
|
1787
|
-
|
1788
|
-
<p>Applies a continuous force to the sprite body.</p>
|
1789
|
-
|
1790
|
-
|
1791
|
-
</div>
|
1792
|
-
</div>
|
1793
|
-
<div class="tags">
|
1794
|
-
<p class="tag_title">Parameters:</p>
|
1795
|
-
<ul class="param">
|
1796
|
-
|
1797
|
-
<li>
|
1798
|
-
|
1799
|
-
<span class='name'>force</span>
|
1800
|
-
|
1801
|
-
|
1802
|
-
<span class='type'>(<tt><span class='object_link'><a href="Point.html" title="MG::Point (class)">Point</a></span></tt>)</span>
|
1803
|
-
|
1804
|
-
|
1805
|
-
|
1806
|
-
—
|
1807
|
-
<div class='inline'>
|
1808
|
-
<p>the force to apply.</p>
|
1809
|
-
</div>
|
1810
|
-
|
1811
|
-
</li>
|
1812
|
-
|
1813
|
-
</ul>
|
1814
|
-
|
1815
|
-
<p class="tag_title">Returns:</p>
|
1816
|
-
<ul class="return">
|
1817
|
-
|
1818
|
-
<li>
|
1819
|
-
|
1820
|
-
|
1821
|
-
<span class='type'>(<tt><span class='object_link'><a href="" title="MG::Sprite (class)">Sprite</a></span></tt>)</span>
|
1822
|
-
|
1823
|
-
|
1824
|
-
|
1825
|
-
—
|
1826
|
-
<div class='inline'>
|
1827
|
-
<p>the receiver.</p>
|
1828
|
-
</div>
|
1829
|
-
|
1830
|
-
</li>
|
1831
|
-
|
1832
|
-
</ul>
|
1833
|
-
|
1834
|
-
</div><table class="source_code">
|
1835
|
-
<tr>
|
1836
|
-
<td>
|
1837
|
-
<pre class="lines">
|
1838
|
-
|
1839
|
-
|
1840
|
-
983</pre>
|
1841
|
-
</td>
|
1842
|
-
<td>
|
1843
|
-
<pre class="code"><span class="info file"># File 'motion-game', line 983</span>
|
1844
|
-
|
1845
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_apply_impulse'>apply_impulse</span><span class='lparen'>(</span><span class='id identifier rubyid_force'>force</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
1846
|
-
</td>
|
1847
|
-
</tr>
|
1848
|
-
</table>
|
1849
|
-
</div>
|
1850
|
-
|
1851
|
-
<div class="method_details ">
|
1852
|
-
<h3 class="signature " id="attach_physics_box-instance_method">
|
1853
|
-
|
1854
|
-
#<strong>attach_physics_box</strong>(size = nil) ⇒ <tt><span class='object_link'><a href="" title="MG::Sprite (class)">Sprite</a></span></tt>
|
1855
|
-
|
1856
|
-
|
1857
|
-
|
1858
|
-
|
1859
|
-
|
1860
|
-
</h3><div class="docstring">
|
1861
|
-
<div class="discussion">
|
1862
|
-
|
1863
|
-
<p>Attaches a physics body with a box shape to the sprite.</p>
|
1864
|
-
|
1865
|
-
|
1866
|
-
</div>
|
1867
|
-
</div>
|
1868
|
-
<div class="tags">
|
1869
|
-
<p class="tag_title">Parameters:</p>
|
1870
|
-
<ul class="param">
|
1871
|
-
|
1872
|
-
<li>
|
1873
|
-
|
1874
|
-
<span class='name'>size</span>
|
1875
|
-
|
1876
|
-
|
1877
|
-
<span class='type'>(<tt><span class='object_link'><a href="Size.html" title="MG::Size (class)">Size</a></span></tt>)</span>
|
1878
|
-
|
1879
|
-
|
1880
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
1881
|
-
|
1882
|
-
|
1883
|
-
—
|
1884
|
-
<div class='inline'>
|
1885
|
-
<p>the size of the box. If <code>nil</code> is given, the size of the sprite,
|
1886
|
-
retrieved with <span class='object_link'><a href="Node.html#size-instance_method" title="MG::Node#size (method)">Node#size</a></span>, will be used instead.</p>
|
1887
|
-
</div>
|
1888
|
-
|
1889
|
-
</li>
|
1890
|
-
|
1891
|
-
</ul>
|
1892
|
-
|
1893
|
-
<p class="tag_title">Returns:</p>
|
1894
|
-
<ul class="return">
|
1895
|
-
|
1896
|
-
<li>
|
1897
|
-
|
1898
|
-
|
1899
|
-
<span class='type'>(<tt><span class='object_link'><a href="" title="MG::Sprite (class)">Sprite</a></span></tt>)</span>
|
1900
|
-
|
1901
|
-
|
1902
|
-
|
1903
|
-
—
|
1904
|
-
<div class='inline'>
|
1905
|
-
<p>the receiver.</p>
|
1906
|
-
</div>
|
1907
|
-
|
1908
|
-
</li>
|
1909
|
-
|
1910
|
-
</ul>
|
1911
|
-
|
1912
|
-
</div><table class="source_code">
|
1913
|
-
<tr>
|
1914
|
-
<td>
|
1915
|
-
<pre class="lines">
|
1916
|
-
|
1917
|
-
|
1918
|
-
978</pre>
|
1919
|
-
</td>
|
1920
|
-
<td>
|
1921
|
-
<pre class="code"><span class="info file"># File 'motion-game', line 978</span>
|
1922
|
-
|
1923
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_attach_physics_box'>attach_physics_box</span><span class='lparen'>(</span><span class='id identifier rubyid_size'>size</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
1924
|
-
</td>
|
1925
|
-
</tr>
|
1926
|
-
</table>
|
1927
|
-
</div>
|
1928
|
-
|
1929
|
-
<div class="method_details ">
|
1930
|
-
<h3 class="signature " id="blink-instance_method">
|
1931
|
-
|
1932
|
-
#<strong>blink</strong>(number_of_blinks, interval) ⇒ <tt><span class='object_link'><a href="" title="MG::Sprite (class)">Sprite</a></span></tt>
|
1933
|
-
|
1934
|
-
|
1935
|
-
|
1936
|
-
|
1937
|
-
|
1938
|
-
</h3><div class="docstring">
|
1939
|
-
<div class="discussion">
|
1940
|
-
|
1941
|
-
<p>Blinks the receiver.</p>
|
1942
|
-
|
1943
|
-
|
1944
|
-
</div>
|
1945
|
-
</div>
|
1946
|
-
<div class="tags">
|
1947
|
-
<p class="tag_title">Parameters:</p>
|
1948
|
-
<ul class="param">
|
1949
|
-
|
1950
|
-
<li>
|
1951
|
-
|
1952
|
-
<span class='name'>number_of_blinks</span>
|
1953
|
-
|
1954
|
-
|
1955
|
-
<span class='type'>(<tt>Integer</tt>)</span>
|
1956
|
-
|
1957
|
-
|
1958
|
-
|
1959
|
-
—
|
1960
|
-
<div class='inline'>
|
1961
|
-
<p>the number of times the receiver should blink.</p>
|
1962
|
-
</div>
|
1963
|
-
|
1964
|
-
</li>
|
1965
|
-
|
1966
|
-
<li>
|
1967
|
-
|
1968
|
-
<span class='name'>interval</span>
|
1969
|
-
|
1970
|
-
|
1971
|
-
<span class='type'>(<tt>Float</tt>)</span>
|
1972
|
-
|
1973
|
-
|
1974
|
-
|
1975
|
-
—
|
1976
|
-
<div class='inline'>
|
1977
|
-
<p>the animation interval.</p>
|
1978
|
-
</div>
|
1979
|
-
|
1980
|
-
</li>
|
1981
|
-
|
1982
|
-
</ul>
|
1983
|
-
|
1984
|
-
<p class="tag_title">Returns:</p>
|
1985
|
-
<ul class="return">
|
1986
|
-
|
1987
|
-
<li>
|
1988
|
-
|
1989
|
-
|
1990
|
-
<span class='type'>(<tt><span class='object_link'><a href="" title="MG::Sprite (class)">Sprite</a></span></tt>)</span>
|
1991
|
-
|
1992
|
-
|
1993
|
-
|
1994
|
-
—
|
1995
|
-
<div class='inline'>
|
1996
|
-
<p>the receiver.</p>
|
1997
|
-
</div>
|
1998
|
-
|
1999
|
-
</li>
|
2000
|
-
|
2001
|
-
</ul>
|
2002
|
-
|
2003
|
-
</div><table class="source_code">
|
2004
|
-
<tr>
|
2005
|
-
<td>
|
2006
|
-
<pre class="lines">
|
2007
|
-
|
2008
|
-
|
2009
|
-
938</pre>
|
2010
|
-
</td>
|
2011
|
-
<td>
|
2012
|
-
<pre class="code"><span class="info file"># File 'motion-game', line 938</span>
|
2013
|
-
|
2014
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_blink'>blink</span><span class='lparen'>(</span><span class='id identifier rubyid_number_of_blinks'>number_of_blinks</span><span class='comma'>,</span> <span class='id identifier rubyid_interval'>interval</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
2015
|
-
</td>
|
2016
|
-
</tr>
|
2017
|
-
</table>
|
2018
|
-
</div>
|
2019
|
-
|
2020
|
-
<div class="method_details ">
|
2021
|
-
<h3 class="signature " id="flipped_horizontally=-instance_method">
|
2022
|
-
|
2023
|
-
#<strong>flipped_horizontally=</strong>(value) ⇒ <tt>Object</tt>
|
2024
|
-
|
2025
|
-
|
2026
|
-
|
2027
|
-
|
2028
|
-
|
2029
|
-
</h3><div class="docstring">
|
2030
|
-
<div class="discussion">
|
2031
|
-
|
2032
|
-
<p>Sets whether the sprite should be flipped horizontally or not. It only
|
2033
|
-
flips the texture of the sprite, and not the texture of the sprite's
|
2034
|
-
children. Also, flipping the texture doesn't alter the anchorPoint.</p>
|
2035
|
-
|
2036
|
-
|
2037
|
-
</div>
|
2038
|
-
</div>
|
2039
|
-
<div class="tags">
|
2040
|
-
<p class="tag_title">Parameters:</p>
|
2041
|
-
<ul class="param">
|
2042
|
-
|
2043
|
-
<li>
|
2044
|
-
|
2045
|
-
<span class='name'>value</span>
|
2046
|
-
|
2047
|
-
|
2048
|
-
<span class='type'>(<tt>Boolean</tt>)</span>
|
2049
|
-
|
2050
|
-
|
2051
|
-
|
2052
|
-
—
|
2053
|
-
<div class='inline'>
|
2054
|
-
<p>true if the sprite should be flipped horizontally, false otherwise.</p>
|
2055
|
-
</div>
|
2056
|
-
|
2057
|
-
</li>
|
2058
|
-
|
2059
|
-
</ul>
|
2060
|
-
|
2061
|
-
|
2062
|
-
</div><table class="source_code">
|
2063
|
-
<tr>
|
2064
|
-
<td>
|
2065
|
-
<pre class="lines">
|
2066
|
-
|
2067
|
-
|
2068
|
-
957</pre>
|
2069
|
-
</td>
|
2070
|
-
<td>
|
2071
|
-
<pre class="code"><span class="info file"># File 'motion-game', line 957</span>
|
2072
|
-
|
2073
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_flipped_horizontally='>flipped_horizontally=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
2074
|
-
</td>
|
2075
|
-
</tr>
|
2076
|
-
</table>
|
2077
|
-
</div>
|
2078
|
-
|
2079
|
-
<div class="method_details ">
|
2080
|
-
<h3 class="signature " id="flipped_vertically=-instance_method">
|
2081
|
-
|
2082
|
-
#<strong>flipped_vertically=</strong>(value) ⇒ <tt>Object</tt>
|
2083
|
-
|
2084
|
-
|
2085
|
-
|
2086
|
-
|
2087
|
-
|
2088
|
-
</h3><div class="docstring">
|
2089
|
-
<div class="discussion">
|
2090
|
-
|
2091
|
-
<p>Sets whether the sprite should be flipped vertically or not. It only flips
|
2092
|
-
the texture of the sprite, and not the texture of the sprite's
|
2093
|
-
children. Also, flipping the texture doesn't alter the anchorPoint.</p>
|
2094
|
-
|
2095
|
-
|
2096
|
-
</div>
|
2097
|
-
</div>
|
2098
|
-
<div class="tags">
|
2099
|
-
<p class="tag_title">Parameters:</p>
|
2100
|
-
<ul class="param">
|
2101
|
-
|
2102
|
-
<li>
|
2103
|
-
|
2104
|
-
<span class='name'>value</span>
|
2105
|
-
|
2106
|
-
|
2107
|
-
<span class='type'>(<tt>Boolean</tt>)</span>
|
2108
|
-
|
2109
|
-
|
2110
|
-
|
2111
|
-
—
|
2112
|
-
<div class='inline'>
|
2113
|
-
<p>true if the sprite should be flipped vertically, false otherwise.</p>
|
2114
|
-
</div>
|
2115
|
-
|
2116
|
-
</li>
|
2117
|
-
|
2118
|
-
</ul>
|
2119
|
-
|
2120
|
-
|
2121
|
-
</div><table class="source_code">
|
2122
|
-
<tr>
|
2123
|
-
<td>
|
2124
|
-
<pre class="lines">
|
2125
|
-
|
2126
|
-
|
2127
|
-
966</pre>
|
2128
|
-
</td>
|
2129
|
-
<td>
|
2130
|
-
<pre class="code"><span class="info file"># File 'motion-game', line 966</span>
|
2131
|
-
|
2132
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_flipped_vertically='>flipped_vertically=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
2133
|
-
</td>
|
2134
|
-
</tr>
|
2135
|
-
</table>
|
2136
|
-
</div>
|
2137
|
-
|
2138
|
-
<div class="method_details ">
|
2139
|
-
<h3 class="signature " id="flipped_x=-instance_method">
|
2140
|
-
|
2141
|
-
#<strong>flipped_x=</strong>(value) ⇒ <tt>Object</tt>
|
2142
|
-
|
2143
|
-
|
2144
|
-
|
2145
|
-
|
2146
|
-
|
2147
|
-
</h3><div class="docstring">
|
2148
|
-
<div class="discussion">
|
2149
|
-
|
2150
|
-
<p>This is alias method of “#flipped_horizontally=”.</p>
|
2151
|
-
|
2152
|
-
|
2153
|
-
</div>
|
2154
|
-
</div>
|
2155
|
-
<div class="tags">
|
2156
|
-
|
2157
|
-
|
2158
|
-
</div><table class="source_code">
|
2159
|
-
<tr>
|
2160
|
-
<td>
|
2161
|
-
<pre class="lines">
|
2162
|
-
|
2163
|
-
|
2164
|
-
960</pre>
|
2165
|
-
</td>
|
2166
|
-
<td>
|
2167
|
-
<pre class="code"><span class="info file"># File 'motion-game', line 960</span>
|
2168
|
-
|
2169
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_flipped_x='>flipped_x=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
2170
|
-
</td>
|
2171
|
-
</tr>
|
2172
|
-
</table>
|
2173
|
-
</div>
|
2174
|
-
|
2175
|
-
<div class="method_details ">
|
2176
|
-
<h3 class="signature " id="flipped_y=-instance_method">
|
2177
|
-
|
2178
|
-
#<strong>flipped_y=</strong>(value) ⇒ <tt>Object</tt>
|
2179
|
-
|
2180
|
-
|
2181
|
-
|
2182
|
-
|
2183
|
-
|
2184
|
-
</h3><div class="docstring">
|
2185
|
-
<div class="discussion">
|
2186
|
-
|
2187
|
-
<p>This is alias method of “#flipped_vertically=”.</p>
|
2188
|
-
|
2189
|
-
|
2190
|
-
</div>
|
2191
|
-
</div>
|
2192
|
-
<div class="tags">
|
2193
|
-
|
2194
|
-
|
2195
|
-
</div><table class="source_code">
|
2196
|
-
<tr>
|
2197
|
-
<td>
|
2198
|
-
<pre class="lines">
|
2199
|
-
|
2200
|
-
|
2201
|
-
969</pre>
|
2202
|
-
</td>
|
2203
|
-
<td>
|
2204
|
-
<pre class="code"><span class="info file"># File 'motion-game', line 969</span>
|
2205
|
-
|
2206
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_flipped_y='>flipped_y=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
2207
|
-
</td>
|
2208
|
-
</tr>
|
2209
|
-
</table>
|
2210
|
-
</div>
|
2211
|
-
|
2212
|
-
<div class="method_details ">
|
2213
|
-
<h3 class="signature " id="move_by-instance_method">
|
2214
|
-
|
2215
|
-
#<strong>move_by</strong>(delta_location, interval) ⇒ <tt><span class='object_link'><a href="" title="MG::Sprite (class)">Sprite</a></span></tt>
|
2216
|
-
|
2217
|
-
|
2218
|
-
|
2219
|
-
|
2220
|
-
|
2221
|
-
</h3><div class="docstring">
|
2222
|
-
<div class="discussion">
|
2223
|
-
|
2224
|
-
<p>Moves the position of the receiver to a new location determined by the sum
|
2225
|
-
of the current location and the given <code>delta_location</code> object.</p>
|
2226
|
-
|
2227
|
-
|
2228
|
-
</div>
|
2229
|
-
</div>
|
2230
|
-
<div class="tags">
|
2231
|
-
<p class="tag_title">Parameters:</p>
|
2232
|
-
<ul class="param">
|
2233
|
-
|
2234
|
-
<li>
|
2235
|
-
|
2236
|
-
<span class='name'>delta_location</span>
|
2237
|
-
|
2238
|
-
|
2239
|
-
<span class='type'>(<tt><span class='object_link'><a href="Point.html" title="MG::Point (class)">Point</a></span></tt>)</span>
|
2240
|
-
|
2241
|
-
|
2242
|
-
|
2243
|
-
—
|
2244
|
-
<div class='inline'>
|
2245
|
-
<p>a point that will be added to the receiver's current location.</p>
|
2246
|
-
</div>
|
2247
|
-
|
2248
|
-
</li>
|
2249
|
-
|
2250
|
-
<li>
|
2251
|
-
|
2252
|
-
<span class='name'>interval</span>
|
2253
|
-
|
2254
|
-
|
2255
|
-
<span class='type'>(<tt>Float</tt>)</span>
|
2256
|
-
|
2257
|
-
|
2258
|
-
|
2259
|
-
—
|
2260
|
-
<div class='inline'>
|
2261
|
-
<p>the animation interval.</p>
|
2262
|
-
</div>
|
2263
|
-
|
2264
|
-
</li>
|
2265
|
-
|
2266
|
-
</ul>
|
2267
|
-
|
2268
|
-
<p class="tag_title">Returns:</p>
|
2269
|
-
<ul class="return">
|
2270
|
-
|
2271
|
-
<li>
|
2272
|
-
|
2273
|
-
|
2274
|
-
<span class='type'>(<tt><span class='object_link'><a href="" title="MG::Sprite (class)">Sprite</a></span></tt>)</span>
|
2275
|
-
|
2276
|
-
|
2277
|
-
|
2278
|
-
—
|
2279
|
-
<div class='inline'>
|
2280
|
-
<p>the receiver.</p>
|
2281
|
-
</div>
|
2282
|
-
|
2283
|
-
</li>
|
2284
|
-
|
2285
|
-
</ul>
|
2286
|
-
|
2287
|
-
</div><table class="source_code">
|
2288
|
-
<tr>
|
2289
|
-
<td>
|
2290
|
-
<pre class="lines">
|
2291
|
-
|
2292
|
-
|
2293
|
-
911</pre>
|
2294
|
-
</td>
|
2295
|
-
<td>
|
2296
|
-
<pre class="code"><span class="info file"># File 'motion-game', line 911</span>
|
2297
|
-
|
2298
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_move_by'>move_by</span><span class='lparen'>(</span><span class='id identifier rubyid_delta_location'>delta_location</span><span class='comma'>,</span> <span class='id identifier rubyid_interval'>interval</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
2299
|
-
</td>
|
2300
|
-
</tr>
|
2301
|
-
</table>
|
2302
|
-
</div>
|
2303
|
-
|
2304
|
-
<div class="method_details ">
|
2305
|
-
<h3 class="signature " id="move_to-instance_method">
|
2306
|
-
|
2307
|
-
#<strong>move_to</strong>(location, interval) ⇒ <tt><span class='object_link'><a href="" title="MG::Sprite (class)">Sprite</a></span></tt>
|
2308
|
-
|
2309
|
-
|
2310
|
-
|
2311
|
-
|
2312
|
-
|
2313
|
-
</h3><div class="docstring">
|
2314
|
-
<div class="discussion">
|
2315
|
-
|
2316
|
-
<p>Moves the position of the receiver to a new given location.</p>
|
2317
|
-
|
2318
|
-
|
2319
|
-
</div>
|
2320
|
-
</div>
|
2321
|
-
<div class="tags">
|
2322
|
-
<p class="tag_title">Parameters:</p>
|
2323
|
-
<ul class="param">
|
2324
|
-
|
2325
|
-
<li>
|
2326
|
-
|
2327
|
-
<span class='name'>location</span>
|
2328
|
-
|
2329
|
-
|
2330
|
-
<span class='type'>(<tt><span class='object_link'><a href="Point.html" title="MG::Point (class)">Point</a></span></tt>)</span>
|
2331
|
-
|
2332
|
-
|
2333
|
-
|
2334
|
-
—
|
2335
|
-
<div class='inline'>
|
2336
|
-
<p>where the receiver should be moved to.</p>
|
2337
|
-
</div>
|
2338
|
-
|
2339
|
-
</li>
|
2340
|
-
|
2341
|
-
<li>
|
2342
|
-
|
2343
|
-
<span class='name'>interval</span>
|
2344
|
-
|
2345
|
-
|
2346
|
-
<span class='type'>(<tt>Float</tt>)</span>
|
2347
|
-
|
2348
|
-
|
2349
|
-
|
2350
|
-
—
|
2351
|
-
<div class='inline'>
|
2352
|
-
<p>the animation interval.</p>
|
2353
|
-
</div>
|
2354
|
-
|
2355
|
-
</li>
|
2356
|
-
|
2357
|
-
</ul>
|
2358
|
-
|
2359
|
-
<p class="tag_title">Returns:</p>
|
2360
|
-
<ul class="return">
|
2361
|
-
|
2362
|
-
<li>
|
2363
|
-
|
2364
|
-
|
2365
|
-
<span class='type'>(<tt><span class='object_link'><a href="" title="MG::Sprite (class)">Sprite</a></span></tt>)</span>
|
2366
|
-
|
2367
|
-
|
2368
|
-
|
2369
|
-
—
|
2370
|
-
<div class='inline'>
|
2371
|
-
<p>the receiver.</p>
|
2372
|
-
</div>
|
2373
|
-
|
2374
|
-
</li>
|
2375
|
-
|
2376
|
-
</ul>
|
2377
|
-
|
2378
|
-
</div><table class="source_code">
|
2379
|
-
<tr>
|
2380
|
-
<td>
|
2381
|
-
<pre class="lines">
|
2382
|
-
|
2383
|
-
|
2384
|
-
917</pre>
|
2385
|
-
</td>
|
2386
|
-
<td>
|
2387
|
-
<pre class="code"><span class="info file"># File 'motion-game', line 917</span>
|
2388
|
-
|
2389
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_move_to'>move_to</span><span class='lparen'>(</span><span class='id identifier rubyid_location'>location</span><span class='comma'>,</span> <span class='id identifier rubyid_interval'>interval</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
2390
|
-
</td>
|
2391
|
-
</tr>
|
2392
|
-
</table>
|
2393
|
-
</div>
|
2394
|
-
|
2395
|
-
<div class="method_details ">
|
2396
|
-
<h3 class="signature " id="rotate_by-instance_method">
|
2397
|
-
|
2398
|
-
#<strong>rotate_by</strong>(delta_angle, interval) ⇒ <tt><span class='object_link'><a href="" title="MG::Sprite (class)">Sprite</a></span></tt>
|
2399
|
-
|
2400
|
-
|
2401
|
-
|
2402
|
-
|
2403
|
-
|
2404
|
-
</h3><div class="docstring">
|
2405
|
-
<div class="discussion">
|
2406
|
-
|
2407
|
-
<p>Rotates the position of the receiver to a new angle determined by the sum
|
2408
|
-
of the current rotation and the given <code>delta_angle</code> object.</p>
|
2409
|
-
|
2410
|
-
|
2411
|
-
</div>
|
2412
|
-
</div>
|
2413
|
-
<div class="tags">
|
2414
|
-
<p class="tag_title">Parameters:</p>
|
2415
|
-
<ul class="param">
|
2416
|
-
|
2417
|
-
<li>
|
2418
|
-
|
2419
|
-
<span class='name'>delta_angle</span>
|
2420
|
-
|
2421
|
-
|
2422
|
-
<span class='type'>(<tt>Float</tt>)</span>
|
2423
|
-
|
2424
|
-
|
2425
|
-
|
2426
|
-
—
|
2427
|
-
<div class='inline'>
|
2428
|
-
<p>the angle to add to the current rotation</p>
|
2429
|
-
</div>
|
2430
|
-
|
2431
|
-
</li>
|
2432
|
-
|
2433
|
-
<li>
|
2434
|
-
|
2435
|
-
<span class='name'>interval</span>
|
2436
|
-
|
2437
|
-
|
2438
|
-
<span class='type'>(<tt>Float</tt>)</span>
|
2439
|
-
|
2440
|
-
|
2441
|
-
|
2442
|
-
—
|
2443
|
-
<div class='inline'>
|
2444
|
-
<p>the animation interval.</p>
|
2445
|
-
</div>
|
2446
|
-
|
2447
|
-
</li>
|
2448
|
-
|
2449
|
-
</ul>
|
2450
|
-
|
2451
|
-
<p class="tag_title">Returns:</p>
|
2452
|
-
<ul class="return">
|
2453
|
-
|
2454
|
-
<li>
|
2455
|
-
|
2456
|
-
|
2457
|
-
<span class='type'>(<tt><span class='object_link'><a href="" title="MG::Sprite (class)">Sprite</a></span></tt>)</span>
|
2458
|
-
|
2459
|
-
|
2460
|
-
|
2461
|
-
—
|
2462
|
-
<div class='inline'>
|
2463
|
-
<p>the receiver.</p>
|
2464
|
-
</div>
|
2465
|
-
|
2466
|
-
</li>
|
2467
|
-
|
2468
|
-
</ul>
|
2469
|
-
|
2470
|
-
</div><table class="source_code">
|
2471
|
-
<tr>
|
2472
|
-
<td>
|
2473
|
-
<pre class="lines">
|
2474
|
-
|
2475
|
-
|
2476
|
-
924</pre>
|
2477
|
-
</td>
|
2478
|
-
<td>
|
2479
|
-
<pre class="code"><span class="info file"># File 'motion-game', line 924</span>
|
2480
|
-
|
2481
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_rotate_by'>rotate_by</span><span class='lparen'>(</span><span class='id identifier rubyid_delta_angle'>delta_angle</span><span class='comma'>,</span> <span class='id identifier rubyid_interval'>interval</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
2482
|
-
</td>
|
2483
|
-
</tr>
|
2484
|
-
</table>
|
2485
|
-
</div>
|
2486
|
-
|
2487
|
-
<div class="method_details ">
|
2488
|
-
<h3 class="signature " id="rotate_to-instance_method">
|
2489
|
-
|
2490
|
-
#<strong>rotate_to</strong>(angle, interval) ⇒ <tt><span class='object_link'><a href="" title="MG::Sprite (class)">Sprite</a></span></tt>
|
2491
|
-
|
2492
|
-
|
2493
|
-
|
2494
|
-
|
2495
|
-
|
2496
|
-
</h3><div class="docstring">
|
2497
|
-
<div class="discussion">
|
2498
|
-
|
2499
|
-
<p>Rotates the angle of the receiver to a new angle certain angle by modifying
|
2500
|
-
it's rotation attribute.</p>
|
2501
|
-
|
2502
|
-
|
2503
|
-
</div>
|
2504
|
-
</div>
|
2505
|
-
<div class="tags">
|
2506
|
-
<p class="tag_title">Parameters:</p>
|
2507
|
-
<ul class="param">
|
2508
|
-
|
2509
|
-
<li>
|
2510
|
-
|
2511
|
-
<span class='name'>angle</span>
|
2512
|
-
|
2513
|
-
|
2514
|
-
<span class='type'>(<tt>Float</tt>)</span>
|
2515
|
-
|
2516
|
-
|
2517
|
-
|
2518
|
-
—
|
2519
|
-
<div class='inline'>
|
2520
|
-
<p>the receiver should be rotated to.</p>
|
2521
|
-
</div>
|
2522
|
-
|
2523
|
-
</li>
|
2524
|
-
|
2525
|
-
<li>
|
2526
|
-
|
2527
|
-
<span class='name'>interval</span>
|
2528
|
-
|
2529
|
-
|
2530
|
-
<span class='type'>(<tt>Float</tt>)</span>
|
2531
|
-
|
2532
|
-
|
2533
|
-
|
2534
|
-
—
|
2535
|
-
<div class='inline'>
|
2536
|
-
<p>the animation interval.</p>
|
2537
|
-
</div>
|
2538
|
-
|
2539
|
-
</li>
|
2540
|
-
|
2541
|
-
</ul>
|
2542
|
-
|
2543
|
-
<p class="tag_title">Returns:</p>
|
2544
|
-
<ul class="return">
|
2545
|
-
|
2546
|
-
<li>
|
2547
|
-
|
2548
|
-
|
2549
|
-
<span class='type'>(<tt><span class='object_link'><a href="" title="MG::Sprite (class)">Sprite</a></span></tt>)</span>
|
2550
|
-
|
2551
|
-
|
2552
|
-
|
2553
|
-
—
|
2554
|
-
<div class='inline'>
|
2555
|
-
<p>the receiver.</p>
|
2556
|
-
</div>
|
2557
|
-
|
2558
|
-
</li>
|
2559
|
-
|
2560
|
-
</ul>
|
2561
|
-
|
2562
|
-
</div><table class="source_code">
|
2563
|
-
<tr>
|
2564
|
-
<td>
|
2565
|
-
<pre class="lines">
|
2566
|
-
|
2567
|
-
|
2568
|
-
931</pre>
|
2569
|
-
</td>
|
2570
|
-
<td>
|
2571
|
-
<pre class="code"><span class="info file"># File 'motion-game', line 931</span>
|
2572
|
-
|
2573
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_rotate_to'>rotate_to</span><span class='lparen'>(</span><span class='id identifier rubyid_angle'>angle</span><span class='comma'>,</span> <span class='id identifier rubyid_interval'>interval</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
2574
|
-
</td>
|
2575
|
-
</tr>
|
2576
|
-
</table>
|
2577
|
-
</div>
|
2578
|
-
|
2579
|
-
</div>
|
2580
|
-
|
2581
|
-
</div>
|
2582
|
-
|
2583
|
-
<div id="footer">
|
2584
|
-
Generated on Sun Dec 11 16:38:30 2016 by
|
2585
|
-
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
2586
|
-
0.9.5 (ruby-2.3.3).
|
2587
|
-
</div>
|
2588
|
-
|
2589
|
-
</div>
|
2590
|
-
</body>
|
2591
|
-
</html>
|