dxopal 1.5.1 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -0
  3. data/DEVELOPMENT.md +4 -4
  4. data/Gemfile +1 -1
  5. data/Gemfile.lock +23 -25
  6. data/README.md +7 -3
  7. data/Rakefile +8 -15
  8. data/build/dxopal.js +57670 -40007
  9. data/build/dxopal.min.js +1 -1
  10. data/config.ru +1 -1
  11. data/doc/api/DXOpal/Constants/Colors.html +172 -0
  12. data/doc/api/DXOpal/Constants.html +115 -0
  13. data/doc/api/DXOpal/Font.html +72 -18
  14. data/doc/api/DXOpal/Image.html +902 -409
  15. data/doc/api/DXOpal/Input/KeyCodes.html +986 -0
  16. data/doc/api/DXOpal/Input/MouseCodes.html +8 -8
  17. data/doc/api/DXOpal/Input/Touch.html +834 -0
  18. data/doc/api/DXOpal/Input.html +833 -104
  19. data/doc/api/DXOpal/RemoteResource.html +170 -41
  20. data/doc/api/DXOpal/Sound.html +33 -27
  21. data/doc/api/DXOpal/SoundEffect/WaveTypes.html +8 -8
  22. data/doc/api/DXOpal/SoundEffect.html +13 -15
  23. data/doc/api/DXOpal/Sprite/CollisionArea/Base.html +649 -0
  24. data/doc/api/DXOpal/Sprite/CollisionArea/Circle.html +656 -0
  25. data/doc/api/DXOpal/Sprite/CollisionArea/Point.html +448 -0
  26. data/doc/api/DXOpal/Sprite/CollisionArea/Rect.html +549 -0
  27. data/doc/api/DXOpal/Sprite/CollisionArea/Triangle.html +423 -0
  28. data/doc/api/DXOpal/Sprite/CollisionArea.html +126 -0
  29. data/doc/api/DXOpal/Sprite/CollisionCheck/ClassMethods.html +268 -0
  30. data/doc/api/DXOpal/Sprite/CollisionCheck.html +926 -0
  31. data/doc/api/DXOpal/Sprite/Physics.html +426 -0
  32. data/doc/api/DXOpal/Sprite.html +522 -45
  33. data/doc/api/DXOpal/Window.html +245 -156
  34. data/doc/api/DXOpal.html +11 -11
  35. data/doc/api/Kernel.html +131 -0
  36. data/doc/api/_index.html +277 -5
  37. data/doc/api/class_list.html +1 -1
  38. data/doc/api/css/style.css +1 -0
  39. data/doc/api/file.README.html +23 -22
  40. data/doc/api/frames.html +10 -5
  41. data/doc/api/index.html +23 -22
  42. data/doc/api/method_list.html +1608 -0
  43. data/doc/api/top-level-namespace.html +155 -4
  44. data/lib/dxopal/input.rb +9 -4
  45. data/lib/dxopal/remote_resource.rb +33 -1
  46. data/lib/dxopal/sound.rb +5 -2
  47. data/lib/dxopal/version.rb +1 -1
  48. data/lib/dxopal/window.rb +6 -3
  49. data/lib/dxopal.rb +1 -0
  50. metadata +21 -8
@@ -6,15 +6,15 @@
6
6
  <title>
7
7
  Module: DXOpal::Input
8
8
 
9
- &mdash; Documentation by YARD 0.9.16
9
+ &mdash; Documentation by YARD 0.9.36
10
10
 
11
11
  </title>
12
12
 
13
- <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" />
14
14
 
15
- <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" />
16
16
 
17
- <script type="text/javascript" charset="utf-8">
17
+ <script type="text/javascript">
18
18
  pathId = "DXOpal::Input";
19
19
  relpath = '../';
20
20
  </script>
@@ -78,7 +78,9 @@
78
78
 
79
79
  <dl>
80
80
  <dt>Defined in:</dt>
81
- <dd>opal/dxopal/input.rb</dd>
81
+ <dd>lib/dxopal/input.rb<span class="defines">,<br />
82
+ lib/dxopal/input/key_codes.rb</span>
83
+ </dd>
82
84
  </dl>
83
85
 
84
86
  </div>
@@ -87,10 +89,12 @@
87
89
  <p class="children">
88
90
 
89
91
 
90
- <strong class="modules">Modules:</strong> <span class='object_link'><a href="Input/MouseCodes.html" title="DXOpal::Input::MouseCodes (module)">MouseCodes</a></span>
92
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="Input/KeyCodes.html" title="DXOpal::Input::KeyCodes (module)">KeyCodes</a></span>, <span class='object_link'><a href="Input/MouseCodes.html" title="DXOpal::Input::MouseCodes (module)">MouseCodes</a></span>
91
93
 
92
94
 
93
95
 
96
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="Input/Touch.html" title="DXOpal::Input::Touch (class)">Touch</a></span>
97
+
94
98
 
95
99
  </p>
96
100
 
@@ -208,6 +212,30 @@
208
212
  <p>(internal) initialize mouse events.</p>
209
213
  </div></span>
210
214
 
215
+ </li>
216
+
217
+
218
+ <li class="public ">
219
+ <span class="summary_signature">
220
+
221
+ <a href="#_init_touch_events-class_method" title="_init_touch_events (class method)">.<strong>_init_touch_events</strong> &#x21d2; Object </a>
222
+
223
+
224
+
225
+ </span>
226
+
227
+
228
+
229
+
230
+
231
+
232
+
233
+
234
+
235
+ <span class="summary_desc"><div class='inline'>
236
+ <p>(internal) initialize touch events.</p>
237
+ </div></span>
238
+
211
239
  </li>
212
240
 
213
241
 
@@ -252,6 +280,28 @@
252
280
 
253
281
 
254
282
 
283
+ <span class="summary_desc"><div class='inline'></div></span>
284
+
285
+ </li>
286
+
287
+
288
+ <li class="public ">
289
+ <span class="summary_signature">
290
+
291
+ <a href="#_update_touch_info-class_method" title="_update_touch_info (class method)">.<strong>_update_touch_info</strong> &#x21d2; Object </a>
292
+
293
+
294
+
295
+ </span>
296
+
297
+
298
+
299
+
300
+
301
+
302
+
303
+
304
+
255
305
  <span class="summary_desc"><div class='inline'></div></span>
