dxopal 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +5 -0
- data/.ignore +5 -0
- data/.nojekyll +4 -0
- data/CHANGELOG.md +90 -0
- data/DEVELOPMENT.md +57 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +39 -0
- data/README.md +22 -0
- data/Rakefile +66 -0
- data/TODO.md +278 -0
- data/build/dxopal.js +46590 -0
- data/build/dxopal.min.js +1 -0
- data/config.ru +39 -0
- data/doc/api/DXOpal.html +129 -0
- data/doc/api/DXOpal/Font.html +485 -0
- data/doc/api/DXOpal/Image.html +2533 -0
- data/doc/api/DXOpal/Input.html +1086 -0
- data/doc/api/DXOpal/Input/MouseCodes.html +146 -0
- data/doc/api/DXOpal/RemoteResource.html +641 -0
- data/doc/api/DXOpal/Sound.html +568 -0
- data/doc/api/DXOpal/SoundEffect.html +444 -0
- data/doc/api/DXOpal/SoundEffect/WaveTypes.html +130 -0
- data/doc/api/DXOpal/Sprite.html +1419 -0
- data/doc/api/DXOpal/Window.html +1915 -0
- data/doc/api/_index.html +228 -0
- data/doc/api/class_list.html +51 -0
- data/doc/api/css/common.css +1 -0
- data/doc/api/css/full_list.css +58 -0
- data/doc/api/css/style.css +492 -0
- data/doc/api/file.CHANGELOG.html +162 -0
- data/doc/api/file.README.html +124 -0
- data/doc/api/file_list.html +61 -0
- data/doc/api/frames.html +17 -0
- data/doc/api/index.html +124 -0
- data/doc/api/js/app.js +248 -0
- data/doc/api/js/full_list.js +216 -0
- data/doc/api/js/jquery.js +4 -0
- data/doc/api/method_list.html +939 -0
- data/doc/api/top-level-namespace.html +110 -0
- data/doc/en/index.html +93 -0
- data/doc/ja/index.html +92 -0
- data/dxopal.gemspec +29 -0
- data/exe/dxopal +44 -0
- data/index.html +56 -0
- data/opal/dxopal.rb +54 -0
- data/opal/dxopal/constants/colors.rb +16 -0
- data/opal/dxopal/font.rb +20 -0
- data/opal/dxopal/image.rb +301 -0
- data/opal/dxopal/input.rb +170 -0
- data/opal/dxopal/input/key_codes.rb +168 -0
- data/opal/dxopal/remote_resource.rb +65 -0
- data/opal/dxopal/sound.rb +53 -0
- data/opal/dxopal/sound_effect.rb +84 -0
- data/opal/dxopal/sprite.rb +94 -0
- data/opal/dxopal/sprite/collision_area.rb +288 -0
- data/opal/dxopal/sprite/collision_check.rb +106 -0
- data/opal/dxopal/sprite/collision_checker.rb +169 -0
- data/opal/dxopal/sprite/physics.rb +82 -0
- data/opal/dxopal/version.rb +3 -0
- data/opal/dxopal/window.rb +173 -0
- data/template/index.html +13 -0
- data/template/main.rb +9 -0
- metadata +191 -0
@@ -0,0 +1,1419 @@
|
|
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: DXOpal::Sprite
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.9
|
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 = "DXOpal::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?1"></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="../DXOpal.html" title="DXOpal (module)">DXOpal</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
|
+
<div id="content"><h1>Class: DXOpal::Sprite
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName">Object</span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">DXOpal::Sprite</li>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
81
|
+
|
82
|
+
</dd>
|
83
|
+
</dl>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
<dl>
|
89
|
+
<dt>Extended by:</dt>
|
90
|
+
<dd>CollisionCheck::ClassMethods</dd>
|
91
|
+
</dl>
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
<dl>
|
96
|
+
<dt>Includes:</dt>
|
97
|
+
<dd>CollisionCheck, Physics</dd>
|
98
|
+
</dl>
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
<dl>
|
106
|
+
<dt>Defined in:</dt>
|
107
|
+
<dd>opal/dxopal/sprite.rb</dd>
|
108
|
+
</dl>
|
109
|
+
|
110
|
+
</div>
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
117
|
+
<ul class="summary">
|
118
|
+
|
119
|
+
<li class="public ">
|
120
|
+
<span class="summary_signature">
|
121
|
+
|
122
|
+
<a href="#angle-instance_method" title="#angle (instance method)">#<strong>angle</strong> ⇒ Object </a>
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
</span>
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
<span class="summary_desc"><div class='inline'>
|
140
|
+
<p>Set angle (0~360, default: 0).</p>
|
141
|
+
</div></span>
|
142
|
+
|
143
|
+
</li>
|
144
|
+
|
145
|
+
|
146
|
+
<li class="public ">
|
147
|
+
<span class="summary_signature">
|
148
|
+
|
149
|
+
<a href="#center_x-instance_method" title="#center_x (instance method)">#<strong>center_x</strong> ⇒ Object </a>
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
</span>
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
<span class="summary_desc"><div class='inline'>
|
167
|
+
<p>Set rotation center (default: center of `image`).</p>
|
168
|
+
</div></span>
|
169
|
+
|
170
|
+
</li>
|
171
|
+
|
172
|
+
|
173
|
+
<li class="public ">
|
174
|
+
<span class="summary_signature">
|
175
|
+
|
176
|
+
<a href="#center_y-instance_method" title="#center_y (instance method)">#<strong>center_y</strong> ⇒ Object </a>
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
</span>
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
<span class="summary_desc"><div class='inline'>
|
194
|
+
<p>Set rotation center (default: center of `image`).</p>
|
195
|
+
</div></span>
|
196
|
+
|
197
|
+
</li>
|
198
|
+
|
199
|
+
|
200
|
+
<li class="public ">
|
201
|
+
<span class="summary_signature">
|
202
|
+
|
203
|
+
<a href="#scale_x-instance_method" title="#scale_x (instance method)">#<strong>scale_x</strong> ⇒ Object </a>
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
</span>
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
<span class="summary_desc"><div class='inline'>
|
221
|
+
<p>Set horizontal/vertical scale (default: 1.0).</p>
|
222
|
+
</div></span>
|
223
|
+
|
224
|
+
</li>
|
225
|
+
|
226
|
+
|
227
|
+
<li class="public ">
|
228
|
+
<span class="summary_signature">
|
229
|
+
|
230
|
+
<a href="#scale_y-instance_method" title="#scale_y (instance method)">#<strong>scale_y</strong> ⇒ Object </a>
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
</span>
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
<span class="summary_desc"><div class='inline'>
|
248
|
+
<p>Set horizontal/vertical scale (default: 1.0).</p>
|
249
|
+
</div></span>
|
250
|
+
|
251
|
+
</li>
|
252
|
+
|
253
|
+
|
254
|
+
<li class="public ">
|
255
|
+
<span class="summary_signature">
|
256
|
+
|
257
|
+
<a href="#visible-instance_method" title="#visible (instance method)">#<strong>visible</strong> ⇒ Object </a>
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
</span>
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
<span class="summary_desc"><div class='inline'>
|
275
|
+
<p>Returns the value of attribute visible.</p>
|
276
|
+
</div></span>
|
277
|
+
|
278
|
+
</li>
|
279
|
+
|
280
|
+
|
281
|
+
<li class="public ">
|
282
|
+
<span class="summary_signature">
|
283
|
+
|
284
|
+
<a href="#x-instance_method" title="#x (instance method)">#<strong>x</strong> ⇒ Object </a>
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
</span>
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
<span class="summary_desc"><div class='inline'>
|
302
|
+
<p>Returns the value of attribute x.</p>
|
303
|
+
</div></span>
|
304
|
+
|
305
|
+
</li>
|
306
|
+
|
307
|
+
|
308
|
+
<li class="public ">
|
309
|
+
<span class="summary_signature">
|
310
|
+
|
311
|
+
<a href="#y-instance_method" title="#y (instance method)">#<strong>y</strong> ⇒ Object </a>
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
</span>
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
<span class="summary_desc"><div class='inline'>
|
329
|
+
<p>Returns the value of attribute y.</p>
|
330
|
+
</div></span>
|
331
|
+
|
332
|
+
</li>
|
333
|
+
|
334
|
+
|
335
|
+
<li class="public ">
|
336
|
+
<span class="summary_signature">
|
337
|
+
|
338
|
+
<a href="#z-instance_method" title="#z (instance method)">#<strong>z</strong> ⇒ Object </a>
|
339
|
+
|
340
|
+
|
341
|
+
|
342
|
+
</span>
|
343
|
+
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
<span class="summary_desc"><div class='inline'>
|
356
|
+
<p>Returns the value of attribute z.</p>
|
357
|
+
</div></span>
|
358
|
+
|
359
|
+
</li>
|
360
|
+
|
361
|
+
|
362
|
+
</ul>
|
363
|
+
|
364
|
+
|
365
|
+
|
366
|
+
|
367
|
+
|
368
|
+
<h2>
|
369
|
+
Class Method Summary
|
370
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
371
|
+
</h2>
|
372
|
+
|
373
|
+
<ul class="summary">
|
374
|
+
|
375
|
+
<li class="public ">
|
376
|
+
<span class="summary_signature">
|
377
|
+
|
378
|
+
<a href="#clean-class_method" title="clean (class method)">.<strong>clean</strong>(sprites) ⇒ Object </a>
|
379
|
+
|
380
|
+
|
381
|
+
|
382
|
+
</span>
|
383
|
+
|
384
|
+
|
385
|
+
|
386
|
+
|
387
|
+
|
388
|
+
|
389
|
+
|
390
|
+
|
391
|
+
|
392
|
+
<span class="summary_desc"><div class='inline'>
|
393
|
+
<p>Remove vanished sprites (and nils) from the array, destructively.</p>
|
394
|
+
</div></span>
|
395
|
+
|
396
|
+
</li>
|
397
|
+
|
398
|
+
|
399
|
+
<li class="public ">
|
400
|
+
<span class="summary_signature">
|
401
|
+
|
402
|
+
<a href="#draw-class_method" title="draw (class method)">.<strong>draw</strong>(sprites) ⇒ Object </a>
|
403
|
+
|
404
|
+
|
405
|
+
|
406
|
+
</span>
|
407
|
+
|
408
|
+
|
409
|
+
|
410
|
+
|
411
|
+
|
412
|
+
|
413
|
+
|
414
|
+
|
415
|
+
|
416
|
+
<span class="summary_desc"><div class='inline'>
|
417
|
+
<p>Draw each of the given sprites (unless it is vanished).</p>
|
418
|
+
</div></span>
|
419
|
+
|
420
|
+
</li>
|
421
|
+
|
422
|
+
|
423
|
+
<li class="public ">
|
424
|
+
<span class="summary_signature">
|
425
|
+
|
426
|
+
<a href="#update-class_method" title="update (class method)">.<strong>update</strong>(sprites) ⇒ Object </a>
|
427
|
+
|
428
|
+
|
429
|
+
|
430
|
+
</span>
|
431
|
+
|
432
|
+
|
433
|
+
|
434
|
+
|
435
|
+
|
436
|
+
|
437
|
+
|
438
|
+
|
439
|
+
|
440
|
+
<span class="summary_desc"><div class='inline'>
|
441
|
+
<p>Call #update on each sprite (unless it is vanished or do not have #update).</p>
|
442
|
+
</div></span>
|
443
|
+
|
444
|
+
</li>
|
445
|
+
|
446
|
+
|
447
|
+
</ul>
|
448
|
+
|
449
|
+
<h2>
|
450
|
+
Instance Method Summary
|
451
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
452
|
+
</h2>
|
453
|
+
|
454
|
+
<ul class="summary">
|
455
|
+
|
456
|
+
<li class="public ">
|
457
|
+
<span class="summary_signature">
|
458
|
+
|
459
|
+
<a href="#draw-instance_method" title="#draw (instance method)">#<strong>draw</strong> ⇒ Object </a>
|
460
|
+
|
461
|
+
|
462
|
+
|
463
|
+
</span>
|
464
|
+
|
465
|
+
|
466
|
+
|
467
|
+
|
468
|
+
|
469
|
+
|
470
|
+
|
471
|
+
|
472
|
+
|
473
|
+
<span class="summary_desc"><div class='inline'>
|
474
|
+
<p>Draw this sprite to Window.</p>
|
475
|
+
</div></span>
|
476
|
+
|
477
|
+
</li>
|
478
|
+
|
479
|
+
|
480
|
+
<li class="public ">
|
481
|
+
<span class="summary_signature">
|
482
|
+
|
483
|
+
<a href="#image-instance_method" title="#image (instance method)">#<strong>image</strong> ⇒ Object </a>
|
484
|
+
|
485
|
+
|
486
|
+
|
487
|
+
</span>
|
488
|
+
|
489
|
+
|
490
|
+
|
491
|
+
|
492
|
+
|
493
|
+
|
494
|
+
|
495
|
+
|
496
|
+
|
497
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
498
|
+
|
499
|
+
</li>
|
500
|
+
|
501
|
+
|
502
|
+
<li class="public ">
|
503
|
+
<span class="summary_signature">
|
504
|
+
|
505
|
+
<a href="#image=-instance_method" title="#image= (instance method)">#<strong>image=</strong>(img) ⇒ Object </a>
|
506
|
+
|
507
|
+
|
508
|
+
|
509
|
+
</span>
|
510
|
+
|
511
|
+
|
512
|
+
|
513
|
+
|
514
|
+
|
515
|
+
|
516
|
+
|
517
|
+
|
518
|
+
|
519
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
520
|
+
|
521
|
+
</li>
|
522
|
+
|
523
|
+
|
524
|
+
<li class="public ">
|
525
|
+
<span class="summary_signature">
|
526
|
+
|
527
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(x = 0, y = 0, image = nil) ⇒ Sprite </a>
|
528
|
+
|
529
|
+
|
530
|
+
|
531
|
+
</span>
|
532
|
+
|
533
|
+
|
534
|
+
<span class="note title constructor">constructor</span>
|
535
|
+
|
536
|
+
|
537
|
+
|
538
|
+
|
539
|
+
|
540
|
+
|
541
|
+
|
542
|
+
|
543
|
+
<span class="summary_desc"><div class='inline'>
|
544
|
+
<p>A new instance of Sprite.</p>
|
545
|
+
</div></span>
|
546
|
+
|
547
|
+
</li>
|
548
|
+
|
549
|
+
|
550
|
+
<li class="public ">
|
551
|
+
<span class="summary_signature">
|
552
|
+
|
553
|
+
<a href="#vanish-instance_method" title="#vanish (instance method)">#<strong>vanish</strong> ⇒ Object </a>
|
554
|
+
|
555
|
+
|
556
|
+
|
557
|
+
</span>
|
558
|
+
|
559
|
+
|
560
|
+
|
561
|
+
|
562
|
+
|
563
|
+
|
564
|
+
|
565
|
+
|
566
|
+
|
567
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
568
|
+
|
569
|
+
</li>
|
570
|
+
|
571
|
+
|
572
|
+
<li class="public ">
|
573
|
+
<span class="summary_signature">
|
574
|
+
|
575
|
+
<a href="#vanished%3F-instance_method" title="#vanished? (instance method)">#<strong>vanished?</strong> ⇒ Boolean </a>
|
576
|
+
|
577
|
+
|
578
|
+
|
579
|
+
</span>
|
580
|
+
|
581
|
+
|
582
|
+
|
583
|
+
|
584
|
+
|
585
|
+
|
586
|
+
|
587
|
+
|
588
|
+
|
589
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
590
|
+
|
591
|
+
</li>
|
592
|
+
|
593
|
+
|
594
|
+
</ul>
|
595
|
+
|
596
|
+
|
597
|
+
|
598
|
+
|
599
|
+
|
600
|
+
<div id="constructor_details" class="method_details_list">
|
601
|
+
<h2>Constructor Details</h2>
|
602
|
+
|
603
|
+
<div class="method_details first">
|
604
|
+
<h3 class="signature first" id="initialize-instance_method">
|
605
|
+
|
606
|
+
#<strong>initialize</strong>(x = 0, y = 0, image = nil) ⇒ <tt><span class='object_link'><a href="" title="DXOpal::Sprite (class)">Sprite</a></span></tt>
|
607
|
+
|
608
|
+
|
609
|
+
|
610
|
+
|
611
|
+
|
612
|
+
</h3><div class="docstring">
|
613
|
+
<div class="discussion">
|
614
|
+
|
615
|
+
<p>Returns a new instance of Sprite</p>
|
616
|
+
|
617
|
+
|
618
|
+
</div>
|
619
|
+
</div>
|
620
|
+
<div class="tags">
|
621
|
+
|
622
|
+
|
623
|
+
</div><table class="source_code">
|
624
|
+
<tr>
|
625
|
+
<td>
|
626
|
+
<pre class="lines">
|
627
|
+
|
628
|
+
|
629
|
+
34
|
630
|
+
35
|
631
|
+
36
|
632
|
+
37
|
633
|
+
38
|
634
|
+
39
|
635
|
+
40
|
636
|
+
41
|
637
|
+
42
|
638
|
+
43
|
639
|
+
44
|
640
|
+
45
|
641
|
+
46
|
642
|
+
47</pre>
|
643
|
+
</td>
|
644
|
+
<td>
|
645
|
+
<pre class="code"><span class="info file"># File 'opal/dxopal/sprite.rb', line 34</span>
|
646
|
+
|
647
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_x'>x</span><span class='op'>=</span><span class='int'>0</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span><span class='op'>=</span><span class='int'>0</span><span class='comma'>,</span> <span class='id identifier rubyid_image'>image</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
|
648
|
+
<span class='ivar'>@x</span><span class='comma'>,</span> <span class='ivar'>@y</span><span class='comma'>,</span> <span class='ivar'>@image</span> <span class='op'>=</span> <span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span><span class='comma'>,</span> <span class='id identifier rubyid_image'>image</span>
|
649
|
+
<span class='ivar'>@z</span> <span class='op'>=</span> <span class='int'>0</span>
|
650
|
+
<span class='ivar'>@angle</span> <span class='op'>=</span> <span class='int'>0</span>
|
651
|
+
<span class='ivar'>@scale_x</span> <span class='op'>=</span> <span class='ivar'>@scale_y</span> <span class='op'>=</span> <span class='float'>1.0</span>
|
652
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_image'>image</span>
|
653
|
+
<span class='ivar'>@center_x</span> <span class='op'>=</span> <span class='id identifier rubyid_image'>image</span><span class='period'>.</span><span class='id identifier rubyid_width'>width</span> <span class='op'>/</span> <span class='int'>2</span>
|
654
|
+
<span class='ivar'>@center_y</span> <span class='op'>=</span> <span class='id identifier rubyid_image'>image</span><span class='period'>.</span><span class='id identifier rubyid_height'>height</span> <span class='op'>/</span> <span class='int'>2</span>
|
655
|
+
<span class='kw'>end</span>
|
656
|
+
|
657
|
+
<span class='ivar'>@visible</span> <span class='op'>=</span> <span class='kw'>true</span>
|
658
|
+
<span class='ivar'>@vanished</span> <span class='op'>=</span> <span class='kw'>false</span>
|
659
|
+
<span class='id identifier rubyid__init_collision_info'>_init_collision_info</span><span class='lparen'>(</span><span class='ivar'>@image</span><span class='rparen'>)</span>
|
660
|
+
<span class='kw'>end</span></pre>
|
661
|
+
</td>
|
662
|
+
</tr>
|
663
|
+
</table>
|
664
|
+
</div>
|
665
|
+
|
666
|
+
</div>
|
667
|
+
|
668
|
+
<div id="instance_attr_details" class="attr_details">
|
669
|
+
<h2>Instance Attribute Details</h2>
|
670
|
+
|
671
|
+
|
672
|
+
<span id="angle=-instance_method"></span>
|
673
|
+
<div class="method_details first">
|
674
|
+
<h3 class="signature first" id="angle-instance_method">
|
675
|
+
|
676
|
+
#<strong>angle</strong> ⇒ <tt>Object</tt>
|
677
|
+
|
678
|
+
|
679
|
+
|
680
|
+
|
681
|
+
|
682
|
+
</h3><div class="docstring">
|
683
|
+
<div class="discussion">
|
684
|
+
|
685
|
+
<p>Set angle (0~360, default: 0)</p>
|
686
|
+
|
687
|
+
|
688
|
+
</div>
|
689
|
+
</div>
|
690
|
+
<div class="tags">
|
691
|
+
|
692
|
+
|
693
|
+
</div><table class="source_code">
|
694
|
+
<tr>
|
695
|
+
<td>
|
696
|
+
<pre class="lines">
|
697
|
+
|
698
|
+
|
699
|
+
51
|
700
|
+
52
|
701
|
+
53</pre>
|
702
|
+
</td>
|
703
|
+
<td>
|
704
|
+
<pre class="code"><span class="info file"># File 'opal/dxopal/sprite.rb', line 51</span>
|
705
|
+
|
706
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_angle'>angle</span>
|
707
|
+
<span class='ivar'>@angle</span>
|
708
|
+
<span class='kw'>end</span></pre>
|
709
|
+
</td>
|
710
|
+
</tr>
|
711
|
+
</table>
|
712
|
+
</div>
|
713
|
+
|
714
|
+
|
715
|
+
<span id="center_x=-instance_method"></span>
|
716
|
+
<div class="method_details ">
|
717
|
+
<h3 class="signature " id="center_x-instance_method">
|
718
|
+
|
719
|
+
#<strong>center_x</strong> ⇒ <tt>Object</tt>
|
720
|
+
|
721
|
+
|
722
|
+
|
723
|
+
|
724
|
+
|
725
|
+
</h3><div class="docstring">
|
726
|
+
<div class="discussion">
|
727
|
+
|
728
|
+
<p>Set rotation center (default: center of `image`)</p>
|
729
|
+
|
730
|
+
|
731
|
+
</div>
|
732
|
+
</div>
|
733
|
+
<div class="tags">
|
734
|
+
|
735
|
+
|
736
|
+
</div><table class="source_code">
|
737
|
+
<tr>
|
738
|
+
<td>
|
739
|
+
<pre class="lines">
|
740
|
+
|
741
|
+
|
742
|
+
55
|
743
|
+
56
|
744
|
+
57</pre>
|
745
|
+
</td>
|
746
|
+
<td>
|
747
|
+
<pre class="code"><span class="info file"># File 'opal/dxopal/sprite.rb', line 55</span>
|
748
|
+
|
749
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_center_x'>center_x</span>
|
750
|
+
<span class='ivar'>@center_x</span>
|
751
|
+
<span class='kw'>end</span></pre>
|
752
|
+
</td>
|
753
|
+
</tr>
|
754
|
+
</table>
|
755
|
+
</div>
|
756
|
+
|
757
|
+
|
758
|
+
<span id="center_y=-instance_method"></span>
|
759
|
+
<div class="method_details ">
|
760
|
+
<h3 class="signature " id="center_y-instance_method">
|
761
|
+
|
762
|
+
#<strong>center_y</strong> ⇒ <tt>Object</tt>
|
763
|
+
|
764
|
+
|
765
|
+
|
766
|
+
|
767
|
+
|
768
|
+
</h3><div class="docstring">
|
769
|
+
<div class="discussion">
|
770
|
+
|
771
|
+
<p>Set rotation center (default: center of `image`)</p>
|
772
|
+
|
773
|
+
|
774
|
+
</div>
|
775
|
+
</div>
|
776
|
+
<div class="tags">
|
777
|
+
|
778
|
+
|
779
|
+
</div><table class="source_code">
|
780
|
+
<tr>
|
781
|
+
<td>
|
782
|
+
<pre class="lines">
|
783
|
+
|
784
|
+
|
785
|
+
55
|
786
|
+
56
|
787
|
+
57</pre>
|
788
|
+
</td>
|
789
|
+
<td>
|
790
|
+
<pre class="code"><span class="info file"># File 'opal/dxopal/sprite.rb', line 55</span>
|
791
|
+
|
792
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_center_y'>center_y</span>
|
793
|
+
<span class='ivar'>@center_y</span>
|
794
|
+
<span class='kw'>end</span></pre>
|
795
|
+
</td>
|
796
|
+
</tr>
|
797
|
+
</table>
|
798
|
+
</div>
|
799
|
+
|
800
|
+
|
801
|
+
<span id="scale_x=-instance_method"></span>
|
802
|
+
<div class="method_details ">
|
803
|
+
<h3 class="signature " id="scale_x-instance_method">
|
804
|
+
|
805
|
+
#<strong>scale_x</strong> ⇒ <tt>Object</tt>
|
806
|
+
|
807
|
+
|
808
|
+
|
809
|
+
|
810
|
+
|
811
|
+
</h3><div class="docstring">
|
812
|
+
<div class="discussion">
|
813
|
+
|
814
|
+
<p>Set horizontal/vertical scale (default: 1.0)</p>
|
815
|
+
|
816
|
+
|
817
|
+
</div>
|
818
|
+
</div>
|
819
|
+
<div class="tags">
|
820
|
+
|
821
|
+
|
822
|
+
</div><table class="source_code">
|
823
|
+
<tr>
|
824
|
+
<td>
|
825
|
+
<pre class="lines">
|
826
|
+
|
827
|
+
|
828
|
+
53
|
829
|
+
54
|
830
|
+
55</pre>
|
831
|
+
</td>
|
832
|
+
<td>
|
833
|
+
<pre class="code"><span class="info file"># File 'opal/dxopal/sprite.rb', line 53</span>
|
834
|
+
|
835
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_scale_x'>scale_x</span>
|
836
|
+
<span class='ivar'>@scale_x</span>
|
837
|
+
<span class='kw'>end</span></pre>
|
838
|
+
</td>
|
839
|
+
</tr>
|
840
|
+
</table>
|
841
|
+
</div>
|
842
|
+
|
843
|
+
|
844
|
+
<span id="scale_y=-instance_method"></span>
|
845
|
+
<div class="method_details ">
|
846
|
+
<h3 class="signature " id="scale_y-instance_method">
|
847
|
+
|
848
|
+
#<strong>scale_y</strong> ⇒ <tt>Object</tt>
|
849
|
+
|
850
|
+
|
851
|
+
|
852
|
+
|
853
|
+
|
854
|
+
</h3><div class="docstring">
|
855
|
+
<div class="discussion">
|
856
|
+
|
857
|
+
<p>Set horizontal/vertical scale (default: 1.0)</p>
|
858
|
+
|
859
|
+
|
860
|
+
</div>
|
861
|
+
</div>
|
862
|
+
<div class="tags">
|
863
|
+
|
864
|
+
|
865
|
+
</div><table class="source_code">
|
866
|
+
<tr>
|
867
|
+
<td>
|
868
|
+
<pre class="lines">
|
869
|
+
|
870
|
+
|
871
|
+
53
|
872
|
+
54
|
873
|
+
55</pre>
|
874
|
+
</td>
|
875
|
+
<td>
|
876
|
+
<pre class="code"><span class="info file"># File 'opal/dxopal/sprite.rb', line 53</span>
|
877
|
+
|
878
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_scale_y'>scale_y</span>
|
879
|
+
<span class='ivar'>@scale_y</span>
|
880
|
+
<span class='kw'>end</span></pre>
|
881
|
+
</td>
|
882
|
+
</tr>
|
883
|
+
</table>
|
884
|
+
</div>
|
885
|
+
|
886
|
+
|
887
|
+
<span id="visible=-instance_method"></span>
|
888
|
+
<div class="method_details ">
|
889
|
+
<h3 class="signature " id="visible-instance_method">
|
890
|
+
|
891
|
+
#<strong>visible</strong> ⇒ <tt>Object</tt>
|
892
|
+
|
893
|
+
|
894
|
+
|
895
|
+
|
896
|
+
|
897
|
+
</h3><div class="docstring">
|
898
|
+
<div class="discussion">
|
899
|
+
|
900
|
+
<p>Returns the value of attribute visible</p>
|
901
|
+
|
902
|
+
|
903
|
+
</div>
|
904
|
+
</div>
|
905
|
+
<div class="tags">
|
906
|
+
|
907
|
+
|
908
|
+
</div><table class="source_code">
|
909
|
+
<tr>
|
910
|
+
<td>
|
911
|
+
<pre class="lines">
|
912
|
+
|
913
|
+
|
914
|
+
48
|
915
|
+
49
|
916
|
+
50</pre>
|
917
|
+
</td>
|
918
|
+
<td>
|
919
|
+
<pre class="code"><span class="info file"># File 'opal/dxopal/sprite.rb', line 48</span>
|
920
|
+
|
921
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_visible'>visible</span>
|
922
|
+
<span class='ivar'>@visible</span>
|
923
|
+
<span class='kw'>end</span></pre>
|
924
|
+
</td>
|
925
|
+
</tr>
|
926
|
+
</table>
|
927
|
+
</div>
|
928
|
+
|
929
|
+
|
930
|
+
<span id="x=-instance_method"></span>
|
931
|
+
<div class="method_details ">
|
932
|
+
<h3 class="signature " id="x-instance_method">
|
933
|
+
|
934
|
+
#<strong>x</strong> ⇒ <tt>Object</tt>
|
935
|
+
|
936
|
+
|
937
|
+
|
938
|
+
|
939
|
+
|
940
|
+
</h3><div class="docstring">
|
941
|
+
<div class="discussion">
|
942
|
+
|
943
|
+
<p>Returns the value of attribute x</p>
|
944
|
+
|
945
|
+
|
946
|
+
</div>
|
947
|
+
</div>
|
948
|
+
<div class="tags">
|
949
|
+
|
950
|
+
|
951
|
+
</div><table class="source_code">
|
952
|
+
<tr>
|
953
|
+
<td>
|
954
|
+
<pre class="lines">
|
955
|
+
|
956
|
+
|
957
|
+
57
|
958
|
+
58
|
959
|
+
59</pre>
|
960
|
+
</td>
|
961
|
+
<td>
|
962
|
+
<pre class="code"><span class="info file"># File 'opal/dxopal/sprite.rb', line 57</span>
|
963
|
+
|
964
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_x'>x</span>
|
965
|
+
<span class='ivar'>@x</span>
|
966
|
+
<span class='kw'>end</span></pre>
|
967
|
+
</td>
|
968
|
+
</tr>
|
969
|
+
</table>
|
970
|
+
</div>
|
971
|
+
|
972
|
+
|
973
|
+
<span id="y=-instance_method"></span>
|
974
|
+
<div class="method_details ">
|
975
|
+
<h3 class="signature " id="y-instance_method">
|
976
|
+
|
977
|
+
#<strong>y</strong> ⇒ <tt>Object</tt>
|
978
|
+
|
979
|
+
|
980
|
+
|
981
|
+
|
982
|
+
|
983
|
+
</h3><div class="docstring">
|
984
|
+
<div class="discussion">
|
985
|
+
|
986
|
+
<p>Returns the value of attribute y</p>
|
987
|
+
|
988
|
+
|
989
|
+
</div>
|
990
|
+
</div>
|
991
|
+
<div class="tags">
|
992
|
+
|
993
|
+
|
994
|
+
</div><table class="source_code">
|
995
|
+
<tr>
|
996
|
+
<td>
|
997
|
+
<pre class="lines">
|
998
|
+
|
999
|
+
|
1000
|
+
57
|
1001
|
+
58
|
1002
|
+
59</pre>
|
1003
|
+
</td>
|
1004
|
+
<td>
|
1005
|
+
<pre class="code"><span class="info file"># File 'opal/dxopal/sprite.rb', line 57</span>
|
1006
|
+
|
1007
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_y'>y</span>
|
1008
|
+
<span class='ivar'>@y</span>
|
1009
|
+
<span class='kw'>end</span></pre>
|
1010
|
+
</td>
|
1011
|
+
</tr>
|
1012
|
+
</table>
|
1013
|
+
</div>
|
1014
|
+
|
1015
|
+
|
1016
|
+
<span id="z=-instance_method"></span>
|
1017
|
+
<div class="method_details ">
|
1018
|
+
<h3 class="signature " id="z-instance_method">
|
1019
|
+
|
1020
|
+
#<strong>z</strong> ⇒ <tt>Object</tt>
|
1021
|
+
|
1022
|
+
|
1023
|
+
|
1024
|
+
|
1025
|
+
|
1026
|
+
</h3><div class="docstring">
|
1027
|
+
<div class="discussion">
|
1028
|
+
|
1029
|
+
<p>Returns the value of attribute z</p>
|
1030
|
+
|
1031
|
+
|
1032
|
+
</div>
|
1033
|
+
</div>
|
1034
|
+
<div class="tags">
|
1035
|
+
|
1036
|
+
|
1037
|
+
</div><table class="source_code">
|
1038
|
+
<tr>
|
1039
|
+
<td>
|
1040
|
+
<pre class="lines">
|
1041
|
+
|
1042
|
+
|
1043
|
+
48
|
1044
|
+
49
|
1045
|
+
50</pre>
|
1046
|
+
</td>
|
1047
|
+
<td>
|
1048
|
+
<pre class="code"><span class="info file"># File 'opal/dxopal/sprite.rb', line 48</span>
|
1049
|
+
|
1050
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_z'>z</span>
|
1051
|
+
<span class='ivar'>@z</span>
|
1052
|
+
<span class='kw'>end</span></pre>
|
1053
|
+
</td>
|
1054
|
+
</tr>
|
1055
|
+
</table>
|
1056
|
+
</div>
|
1057
|
+
|
1058
|
+
</div>
|
1059
|
+
|
1060
|
+
|
1061
|
+
<div id="class_method_details" class="method_details_list">
|
1062
|
+
<h2>Class Method Details</h2>
|
1063
|
+
|
1064
|
+
|
1065
|
+
<div class="method_details first">
|
1066
|
+
<h3 class="signature first" id="clean-class_method">
|
1067
|
+
|
1068
|
+
.<strong>clean</strong>(sprites) ⇒ <tt>Object</tt>
|
1069
|
+
|
1070
|
+
|
1071
|
+
|
1072
|
+
|
1073
|
+
|
1074
|
+
</h3><div class="docstring">
|
1075
|
+
<div class="discussion">
|
1076
|
+
|
1077
|
+
<p>Remove vanished sprites (and nils) from the array, destructively</p>
|
1078
|
+
|
1079
|
+
|
1080
|
+
</div>
|
1081
|
+
</div>
|
1082
|
+
<div class="tags">
|
1083
|
+
|
1084
|
+
|
1085
|
+
</div><table class="source_code">
|
1086
|
+
<tr>
|
1087
|
+
<td>
|
1088
|
+
<pre class="lines">
|
1089
|
+
|
1090
|
+
|
1091
|
+
20
|
1092
|
+
21
|
1093
|
+
22
|
1094
|
+
23
|
1095
|
+
24</pre>
|
1096
|
+
</td>
|
1097
|
+
<td>
|
1098
|
+
<pre class="code"><span class="info file"># File 'opal/dxopal/sprite.rb', line 20</span>
|
1099
|
+
|
1100
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_clean'>clean</span><span class='lparen'>(</span><span class='id identifier rubyid_sprites'>sprites</span><span class='rparen'>)</span>
|
1101
|
+
<span class='id identifier rubyid_sprites'>sprites</span><span class='period'>.</span><span class='id identifier rubyid_reject!'>reject!</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_sprite'>sprite</span><span class='op'>|</span>
|
1102
|
+
<span class='id identifier rubyid_sprite'>sprite</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='op'>||</span> <span class='id identifier rubyid_sprite'>sprite</span><span class='period'>.</span><span class='id identifier rubyid_vanished?'>vanished?</span>
|
1103
|
+
<span class='rbrace'>}</span>
|
1104
|
+
<span class='kw'>end</span></pre>
|
1105
|
+
</td>
|
1106
|
+
</tr>
|
1107
|
+
</table>
|
1108
|
+
</div>
|
1109
|
+
|
1110
|
+
<div class="method_details ">
|
1111
|
+
<h3 class="signature " id="draw-class_method">
|
1112
|
+
|
1113
|
+
.<strong>draw</strong>(sprites) ⇒ <tt>Object</tt>
|
1114
|
+
|
1115
|
+
|
1116
|
+
|
1117
|
+
|
1118
|
+
|
1119
|
+
</h3><div class="docstring">
|
1120
|
+
<div class="discussion">
|
1121
|
+
|
1122
|
+
<p>Draw each of the given sprites (unless it is vanished)</p>
|
1123
|
+
|
1124
|
+
|
1125
|
+
</div>
|
1126
|
+
</div>
|
1127
|
+
<div class="tags">
|
1128
|
+
|
1129
|
+
|
1130
|
+
</div><table class="source_code">
|
1131
|
+
<tr>
|
1132
|
+
<td>
|
1133
|
+
<pre class="lines">
|
1134
|
+
|
1135
|
+
|
1136
|
+
27
|
1137
|
+
28
|
1138
|
+
29
|
1139
|
+
30
|
1140
|
+
31
|
1141
|
+
32</pre>
|
1142
|
+
</td>
|
1143
|
+
<td>
|
1144
|
+
<pre class="code"><span class="info file"># File 'opal/dxopal/sprite.rb', line 27</span>
|
1145
|
+
|
1146
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_draw'>draw</span><span class='lparen'>(</span><span class='id identifier rubyid_sprites'>sprites</span><span class='rparen'>)</span>
|
1147
|
+
<span class='id identifier rubyid_sprites'>sprites</span><span class='period'>.</span><span class='id identifier rubyid_flatten'>flatten</span><span class='period'>.</span><span class='id identifier rubyid_sort_by'>sort_by</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:z</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_sprite'>sprite</span><span class='op'>|</span>
|
1148
|
+
<span class='kw'>next</span> <span class='kw'>if</span> <span class='id identifier rubyid_sprite'>sprite</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:vanished?</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_sprite'>sprite</span><span class='period'>.</span><span class='id identifier rubyid_vanished?'>vanished?</span>
|
1149
|
+
<span class='id identifier rubyid_sprite'>sprite</span><span class='period'>.</span><span class='id identifier rubyid_draw'>draw</span>
|
1150
|
+
<span class='kw'>end</span>
|
1151
|
+
<span class='kw'>end</span></pre>
|
1152
|
+
</td>
|
1153
|
+
</tr>
|
1154
|
+
</table>
|
1155
|
+
</div>
|
1156
|
+
|
1157
|
+
<div class="method_details ">
|
1158
|
+
<h3 class="signature " id="update-class_method">
|
1159
|
+
|
1160
|
+
.<strong>update</strong>(sprites) ⇒ <tt>Object</tt>
|
1161
|
+
|
1162
|
+
|
1163
|
+
|
1164
|
+
|
1165
|
+
|
1166
|
+
</h3><div class="docstring">
|
1167
|
+
<div class="discussion">
|
1168
|
+
|
1169
|
+
<p>Call #update on each sprite (unless it is vanished or do not have #update)</p>
|
1170
|
+
|
1171
|
+
|
1172
|
+
</div>
|
1173
|
+
</div>
|
1174
|
+
<div class="tags">
|
1175
|
+
|
1176
|
+
|
1177
|
+
</div><table class="source_code">
|
1178
|
+
<tr>
|
1179
|
+
<td>
|
1180
|
+
<pre class="lines">
|
1181
|
+
|
1182
|
+
|
1183
|
+
11
|
1184
|
+
12
|
1185
|
+
13
|
1186
|
+
14
|
1187
|
+
15
|
1188
|
+
16
|
1189
|
+
17</pre>
|
1190
|
+
</td>
|
1191
|
+
<td>
|
1192
|
+
<pre class="code"><span class="info file"># File 'opal/dxopal/sprite.rb', line 11</span>
|
1193
|
+
|
1194
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_update'>update</span><span class='lparen'>(</span><span class='id identifier rubyid_sprites'>sprites</span><span class='rparen'>)</span>
|
1195
|
+
<span class='id identifier rubyid_sprites'>sprites</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_sprite'>sprite</span><span class='op'>|</span>
|
1196
|
+
<span class='kw'>next</span> <span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_sprite'>sprite</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:update</span><span class='rparen'>)</span>
|
1197
|
+
<span class='kw'>next</span> <span class='kw'>if</span> <span class='id identifier rubyid_sprite'>sprite</span><span class='period'>.</span><span class='id identifier rubyid_respond_to?'>respond_to?</span><span class='lparen'>(</span><span class='symbol'>:vanished?</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_sprite'>sprite</span><span class='period'>.</span><span class='id identifier rubyid_vanished?'>vanished?</span>
|
1198
|
+
<span class='id identifier rubyid_sprite'>sprite</span><span class='period'>.</span><span class='id identifier rubyid_update'>update</span>
|
1199
|
+
<span class='kw'>end</span>
|
1200
|
+
<span class='kw'>end</span></pre>
|
1201
|
+
</td>
|
1202
|
+
</tr>
|
1203
|
+
</table>
|
1204
|
+
</div>
|
1205
|
+
|
1206
|
+
</div>
|
1207
|
+
|
1208
|
+
<div id="instance_method_details" class="method_details_list">
|
1209
|
+
<h2>Instance Method Details</h2>
|
1210
|
+
|
1211
|
+
|
1212
|
+
<div class="method_details first">
|
1213
|
+
<h3 class="signature first" id="draw-instance_method">
|
1214
|
+
|
1215
|
+
#<strong>draw</strong> ⇒ <tt>Object</tt>
|
1216
|
+
|
1217
|
+
|
1218
|
+
|
1219
|
+
|
1220
|
+
|
1221
|
+
</h3><div class="docstring">
|
1222
|
+
<div class="discussion">
|
1223
|
+
|
1224
|
+
<p>Draw this sprite to Window</p>
|
1225
|
+
|
1226
|
+
|
1227
|
+
</div>
|
1228
|
+
</div>
|
1229
|
+
<div class="tags">
|
1230
|
+
|
1231
|
+
|
1232
|
+
</div><table class="source_code">
|
1233
|
+
<tr>
|
1234
|
+
<td>
|
1235
|
+
<pre class="lines">
|
1236
|
+
|
1237
|
+
|
1238
|
+
85
|
1239
|
+
86
|
1240
|
+
87
|
1241
|
+
88
|
1242
|
+
89
|
1243
|
+
90
|
1244
|
+
91
|
1245
|
+
92</pre>
|
1246
|
+
</td>
|
1247
|
+
<td>
|
1248
|
+
<pre class="code"><span class="info file"># File 'opal/dxopal/sprite.rb', line 85</span>
|
1249
|
+
|
1250
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_draw'>draw</span>
|
1251
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>image not set to Sprite</span><span class='tstring_end'>"</span></span> <span class='kw'>if</span> <span class='ivar'>@image</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
1252
|
+
<span class='kw'>return</span> <span class='kw'>if</span> <span class='op'>!</span><span class='ivar'>@visible</span>
|
1253
|
+
|
1254
|
+
<span class='const'><span class='object_link'><a href="Window.html" title="DXOpal::Window (module)">Window</a></span></span><span class='period'>.</span><span class='id identifier rubyid_draw_ex'><span class='object_link'><a href="Window.html#draw_ex-class_method" title="DXOpal::Window.draw_ex (method)">draw_ex</a></span></span><span class='lparen'>(</span><span class='ivar'>@x</span><span class='comma'>,</span> <span class='ivar'>@y</span><span class='comma'>,</span> <span class='ivar'>@image</span><span class='comma'>,</span>
|
1255
|
+
<span class='label'>scale_x:</span> <span class='ivar'>@scale_x</span><span class='comma'>,</span> <span class='label'>scale_y:</span> <span class='ivar'>@scale_y</span><span class='comma'>,</span>
|
1256
|
+
<span class='label'>angle:</span> <span class='ivar'>@angle</span><span class='comma'>,</span> <span class='label'>center_x:</span> <span class='ivar'>@center_x</span><span class='comma'>,</span> <span class='label'>center_y:</span> <span class='ivar'>@center_y</span><span class='rparen'>)</span>
|
1257
|
+
<span class='kw'>end</span></pre>
|
1258
|
+
</td>
|
1259
|
+
</tr>
|
1260
|
+
</table>
|
1261
|
+
</div>
|
1262
|
+
|
1263
|
+
<div class="method_details ">
|
1264
|
+
<h3 class="signature " id="image-instance_method">
|
1265
|
+
|
1266
|
+
#<strong>image</strong> ⇒ <tt>Object</tt>
|
1267
|
+
|
1268
|
+
|
1269
|
+
|
1270
|
+
|
1271
|
+
|
1272
|
+
</h3><table class="source_code">
|
1273
|
+
<tr>
|
1274
|
+
<td>
|
1275
|
+
<pre class="lines">
|
1276
|
+
|
1277
|
+
|
1278
|
+
69</pre>
|
1279
|
+
</td>
|
1280
|
+
<td>
|
1281
|
+
<pre class="code"><span class="info file"># File 'opal/dxopal/sprite.rb', line 69</span>
|
1282
|
+
|
1283
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_image'>image</span><span class='semicolon'>;</span> <span class='ivar'>@image</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
1284
|
+
</td>
|
1285
|
+
</tr>
|
1286
|
+
</table>
|
1287
|
+
</div>
|
1288
|
+
|
1289
|
+
<div class="method_details ">
|
1290
|
+
<h3 class="signature " id="image=-instance_method">
|
1291
|
+
|
1292
|
+
#<strong>image=</strong>(img) ⇒ <tt>Object</tt>
|
1293
|
+
|
1294
|
+
|
1295
|
+
|
1296
|
+
|
1297
|
+
|
1298
|
+
</h3><table class="source_code">
|
1299
|
+
<tr>
|
1300
|
+
<td>
|
1301
|
+
<pre class="lines">
|
1302
|
+
|
1303
|
+
|
1304
|
+
70
|
1305
|
+
71
|
1306
|
+
72
|
1307
|
+
73
|
1308
|
+
74
|
1309
|
+
75
|
1310
|
+
76
|
1311
|
+
77
|
1312
|
+
78
|
1313
|
+
79</pre>
|
1314
|
+
</td>
|
1315
|
+
<td>
|
1316
|
+
<pre class="code"><span class="info file"># File 'opal/dxopal/sprite.rb', line 70</span>
|
1317
|
+
|
1318
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_image='>image=</span><span class='lparen'>(</span><span class='id identifier rubyid_img'>img</span><span class='rparen'>)</span>
|
1319
|
+
<span class='ivar'>@image</span> <span class='op'>=</span> <span class='id identifier rubyid_img'>img</span>
|
1320
|
+
<span class='kw'>if</span> <span class='ivar'>@collision</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
1321
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_collision'>collision</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='int'>0</span><span class='comma'>,</span> <span class='int'>0</span><span class='comma'>,</span> <span class='id identifier rubyid_img'>img</span><span class='period'>.</span><span class='id identifier rubyid_width'>width</span><span class='op'>-</span><span class='int'>1</span><span class='comma'>,</span> <span class='id identifier rubyid_img'>img</span><span class='period'>.</span><span class='id identifier rubyid_height'>height</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span>
|
1322
|
+
<span class='kw'>end</span>
|
1323
|
+
<span class='kw'>if</span> <span class='ivar'>@center_x</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
1324
|
+
<span class='ivar'>@center_x</span> <span class='op'>=</span> <span class='id identifier rubyid_img'>img</span><span class='period'>.</span><span class='id identifier rubyid_width'>width</span> <span class='op'>/</span> <span class='int'>2</span>
|
1325
|
+
<span class='ivar'>@center_y</span> <span class='op'>=</span> <span class='id identifier rubyid_img'>img</span><span class='period'>.</span><span class='id identifier rubyid_height'>height</span> <span class='op'>/</span> <span class='int'>2</span>
|
1326
|
+
<span class='kw'>end</span>
|
1327
|
+
<span class='kw'>end</span></pre>
|
1328
|
+
</td>
|
1329
|
+
</tr>
|
1330
|
+
</table>
|
1331
|
+
</div>
|
1332
|
+
|
1333
|
+
<div class="method_details ">
|
1334
|
+
<h3 class="signature " id="vanish-instance_method">
|
1335
|
+
|
1336
|
+
#<strong>vanish</strong> ⇒ <tt>Object</tt>
|
1337
|
+
|
1338
|
+
|
1339
|
+
|
1340
|
+
|
1341
|
+
|
1342
|
+
</h3><table class="source_code">
|
1343
|
+
<tr>
|
1344
|
+
<td>
|
1345
|
+
<pre class="lines">
|
1346
|
+
|
1347
|
+
|
1348
|
+
81</pre>
|
1349
|
+
</td>
|
1350
|
+
<td>
|
1351
|
+
<pre class="code"><span class="info file"># File 'opal/dxopal/sprite.rb', line 81</span>
|
1352
|
+
|
1353
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_vanish'>vanish</span><span class='semicolon'>;</span> <span class='ivar'>@vanished</span> <span class='op'>=</span> <span class='kw'>true</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
1354
|
+
</td>
|
1355
|
+
</tr>
|
1356
|
+
</table>
|
1357
|
+
</div>
|
1358
|
+
|
1359
|
+
<div class="method_details ">
|
1360
|
+
<h3 class="signature " id="vanished?-instance_method">
|
1361
|
+
|
1362
|
+
#<strong>vanished?</strong> ⇒ <tt>Boolean</tt>
|
1363
|
+
|
1364
|
+
|
1365
|
+
|
1366
|
+
|
1367
|
+
|
1368
|
+
</h3><div class="docstring">
|
1369
|
+
<div class="discussion">
|
1370
|
+
|
1371
|
+
|
1372
|
+
</div>
|
1373
|
+
</div>
|
1374
|
+
<div class="tags">
|
1375
|
+
|
1376
|
+
<p class="tag_title">Returns:</p>
|
1377
|
+
<ul class="return">
|
1378
|
+
|
1379
|
+
<li>
|
1380
|
+
|
1381
|
+
|
1382
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
1383
|
+
|
1384
|
+
|
1385
|
+
|
1386
|
+
</li>
|
1387
|
+
|
1388
|
+
</ul>
|
1389
|
+
|
1390
|
+
</div><table class="source_code">
|
1391
|
+
<tr>
|
1392
|
+
<td>
|
1393
|
+
<pre class="lines">
|
1394
|
+
|
1395
|
+
|
1396
|
+
82</pre>
|
1397
|
+
</td>
|
1398
|
+
<td>
|
1399
|
+
<pre class="code"><span class="info file"># File 'opal/dxopal/sprite.rb', line 82</span>
|
1400
|
+
|
1401
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_vanished?'>vanished?</span><span class='semicolon'>;</span> <span class='ivar'>@vanished</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
|
1402
|
+
</td>
|
1403
|
+
</tr>
|
1404
|
+
</table>
|
1405
|
+
</div>
|
1406
|
+
|
1407
|
+
</div>
|
1408
|
+
|
1409
|
+
</div>
|
1410
|
+
|
1411
|
+
<div id="footer">
|
1412
|
+
Generated on Tue Oct 17 13:56:28 2017 by
|
1413
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1414
|
+
0.9.9 (ruby-2.4.2).
|
1415
|
+
</div>
|
1416
|
+
|
1417
|
+
</div>
|
1418
|
+
</body>
|
1419
|
+
</html>
|