dxopal 1.5.1 → 1.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/Gemfile +2 -1
  4. data/Gemfile.lock +20 -20
  5. data/README.md +3 -3
  6. data/Rakefile +2 -14
  7. data/build/dxopal.js +26114 -18554
  8. data/build/dxopal.min.js +1 -1
  9. data/doc/api/DXOpal.html +10 -10
  10. data/doc/api/DXOpal/Constants.html +115 -0
  11. data/doc/api/DXOpal/Constants/Colors.html +172 -0
  12. data/doc/api/DXOpal/Font.html +71 -17
  13. data/doc/api/DXOpal/Image.html +891 -398
  14. data/doc/api/DXOpal/Input.html +814 -91
  15. data/doc/api/DXOpal/Input/KeyCodes.html +986 -0
  16. data/doc/api/DXOpal/Input/MouseCodes.html +7 -7
  17. data/doc/api/DXOpal/Input/Touch.html +834 -0
  18. data/doc/api/DXOpal/RemoteResource.html +16 -18
  19. data/doc/api/DXOpal/Sound.html +15 -15
  20. data/doc/api/DXOpal/SoundEffect.html +11 -13
  21. data/doc/api/DXOpal/SoundEffect/WaveTypes.html +7 -7
  22. data/doc/api/DXOpal/Sprite.html +517 -40
  23. data/doc/api/DXOpal/Sprite/CollisionArea.html +126 -0
  24. data/doc/api/DXOpal/Sprite/CollisionArea/Base.html +649 -0
  25. data/doc/api/DXOpal/Sprite/CollisionArea/Circle.html +656 -0
  26. data/doc/api/DXOpal/Sprite/CollisionArea/Point.html +448 -0
  27. data/doc/api/DXOpal/Sprite/CollisionArea/Rect.html +549 -0
  28. data/doc/api/DXOpal/Sprite/CollisionArea/Triangle.html +423 -0
  29. data/doc/api/DXOpal/Sprite/CollisionCheck.html +926 -0
  30. data/doc/api/DXOpal/Sprite/CollisionCheck/ClassMethods.html +268 -0
  31. data/doc/api/DXOpal/Sprite/Physics.html +426 -0
  32. data/doc/api/DXOpal/Window.html +235 -152
  33. data/doc/api/Kernel.html +131 -0
  34. data/doc/api/_index.html +276 -4
  35. data/doc/api/class_list.html +1 -1
  36. data/doc/api/css/style.css +1 -0
  37. data/doc/api/file.README.html +6 -8
  38. data/doc/api/frames.html +1 -1
  39. data/doc/api/index.html +6 -8
  40. data/doc/api/method_list.html +1600 -0
  41. data/doc/api/top-level-namespace.html +154 -3
  42. data/lib/dxopal/input.rb +4 -2
  43. data/lib/dxopal/version.rb +1 -1
  44. metadata +21 -8