256
306
 
257
307
  </li>
@@ -347,7 +397,7 @@
347
397
 
348
398
 
349
399
  <span class="summary_desc"><div class='inline'>
350
- <p>Return DOM element set by `keyevent_target=`.</p>
400
+ <p>Return DOM element set by keyevent_target=`.</p>
351
401
  </div></span>
352
402
 
353
403
  </li>
@@ -469,8 +519,7 @@
469
519
 
470
520
 
471
521
  <span class="summary_desc"><div class='inline'>
472
- <p>Return position of mouse cursor (0, 0) is the top-left corner of the
473
- canvas.</p>
522
+ <p>Return position of mouse cursor (0, 0) is the top-left corner of the canvas.</p>
474
523
  </div></span>
475
524
 
476
525
  </li>
@@ -497,6 +546,176 @@ canvas.</p>
497
546
 
498
547
  <span class="summary_desc"><div class='inline'></div></span>
499
548
 
549
+ </li>
550
+
551
+
552
+ <li class="public ">
553
+ <span class="summary_signature">
554
+
555
+ <a href="#new_touches-class_method" title="new_touches (class method)">.<strong>new_touches</strong> &#x21d2; Object </a>
556
+
557
+
558
+
559
+ </span>
560
+
561
+
562
+
563
+
564
+
565
+
566
+
567
+
568
+
569
+ <span class="summary_desc"><div class='inline'>
570
+ <p>Returns newly created touches.</p>
571
+ </div></span>
572
+
573
+ </li>
574
+
575
+
576
+ <li class="public ">
577
+ <span class="summary_signature">
578
+
579
+ <a href="#touch_down%3F-class_method" title="touch_down? (class method)">.<strong>touch_down?</strong> &#x21d2; Boolean </a>
580
+
581
+
582
+
583
+ </span>
584
+
585
+
586
+
587
+
588
+
589
+
590
+
591
+
592
+
593
+ <span class="summary_desc"><div class='inline'>
594
+ <p>Return true if the touch is being pressed.</p>
595
+ </div></span>
596
+
597
+ </li>
598
+
599
+
600
+ <li class="public ">
601
+ <span class="summary_signature">
602
+
603
+ <a href="#touch_push%3F-class_method" title="touch_push? (class method)">.<strong>touch_push?</strong> &#x21d2; Boolean </a>
604
+
605
+
606
+
607
+ </span>
608
+
609
+
610
+
611
+
612
+
613
+
614
+
615
+
616
+
617
+ <span class="summary_desc"><div class='inline'>
618
+ <p>Return true if the touch is pressed in the last tick.</p>
619
+ </div></span>
620
+
621
+ </li>
622
+
623
+
624
+ <li class="public ">
625
+ <span class="summary_signature">
626
+
627
+ <a href="#touch_release%3F-class_method" title="touch_release? (class method)">.<strong>touch_release?</strong> &#x21d2; Boolean </a>
628
+
629
+
630
+
631
+ </span>
632
+
633
+
634
+
635
+
636
+
637
+
638
+
639
+
640
+
641
+ <span class="summary_desc"><div class='inline'>
642
+ <p>Return true if the touch is released in the last tick.</p>
643
+ </div></span>
644
+
645
+ </li>
646
+
647
+
648
+ <li class="public ">
649
+ <span class="summary_signature">
650
+
651
+ <a href="#touch_x-class_method" title="touch_x (class method)">.<strong>touch_x</strong> &#x21d2; Object </a>
652
+
653
+
654
+
655
+ (also: touch_pos_x)
656
+
657
+ </span>
658
+
659
+
660
+
661
+
662
+
663
+
664
+
665
+
666
+
667
+ <span class="summary_desc"><div class='inline'>
668
+ <p>Return position of touch (0, 0) is the top-left corner of the canvas.</p>
669
+ </div></span>
670
+
671
+ </li>
672
+
673
+
674
+ <li class="public ">
675
+ <span class="summary_signature">
676
+
677
+ <a href="#touch_y-class_method" title="touch_y (class method)">.<strong>touch_y</strong> &#x21d2; Object </a>
678
+
679
+
680
+
681
+ (also: touch_pos_y)
682
+
683
+ </span>
684
+
685
+
686
+
687
+
688
+
689
+
690
+
691
+
692
+
693
+ <span class="summary_desc"><div class='inline'></div></span>
694
+
695
+ </li>
696
+
697
+
698
+ <li class="public ">
699
+ <span class="summary_signature">
700
+
701
+ <a href="#touches-class_method" title="touches (class method)">.<strong>touches</strong> &#x21d2; Object </a>
702
+
703
+
704
+
705
+ </span>
706
+
707
+
708
+
709
+
710
+
711
+
712
+
713
+
714
+
715
+ <span class="summary_desc"><div class='inline'>
716
+ <p>Returns current touches as an array of Input::Touch.</p>
717
+ </div></span>
718
+
500
719
  </li>
501
720
 
502
721
 
@@ -518,7 +737,7 @@ canvas.</p>
518
737
 
519
738
 
520
739
  <span class="summary_desc"><div class='inline'>
521
- <p>Return 1 if &#39;right&#39;, -1 if &#39;left&#39;.</p>
740
+ <p>Return 1 if right’, -1 if left’.</p>
522
741
  </div></span>
523
742
 
524
743
  </li>
@@ -542,7 +761,7 @@ canvas.</p>
542
761
 
543
762
 
544
763
  <span class="summary_desc"><div class='inline'>
545
- <p>Return 1 if &#39;down&#39;, -1 if &#39;up&#39;.</p>
764
+ <p>Return 1 if down’, -1 if up’.</p>
546
765
  </div></span>
547
766
 
548
767
  </li>
@@ -595,22 +814,30 @@ canvas.</p>
595
814
  24
596
815
  25
597
816
  26
598
- 27</pre>
817
+ 27
818
+ 28
819
+ 29
820
+ 30
821
+ 31</pre>
599
822
  </td>
600
823
  <td>
601
- <pre class="code"><span class="info file"># File 'opal/dxopal/input.rb', line 15</span>
824
+ <pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 15</span>
602
825
 
603
826
  <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>
604
827
  <span class='cvar'>@@tick</span> <span class='op'>=</span> <span class='int'>0</span>
605
828
  <span class='cvar'>@@pressing_keys</span> <span class='op'>=</span> <span class='backtick'>`</span><span class='tstring_content'>new Object()</span><span class='tstring_end'>`</span></span>
606
829
  <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>
607
830
  <span class='cvar'>@@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>
831
+ <span class='cvar'>@@touch_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>
832
+ <span class='cvar'>@@pressing_touch</span> <span class='op'>=</span> <span class='backtick'>`</span><span class='tstring_content'>new Object()</span><span class='tstring_end'>`</span></span>
608
833
 
834
+ <span class='cvar'>@@canvas</span> <span class='op'>=</span> <span class='id identifier rubyid_canvas'>canvas</span>
609
835
  <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>
610
836
  <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>
611
837
  <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>
612
838
 
613
839
  <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid__init_mouse_events'>_init_mouse_events</span>
840
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid__init_touch_events'>_init_touch_events</span>
614
841
  <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_keyevent_target'>keyevent_target</span> <span class='op'>=</span> <span class='backtick'>`</span><span class='tstring_content'>window</span><span class='tstring_end'>`</span></span> <span class='kw'>unless</span> <span class='const'><span class='object_link'><a href="" title="DXOpal::Input (module)">Input</a></span></span><span class='period'>.</span><span class='id identifier rubyid_keyevent_target'><span class='object_link'><a href="#keyevent_target-class_method" title="DXOpal::Input.keyevent_target (method)">keyevent_target</a></span></span>
615
842
  <span class='kw'>end</span></pre>
616
843
  </td>
@@ -644,14 +871,6 @@ canvas.</p>
644
871
  <pre class="lines">
645
872
 
646
873
 
647
- 115
648
- 116
649
- 117
650
- 118
651
- 119
652
- 120
653
- 121
654
- 122
655
874
  123
656
875
  124
657
876
  125
@@ -669,10 +888,20 @@ canvas.</p>
669
888
  137
670
889
  138
671
890
  139
672
- 140</pre>
891
+ 140
892
+ 141
893
+ 142
894
+ 143
895
+ 144
896
+ 145
897
+ 146
898
+ 147
899
+ 148
900
+ 149
901
+ 150</pre>
673
902
  </td>
674
903
  <td>
675
- <pre class="code"><span class="info file"># File 'opal/dxopal/input.rb', line 115</span>
904
+ <pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 123</span>
676
905
 
677
906
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid__init_mouse_events'>_init_mouse_events</span>
678
907
  <span class='backtick'>%x{</span><span class='tstring_content'>
@@ -692,9 +921,11 @@ canvas.</p>
692
921
  document.addEventListener(&#39;mouseup&#39;, function(ev){
693
922
  </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'>;
694
923
  </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'>;
924
+ // ev.button =&gt; ev.buttons
925
+ table = { 0: 1, 1: 4, 2: 2, 3: 8, 4: 16 };
695
926
  for (var k=1; k&lt;=16; k&lt;&lt;=1) {
696
- if ((ev.buttons &amp; k) == 0 &amp;&amp; </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@pressing_mouse_buttons</span><span class='embexpr_end'>}</span><span class='tstring_content'>[k]) {
697
- </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@pressing_mouse_buttons</span><span class='embexpr_end'>}</span><span class='tstring_content'>[k] = -</span><span class='embexpr_beg'>#{</span><span class='cvar'>@@tick</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
927
+ if (</span><span class='embexpr_beg'>#{</span><span class='cvar'>@@pressing_mouse_buttons</span><span class='embexpr_end'>}</span><span class='tstring_content'>[k]) {
928
+ </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@pressing_mouse_buttons</span><span class='embexpr_end'>}</span><span class='tstring_content'>[table[ev.button]] = -</span><span class='embexpr_beg'>#{</span><span class='cvar'>@@tick</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
698
929
  }
699
930
  }
700
931
  });
@@ -703,6 +934,133 @@ canvas.</p>
703
934
  </td>
704
935
  </tr>
705
936
  </table>
937
+ </div>
938
+
939
+ <div class="method_details ">
940
+ <h3 class="signature " id="_init_touch_events-class_method">
941
+
942
+ .<strong>_init_touch_events</strong> &#x21d2; <tt>Object</tt>
943
+
944
+
945
+
946
+
947
+
948
+ </h3><div class="docstring">
949
+ <div class="discussion">
950
+
951
+ <p>(internal) initialize touch events</p>
952
+
953
+
954
+ </div>
955
+ </div>
956
+ <div class="tags">
957
+
958
+
959
+ </div><table class="source_code">
960
+ <tr>
961
+ <td>
962
+ <pre class="lines">
963
+
964
+
965
+ 188
966
+ 189
967
+ 190
968
+ 191
969
+ 192
970
+ 193
971
+ 194
972
+ 195
973
+ 196
974
+ 197
975
+ 198
976
+ 199
977
+ 200
978
+ 201
979
+ 202
980
+ 203
981
+ 204
982
+ 205
983
+ 206
984
+ 207
985
+ 208
986
+ 209
987
+ 210
988
+ 211
989
+ 212
990
+ 213
991
+ 214
992
+ 215
993
+ 216
994
+ 217
995
+ 218
996
+ 219
997
+ 220
998
+ 221
999
+ 222
1000
+ 223
1001
+ 224
1002
+ 225
1003
+ 226
1004
+ 227
1005
+ 228
1006
+ 229
1007
+ 230
1008
+ 231
1009
+ 232
1010
+ 233</pre>
1011
+ </td>
1012
+ <td>
1013
+ <pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 188</span>
1014
+
1015
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid__init_touch_events'>_init_touch_events</span>
1016
+ <span class='cvar'>@@touches</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
1017
+ <span class='cvar'>@@new_touches</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
1018
+ <span class='backtick'>%x{</span><span class='tstring_content'>
1019
+ </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@canvas</span><span class='embexpr_end'>}</span><span class='tstring_content'>.addEventListener(&#39;touchmove&#39;, function(ev){
1020
+ ev.preventDefault();
1021
+ ev.stopPropagation();
1022
+ </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@touch_info</span><span class='embexpr_end'>}</span><span class='tstring_content'>.x = ev.changedTouches[0].pageX - </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@canvas_x</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
1023
+ </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@touch_info</span><span class='embexpr_end'>}</span><span class='tstring_content'>.y = ev.changedTouches[0].pageY - </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@canvas_y</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
1024
+ for (var touch of ev.changedTouches) {
1025
+ const id = touch.identifier;
1026
+ const x = touch.pageX - </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@canvas_x</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
1027
+ const y = touch.pageY - </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@canvas_y</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
1028
+ </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@touches</span><span class='lbracket'>[</span><span class='backtick'>`</span><span class='tstring_content'>id</span><span class='tstring_end'>`</span></span><span class='rbracket'>]</span><span class='op'>&amp;.</span><span class='id identifier rubyid__move'>_move</span><span class='lparen'>(</span><span class='backtick'>`</span><span class='tstring_content'>x</span><span class='tstring_end'>`</span></span><span class='comma'>,</span> <span class='backtick'>`</span><span class='tstring_content'>y</span><span class='tstring_end'>`</span></span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>
1029
+ }
1030
+ });
1031
+ </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@canvas</span><span class='embexpr_end'>}</span><span class='tstring_content'>.addEventListener(&#39;touchstart&#39;, function(ev){
1032
+ ev.preventDefault();
1033
+ ev.stopPropagation();
1034
+ </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@touch_info</span><span class='embexpr_end'>}</span><span class='tstring_content'>.x = ev.changedTouches[0].pageX - </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@canvas_x</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
1035
+ </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@touch_info</span><span class='embexpr_end'>}</span><span class='tstring_content'>.y = ev.changedTouches[0].pageY - </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@canvas_y</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
1036
+ </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@pressing_touch</span><span class='embexpr_end'>}</span><span class='tstring_content'>[0] = </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@tick</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
1037
+ for (var touch of ev.changedTouches) {
1038
+ const id = touch.identifier;
1039
+ const x = touch.pageX - </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@canvas_x</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
1040
+ const y = touch.pageY - </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@canvas_y</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
1041
+ </span><span class='embexpr_beg'>#{</span>
1042
+ <span class='id identifier rubyid_new_touch'>new_touch</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Input/Touch.html" title="DXOpal::Input::Touch (class)">Touch</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Input/Touch.html#initialize-instance_method" title="DXOpal::Input::Touch#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='backtick'>`</span><span class='tstring_content'>id</span><span class='tstring_end'>`</span></span><span class='comma'>,</span> <span class='backtick'>`</span><span class='tstring_content'>x</span><span class='tstring_end'>`</span></span><span class='comma'>,</span> <span class='backtick'>`</span><span class='tstring_content'>y</span><span class='tstring_end'>`</span></span><span class='rparen'>)</span>
1043
+ <span class='cvar'>@@touches</span><span class='lbracket'>[</span><span class='backtick'>`</span><span class='tstring_content'>id</span><span class='tstring_end'>`</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_new_touch'>new_touch</span>
1044
+ <span class='cvar'>@@new_touches</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='id identifier rubyid_new_touch'>new_touch</span><span class='rparen'>)</span>
1045
+ <span class='embexpr_end'>}</span><span class='tstring_content'>
1046
+ }
1047
+ });
1048
+ </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@canvas</span><span class='embexpr_end'>}</span><span class='tstring_content'>.addEventListener(&#39;touchend&#39;, function(ev){
1049
+ ev.preventDefault();
1050
+ ev.stopPropagation();
1051
+ </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@touch_info</span><span class='embexpr_end'>}</span><span class='tstring_content'>.x = ev.changedTouches[0].pageX - </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@canvas_x</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
1052
+ </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@touch_info</span><span class='embexpr_end'>}</span><span class='tstring_content'>.y = ev.changedTouches[0].pageY - </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@canvas_y</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
1053
+ </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@pressing_touch</span><span class='embexpr_end'>}</span><span class='tstring_content'>[0] = -</span><span class='embexpr_beg'>#{</span><span class='cvar'>@@tick</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
1054
+ for (var touch of ev.changedTouches) {
1055
+ const id = touch.identifier;
1056
+ </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@touches</span><span class='lbracket'>[</span><span class='backtick'>`</span><span class='tstring_content'>id</span><span class='tstring_end'>`</span></span><span class='rbracket'>]</span><span class='op'>&amp;.</span><span class='id identifier rubyid__released'>_released</span><span class='lparen'>(</span><span class='cvar'>@@tick</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>
1057
+ }
1058
+ });
1059
+ </span><span class='tstring_end'>}</span></span>
1060
+ <span class='kw'>end</span></pre>
1061
+ </td>
1062
+ </tr>
1063
+ </table>
706
1064
  </div>
707
1065
 
708
1066
  <div class="method_details ">
@@ -731,15 +1089,17 @@ canvas.</p>
731
1089
  <pre class="lines">
732
1090
 
733
1091
 
734
- 30
735
- 31
736
- 32</pre>
1092
+ 34
1093
+ 35
1094
+ 36
1095
+ 37</pre>
737
1096
  </td>
738
1097
  <td>
739
- <pre class="code"><span class="info file"># File 'opal/dxopal/input.rb', line 30</span>
1098
+ <pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 34</span>
740
1099
 
741
1100
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid__on_tick'>_on_tick</span>
742
1101
  <span class='cvar'>@@tick</span> <span class='op'>+=</span> <span class='int'>1</span>
1102
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid__update_touch_info'>_update_touch_info</span>
743
1103
  <span class='kw'>end</span></pre>
744
1104
  </td>
745
1105
  </tr>
@@ -764,7 +1124,7 @@ canvas.</p>
764
1124
  12</pre>
765
1125
  </td>
766
1126
  <td>
767
- <pre class="code"><span class="info file"># File 'opal/dxopal/input.rb', line 12</span>
1127
+ <pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 12</span>
768
1128
 
769
1129
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid__pressing_keys'>_pressing_keys</span><span class='semicolon'>;</span> <span class='cvar'>@@pressing_keys</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
770
1130
  </td>
@@ -773,20 +1133,52 @@ canvas.</p>
773
1133
  </div>
774
1134
 
775
1135
  <div class="method_details ">
776
- <h3 class="signature " id="key_down?-class_method">
1136
+ <h3 class="signature " id="_update_touch_info-class_method">
777
1137
 
778
- .<strong>key_down?</strong>(code) &#x21d2; <tt>Boolean</tt>
1138
+ .<strong>_update_touch_info</strong> &#x21d2; <tt>Object</tt>
779
1139
 
780
1140
 
781
1141
 
782
1142
 
783
1143
 
784
- </h3><div class="docstring">
785
- <div class="discussion">
786
-
787
- <p>Return true if the key is being pressed</p>
788
-
789
-
1144
+ </h3><table class="source_code">
1145
+ <tr>
1146
+ <td>
1147
+ <pre class="lines">
1148
+
1149
+
1150
+ 235
1151
+ 236
1152
+ 237
1153
+ 238</pre>
1154
+ </td>
1155
+ <td>
1156
+ <pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 235</span>
1157
+
1158
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid__update_touch_info'>_update_touch_info</span>
1159
+ <span class='comment'># Clear old data
1160
+ </span> <span class='cvar'>@@touches</span><span class='period'>.</span><span class='id identifier rubyid_delete_if'>delete_if</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_id'>id</span><span class='comma'>,</span> <span class='id identifier rubyid_t'>t</span><span class='op'>|</span> <span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid_released?'>released?</span> <span class='op'>&amp;&amp;</span> <span class='id identifier rubyid_t'>t</span><span class='period'>.</span><span class='id identifier rubyid__released_at'>_released_at</span> <span class='op'>&lt;</span> <span class='cvar'>@@tick</span><span class='op'>-</span><span class='int'>1</span><span class='rbrace'>}</span>
1161
+ <span class='kw'>end</span></pre>
1162
+ </td>
1163
+ </tr>
1164
+ </table>
1165
+ </div>
1166
+
1167
+ <div class="method_details ">
1168
+ <h3 class="signature " id="key_down?-class_method">
1169
+
1170
+ .<strong>key_down?</strong>(code) &#x21d2; <tt>Boolean</tt>
1171
+
1172
+
1173
+
1174
+
1175
+
1176
+ </h3><div class="docstring">
1177
+ <div class="discussion">
1178
+
1179
+ <p>Return true if the key is being pressed</p>
1180
+
1181
+
790
1182
  </div>
791
1183
  </div>
792
1184
  <div class="tags">
@@ -811,12 +1203,12 @@ canvas.</p>
811
1203
  <pre class="lines">
812
1204
 
813
1205
 
814
- 55
815
- 56
816
- 57</pre>
1206
+ 60
1207
+ 61
1208
+ 62</pre>
817
1209
  </td>
818
1210
  <td>
819
- <pre class="code"><span class="info file"># File 'opal/dxopal/input.rb', line 55</span>
1211
+ <pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 60</span>
820
1212
 
821
1213
  <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>
822
1214
  <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>
@@ -865,12 +1257,12 @@ canvas.</p>
865
1257
  <pre class="lines">
866
1258
 
867
1259
 
868
- 60
869
- 61
870
- 62</pre>
1260
+ 65
1261
+ 66
1262
+ 67</pre>
871
1263
  </td>
872
1264
  <td>
873
- <pre class="code"><span class="info file"># File 'opal/dxopal/input.rb', line 60</span>
1265
+ <pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 65</span>
874
1266
 
875
1267
  <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>
876
1268
  <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>
@@ -919,12 +1311,12 @@ canvas.</p>
919
1311
  <pre class="lines">
920
1312
 
921
1313
 
922
- 65
923
- 66
924
- 67</pre>
1314
+ 70
1315
+ 71
1316
+ 72</pre>
925
1317
  </td>
926
1318
  <td>
927
- <pre class="code"><span class="info file"># File 'opal/dxopal/input.rb', line 65</span>
1319
+ <pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 70</span>
928
1320
 
929
1321
  <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>
930
1322
  <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>
@@ -946,7 +1338,7 @@ canvas.</p>
946
1338
  </h3><div class="docstring">
947
1339
  <div class="discussion">
948
1340
 
949
- <p>Return DOM element set by `keyevent_target=`</p>
1341
+ <p>Return DOM element set by keyevent_target=`</p>
950
1342
 
