dxopal 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +5 -0
  3. data/.ignore +5 -0
  4. data/.nojekyll +4 -0
  5. data/CHANGELOG.md +90 -0
  6. data/DEVELOPMENT.md +57 -0
  7. data/Gemfile +2 -0
  8. data/Gemfile.lock +39 -0
  9. data/README.md +22 -0
  10. data/Rakefile +66 -0
  11. data/TODO.md +278 -0
  12. data/build/dxopal.js +46590 -0
  13. data/build/dxopal.min.js +1 -0
  14. data/config.ru +39 -0
  15. data/doc/api/DXOpal.html +129 -0
  16. data/doc/api/DXOpal/Font.html +485 -0
  17. data/doc/api/DXOpal/Image.html +2533 -0
  18. data/doc/api/DXOpal/Input.html +1086 -0
  19. data/doc/api/DXOpal/Input/MouseCodes.html +146 -0
  20. data/doc/api/DXOpal/RemoteResource.html +641 -0
  21. data/doc/api/DXOpal/Sound.html +568 -0
  22. data/doc/api/DXOpal/SoundEffect.html +444 -0
  23. data/doc/api/DXOpal/SoundEffect/WaveTypes.html +130 -0
  24. data/doc/api/DXOpal/Sprite.html +1419 -0
  25. data/doc/api/DXOpal/Window.html +1915 -0
  26. data/doc/api/_index.html +228 -0
  27. data/doc/api/class_list.html +51 -0
  28. data/doc/api/css/common.css +1 -0
  29. data/doc/api/css/full_list.css +58 -0
  30. data/doc/api/css/style.css +492 -0
  31. data/doc/api/file.CHANGELOG.html +162 -0
  32. data/doc/api/file.README.html +124 -0
  33. data/doc/api/file_list.html +61 -0
  34. data/doc/api/frames.html +17 -0
  35. data/doc/api/index.html +124 -0
  36. data/doc/api/js/app.js +248 -0
  37. data/doc/api/js/full_list.js +216 -0
  38. data/doc/api/js/jquery.js +4 -0
  39. data/doc/api/method_list.html +939 -0
  40. data/doc/api/top-level-namespace.html +110 -0
  41. data/doc/en/index.html +93 -0
  42. data/doc/ja/index.html +92 -0
  43. data/dxopal.gemspec +29 -0
  44. data/exe/dxopal +44 -0
  45. data/index.html +56 -0
  46. data/opal/dxopal.rb +54 -0
  47. data/opal/dxopal/constants/colors.rb +16 -0
  48. data/opal/dxopal/font.rb +20 -0
  49. data/opal/dxopal/image.rb +301 -0
  50. data/opal/dxopal/input.rb +170 -0
  51. data/opal/dxopal/input/key_codes.rb +168 -0
  52. data/opal/dxopal/remote_resource.rb +65 -0
  53. data/opal/dxopal/sound.rb +53 -0
  54. data/opal/dxopal/sound_effect.rb +84 -0
  55. data/opal/dxopal/sprite.rb +94 -0
  56. data/opal/dxopal/sprite/collision_area.rb +288 -0
  57. data/opal/dxopal/sprite/collision_check.rb +106 -0
  58. data/opal/dxopal/sprite/collision_checker.rb +169 -0
  59. data/opal/dxopal/sprite/physics.rb +82 -0
  60. data/opal/dxopal/version.rb +3 -0
  61. data/opal/dxopal/window.rb +173 -0
  62. data/template/index.html +13 -0
  63. data/template/main.rb +9 -0
  64. metadata +191 -0