@@ -0,0 +1,448 @@
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::CollisionArea::Point
8
+
9
+ &mdash; Documentation by YARD 0.9.26
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../../css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="../../../css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "DXOpal::Sprite::CollisionArea::Point";
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 (P)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../../../DXOpal.html" title="DXOpal (module)">DXOpal</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../../Sprite.html" title="DXOpal::Sprite (class)">Sprite</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../CollisionArea.html" title="DXOpal::Sprite::CollisionArea (module)">CollisionArea</a></span></span>
41
+ &raquo;
42
+ <span class="title">Point</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::CollisionArea::Point
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName"><span class='object_link'><a href="Base.html" title="DXOpal::Sprite::CollisionArea::Base (class)">Base</a></span></span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next"><span class='object_link'><a href="Base.html" title="DXOpal::Sprite::CollisionArea::Base (class)">Base</a></span></li>
78
+
79
+ <li class="next">DXOpal::Sprite::CollisionArea::Point</li>
80
+
81
+ </ul>
82
+ <a href="#" class="inheritanceTree">show all</a>
83
+
84
+ </dd>
85
+ </dl>
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+ <dl>
98
+ <dt>Defined in:</dt>
99
+ <dd>lib/dxopal/sprite/collision_area.rb</dd>
100
+ </dl>
101
+
102
+ </div>
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+ <h2>Instance Attribute Summary</h2>
111
+
112
+ <h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Base.html" title="DXOpal::Sprite::CollisionArea::Base (class)">Base</a></span></h3>
113
+ <p class="inherited"><span class='object_link'><a href="Base.html#sprite-instance_method" title="DXOpal::Sprite::CollisionArea::Base#sprite (method)">#sprite</a></span></p>
114
+
115
+
116
+
117
+ <h2>
118
+ Instance Method Summary
119
+ <small><a href="#" class="summary_toggle">collapse</a></small>
120
+ </h2>
121
+
122
+ <ul class="summary">
123
+
124
+ <li class="public ">
125
+ <span class="summary_signature">
126
+
127
+ <a href="#absolute_pos-instance_method" title="#absolute_pos (instance method)">#<strong>absolute_pos</strong> &#x21d2; Object </a>
128
+
129
+
130
+
131
+ </span>
132
+
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+ <span class="summary_desc"><div class='inline'>
142
+ <p>Return [x, y].</p>
143
+ </div></span>
144
+
145
+ </li>
146
+
147
+
148
+ <li class="public ">
149
+ <span class="summary_signature">
150
+
151
+ <a href="#collides%3F-instance_method" title="#collides? (instance method)">#<strong>collides?</strong>(other) &#x21d2; Boolean </a>
152
+
153
+
154
+
155
+ </span>
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+ <span class="summary_desc"><div class='inline'></div></span>
166
+
167
+ </li>
168
+
169
+
170
+ <li class="public ">
171
+ <span class="summary_signature">
172
+
173
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(sprite, x, y) &#x21d2; Point </a>
174
+
175
+
176
+
177
+ </span>
178
+
179
+
180
+ <span class="note title constructor">constructor</span>
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+ <span class="summary_desc"><div class='inline'>
190
+ <p>A new instance of Point.</p>
191
+ </div></span>
192
+
193
+ </li>
194
+
195
+
196
+ <li class="public ">
197
+ <span class="summary_signature">
198
+
199
+ <a href="#type-instance_method" title="#type (instance method)">#<strong>type</strong> &#x21d2; Object </a>
200
+
201
+
202
+
203
+ </span>
204
+
205
+
206
+
207
+
208
+
209
+
210
+
211
+
212
+
213
+ <span class="summary_desc"><div class='inline'></div></span>
214
+
215
+ </li>
216
+
217
+
218
+ </ul>
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+
228
+
229
+
230
+ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="Base.html" title="DXOpal::Sprite::CollisionArea::Base (class)">Base</a></span></h3>
231
+ <p class="inherited"><span class='object_link'><a href="Base.html#aabb-instance_method" title="DXOpal::Sprite::CollisionArea::Base#aabb (method)">#aabb</a></span>, <span class='object_link'><a href="Base.html#absolute-instance_method" title="DXOpal::Sprite::CollisionArea::Base#absolute (method)">#absolute</a></span>, <span class='object_link'><a href="Base.html#absolute1-instance_method" title="DXOpal::Sprite::CollisionArea::Base#absolute1 (method)">#absolute1</a></span>, <span class='object_link'><a href="Base.html#transback-instance_method" title="DXOpal::Sprite::CollisionArea::Base#transback (method)">#transback</a></span>, <span class='object_link'><a href="Base.html#transback1-instance_method" title="DXOpal::Sprite::CollisionArea::Base#transback1 (method)">#transback1</a></span></p>
232
+ <div id="constructor_details" class="method_details_list">
233
+ <h2>Constructor Details</h2>
234
+
235
+ <div class="method_details first">
236
+ <h3 class="signature first" id="initialize-instance_method">
237
+
238
+ #<strong>initialize</strong>(sprite, x, y) &#x21d2; <tt><span class='object_link'><a href="" title="DXOpal::Sprite::CollisionArea::Point (class)">Point</a></span></tt>
239
+
240
+
241
+
242
+
243
+
244
+ </h3><div class="docstring">
245
+ <div class="discussion">
246
+
247
+ <p>Returns a new instance of Point.</p>
248
+
249
+
250
+ </div>
251
+ </div>
252
+ <div class="tags">
253
+
254
+
255
+ </div><table class="source_code">
256
+ <tr>
257
+ <td>
258
+ <pre class="lines">
259
+
260
+
261
+ 89
262
+ 90
263
+ 91
264
+ 92</pre>
265
+ </td>
266
+ <td>
267
+ <pre class="code"><span class="info file"># File 'lib/dxopal/sprite/collision_area.rb', line 89</span>
268
+
269
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_sprite'>sprite</span><span class='comma'>,</span> <span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span><span class='rparen'>)</span>
270
+ <span class='ivar'>@sprite</span><span class='comma'>,</span> <span class='ivar'>@x</span><span class='comma'>,</span> <span class='ivar'>@y</span> <span class='op'>=</span> <span class='id identifier rubyid_sprite'>sprite</span><span class='comma'>,</span> <span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span>
271
+ <span class='kw'>super</span><span class='lparen'>(</span><span class='rparen'>)</span>
272
+ <span class='kw'>end</span></pre>
273
+ </td>
274
+ </tr>
275
+ </table>
276
+ </div>
277
+
278
+ </div>
279
+
280
+
281
+ <div id="instance_method_details" class="method_details_list">
282
+ <h2>Instance Method Details</h2>
283
+
284
+
285
+ <div class="method_details first">
286
+ <h3 class="signature first" id="absolute_pos-instance_method">
287
+
288
+ #<strong>absolute_pos</strong> &#x21d2; <tt>Object</tt>
289
+
290
+
291
+
292
+
293
+
294
+ </h3><div class="docstring">
295
+ <div class="discussion">
296
+
297
+ <p>Return [x, y]</p>
298
+
299
+
300
+ </div>
301
+ </div>
302
+ <div class="tags">
303
+
304
+
305
+ </div><table class="source_code">
306
+ <tr>
307
+ <td>
308
+ <pre class="lines">
309
+
310
+
311
+ 117
312
+ 118
313
+ 119</pre>
314
+ </td>
315
+ <td>
316
+ <pre class="code"><span class="info file"># File 'lib/dxopal/sprite/collision_area.rb', line 117</span>
317
+
318
+ <span class='kw'>def</span> <span class='id identifier rubyid_absolute_pos'>absolute_pos</span>
319
+ <span class='id identifier rubyid_absolute1'>absolute1</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='ivar'>@x</span><span class='comma'>,</span> <span class='ivar'>@y</span><span class='rbracket'>]</span><span class='rparen'>)</span>
320
+ <span class='kw'>end</span></pre>
321
+ </td>
322
+ </tr>
323
+ </table>
324
+ </div>
325
+
326
+ <div class="method_details ">
327
+ <h3 class="signature " id="collides?-instance_method">
328
+
329
+ #<strong>collides?</strong>(other) &#x21d2; <tt>Boolean</tt>
330
+
331
+
332
+
333
+
334
+
335
+ </h3><div class="docstring">
336
+ <div class="discussion">
337
+
338
+
339
+ </div>
340
+ </div>
341
+ <div class="tags">
342
+
343
+ <p class="tag_title">Returns:</p>
344
+ <ul class="return">
345
+
346
+ <li>
347
+
348
+
349
+ <span class='type'>(<tt>Boolean</tt>)</span>
350
+
351
+
352
+
353
+ </li>
354
+
355
+ </ul>
356
+
357
+ </div><table class="source_code">
358
+ <tr>
359
+ <td>
360
+ <pre class="lines">
361
+
362
+
363
+ 96
364
+ 97
365
+ 98
366
+ 99
367
+ 100
368
+ 101
369
+ 102
370
+ 103
371
+ 104
372
+ 105
373
+ 106
374
+ 107
375
+ 108
376
+ 109
377
+ 110
378
+ 111
379
+ 112
380
+ 113
381
+ 114</pre>
382
+ </td>
383
+ <td>
384
+ <pre class="code"><span class="info file"># File 'lib/dxopal/sprite/collision_area.rb', line 96</span>
385
+
386
+ <span class='kw'>def</span> <span class='id identifier rubyid_collides?'>collides?</span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span>
387
+ <span class='kw'>case</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span>
388
+ <span class='kw'>when</span> <span class='symbol'>:Point</span>
389
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_absolute_pos'>absolute_pos</span> <span class='op'>==</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_absolute_pos'>absolute_pos</span>
390
+ <span class='kw'>when</span> <span class='symbol'>:Circle</span>
391
+ <span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span> <span class='op'>=</span> <span class='op'>*</span><span class='id identifier rubyid_transback1'>transback1</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_absolute_pos'>absolute_pos</span><span class='comma'>,</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_sprite'>sprite</span><span class='rparen'>)</span>
392
+ <span class='id identifier rubyid_cx'>cx</span><span class='comma'>,</span> <span class='id identifier rubyid_cy'>cy</span> <span class='op'>=</span> <span class='op'>*</span><span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_absolute_norot_pos'>absolute_norot_pos</span>
393
+ <span class='backtick'>`</span><span class='tstring_content'>Opal.DXOpal.CCk.check_point_circle(x, y, cx, cy, </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_r'>r</span><span class='embexpr_end'>}</span><span class='tstring_content'>)</span><span class='tstring_end'>`</span></span>
394
+ <span class='kw'>when</span> <span class='symbol'>:Rect</span>
395
+ <span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span> <span class='op'>=</span> <span class='op'>*</span><span class='id identifier rubyid_transback1'>transback1</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_absolute_pos'>absolute_pos</span><span class='comma'>,</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_sprite'>sprite</span><span class='rparen'>)</span>
396
+ <span class='lparen'>(</span><span class='lparen'>(</span><span class='id identifier rubyid_x1'>x1</span><span class='comma'>,</span> <span class='id identifier rubyid_y1'>y1</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='lparen'>(</span><span class='id identifier rubyid_x2'>x2</span><span class='comma'>,</span> <span class='id identifier rubyid_y2'>y2</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='op'>=</span> <span class='op'>*</span><span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_absolute_norot_poss'>absolute_norot_poss</span>
397
+ <span class='backtick'>`</span><span class='tstring_content'>Opal.DXOpal.CCk.check_point_straight_rect(x, y, x1, y1, x2, y2)</span><span class='tstring_end'>`</span></span>
398
+ <span class='kw'>when</span> <span class='symbol'>:Triangle</span>
399
+ <span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span> <span class='op'>=</span> <span class='op'>*</span><span class='id identifier rubyid_absolute_pos'>absolute_pos</span>
400
+ <span class='lparen'>(</span><span class='id identifier rubyid_x1'>x1</span><span class='comma'>,</span> <span class='id identifier rubyid_y1'>y1</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='lparen'>(</span><span class='id identifier rubyid_x2'>x2</span><span class='comma'>,</span> <span class='id identifier rubyid_y2'>y2</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='lparen'>(</span><span class='id identifier rubyid_x3'>x3</span><span class='comma'>,</span> <span class='id identifier rubyid_y3'>y3</span><span class='rparen'>)</span> <span class='op'>=</span> <span class='op'>*</span><span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_absolute_poss'>absolute_poss</span>
401
+ <span class='backtick'>`</span><span class='tstring_content'>Opal.DXOpal.CCk.check_point_triangle(x, y, x1, y1, x2, y2, x3, y3)</span><span class='tstring_end'>`</span></span>
402
+ <span class='kw'>else</span> <span class='id identifier rubyid_raise'>raise</span>
403
+ <span class='kw'>end</span>
404
+ <span class='kw'>end</span></pre>
405
+ </td>
406
+ </tr>
407
+ </table>
408
+ </div>
409
+
410
+ <div class="method_details ">
411
+ <h3 class="signature " id="type-instance_method">
412
+
413
+ #<strong>type</strong> &#x21d2; <tt>Object</tt>
414
+
415
+
416
+
417
+
418
+
419
+ </h3><table class="source_code">
420
+ <tr>
421
+ <td>
422
+ <pre class="lines">
423
+
424
+
425
+ 94</pre>
426
+ </td>
427
+ <td>
428
+ <pre class="code"><span class="info file"># File 'lib/dxopal/sprite/collision_area.rb', line 94</span>
429
+
430
+ <span class='kw'>def</span> <span class='id identifier rubyid_type'>type</span><span class='semicolon'>;</span> <span class='symbol'>:Point</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
431
+ </td>
432
+ </tr>
433
+ </table>
434
+ </div>
435
+
436
+ </div>
437
+
438
+ </div>
439
+
440
+ <div id="footer">
441
+ Generated on Tue Dec 29 11:37:25 2020 by
442
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
443
+ 0.9.26 (ruby-2.7.0).
444
+ </div>
445
+
446
+ </div>
447
+ </body>
448
+ </html>
@@ -0,0 +1,549 @@
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::CollisionArea::Rect
8
+
9
+ &mdash; Documentation by YARD 0.9.26
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../../css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="../../../css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "DXOpal::Sprite::CollisionArea::Rect";
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 (R)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../../../DXOpal.html" title="DXOpal (module)">DXOpal</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../../Sprite.html" title="DXOpal::Sprite (class)">Sprite</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../CollisionArea.html" title="DXOpal::Sprite::CollisionArea (module)">CollisionArea</a></span></span>
41
+ &raquo;
42
+ <span class="title">Rect</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::CollisionArea::Rect
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName"><span class='object_link'><a href="Base.html" title="DXOpal::Sprite::CollisionArea::Base (class)">Base</a></span></span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next"><span class='object_link'><a href="Base.html" title="DXOpal::Sprite::CollisionArea::Base (class)">Base</a></span></li>
78
+
79
+ <li class="next">DXOpal::Sprite::CollisionArea::Rect</li>
80
+
81
+ </ul>
82
+ <a href="#" class="inheritanceTree">show all</a>
83
+
84
+ </dd>
85
+ </dl>
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+ <dl>
98
+ <dt>Defined in:</dt>
99
+ <dd>lib/dxopal/sprite/collision_area.rb</dd>
100
+ </dl>
101
+
102
+ </div>
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+ <h2>Instance Attribute Summary</h2>
111
+
112
+ <h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Base.html" title="DXOpal::Sprite::CollisionArea::Base (class)">Base</a></span></h3>
113
+ <p class="inherited"><span class='object_link'><a href="Base.html#sprite-instance_method" title="DXOpal::Sprite::CollisionArea::Base#sprite (method)">#sprite</a></span></p>
114
+
115
+
116
+
117
+ <h2>
118
+ Instance Method Summary
119
+ <small><a href="#" class="summary_toggle">collapse</a></small>
120
+ </h2>
121
+
122
+ <ul class="summary">
123
+
124
+ <li class="public ">
125
+ <span class="summary_signature">
126
+
127
+ <a href="#absolute_norot_poss-instance_method" title="#absolute_norot_poss (instance method)">#<strong>absolute_norot_poss</strong> &#x21d2; Object </a>
128
+
129
+
130
+
131
+ </span>
132
+
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+ <span class="summary_desc"><div class='inline'></div></span>
142
+
143
+ </li>
144
+
145
+
146
+ <li class="public ">
147
+ <span class="summary_signature">
148
+
149
+ <a href="#absolute_poss-instance_method" title="#absolute_poss (instance method)">#<strong>absolute_poss</strong> &#x21d2; Object </a>
150
+
151
+
152
+
153
+ </span>
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+ <span class="summary_desc"><div class='inline'></div></span>
164
+
165
+ </li>
166
+
167
+
168
+ <li class="public ">
169
+ <span class="summary_signature">
170
+
171
+ <a href="#collides%3F-instance_method" title="#collides? (instance method)">#<strong>collides?</strong>(other) &#x21d2; Boolean </a>
172
+
173
+
174
+
175
+ </span>
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+ <span class="summary_desc"><div class='inline'></div></span>
186
+
187
+ </li>
188
+
189
+
190
+ <li class="public ">
191
+ <span class="summary_signature">
192
+
193
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(sprite, x1, y1, x2, y2) &#x21d2; Rect </a>
194
+
195
+
196
+
197
+ </span>
198
+
199
+
200
+ <span class="note title constructor">constructor</span>
201
+
202
+
203
+
204
+
205
+
206
+
207
+
208
+
209
+ <span class="summary_desc"><div class='inline'>
210
+ <p>A new instance of Rect.</p>
211
+ </div></span>
212
+
213
+ </li>
214
+
215
+
216
+ <li class="public ">
217
+ <span class="summary_signature">
218
+
219
+ <a href="#inspect-instance_method" title="#inspect (instance method)">#<strong>inspect</strong> &#x21d2; Object </a>
220
+
221
+
222
+
223
+ </span>
224
+
225
+
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+ <span class="summary_desc"><div class='inline'></div></span>
234
+
235
+ </li>
236
+
237
+
238
+ <li class="public ">
239
+ <span class="summary_signature">
240
+
241
+ <a href="#type-instance_method" title="#type (instance method)">#<strong>type</strong> &#x21d2; Object </a>
242
+
243
+
244
+
245
+ </span>
246
+
247
+
248
+
249
+
250
+
251
+
252
+
253
+
254
+
255
+ <span class="summary_desc"><div class='inline'></div></span>
256
+
257
+ </li>
258
+
259
+
260
+ </ul>
261
+
262
+
263
+
264
+
265
+
266
+
267
+
268
+
269
+
270
+
271
+
272
+ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="Base.html" title="DXOpal::Sprite::CollisionArea::Base (class)">Base</a></span></h3>
273
+ <p class="inherited"><span class='object_link'><a href="Base.html#aabb-instance_method" title="DXOpal::Sprite::CollisionArea::Base#aabb (method)">#aabb</a></span>, <span class='object_link'><a href="Base.html#absolute-instance_method" title="DXOpal::Sprite::CollisionArea::Base#absolute (method)">#absolute</a></span>, <span class='object_link'><a href="Base.html#absolute1-instance_method" title="DXOpal::Sprite::CollisionArea::Base#absolute1 (method)">#absolute1</a></span>, <span class='object_link'><a href="Base.html#transback-instance_method" title="DXOpal::Sprite::CollisionArea::Base#transback (method)">#transback</a></span>, <span class='object_link'><a href="Base.html#transback1-instance_method" title="DXOpal::Sprite::CollisionArea::Base#transback1 (method)">#transback1</a></span></p>
274
+ <div id="constructor_details" class="method_details_list">
275
+ <h2>Constructor Details</h2>
276
+
277
+ <div class="method_details first">
278
+ <h3 class="signature first" id="initialize-instance_method">
279
+
280
+ #<strong>initialize</strong>(sprite, x1, y1, x2, y2) &#x21d2; <tt><span class='object_link'><a href="" title="DXOpal::Sprite::CollisionArea::Rect (class)">Rect</a></span></tt>
281
+
282
+
283
+
284
+
285
+
286
+ </h3><div class="docstring">
287
+ <div class="discussion">
288
+
289
+ <p>Returns a new instance of Rect.</p>
290
+
291
+
292
+ </div>
293
+ </div>
294
+ <div class="tags">
295
+
296
+
297
+ </div><table class="source_code">
298
+ <tr>
299
+ <td>
300
+ <pre class="lines">
301
+
302
+
303
+ 215
304
+ 216
305
+ 217
306
+ 218
307
+ 219</pre>
308
+ </td>
309
+ <td>
310
+ <pre class="code"><span class="info file"># File 'lib/dxopal/sprite/collision_area.rb', line 215</span>
311
+
312
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_sprite'>sprite</span><span class='comma'>,</span> <span class='id identifier rubyid_x1'>x1</span><span class='comma'>,</span> <span class='id identifier rubyid_y1'>y1</span><span class='comma'>,</span> <span class='id identifier rubyid_x2'>x2</span><span class='comma'>,</span> <span class='id identifier rubyid_y2'>y2</span><span class='rparen'>)</span>
313
+ <span class='ivar'>@sprite</span><span class='comma'>,</span> <span class='ivar'>@x1</span><span class='comma'>,</span> <span class='ivar'>@y1</span><span class='comma'>,</span> <span class='ivar'>@x2</span><span class='comma'>,</span> <span class='ivar'>@y2</span> <span class='op'>=</span> <span class='id identifier rubyid_sprite'>sprite</span><span class='comma'>,</span> <span class='id identifier rubyid_x1'>x1</span><span class='comma'>,</span> <span class='id identifier rubyid_y1'>y1</span><span class='comma'>,</span> <span class='id identifier rubyid_x2'>x2</span><span class='comma'>,</span> <span class='id identifier rubyid_y2'>y2</span>
314
+ <span class='ivar'>@poss</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='lbracket'>[</span><span class='id identifier rubyid_x1'>x1</span><span class='comma'>,</span> <span class='id identifier rubyid_y1'>y1</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='id identifier rubyid_x2'>x2</span><span class='comma'>,</span> <span class='id identifier rubyid_y1'>y1</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='id identifier rubyid_x2'>x2</span><span class='comma'>,</span> <span class='id identifier rubyid_y2'>y2</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='id identifier rubyid_x1'>x1</span><span class='comma'>,</span> <span class='id identifier rubyid_y2'>y2</span><span class='rbracket'>]</span><span class='rbracket'>]</span>
315
+ <span class='kw'>super</span><span class='lparen'>(</span><span class='rparen'>)</span>
316
+ <span class='kw'>end</span></pre>
317
+ </td>
318
+ </tr>
319
+ </table>
320
+ </div>
321
+
322
+ </div>
323
+
324
+
325
+ <div id="instance_method_details" class="method_details_list">
326
+ <h2>Instance Method Details</h2>
327
+
328
+
329
+ <div class="method_details first">
330
+ <h3 class="signature first" id="absolute_norot_poss-instance_method">
331
+
332
+ #<strong>absolute_norot_poss</strong> &#x21d2; <tt>Object</tt>
333
+
334
+
335
+
336
+
337
+
338
+ </h3><table class="source_code">
339
+ <tr>
340
+ <td>
341
+ <pre class="lines">
342
+
343
+
344
+ 254
345
+ 255
346
+ 256
347
+ 257</pre>
348
+ </td>
349
+ <td>
350
+ <pre class="code"><span class="info file"># File 'lib/dxopal/sprite/collision_area.rb', line 254</span>
351
+
352
+ <span class='kw'>def</span> <span class='id identifier rubyid_absolute_norot_poss'>absolute_norot_poss</span>
353
+ <span class='lbracket'>[</span><span class='lbracket'>[</span><span class='ivar'>@x1</span> <span class='op'>+</span> <span class='ivar'>@sprite</span><span class='period'>.</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='ivar'>@y1</span> <span class='op'>+</span> <span class='ivar'>@sprite</span><span class='period'>.</span><span class='id identifier rubyid_y'>y</span><span class='rbracket'>]</span><span class='comma'>,</span>
354
+ <span class='lbracket'>[</span><span class='ivar'>@x2</span> <span class='op'>+</span> <span class='ivar'>@sprite</span><span class='period'>.</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='ivar'>@y2</span> <span class='op'>+</span> <span class='ivar'>@sprite</span><span class='period'>.</span><span class='id identifier rubyid_y'>y</span><span class='rbracket'>]</span><span class='rbracket'>]</span>
355
+ <span class='kw'>end</span></pre>
356
+ </td>
357
+ </tr>
358
+ </table>
359
+ </div>
360
+
361
+ <div class="method_details ">
362
+ <h3 class="signature " id="absolute_poss-instance_method">
363
+
364
+ #<strong>absolute_poss</strong> &#x21d2; <tt>Object</tt>
365
+
366
+
367
+
368
+
369
+
370
+ </h3><table class="source_code">
371
+ <tr>
372
+ <td>
373
+ <pre class="lines">
374
+
375
+
376
+ 250
377
+ 251
378
+ 252</pre>
379
+ </td>
380
+ <td>
381
+ <pre class="code"><span class="info file"># File 'lib/dxopal/sprite/collision_area.rb', line 250</span>
382
+
383
+ <span class='kw'>def</span> <span class='id identifier rubyid_absolute_poss'>absolute_poss</span>
384
+ <span class='id identifier rubyid_absolute'>absolute</span><span class='lparen'>(</span><span class='ivar'>@poss</span><span class='rparen'>)</span>
385
+ <span class='kw'>end</span></pre>
386
+ </td>
387
+ </tr>
388
+ </table>
389
+ </div>
390
+
391
+ <div class="method_details ">
392
+ <h3 class="signature " id="collides?-instance_method">
393
+
394
+ #<strong>collides?</strong>(other) &#x21d2; <tt>Boolean</tt>
395
+
396
+
397
+
398
+
399
+
400
+ </h3><div class="docstring">
401
+ <div class="discussion">
402
+
403
+
404
+ </div>
405
+ </div>
406
+ <div class="tags">
407
+
408
+ <p class="tag_title">Returns:</p>
409
+ <ul class="return">
410
+
411
+ <li>
412
+
413
+
414
+ <span class='type'>(<tt>Boolean</tt>)</span>
415
+
416
+
417
+
418
+ </li>
419
+
420
+ </ul>
421
+
422
+ </div><table class="source_code">
423
+ <tr>
424
+ <td>
425
+ <pre class="lines">
426
+
427
+
428
+ 227
429
+ 228
430
+ 229
431
+ 230
432
+ 231
433
+ 232
434
+ 233
435
+ 234
436
+ 235
437
+ 236
438
+ 237
439
+ 238
440
+ 239
441
+ 240
442
+ 241
443
+ 242
444
+ 243
445
+ 244
446
+ 245
447
+ 246
448
+ 247
449
+ 248</pre>
450
+ </td>
451
+ <td>
452
+ <pre class="code"><span class="info file"># File 'lib/dxopal/sprite/collision_area.rb', line 227</span>
453
+
454
+ <span class='kw'>def</span> <span class='id identifier rubyid_collides?'>collides?</span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span>
455
+ <span class='kw'>case</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_type'>type</span>
456
+ <span class='kw'>when</span> <span class='symbol'>:Point</span><span class='comma'>,</span> <span class='symbol'>:Circle</span>
457
+ <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_collides?'>collides?</span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
458
+ <span class='kw'>when</span> <span class='symbol'>:Rect</span>
459
+ <span class='lparen'>(</span><span class='lparen'>(</span><span class='id identifier rubyid_ox1'>ox1</span><span class='comma'>,</span> <span class='id identifier rubyid_oy1'>oy1</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='lparen'>(</span><span class='id identifier rubyid_ox2'>ox2</span><span class='comma'>,</span> <span class='id identifier rubyid_oy2'>oy2</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_absolute_norot_poss'>absolute_norot_poss</span>
460
+ <span class='lparen'>(</span><span class='lparen'>(</span><span class='id identifier rubyid_dx1'>dx1</span><span class='comma'>,</span> <span class='id identifier rubyid_dy1'>dy1</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='lparen'>(</span><span class='id identifier rubyid_dx2'>dx2</span><span class='comma'>,</span> <span class='id identifier rubyid_dy2'>dy2</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='op'>=</span> <span class='id identifier rubyid_aabb'>aabb</span><span class='lparen'>(</span><span class='id identifier rubyid_transback'>transback</span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_absolute_poss'>absolute_poss</span><span class='comma'>,</span> <span class='ivar'>@sprite</span><span class='rparen'>)</span><span class='rparen'>)</span>
461
+ <span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>unless</span> <span class='backtick'>`</span><span class='tstring_content'>Opal.DXOpal.CCk.check_rect_rect(ox1, oy1, ox2, oy2, dx1, dy1, dx2, dy2)</span><span class='tstring_end'>`</span></span>
462
+
463
+ <span class='lparen'>(</span><span class='lparen'>(</span><span class='id identifier rubyid_ox1'>ox1</span><span class='comma'>,</span> <span class='id identifier rubyid_oy1'>oy1</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='lparen'>(</span><span class='id identifier rubyid_ox2'>ox2</span><span class='comma'>,</span> <span class='id identifier rubyid_oy2'>oy2</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='op'>=</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_absolute_norot_poss'>absolute_norot_poss</span>
464
+ <span class='lparen'>(</span><span class='lparen'>(</span><span class='id identifier rubyid_dx1'>dx1</span><span class='comma'>,</span> <span class='id identifier rubyid_dy1'>dy1</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='lparen'>(</span><span class='id identifier rubyid_dx2'>dx2</span><span class='comma'>,</span> <span class='id identifier rubyid_dy2'>dy2</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='op'>=</span> <span class='id identifier rubyid_aabb'>aabb</span><span class='lparen'>(</span><span class='id identifier rubyid_transback'>transback</span><span class='lparen'>(</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_absolute_poss'>absolute_poss</span><span class='comma'>,</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_sprite'>sprite</span><span class='rparen'>)</span><span class='rparen'>)</span>
465
+ <span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>unless</span> <span class='backtick'>`</span><span class='tstring_content'>Opal.DXOpal.CCk.check_rect_rect(ox1, oy1, ox2, oy2, dx1, dy1, dx2, dy2)</span><span class='tstring_end'>`</span></span>
466
+ <span class='kw'>true</span>
467
+ <span class='kw'>when</span> <span class='symbol'>:Triangle</span>
468
+ <span class='lparen'>(</span><span class='id identifier rubyid_ox1'>ox1</span><span class='comma'>,</span> <span class='id identifier rubyid_oy1'>oy1</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='lparen'>(</span><span class='id identifier rubyid_ox2'>ox2</span><span class='comma'>,</span> <span class='id identifier rubyid_oy2'>oy2</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='lparen'>(</span><span class='id identifier rubyid_ox3'>ox3</span><span class='comma'>,</span> <span class='id identifier rubyid_oy3'>oy3</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='lparen'>(</span><span class='id identifier rubyid_ox4'>ox4</span><span class='comma'>,</span> <span class='id identifier rubyid_oy4'>oy4</span><span class='rparen'>)</span> <span class='op'>=</span> <span class='op'>*</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_absolute_poss'>absolute_poss</span>
469
+ <span class='lparen'>(</span><span class='id identifier rubyid_dx1'>dx1</span><span class='comma'>,</span> <span class='id identifier rubyid_dy1'>dy1</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='lparen'>(</span><span class='id identifier rubyid_dx2'>dx2</span><span class='comma'>,</span> <span class='id identifier rubyid_dy2'>dy2</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='lparen'>(</span><span class='id identifier rubyid_dx3'>dx3</span><span class='comma'>,</span> <span class='id identifier rubyid_dy3'>dy3</span><span class='rparen'>)</span> <span class='op'>=</span> <span class='op'>*</span><span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_absolute_poss'>absolute_poss</span>
470
+ <span class='backtick'>`</span><span class='tstring_content'>Opal.DXOpal.CCk.check_tilted_rect_triangle(ox1, oy1, ox2, oy2, ox3, oy3, ox4, oy4,
471
+ dx1, dy1, dx2, dy2, dx3, dy3)</span><span class='tstring_end'>`</span></span>
472
+
473
+ <span class='kw'>else</span> <span class='id identifier rubyid_raise'>raise</span>
474
+ <span class='kw'>end</span>
475
+ <span class='kw'>end</span></pre>
476
+ </td>
477
+ </tr>
478
+ </table>
479
+ </div>
480
+
481
+ <div class="method_details ">
482
+ <h3 class="signature " id="inspect-instance_method">
483
+
484
+ #<strong>inspect</strong> &#x21d2; <tt>Object</tt>
485
+
486
+
487
+
488
+
489
+
490
+ </h3><table class="source_code">
491
+ <tr>
492
+ <td>
493
+ <pre class="lines">
494
+
495
+
496
+ 223
497
+ 224
498
+ 225</pre>
499
+ </td>
500
+ <td>
501
+ <pre class="code"><span class="info file"># File 'lib/dxopal/sprite/collision_area.rb', line 223</span>
502
+
503
+ <span class='kw'>def</span> <span class='id identifier rubyid_inspect'>inspect</span>
504
+ <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>#&lt;CollisionArea::Rect(</span><span class='embexpr_beg'>#{</span><span class='ivar'>@x1</span><span class='embexpr_end'>}</span><span class='tstring_content'>, </span><span class='embexpr_beg'>#{</span><span class='ivar'>@y1</span><span class='embexpr_end'>}</span><span class='tstring_content'>, </span><span class='embexpr_beg'>#{</span><span class='ivar'>@x2</span><span class='embexpr_end'>}</span><span class='tstring_content'>, </span><span class='embexpr_beg'>#{</span><span class='ivar'>@y2</span><span class='embexpr_end'>}</span><span class='tstring_content'>)&gt;</span><span class='tstring_end'>&quot;</span></span>
505
+ <span class='kw'>end</span></pre>
506
+ </td>
507
+ </tr>
508
+ </table>
509
+ </div>
510
+
511
+ <div class="method_details ">
512
+ <h3 class="signature " id="type-instance_method">
513
+
514
+ #<strong>type</strong> &#x21d2; <tt>Object</tt>
515
+
516
+
517
+
518
+
519
+
520
+ </h3><table class="source_code">
521
+ <tr>
522
+ <td>
523
+ <pre class="lines">
524
+
525
+
526
+ 221</pre>
527
+ </td>
528
+ <td>
529
+ <pre class="code"><span class="info file"># File 'lib/dxopal/sprite/collision_area.rb', line 221</span>
530
+
531
+ <span class='kw'>def</span> <span class='id identifier rubyid_type'>type</span><span class='semicolon'>;</span> <span class='symbol'>:Rect</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
532
+ </td>
533
+ </tr>
534
+ </table>
535
+ </div>
536
+
537
+ </div>
538
+
539
+ </div>
540
+
541
+ <div id="footer">
542
+ Generated on Tue Dec 29 11:37:25 2020 by
543
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
544
+ 0.9.26 (ruby-2.7.0).
545
+ </div>
546
+
547
+ </div>
548
+ </body>
549
+ </html>