951
1343
 
952
1344
  </div>
@@ -960,12 +1352,18 @@ canvas.</p>
960
1352
  <pre class="lines">
961
1353
 
962
1354
 
963
- 108</pre>
1355
+ 113
1356
+ 114
1357
+ 115
1358
+ 116</pre>
964
1359
  </td>
965
1360
  <td>
966
- <pre class="code"><span class="info file"># File 'opal/dxopal/input.rb', line 108</span>
1361
+ <pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 113</span>
967
1362
 
968
- <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_keyevent_target'>keyevent_target</span><span class='semicolon'>;</span> <span class='cvar'>@@keyevent_target</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
1363
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_keyevent_target'>keyevent_target</span>
1364
+ <span class='kw'>return</span> <span class='kw'>nil</span> <span class='kw'>unless</span> <span class='id identifier rubyid_class_variable_defined?'>class_variable_defined?</span><span class='lparen'>(</span><span class='symbol'>:@@keyevent_target</span><span class='rparen'>)</span>
1365
+ <span class='cvar'>@@keyevent_target</span>
1366
+ <span class='kw'>end</span></pre>
969
1367
  </td>
970
1368
  </tr>
971
1369
  </table>
@@ -985,9 +1383,7 @@ canvas.</p>
985
1383
 
986
1384
  <p>Set DOM element to receive keydown/keyup event</p>