@@ -0,0 +1,1086 @@
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
+ Module: DXOpal::Input
8
+
9
+ &mdash; 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::Input";
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 (I)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../DXOpal.html" title="DXOpal (module)">DXOpal</a></span></span>
41
+ &raquo;
42
+ <span class="title">Input</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>Module: DXOpal::Input
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+ <dl>
80
+ <dt>Defined in:</dt>
81
+ <dd>opal/dxopal/input.rb</dd>
82
+ </dl>
83
+
84
+ </div>
85
+
86
+ <h2>Defined Under Namespace</h2>
87
+ <p class="children">
88
+
89
+
90
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="Input/MouseCodes.html" title="DXOpal::Input::MouseCodes (module)">MouseCodes</a></span>
91
+
92
+
93
+
94
+
95
+ </p>
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+ <h2>
105
+ Class Method Summary
106
+ <small><a href="#" class="summary_toggle">collapse</a></small>
107
+ </h2>
108
+
109
+ <ul class="summary">
110
+
111
+ <li class="public ">
112
+ <span class="summary_signature">
113
+
114
+ <a href="#_init-class_method" title="_init (class method)">.<strong>_init</strong>(canvas) &#x21d2; Object </a>
115
+
116
+
117
+
118
+ </span>
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+ <span class="summary_desc"><div class='inline'>
129
+ <p>Internal setup for Input class.</p>
130
+ </div></span>
131
+
132
+ </li>
133
+
134
+
135
+ <li class="public ">
136
+ <span class="summary_signature">
137
+
138
+ <a href="#_on_tick-class_method" title="_on_tick (class method)">.<strong>_on_tick</strong> &#x21d2; Object </a>
139
+
140
+
141
+
142
+ </span>
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+ <span class="summary_desc"><div class='inline'>
153
+ <p>Called on every frame from Window.</p>
154
+ </div></span>
155
+
156
+ </li>
157
+
158
+
159
+ <li class="public ">
160
+ <span class="summary_signature">
161
+
162
+ <a href="#key_down%3F-class_method" title="key_down? (class method)">.<strong>key_down?</strong>(code) &#x21d2; Boolean </a>
163
+
164
+
165
+
166
+ </span>
167
+
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+
176
+ <span class="summary_desc"><div class='inline'>
177
+ <p>Return true if the key is being pressed.</p>
178
+ </div></span>
179
+
180
+ </li>
181
+
182
+
183
+ <li class="public ">
184
+ <span class="summary_signature">
185
+
186
+ <a href="#key_push%3F-class_method" title="key_push? (class method)">.<strong>key_push?</strong>(code) &#x21d2; Boolean </a>
187
+
188
+
189
+
190
+ </span>
191
+
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+ <span class="summary_desc"><div class='inline'>
201
+ <p>Return true if the key is just pressed.</p>
202
+ </div></span>
203
+
204
+ </li>
205
+
206
+
207
+ <li class="public ">
208
+ <span class="summary_signature">
209
+
210
+ <a href="#key_release%3F-class_method" title="key_release? (class method)">.<strong>key_release?</strong>(code) &#x21d2; Boolean </a>
211
+
212
+
213
+
214
+ </span>
215
+
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+ <span class="summary_desc"><div class='inline'>
225
+ <p>Return true if the key is just released.</p>
226
+ </div></span>
227
+
228
+ </li>
229
+
230
+
231
+ <li class="public ">
232
+ <span class="summary_signature">
233
+
234
+ <a href="#mouse_down%3F-class_method" title="mouse_down? (class method)">.<strong>mouse_down?</strong>(mouse_code) &#x21d2; Boolean </a>
235
+
236
+
237
+
238
+ </span>
239
+
240
+
241
+
242
+
243
+
244
+
245
+
246
+
247
+
248
+ <span class="summary_desc"><div class='inline'>
249
+ <p>Return true if the mouse button is being pressed.</p>
250
+ </div></span>
251
+
252
+ </li>
253
+
254
+
255
+ <li class="public ">
256
+ <span class="summary_signature">
257
+
258
+ <a href="#mouse_push%3F-class_method" title="mouse_push? (class method)">.<strong>mouse_push?</strong>(mouse_code) &#x21d2; Boolean </a>
259
+
260
+
261
+
262
+ </span>
263
+
264
+
265
+
266
+
267
+
268
+
269
+
270
+
271
+
272
+ <span class="summary_desc"><div class='inline'>
273
+ <p>Return true if the mouse button is pressed in the last tick.</p>
274
+ </div></span>
275
+
276
+ </li>
277
+
278
+
279
+ <li class="public ">
280
+ <span class="summary_signature">
281
+
282
+ <a href="#mouse_release%3F-class_method" title="mouse_release? (class method)">.<strong>mouse_release?</strong>(mouse_code) &#x21d2; Boolean </a>
283
+
284
+
285
+
286
+ </span>
287
+
288
+
289
+
290
+
291
+
292
+
293
+
294
+
295
+
296
+ <span class="summary_desc"><div class='inline'>
297
+ <p>Return true if the mouse button is released in the last tick.</p>
298
+ </div></span>
299
+
300
+ </li>
301
+
302
+
303
+ <li class="public ">
304
+ <span class="summary_signature">
305
+
306
+ <a href="#mouse_x-class_method" title="mouse_x (class method)">.<strong>mouse_x</strong> &#x21d2; Object </a>
307
+
308
+
309
+
310
+ (also: mouse_pos_x)
311
+
312
+ </span>
313
+
314
+
315
+
316
+
317
+
318
+
319
+
320
+
321
+
322
+ <span class="summary_desc"><div class='inline'>
323
+ <p>Return position of mouse cursor (0, 0) is the top-left corner of the
324
+ canvas.</p>
325
+ </div></span>
326
+
327
+ </li>
328
+
329
+
330
+ <li class="public ">
331
+ <span class="summary_signature">
332
+
333
+ <a href="#mouse_y-class_method" title="mouse_y (class method)">.<strong>mouse_y</strong> &#x21d2; Object </a>
334
+
335
+
336
+
337
+ (also: mouse_pos_y)
338
+
339
+ </span>
340
+
341
+
342
+
343
+
344
+
345
+
346
+
347
+
348
+
349
+ <span class="summary_desc"><div class='inline'></div></span>
350
+
351
+ </li>
352
+
353
+
354
+ <li class="public ">
355
+ <span class="summary_signature">
356
+
357
+ <a href="#x-class_method" title="x (class method)">.<strong>x</strong>(pad_number = 0) &#x21d2; Object </a>
358
+
359
+
360
+
361
+ </span>
362
+
363
+
364
+
365
+
366
+
367
+
368
+
369
+
370
+
371
+ <span class="summary_desc"><div class='inline'>
372
+ <p>Return 1 if &#39;right&#39;, -1 if &#39;left&#39;.</p>
373
+ </div></span>
374
+
375
+ </li>
376
+
377
+
378
+ <li class="public ">
379
+ <span class="summary_signature">
380
+
381
+ <a href="#y-class_method" title="y (class method)">.<strong>y</strong>(pad_number = 0) &#x21d2; Object </a>
382
+
383
+
384
+
385
+ </span>
386
+
387
+
388
+
389
+
390
+
391
+
392
+
393
+
394
+
395
+ <span class="summary_desc"><div class='inline'>
396
+ <p>Return 1 if &#39;down&#39;, -1 if &#39;up&#39;.</p>
397
+ </div></span>
398
+
399
+ </li>
400
+
401
+
402
+ </ul>
403
+
404
+
405
+
406
+
407
+ <div id="class_method_details" class="method_details_list">
408
+ <h2>Class Method Details</h2>
409
+
410
+
411
+ <div class="method_details first">
412
+ <h3 class="signature first" id="_init-class_method">
413
+
414
+ .<strong>_init</strong>(canvas) &#x21d2; <tt>Object</tt>
415
+
416
+
417
+
418
+
419
+
420
+ </h3><div class="docstring">
421
+ <div class="discussion">
422
+
423
+ <p>Internal setup for Input class</p>
424
+
425
+
426
+ </div>
427
+ </div>
428
+ <div class="tags">
429
+
430
+
431
+ </div><table class="source_code">
432
+ <tr>
433
+ <td>
434
+ <pre class="lines">
435
+
436
+
437
+ 13
438
+ 14
439
+ 15
440
+ 16
441
+ 17
442
+ 18
443
+ 19
444
+ 20
445
+ 21
446
+ 22
447
+ 23
448
+ 24
449
+ 25
450
+ 26
451
+ 27
452
+ 28
453
+ 29
454
+ 30
455
+ 31
456
+ 32
457
+ 33
458
+ 34
459
+ 35
460
+ 36
461
+ 37
462
+ 38
463
+ 39
464
+ 40
465
+ 41
466
+ 42
467
+ 43
468
+ 44
469
+ 45
470
+ 46
471
+ 47
472
+ 48
473
+ 49
474
+ 50
475
+ 51
476
+ 52
477
+ 53
478
+ 54
479
+ 55
480
+ 56
481
+ 57</pre>
482
+ </td>
483
+ <td>
484
+ <pre class="code"><span class="info file"># File 'opal/dxopal/input.rb', line 13</span>
485
+
486
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid__init'>_init</span><span class='lparen'>(</span><span class='id identifier rubyid_canvas'>canvas</span><span class='rparen'>)</span>
487
+ <span class='cvar'>@@tick</span> <span class='op'>=</span> <span class='int'>0</span>
488
+ <span class='cvar'>@@pressing_keys</span> <span class='op'>=</span> <span class='id identifier rubyid_pressing_keys'>pressing_keys</span> <span class='op'>=</span> <span class='backtick'>`</span><span class='tstring_content'>new Object()</span><span class='tstring_end'>`</span></span>
489
+ <span class='cvar'>@@mouse_info</span> <span class='op'>=</span> <span class='backtick'>`</span><span class='tstring_content'>{x: 0, y: 0}</span><span class='tstring_end'>`</span></span>
490
+ <span class='cvar'>@@pressing_mouse_buttons</span> <span class='op'>=</span> <span class='id identifier rubyid_pressing_mouse_buttons'>pressing_mouse_buttons</span> <span class='op'>=</span> <span class='backtick'>`</span><span class='tstring_content'>new Object()</span><span class='tstring_end'>`</span></span>
491
+
492
+ <span class='id identifier rubyid_rect'>rect</span> <span class='op'>=</span> <span class='backtick'>`</span><span class='tstring_content'>canvas.getBoundingClientRect()</span><span class='tstring_end'>`</span></span>
493
+ <span class='cvar'>@@canvas_x</span> <span class='op'>=</span> <span class='backtick'>`</span><span class='tstring_content'>rect.left + window.pageXOffset</span><span class='tstring_end'>`</span></span>
494
+ <span class='cvar'>@@canvas_y</span> <span class='op'>=</span> <span class='backtick'>`</span><span class='tstring_content'>rect.top + window.pageYOffset</span><span class='tstring_end'>`</span></span>
495
+
496
+ <span class='backtick'>%x{</span><span class='tstring_content'>
497
+ document.addEventListener(&#39;keydown&#39;, function(ev){
498
+ pressing_keys[ev.keyCode] = </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@tick</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
499
+ ev.preventDefault();
500
+ ev.stopPropagation();
501
+ });
502
+ document.addEventListener(&#39;keyup&#39;, function(ev){
503
+ pressing_keys[ev.keyCode] = -</span><span class='embexpr_beg'>#{</span><span class='cvar'>@@tick</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
504
+ ev.preventDefault();
505
+ ev.stopPropagation();
506
+ });
507
+ document.addEventListener(&#39;mousemove&#39;, function(ev){
508
+ </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@mouse_info</span><span class='embexpr_end'>}</span><span class='tstring_content'>.x = ev.pageX - </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@canvas_x</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
509
+ </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@mouse_info</span><span class='embexpr_end'>}</span><span class='tstring_content'>.y = ev.pageY - </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@canvas_y</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
510
+ });
511
+ document.addEventListener(&#39;mousedown&#39;, function(ev){
512
+ </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@mouse_info</span><span class='embexpr_end'>}</span><span class='tstring_content'>.x = ev.pageX - </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@canvas_x</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
513
+ </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@mouse_info</span><span class='embexpr_end'>}</span><span class='tstring_content'>.y = ev.pageY - </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@canvas_y</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
514
+ for (var k=1; k&lt;=16; k&lt;&lt;=1) {
515
+ if (ev.buttons &amp; k) {
516
+ pressing_mouse_buttons[k] = </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@tick</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
517
+ }
518
+ }
519
+ });
520
+ document.addEventListener(&#39;mouseup&#39;, function(ev){
521
+ </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@mouse_info</span><span class='embexpr_end'>}</span><span class='tstring_content'>.x = ev.pageX - </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@canvas_x</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
522
+ </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@mouse_info</span><span class='embexpr_end'>}</span><span class='tstring_content'>.y = ev.pageY - </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@canvas_y</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
523
+ for (var k=1; k&lt;=16; k&lt;&lt;=1) {
524
+ if ((ev.buttons &amp; k) == 0 &amp;&amp; pressing_mouse_buttons[k]) {
525
+ pressing_mouse_buttons[k] = -</span><span class='embexpr_beg'>#{</span><span class='cvar'>@@tick</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
526
+ }
527
+ }
528
+ });
529
+ </span><span class='tstring_end'>}</span></span>
530
+ <span class='kw'>end</span></pre>
531
+ </td>
532
+ </tr>
533
+ </table>
534
+ </div>
535
+
536
+ <div class="method_details ">
537
+ <h3 class="signature " id="_on_tick-class_method">
538
+
539
+ .<strong>_on_tick</strong> &#x21d2; <tt>Object</tt>
540
+
541
+
542
+
543
+
544
+
545
+ </h3><div class="docstring">
546
+ <div class="discussion">
547
+
548
+ <p>Called on every frame from Window</p>
549
+
550
+
551
+ </div>
552
+ </div>
553
+ <div class="tags">
554
+
555
+
556
+ </div><table class="source_code">
557
+ <tr>
558
+ <td>
559
+ <pre class="lines">
560
+
561
+
562
+ 60
563
+ 61
564
+ 62</pre>
565
+ </td>
566
+ <td>
567
+ <pre class="code"><span class="info file"># File 'opal/dxopal/input.rb', line 60</span>
568
+
569
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid__on_tick'>_on_tick</span>
570
+ <span class='cvar'>@@tick</span> <span class='op'>+=</span> <span class='int'>1</span>
571
+ <span class='kw'>end</span></pre>
572
+ </td>
573
+ </tr>
574
+ </table>
575
+ </div>
576
+
577
+ <div class="method_details ">
578
+ <h3 class="signature " id="key_down?-class_method">
579
+
580
+ .<strong>key_down?</strong>(code) &#x21d2; <tt>Boolean</tt>
581
+
582
+
583
+
584
+
585
+
586
+ </h3><div class="docstring">
587
+ <div class="discussion">
588
+
589
+ <p>Return true if the key is being pressed</p>
590
+
591
+
592
+ </div>
593
+ </div>
594
+ <div class="tags">
595
+
596
+ <p class="tag_title">Returns:</p>
597
+ <ul class="return">
598
+
599
+ <li>
600
+
601
+
602
+ <span class='type'>(<tt>Boolean</tt>)</span>
603
+
604
+
605
+
606
+ </li>
607
+
608
+ </ul>
609
+
610
+ </div><table class="source_code">
611
+ <tr>
612
+ <td>
613
+ <pre class="lines">
614
+
615
+
616
+ 81
617
+ 82
618
+ 83</pre>
619
+ </td>
620
+ <td>
621
+ <pre class="code"><span class="info file"># File 'opal/dxopal/input.rb', line 81</span>
622
+
623
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_key_down?'>key_down?</span><span class='lparen'>(</span><span class='id identifier rubyid_code'>code</span><span class='rparen'>)</span>
624
+ <span class='kw'>return</span> <span class='backtick'>`</span><span class='embexpr_beg'>#{</span><span class='cvar'>@@pressing_keys</span><span class='embexpr_end'>}</span><span class='tstring_content'>[code] &gt; 0</span><span class='tstring_end'>`</span></span>
625
+ <span class='kw'>end</span></pre>
626
+ </td>
627
+ </tr>
628
+ </table>
629
+ </div>
630
+
631
+ <div class="method_details ">
632
+ <h3 class="signature " id="key_push?-class_method">
633
+
634
+ .<strong>key_push?</strong>(code) &#x21d2; <tt>Boolean</tt>
635
+
636
+
637
+
638
+
639
+
640
+ </h3><div class="docstring">
641
+ <div class="discussion">
642
+
643
+ <p>Return true if the key is just pressed</p>
644
+
645
+
646
+ </div>
647
+ </div>
648
+ <div class="tags">
649
+
650
+ <p class="tag_title">Returns:</p>
651
+ <ul class="return">
652
+
653
+ <li>
654
+
655
+
656
+ <span class='type'>(<tt>Boolean</tt>)</span>
657
+
658
+
659
+
660
+ </li>
661
+
662
+ </ul>
663
+
664
+ </div><table class="source_code">
665
+ <tr>
666
+ <td>
667
+ <pre class="lines">
668
+
669
+
670
+ 86
671
+ 87
672
+ 88</pre>
673
+ </td>
674
+ <td>
675
+ <pre class="code"><span class="info file"># File 'opal/dxopal/input.rb', line 86</span>
676
+
677
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_key_push?'>key_push?</span><span class='lparen'>(</span><span class='id identifier rubyid_code'>code</span><span class='rparen'>)</span>
678
+ <span class='kw'>return</span> <span class='backtick'>`</span><span class='embexpr_beg'>#{</span><span class='cvar'>@@pressing_keys</span><span class='embexpr_end'>}</span><span class='tstring_content'>[code] == </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@tick</span><span class='embexpr_end'>}</span><span class='tstring_content'>-1</span><span class='tstring_end'>`</span></span>
679
+ <span class='kw'>end</span></pre>
680
+ </td>
681
+ </tr>
682
+ </table>
683
+ </div>
684
+
685
+ <div class="method_details ">
686
+ <h3 class="signature " id="key_release?-class_method">
687
+
688
+ .<strong>key_release?</strong>(code) &#x21d2; <tt>Boolean</tt>
689
+
690
+
691
+
692
+
693
+
694
+ </h3><div class="docstring">
695
+ <div class="discussion">
696
+
697
+ <p>Return true if the key is just released</p>
698
+
699
+
700
+ </div>
701
+ </div>
702
+ <div class="tags">
703
+
704
+ <p class="tag_title">Returns:</p>
705
+ <ul class="return">
706
+
707
+ <li>
708
+
709
+
710
+ <span class='type'>(<tt>Boolean</tt>)</span>
711
+
712
+
713
+
714
+ </li>
715
+
716
+ </ul>
717
+
718
+ </div><table class="source_code">
719
+ <tr>
720
+ <td>
721
+ <pre class="lines">
722
+
723
+
724
+ 91
725
+ 92
726
+ 93</pre>
727
+ </td>
728
+ <td>
729
+ <pre class="code"><span class="info file"># File 'opal/dxopal/input.rb', line 91</span>
730
+
731
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_key_release?'>key_release?</span><span class='lparen'>(</span><span class='id identifier rubyid_code'>code</span><span class='rparen'>)</span>
732
+ <span class='kw'>return</span> <span class='backtick'>`</span><span class='embexpr_beg'>#{</span><span class='cvar'>@@pressing_keys</span><span class='embexpr_end'>}</span><span class='tstring_content'>[code] == -(</span><span class='embexpr_beg'>#{</span><span class='cvar'>@@tick</span><span class='embexpr_end'>}</span><span class='tstring_content'>-1)</span><span class='tstring_end'>`</span></span>
733
+ <span class='kw'>end</span></pre>
734
+ </td>
735
+ </tr>
736
+ </table>
737
+ </div>
738
+
739
+ <div class="method_details ">
740
+ <h3 class="signature " id="mouse_down?-class_method">
741
+
742
+ .<strong>mouse_down?</strong>(mouse_code) &#x21d2; <tt>Boolean</tt>
743
+
744
+
745
+
746
+
747
+
748
+ </h3><div class="docstring">
749
+ <div class="discussion">
750
+
751
+ <p>Return true if the mouse button is being pressed</p>
752
+
753
+
754
+ </div>
755
+ </div>
756
+ <div class="tags">
757
+
758
+ <p class="tag_title">Returns:</p>
759
+ <ul class="return">
760
+
761
+ <li>
762
+
763
+
764
+ <span class='type'>(<tt>Boolean</tt>)</span>
765
+
766
+
767
+
768
+ </li>
769
+
770
+ </ul>
771
+
772
+ </div><table class="source_code">
773
+ <tr>
774
+ <td>
775
+ <pre class="lines">
776
+
777
+
778
+ 109
779
+ 110
780
+ 111</pre>
781
+ </td>
782
+ <td>
783
+ <pre class="code"><span class="info file"># File 'opal/dxopal/input.rb', line 109</span>
784
+
785
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_mouse_down?'>mouse_down?</span><span class='lparen'>(</span><span class='id identifier rubyid_mouse_code'>mouse_code</span><span class='rparen'>)</span>
786
+ <span class='kw'>return</span> <span class='backtick'>`</span><span class='embexpr_beg'>#{</span><span class='cvar'>@@pressing_mouse_buttons</span><span class='embexpr_end'>}</span><span class='tstring_content'>[mouse_code] &gt; 0</span><span class='tstring_end'>`</span></span>
787
+ <span class='kw'>end</span></pre>
788
+ </td>
789
+ </tr>
790
+ </table>
791
+ </div>
792
+
793
+ <div class="method_details ">
794
+ <h3 class="signature " id="mouse_push?-class_method">
795
+
796
+ .<strong>mouse_push?</strong>(mouse_code) &#x21d2; <tt>Boolean</tt>
797
+
798
+
799
+
800
+
801
+
802
+ </h3><div class="docstring">
803
+ <div class="discussion">
804
+
805
+ <p>Return true if the mouse button is pressed in the last tick</p>
806
+
807
+
808
+ </div>
809
+ </div>
810
+ <div class="tags">
811
+
812
+ <p class="tag_title">Returns:</p>
813
+ <ul class="return">
814
+
815
+ <li>
816
+
817
+
818
+ <span class='type'>(<tt>Boolean</tt>)</span>
819
+
820
+
821
+
822
+ </li>
823
+
824
+ </ul>
825
+
826
+ </div><table class="source_code">
827
+ <tr>
828
+ <td>
829
+ <pre class="lines">
830
+
831
+
832
+ 114
833
+ 115
834
+ 116</pre>
835
+ </td>
836
+ <td>
837
+ <pre class="code"><span class="info file"># File 'opal/dxopal/input.rb', line 114</span>
838
+
839
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_mouse_push?'>mouse_push?</span><span class='lparen'>(</span><span class='id identifier rubyid_mouse_code'>mouse_code</span><span class='rparen'>)</span>
840
+ <span class='kw'>return</span> <span class='backtick'>`</span><span class='embexpr_beg'>#{</span><span class='cvar'>@@pressing_mouse_buttons</span><span class='embexpr_end'>}</span><span class='tstring_content'>[mouse_code] == -(</span><span class='embexpr_beg'>#{</span><span class='cvar'>@@tick</span><span class='embexpr_end'>}</span><span class='tstring_content'>-1)</span><span class='tstring_end'>`</span></span>
841
+ <span class='kw'>end</span></pre>
842
+ </td>
843
+ </tr>
844
+ </table>
845
+ </div>
846
+
847
+ <div class="method_details ">
848
+ <h3 class="signature " id="mouse_release?-class_method">
849
+
850
+ .<strong>mouse_release?</strong>(mouse_code) &#x21d2; <tt>Boolean</tt>
851
+
852
+
853
+
854
+
855
+
856
+ </h3><div class="docstring">
857
+ <div class="discussion">
858
+
859
+ <p>Return true if the mouse button is released in the last tick</p>
860
+
861
+
862
+ </div>
863
+ </div>
864
+ <div class="tags">
865
+
866
+ <p class="tag_title">Returns:</p>
867
+ <ul class="return">
868
+
869
+ <li>
870
+
871
+
872
+ <span class='type'>(<tt>Boolean</tt>)</span>
873
+
874
+
875
+
876
+ </li>
877
+
878
+ </ul>
879
+
880
+ </div><table class="source_code">
881
+ <tr>
882
+ <td>
883
+ <pre class="lines">
884
+
885
+
886
+ 119
887
+ 120
888
+ 121</pre>
889
+ </td>
890
+ <td>
891
+ <pre class="code"><span class="info file"># File 'opal/dxopal/input.rb', line 119</span>
892
+
893
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_mouse_release?'>mouse_release?</span><span class='lparen'>(</span><span class='id identifier rubyid_mouse_code'>mouse_code</span><span class='rparen'>)</span>
894
+ <span class='kw'>return</span> <span class='backtick'>`</span><span class='embexpr_beg'>#{</span><span class='cvar'>@@pressing_mouse_buttons</span><span class='embexpr_end'>}</span><span class='tstring_content'>[mouse_code] == -(</span><span class='embexpr_beg'>#{</span><span class='cvar'>@@tick</span><span class='embexpr_end'>}</span><span class='tstring_content'>-1)</span><span class='tstring_end'>`</span></span>
895
+ <span class='kw'>end</span></pre>
896
+ </td>
897
+ </tr>
898
+ </table>
899
+ </div>
900
+
901
+ <div class="method_details ">
902
+ <h3 class="signature " id="mouse_x-class_method">
903
+
904
+ .<strong>mouse_x</strong> &#x21d2; <tt>Object</tt>
905
+
906
+
907
+
908
+ <span class="aliases">Also known as:
909
+ <span class="names"><span id='mouse_pos_x-class_method'>mouse_pos_x</span></span>
910
+ </span>
911
+
912
+
913
+
914
+ </h3><div class="docstring">
915
+ <div class="discussion">
916
+
917
+ <p>Return position of mouse cursor (0, 0) is the top-left corner of the canvas</p>
918
+
919
+
920
+ </div>
921
+ </div>
922
+ <div class="tags">
923
+
924
+
925
+ </div><table class="source_code">
926
+ <tr>
927
+ <td>
928
+ <pre class="lines">
929
+
930
+
931
+ 97
932
+ 98
933
+ 99</pre>
934
+ </td>
935
+ <td>
936
+ <pre class="code"><span class="info file"># File 'opal/dxopal/input.rb', line 97</span>
937
+
938
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_mouse_x'>mouse_x</span>
939
+ <span class='kw'>return</span> <span class='backtick'>`</span><span class='embexpr_beg'>#{</span><span class='cvar'>@@mouse_info</span><span class='embexpr_end'>}</span><span class='tstring_content'>.x</span><span class='tstring_end'>`</span></span>
940
+ <span class='kw'>end</span></pre>
941
+ </td>
942
+ </tr>
943
+ </table>
944
+ </div>
945
+
946
+ <div class="method_details ">
947
+ <h3 class="signature " id="mouse_y-class_method">
948
+
949
+ .<strong>mouse_y</strong> &#x21d2; <tt>Object</tt>
950
+
951
+
952
+
953
+ <span class="aliases">Also known as:
954
+ <span class="names"><span id='mouse_pos_y-class_method'>mouse_pos_y</span></span>
955
+ </span>
956
+
957
+
958
+
959
+ </h3><table class="source_code">
960
+ <tr>
961
+ <td>
962
+ <pre class="lines">
963
+
964
+
965
+ 100
966
+ 101
967
+ 102</pre>
968
+ </td>
969
+ <td>
970
+ <pre class="code"><span class="info file"># File 'opal/dxopal/input.rb', line 100</span>
971
+
972
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_mouse_y'>mouse_y</span>
973
+ <span class='kw'>return</span> <span class='backtick'>`</span><span class='embexpr_beg'>#{</span><span class='cvar'>@@mouse_info</span><span class='embexpr_end'>}</span><span class='tstring_content'>.y</span><span class='tstring_end'>`</span></span>
974
+ <span class='kw'>end</span></pre>
975
+ </td>
976
+ </tr>
977
+ </table>
978
+ </div>
979
+
980
+ <div class="method_details ">
981
+ <h3 class="signature " id="x-class_method">
982
+
983
+ .<strong>x</strong>(pad_number = 0) &#x21d2; <tt>Object</tt>
984
+
985
+
986
+
987
+
988
+
989
+ </h3><div class="docstring">
990
+ <div class="discussion">
991
+
992
+ <p>Return 1 if &#39;right&#39;, -1 if &#39;left&#39;</p>
993
+
994
+
995
+ </div>
996
+ </div>
997
+ <div class="tags">
998
+
999
+
1000
+ </div><table class="source_code">
1001
+ <tr>
1002
+ <td>
1003
+ <pre class="lines">
1004
+
1005
+
1006
+ 65
1007
+ 66
1008
+ 67
1009
+ 68
1010
+ 69
1011
+ 70</pre>
1012
+ </td>
1013
+ <td>
1014
+ <pre class="code"><span class="info file"># File 'opal/dxopal/input.rb', line 65</span>
1015
+
1016
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_x'>x</span><span class='lparen'>(</span><span class='id identifier rubyid_pad_number'>pad_number</span><span class='op'>=</span><span class='int'>0</span><span class='rparen'>)</span>
1017
+ <span class='id identifier rubyid_ret'>ret</span> <span class='op'>=</span> <span class='int'>0</span>
1018
+ <span class='id identifier rubyid_ret'>ret</span> <span class='op'>+=</span> <span class='int'>1</span> <span class='kw'>if</span> <span class='id identifier rubyid_key_down?'>key_down?</span><span class='lparen'>(</span><span class='const'>K_RIGHT</span><span class='rparen'>)</span>
1019
+ <span class='id identifier rubyid_ret'>ret</span> <span class='op'>-=</span> <span class='int'>1</span> <span class='kw'>if</span> <span class='id identifier rubyid_key_down?'>key_down?</span><span class='lparen'>(</span><span class='const'>K_LEFT</span><span class='rparen'>)</span>
1020
+ <span class='id identifier rubyid_ret'>ret</span>
1021
+ <span class='kw'>end</span></pre>
1022
+ </td>
1023
+ </tr>
1024
+ </table>
1025
+ </div>
1026
+
1027
+ <div class="method_details ">
1028
+ <h3 class="signature " id="y-class_method">
1029
+
1030
+ .<strong>y</strong>(pad_number = 0) &#x21d2; <tt>Object</tt>
1031
+
1032
+
1033
+
1034
+
1035
+
1036
+ </h3><div class="docstring">
1037
+ <div class="discussion">
1038
+
1039
+ <p>Return 1 if &#39;down&#39;, -1 if &#39;up&#39;</p>
1040
+
1041
+
1042
+ </div>
1043
+ </div>
1044
+ <div class="tags">
1045
+
1046
+
1047
+ </div><table class="source_code">
1048
+ <tr>
1049
+ <td>
1050
+ <pre class="lines">
1051
+
1052
+
1053
+ 73
1054
+ 74
1055
+ 75
1056
+ 76
1057
+ 77
1058
+ 78</pre>
1059
+ </td>
1060
+ <td>
1061
+ <pre class="code"><span class="info file"># File 'opal/dxopal/input.rb', line 73</span>
1062
+
1063
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_y'>y</span><span class='lparen'>(</span><span class='id identifier rubyid_pad_number'>pad_number</span><span class='op'>=</span><span class='int'>0</span><span class='rparen'>)</span>
1064
+ <span class='id identifier rubyid_ret'>ret</span> <span class='op'>=</span> <span class='int'>0</span>
1065
+ <span class='id identifier rubyid_ret'>ret</span> <span class='op'>+=</span> <span class='int'>1</span> <span class='kw'>if</span> <span class='id identifier rubyid_key_down?'>key_down?</span><span class='lparen'>(</span><span class='const'>K_DOWN</span><span class='rparen'>)</span>
1066
+ <span class='id identifier rubyid_ret'>ret</span> <span class='op'>-=</span> <span class='int'>1</span> <span class='kw'>if</span> <span class='id identifier rubyid_key_down?'>key_down?</span><span class='lparen'>(</span><span class='const'>K_UP</span><span class='rparen'>)</span>
1067
+ <span class='id identifier rubyid_ret'>ret</span>
1068
+ <span class='kw'>end</span></pre>
1069
+ </td>
1070
+ </tr>
1071
+ </table>
1072
+ </div>
1073
+
1074
+ </div>
1075
+
1076
+ </div>
1077
+
1078
+ <div id="footer">
1079
+ Generated on Tue Oct 17 13:56:27 2017 by
1080
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1081
+ 0.9.9 (ruby-2.4.2).
1082
+ </div>
1083
+
1084
+ </div>
1085
+ </body>
1086
+ </html>