987
1385
 
988
- <p>By default, `window` is set to this (i.e. all key events are stolen by
989
- DXOpal.) If canvas element is set to this, only key events happend on
990
- canvas are processed by DXOpal.</p>
1386
+ <p>By default, window` is set to this (i.e. all key events are stolen by DXOpal.) If canvas element is set to this, only key events happend on canvas are processed by DXOpal.</p>
991
1387
 
992
1388
 
993
1389
  </div>
@@ -1001,11 +1397,6 @@ canvas are processed by DXOpal.</p>
1001
1397
  <pre class="lines">
1002
1398
 
1003
1399
 
1004
- 90
1005
- 91
1006
- 92
1007
- 93
1008
- 94
1009
1400
  95
1010
1401
  96
1011
1402
  97
@@ -1016,13 +1407,18 @@ canvas are processed by DXOpal.</p>
1016
1407
  102
1017
1408
  103
1018
1409
  104
1019
- 105</pre>
1410
+ 105
1411
+ 106
1412
+ 107
1413
+ 108
1414
+ 109
1415
+ 110</pre>
1020
1416
  </td>
1021
1417
  <td>
1022
- <pre class="code"><span class="info file"># File 'opal/dxopal/input.rb', line 90</span>
1418
+ <pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 95</span>
1023
1419
 
1024
1420
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_keyevent_target='>keyevent_target=</span><span class='lparen'>(</span><span class='id identifier rubyid_target'>target</span><span class='rparen'>)</span>
1025
- <span class='kw'>if</span> <span class='cvar'>@@keyevent_target</span>
1421
+ <span class='kw'>if</span> <span class='id identifier rubyid_keyevent_target'>keyevent_target</span>
1026
1422
  <span class='backtick'>%x{</span><span class='tstring_content'>
1027
1423
  </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@keyevent_target</span><span class='embexpr_end'>}</span><span class='tstring_content'>.removeEventListener(&#39;keydown&#39;, </span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#ON_KEYDOWN_-constant" title="DXOpal::Input::ON_KEYDOWN_ (constant)">ON_KEYDOWN_</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>);
1028
1424
  </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@keyevent_target</span><span class='embexpr_end'>}</span><span class='tstring_content'>.removeEventListener(&#39;keyup&#39;, </span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#ON_KEYUP_-constant" title="DXOpal::Input::ON_KEYUP_ (constant)">ON_KEYUP_</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>);
@@ -1081,14 +1477,16 @@ canvas are processed by DXOpal.</p>
1081
1477
  <pre class="lines">
1082
1478
 
1083
1479
 
1084
- 156
1085
- 157
1086
- 158</pre>
1480
+ 166
1481
+ 167
1482
+ 168
1483
+ 169</pre>
1087
1484
  </td>
1088
1485
  <td>
1089
- <pre class="code"><span class="info file"># File 'opal/dxopal/input.rb', line 156</span>
1486
+ <pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 166</span>
1090
1487
 
1091
1488
  <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>
1489
+ <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>missing argument of `mouse_down?&#39;</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_mouse_code'>mouse_code</span>
1092
1490
  <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>
1093
1491
  <span class='kw'>end</span></pre>
1094
1492
  </td>
@@ -1135,14 +1533,16 @@ canvas are processed by DXOpal.</p>
1135
1533
  <pre class="lines">
1136
1534
 
1137
1535
 
1138
- 161
1139
- 162
1140
- 163</pre>
1536
+ 172
1537
+ 173
1538
+ 174
1539
+ 175</pre>
1141
1540
  </td>
1142
1541
  <td>
1143
- <pre class="code"><span class="info file"># File 'opal/dxopal/input.rb', line 161</span>
1542
+ <pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 172</span>
1144
1543
 
1145
1544
  <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>
1545
+ <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>missing argument of `mouse_push?&#39;</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_mouse_code'>mouse_code</span>
1146
1546
  <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>
1147
1547
  <span class='kw'>end</span></pre>
1148
1548
  </td>
@@ -1189,14 +1589,16 @@ canvas are processed by DXOpal.</p>
1189
1589
  <pre class="lines">
1190
1590
 
1191
1591
 
1192
- 166
1193
- 167
1194
- 168</pre>
1592
+ 178
1593
+ 179
1594
+ 180
1595
+ 181</pre>
1195
1596
  </td>
1196
1597
  <td>
1197
- <pre class="code"><span class="info file"># File 'opal/dxopal/input.rb', line 166</span>
1598
+ <pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 178</span>
1198
1599
 
1199
1600
  <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>
1601
+ <span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>missing argument of `mouse_release?&#39;</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_mouse_code'>mouse_code</span>
1200
1602
  <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>
1201
1603
  <span class='kw'>end</span></pre>
1202
1604
  </td>
@@ -1234,12 +1636,12 @@ canvas are processed by DXOpal.</p>
1234
1636
  <pre class="lines">
1235
1637
 
1236
1638
 
1237
- 144
1238
- 145
1239
- 146</pre>
1639
+ 154
1640
+ 155
1641
+ 156</pre>
1240
1642
  </td>
1241
1643
  <td>
1242
- <pre class="code"><span class="info file"># File 'opal/dxopal/input.rb', line 144</span>
1644
+ <pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 154</span>
1243
1645
 
1244
1646
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_mouse_x'>mouse_x</span>
1245
1647
  <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>
@@ -1268,12 +1670,12 @@ canvas are processed by DXOpal.</p>
1268
1670
  <pre class="lines">
1269
1671
 
1270
1672
 
1271
- 147
1272
- 148
1273
- 149</pre>
1673
+ 157
1674
+ 158
1675
+ 159</pre>
1274
1676
  </td>
1275
1677
  <td>
1276
- <pre class="code"><span class="info file"># File 'opal/dxopal/input.rb', line 147</span>
1678
+ <pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 157</span>
1277
1679
 
1278
1680
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_mouse_y'>mouse_y</span>
1279
1681
  <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>
@@ -1281,6 +1683,333 @@ canvas are processed by DXOpal.</p>
1281
1683
  </td>
1282
1684
  </tr>
1283
1685
  </table>
1686
+ </div>
1687
+
1688
+ <div class="method_details ">
1689
+ <h3 class="signature " id="new_touches-class_method">
1690
+
1691
+ .<strong>new_touches</strong> &#x21d2; <tt>Object</tt>
1692
+
1693
+
1694
+
1695
+
1696
+
1697
+ </h3><div class="docstring">
1698
+ <div class="discussion">
1699
+
1700
+ <p>Returns newly created touches</p>
1701
+
1702
+
1703
+ </div>
1704
+ </div>
1705
+ <div class="tags">
1706
+
1707
+
1708
+ </div><table class="source_code">
1709
+ <tr>
1710
+ <td>
1711
+ <pre class="lines">
1712
+
1713
+
1714
+ 312
1715
+ 313
1716
+ 314
1717
+ 315
1718
+ 316</pre>
1719
+ </td>
1720
+ <td>
1721
+ <pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 312</span>
1722
+
1723
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_new_touches'>new_touches</span>
1724
+ <span class='id identifier rubyid_ret'>ret</span> <span class='op'>=</span> <span class='cvar'>@@new_touches</span>
1725
+ <span class='cvar'>@@new_touches</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
1726
+ <span class='id identifier rubyid_ret'>ret</span>
1727
+ <span class='kw'>end</span></pre>
1728
+ </td>
1729
+ </tr>
1730
+ </table>
1731
+ </div>
1732
+
1733
+ <div class="method_details ">
1734
+ <h3 class="signature " id="touch_down?-class_method">
1735
+
1736
+ .<strong>touch_down?</strong> &#x21d2; <tt>Boolean</tt>
1737
+
1738
+
1739
+
1740
+
1741
+
1742
+ </h3><div class="docstring">
1743
+ <div class="discussion">
1744
+
1745
+ <p>Return true if the touch is being pressed</p>
1746
+
1747
+
1748
+ </div>
1749
+ </div>
1750
+ <div class="tags">
1751
+
1752
+ <p class="tag_title">Returns:</p>
1753
+ <ul class="return">
1754
+
1755
+ <li>
1756
+
1757
+
1758
+ <span class='type'>(<tt>Boolean</tt>)</span>
1759
+
1760
+
1761
+
1762
+ </li>
1763
+
1764
+ </ul>
1765
+
1766
+ </div><table class="source_code">
1767
+ <tr>
1768
+ <td>
1769
+ <pre class="lines">
1770
+
1771
+
1772
+ 258
1773
+ 259
1774
+ 260</pre>
1775
+ </td>
1776
+ <td>
1777
+ <pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 258</span>
1778
+
1779
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_touch_down?'>touch_down?</span>
1780
+ <span class='kw'>return</span> <span class='backtick'>`</span><span class='embexpr_beg'>#{</span><span class='cvar'>@@pressing_touch</span><span class='embexpr_end'>}</span><span class='tstring_content'>[0] &gt; 0</span><span class='tstring_end'>`</span></span>
1781
+ <span class='kw'>end</span></pre>
1782
+ </td>
1783
+ </tr>
1784
+ </table>
1785
+ </div>
1786
+
1787
+ <div class="method_details ">
1788
+ <h3 class="signature " id="touch_push?-class_method">
1789
+
1790
+ .<strong>touch_push?</strong> &#x21d2; <tt>Boolean</tt>
1791
+
1792
+
1793
+
1794
+
1795
+
1796
+ </h3><div class="docstring">
1797
+ <div class="discussion">
1798
+
1799
+ <p>Return true if the touch is pressed in the last tick</p>
1800
+
1801
+
1802
+ </div>
1803
+ </div>
1804
+ <div class="tags">
1805
+
1806
+ <p class="tag_title">Returns:</p>
1807
+ <ul class="return">
1808
+
1809
+ <li>
1810
+
1811
+
1812
+ <span class='type'>(<tt>Boolean</tt>)</span>
1813
+
1814
+
1815
+
1816
+ </li>
1817
+
1818
+ </ul>
1819
+
1820
+ </div><table class="source_code">
1821
+ <tr>
1822
+ <td>
1823
+ <pre class="lines">
1824
+
1825
+
1826
+ 263
1827
+ 264
1828
+ 265</pre>
1829
+ </td>
1830
+ <td>
1831
+ <pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 263</span>
1832
+
1833
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_touch_push?'>touch_push?</span>
1834
+ <span class='kw'>return</span> <span class='backtick'>`</span><span class='embexpr_beg'>#{</span><span class='cvar'>@@pressing_touch</span><span class='embexpr_end'>}</span><span class='tstring_content'>[0] == -(</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>
1835
+ <span class='kw'>end</span></pre>
1836
+ </td>
1837
+ </tr>
1838
+ </table>
1839
+ </div>
1840
+
1841
+ <div class="method_details ">
1842
+ <h3 class="signature " id="touch_release?-class_method">
1843
+
1844
+ .<strong>touch_release?</strong> &#x21d2; <tt>Boolean</tt>
1845
+
1846
+
1847
+
1848
+
1849
+
1850
+ </h3><div class="docstring">
1851
+ <div class="discussion">
1852
+
1853
+ <p>Return true if the touch is released in the last tick</p>
1854
+
1855
+
1856
+ </div>
1857
+ </div>
1858
+ <div class="tags">
1859
+
1860
+ <p class="tag_title">Returns:</p>
1861
+ <ul class="return">
1862
+
1863
+ <li>
1864
+
1865
+
1866
+ <span class='type'>(<tt>Boolean</tt>)</span>
1867
+
1868
+
1869
+
1870
+ </li>
1871
+
1872
+ </ul>
1873
+
1874
+ </div><table class="source_code">
1875
+ <tr>
1876
+ <td>
1877
+ <pre class="lines">
1878
+
1879
+
1880
+ 268
1881
+ 269
1882
+ 270</pre>
1883
+ </td>
1884
+ <td>
1885
+ <pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 268</span>
1886
+
1887
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_touch_release?'>touch_release?</span>
1888
+ <span class='kw'>return</span> <span class='backtick'>`</span><span class='embexpr_beg'>#{</span><span class='cvar'>@@pressing_touch</span><span class='embexpr_end'>}</span><span class='tstring_content'>[0] == -(</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>
1889
+ <span class='kw'>end</span></pre>
1890
+ </td>
1891
+ </tr>
1892
+ </table>
1893
+ </div>
1894
+
1895
+ <div class="method_details ">
1896
+ <h3 class="signature " id="touch_x-class_method">
1897
+
1898
+ .<strong>touch_x</strong> &#x21d2; <tt>Object</tt>
1899
+
1900
+
1901
+
1902
+ <span class="aliases">Also known as:
1903
+ <span class="names"><span id='touch_pos_x-class_method'>touch_pos_x</span></span>
1904
+ </span>
1905
+
1906
+
1907
+
1908
+ </h3><div class="docstring">
1909
+ <div class="discussion">
1910
+
1911
+ <p>Return position of touch (0, 0) is the top-left corner of the canvas</p>
1912
+
1913
+
1914
+ </div>
1915
+ </div>
1916
+ <div class="tags">
1917
+
1918
+
1919
+ </div><table class="source_code">
1920
+ <tr>
1921
+ <td>
1922
+ <pre class="lines">
1923
+
1924
+
1925
+ 246
1926
+ 247
1927
+ 248</pre>
1928
+ </td>
1929
+ <td>
1930
+ <pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 246</span>
1931
+
1932
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_touch_x'>touch_x</span>
1933
+ <span class='kw'>return</span> <span class='backtick'>`</span><span class='embexpr_beg'>#{</span><span class='cvar'>@@touch_info</span><span class='embexpr_end'>}</span><span class='tstring_content'>.x</span><span class='tstring_end'>`</span></span>
1934
+ <span class='kw'>end</span></pre>
1935
+ </td>
1936
+ </tr>
1937
+ </table>
1938
+ </div>
1939
+
1940
+ <div class="method_details ">
1941
+ <h3 class="signature " id="touch_y-class_method">
1942
+
1943
+ .<strong>touch_y</strong> &#x21d2; <tt>Object</tt>
1944
+
1945
+
1946
+
1947
+ <span class="aliases">Also known as:
1948
+ <span class="names"><span id='touch_pos_y-class_method'>touch_pos_y</span></span>
1949
+ </span>
1950
+
1951
+
1952
+
1953
+ </h3><table class="source_code">
1954
+ <tr>
1955
+ <td>
1956
+ <pre class="lines">
1957
+
1958
+
1959
+ 249
1960
+ 250
1961
+ 251</pre>
1962
+ </td>
1963
+ <td>
1964
+ <pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 249</span>
1965
+
1966
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_touch_y'>touch_y</span>
1967
+ <span class='kw'>return</span> <span class='backtick'>`</span><span class='embexpr_beg'>#{</span><span class='cvar'>@@touch_info</span><span class='embexpr_end'>}</span><span class='tstring_content'>.y</span><span class='tstring_end'>`</span></span>
1968
+ <span class='kw'>end</span></pre>
1969
+ </td>
1970
+ </tr>
1971
+ </table>
1972
+ </div>
1973
+
1974
+ <div class="method_details ">
1975
+ <h3 class="signature " id="touches-class_method">
1976
+
1977
+ .<strong>touches</strong> &#x21d2; <tt>Object</tt>
1978
+
1979
+
1980
+
1981
+
1982
+
1983
+ </h3><div class="docstring">
1984
+ <div class="discussion">
1985
+
1986
+ <p>Returns current touches as an array of Input::Touch</p>
1987
+
1988
+
1989
+ </div>
1990
+ </div>
1991
+ <div class="tags">
1992
+
1993
+
1994
+ </div><table class="source_code">
1995
+ <tr>
1996
+ <td>
1997
+ <pre class="lines">
1998
+
1999
+
2000
+ 307
2001
+ 308
2002
+ 309</pre>
2003
+ </td>
2004
+ <td>
2005
+ <pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 307</span>
2006
+
2007
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_touches'>touches</span>
2008
+ <span class='cvar'>@@touches</span><span class='period'>.</span><span class='id identifier rubyid_values'>values</span>
2009
+ <span class='kw'>end</span></pre>
2010
+ </td>
2011
+ </tr>
2012
+ </table>
1284
2013
  </div>
1285
2014
 
1286
2015
  <div class="method_details ">
@@ -1295,7 +2024,7 @@ canvas are processed by DXOpal.</p>
1295
2024
  </h3><div class="docstring">
1296
2025
  <div class="discussion">
1297
2026
 
1298
- <p>Return 1 if &#39;right&#39;, -1 if &#39;left&#39;</p>
2027
+ <p>Return 1 if right’, -1 if left’</p>
1299
2028
 
1300
2029
 
1301
2030
  </div>
@@ -1309,15 +2038,15 @@ canvas are processed by DXOpal.</p>
1309
2038
  <pre class="lines">
1310
2039
 
1311
2040
 
1312
- 35
1313
- 36
1314
- 37
1315
- 38
1316
- 39
1317
- 40</pre>
2041
+ 40
2042
+ 41
2043
+ 42
2044
+ 43
2045
+ 44
2046
+ 45</pre>
1318
2047
  </td>
1319
2048
  <td>
1320
- <pre class="code"><span class="info file"># File 'opal/dxopal/input.rb', line 35</span>
2049
+ <pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 40</span>
1321
2050
 
1322
2051
  <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>
1323
2052
  <span class='id identifier rubyid_ret'>ret</span> <span class='op'>=</span> <span class='int'>0</span>
@@ -1342,7 +2071,7 @@ canvas are processed by DXOpal.</p>
1342
2071
  </h3><div class="docstring">
1343
2072
  <div class="discussion">
1344
2073
 
1345
- <p>Return 1 if &#39;down&#39;, -1 if &#39;up&#39;</p>
2074
+ <p>Return 1 if down’, -1 if up’</p>
1346
2075
 
1347
2076
 
1348
2077
  </div>
@@ -1356,15 +2085,15 @@ canvas are processed by DXOpal.</p>
1356
2085
  <pre class="lines">
1357
2086
 
1358
2087
 
1359
- 43
1360
- 44
1361
- 45
1362
- 46
1363
- 47
1364
- 48</pre>
2088
+ 48
2089
+ 49
2090
+ 50
2091
+ 51
2092
+ 52
2093
+ 53</pre>
1365
2094
  </td>
1366
2095
  <td>
1367
- <pre class="code"><span class="info file"># File 'opal/dxopal/input.rb', line 43</span>
2096
+ <pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 48</span>
1368
2097
 
1369
2098
  <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>
1370
2099
  <span class='id identifier rubyid_ret'>ret</span> <span class='op'>=</span> <span class='int'>0</span>
@@ -1382,9 +2111,9 @@ canvas are processed by DXOpal.</p>
1382
2111
  </div>
1383
2112
 
1384
2113
  <div id="footer">
1385
- Generated on Sat Sep 29 15:56:47 2018 by
1386
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1387
- 0.9.16 (ruby-2.5.1).
2114
+ Generated on Tue Jul 9 22:42:33 2024 by
2115
+ <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
2116
+ 0.9.36 (ruby-3.2.2).
1388
2117
  </div>
1389
2118
 
1390
2119
  </div>