dxopal 1.5.1 → 1.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile +2 -1
- data/Gemfile.lock +20 -20
- data/README.md +3 -3
- data/Rakefile +2 -14
- data/build/dxopal.js +26114 -18554
- data/build/dxopal.min.js +1 -1
- data/doc/api/DXOpal.html +10 -10
- data/doc/api/DXOpal/Constants.html +115 -0
- data/doc/api/DXOpal/Constants/Colors.html +172 -0
- data/doc/api/DXOpal/Font.html +71 -17
- data/doc/api/DXOpal/Image.html +891 -398
- data/doc/api/DXOpal/Input.html +814 -91
- data/doc/api/DXOpal/Input/KeyCodes.html +986 -0
- data/doc/api/DXOpal/Input/MouseCodes.html +7 -7
- data/doc/api/DXOpal/Input/Touch.html +834 -0
- data/doc/api/DXOpal/RemoteResource.html +16 -18
- data/doc/api/DXOpal/Sound.html +15 -15
- data/doc/api/DXOpal/SoundEffect.html +11 -13
- data/doc/api/DXOpal/SoundEffect/WaveTypes.html +7 -7
- data/doc/api/DXOpal/Sprite.html +517 -40
- data/doc/api/DXOpal/Sprite/CollisionArea.html +126 -0
- data/doc/api/DXOpal/Sprite/CollisionArea/Base.html +649 -0
- data/doc/api/DXOpal/Sprite/CollisionArea/Circle.html +656 -0
- data/doc/api/DXOpal/Sprite/CollisionArea/Point.html +448 -0
- data/doc/api/DXOpal/Sprite/CollisionArea/Rect.html +549 -0
- data/doc/api/DXOpal/Sprite/CollisionArea/Triangle.html +423 -0
- data/doc/api/DXOpal/Sprite/CollisionCheck.html +926 -0
- data/doc/api/DXOpal/Sprite/CollisionCheck/ClassMethods.html +268 -0
- data/doc/api/DXOpal/Sprite/Physics.html +426 -0
- data/doc/api/DXOpal/Window.html +235 -152
- data/doc/api/Kernel.html +131 -0
- data/doc/api/_index.html +276 -4
- data/doc/api/class_list.html +1 -1
- data/doc/api/css/style.css +1 -0
- data/doc/api/file.README.html +6 -8
- data/doc/api/frames.html +1 -1
- data/doc/api/index.html +6 -8
- data/doc/api/method_list.html +1600 -0
- data/doc/api/top-level-namespace.html +154 -3
- data/lib/dxopal/input.rb +4 -2
- data/lib/dxopal/version.rb +1 -1
- metadata +21 -8
data/doc/api/DXOpal/Input.html
CHANGED
@@ -6,15 +6,15 @@
|
|
6
6
|
<title>
|
7
7
|
Module: DXOpal::Input
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.26
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
13
|
-
<link rel="stylesheet" href="../css/style.css" type="text/css"
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
14
14
|
|
15
|
-
<link rel="stylesheet" href="../css/common.css" type="text/css"
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
16
16
|
|
17
|
-
<script type="text/javascript"
|
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>
|
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> ⇒ 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> ⇒ 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>
|
@@ -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> ⇒ 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> ⇒ 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> ⇒ 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> ⇒ 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> ⇒ 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> ⇒ 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> ⇒ 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
|
|
@@ -595,22 +814,30 @@ canvas.</p>
|
|
595
814
|
24
|
596
815
|
25
|
597
816
|
26
|
598
|
-
27
|
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 '
|
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,11 +871,6 @@ canvas.</p>
|
|
644
871
|
<pre class="lines">
|
645
872
|
|
646
873
|
|
647
|
-
115
|
648
|
-
116
|
649
|
-
117
|
650
|
-
118
|
651
|
-
119
|
652
874
|
120
|
653
875
|
121
|
654
876
|
122
|
@@ -669,10 +891,17 @@ canvas.</p>
|
|
669
891
|
137
|
670
892
|
138
|
671
893
|
139
|
672
|
-
140
|
894
|
+
140
|
895
|
+
141
|
896
|
+
142
|
897
|
+
143
|
898
|
+
144
|
899
|
+
145
|
900
|
+
146
|
901
|
+
147</pre>
|
673
902
|
</td>
|
674
903
|
<td>
|
675
|
-
<pre class="code"><span class="info file"># File '
|
904
|
+
<pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 120</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('mouseup', 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 => ev.buttons
|
925
|
+
table = { 0: 1, 1: 4, 2: 2, 3: 8, 4: 16 };
|
695
926
|
for (var k=1; k<=16; k<<=1) {
|
696
|
-
if (
|
697
|
-
</span><span class='embexpr_beg'>#{</span><span class='cvar'>@@pressing_mouse_buttons</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> ⇒ <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
|
+
185
|
966
|
+
186
|
967
|
+
187
|
968
|
+
188
|
969
|
+
189
|
970
|
+
190
|
971
|
+
191
|
972
|
+
192
|
973
|
+
193
|
974
|
+
194
|
975
|
+
195
|
976
|
+
196
|
977
|
+
197
|
978
|
+
198
|
979
|
+
199
|
980
|
+
200
|
981
|
+
201
|
982
|
+
202
|
983
|
+
203
|
984
|
+
204
|
985
|
+
205
|
986
|
+
206
|
987
|
+
207
|
988
|
+
208
|
989
|
+
209
|
990
|
+
210
|
991
|
+
211
|
992
|
+
212
|
993
|
+
213
|
994
|
+
214
|
995
|
+
215
|
996
|
+
216
|
997
|
+
217
|
998
|
+
218
|
999
|
+
219
|
1000
|
+
220
|
1001
|
+
221
|
1002
|
+
222
|
1003
|
+
223
|
1004
|
+
224
|
1005
|
+
225
|
1006
|
+
226
|
1007
|
+
227
|
1008
|
+
228
|
1009
|
+
229
|
1010
|
+
230</pre>
|
1011
|
+
</td>
|
1012
|
+
<td>
|
1013
|
+
<pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 185</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('touchmove', 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'>&.</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('touchstart', 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('touchend', 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'>&.</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
|
-
|
735
|
-
|
736
|
-
|
1092
|
+
34
|
1093
|
+
35
|
1094
|
+
36
|
1095
|
+
37</pre>
|
737
1096
|
</td>
|
738
1097
|
<td>
|
739
|
-
<pre class="code"><span class="info file"># File '
|
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 '
|
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,21 +1133,53 @@ canvas.</p>
|
|
773
1133
|
</div>
|
774
1134
|
|
775
1135
|
<div class="method_details ">
|
776
|
-
<h3 class="signature " id="
|
1136
|
+
<h3 class="signature " id="_update_touch_info-class_method">
|
777
1137
|
|
778
|
-
.<strong>
|
1138
|
+
.<strong>_update_touch_info</strong> ⇒ <tt>Object</tt>
|
779
1139
|
|
780
1140
|
|
781
1141
|
|
782
1142
|
|
783
1143
|
|
784
|
-
</h3><
|
785
|
-
<
|
786
|
-
|
787
|
-
<
|
1144
|
+
</h3><table class="source_code">
|
1145
|
+
<tr>
|
1146
|
+
<td>
|
1147
|
+
<pre class="lines">
|
788
1148
|
|
789
1149
|
|
790
|
-
|
1150
|
+
232
|
1151
|
+
233
|
1152
|
+
234
|
1153
|
+
235</pre>
|
1154
|
+
</td>
|
1155
|
+
<td>
|
1156
|
+
<pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 232</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'>&&</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'><</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) ⇒ <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
|
+
|
1182
|
+
</div>
|
791
1183
|
</div>
|
792
1184
|
<div class="tags">
|
793
1185
|
|
@@ -811,12 +1203,12 @@ canvas.</p>
|
|
811
1203
|
<pre class="lines">
|
812
1204
|
|
813
1205
|
|
814
|
-
|
815
|
-
|
816
|
-
|
1206
|
+
60
|
1207
|
+
61
|
1208
|
+
62</pre>
|
817
1209
|
</td>
|
818
1210
|
<td>
|
819
|
-
<pre class="code"><span class="info file"># File '
|
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] > 0</span><span class='tstring_end'>`</span></span>
|
@@ -865,12 +1257,12 @@ canvas.</p>
|
|
865
1257
|
<pre class="lines">
|
866
1258
|
|
867
1259
|
|
868
|
-
|
869
|
-
|
870
|
-
|
1260
|
+
65
|
1261
|
+
66
|
1262
|
+
67</pre>
|
871
1263
|
</td>
|
872
1264
|
<td>
|
873
|
-
<pre class="code"><span class="info file"># File '
|
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
|
-
|
923
|
-
|
924
|
-
|
1314
|
+
70
|
1315
|
+
71
|
1316
|
+
72</pre>
|
925
1317
|
</td>
|
926
1318
|
<td>
|
927
|
-
<pre class="code"><span class="info file"># File '
|
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>
|
@@ -960,10 +1352,10 @@ canvas.</p>
|
|
960
1352
|
<pre class="lines">
|
961
1353
|
|
962
1354
|
|
963
|
-
|
1355
|
+
113</pre>
|
964
1356
|
</td>
|
965
1357
|
<td>
|
966
|
-
<pre class="code"><span class="info file"># File '
|
1358
|
+
<pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 113</span>
|
967
1359
|
|
968
1360
|
<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>
|
969
1361
|
</td>
|
@@ -985,9 +1377,7 @@ canvas.</p>
|
|
985
1377
|
|
986
1378
|
<p>Set DOM element to receive keydown/keyup event</p>
|
987
1379
|
|
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>
|
1380
|
+
<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
1381
|
|
992
1382
|
|
993
1383
|
</div>
|
@@ -1001,11 +1391,6 @@ canvas are processed by DXOpal.</p>
|
|
1001
1391
|
<pre class="lines">
|
1002
1392
|
|
1003
1393
|
|
1004
|
-
90
|
1005
|
-
91
|
1006
|
-
92
|
1007
|
-
93
|
1008
|
-
94
|
1009
1394
|
95
|
1010
1395
|
96
|
1011
1396
|
97
|
@@ -1016,10 +1401,15 @@ canvas are processed by DXOpal.</p>
|
|
1016
1401
|
102
|
1017
1402
|
103
|
1018
1403
|
104
|
1019
|
-
105
|
1404
|
+
105
|
1405
|
+
106
|
1406
|
+
107
|
1407
|
+
108
|
1408
|
+
109
|
1409
|
+
110</pre>
|
1020
1410
|
</td>
|
1021
1411
|
<td>
|
1022
|
-
<pre class="code"><span class="info file"># File '
|
1412
|
+
<pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 95</span>
|
1023
1413
|
|
1024
1414
|
<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
1415
|
<span class='kw'>if</span> <span class='cvar'>@@keyevent_target</span>
|
@@ -1081,14 +1471,16 @@ canvas are processed by DXOpal.</p>
|
|
1081
1471
|
<pre class="lines">
|
1082
1472
|
|
1083
1473
|
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1474
|
+
163
|
1475
|
+
164
|
1476
|
+
165
|
1477
|
+
166</pre>
|
1087
1478
|
</td>
|
1088
1479
|
<td>
|
1089
|
-
<pre class="code"><span class="info file"># File '
|
1480
|
+
<pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 163</span>
|
1090
1481
|
|
1091
1482
|
<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>
|
1483
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>missing argument of `mouse_down?'</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_mouse_code'>mouse_code</span>
|
1092
1484
|
<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] > 0</span><span class='tstring_end'>`</span></span>
|
1093
1485
|
<span class='kw'>end</span></pre>
|
1094
1486
|
</td>
|
@@ -1135,14 +1527,16 @@ canvas are processed by DXOpal.</p>
|
|
1135
1527
|
<pre class="lines">
|
1136
1528
|
|
1137
1529
|
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1530
|
+
169
|
1531
|
+
170
|
1532
|
+
171
|
1533
|
+
172</pre>
|
1141
1534
|
</td>
|
1142
1535
|
<td>
|
1143
|
-
<pre class="code"><span class="info file"># File '
|
1536
|
+
<pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 169</span>
|
1144
1537
|
|
1145
1538
|
<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>
|
1539
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>missing argument of `mouse_push?'</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_mouse_code'>mouse_code</span>
|
1146
1540
|
<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
1541
|
<span class='kw'>end</span></pre>
|
1148
1542
|
</td>
|
@@ -1189,14 +1583,16 @@ canvas are processed by DXOpal.</p>
|
|
1189
1583
|
<pre class="lines">
|
1190
1584
|
|
1191
1585
|
|
1192
|
-
|
1193
|
-
|
1194
|
-
|
1586
|
+
175
|
1587
|
+
176
|
1588
|
+
177
|
1589
|
+
178</pre>
|
1195
1590
|
</td>
|
1196
1591
|
<td>
|
1197
|
-
<pre class="code"><span class="info file"># File '
|
1592
|
+
<pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 175</span>
|
1198
1593
|
|
1199
1594
|
<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>
|
1595
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>missing argument of `mouse_release?'</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='id identifier rubyid_mouse_code'>mouse_code</span>
|
1200
1596
|
<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
1597
|
<span class='kw'>end</span></pre>
|
1202
1598
|
</td>
|
@@ -1234,12 +1630,12 @@ canvas are processed by DXOpal.</p>
|
|
1234
1630
|
<pre class="lines">
|
1235
1631
|
|
1236
1632
|
|
1237
|
-
|
1238
|
-
|
1239
|
-
|
1633
|
+
151
|
1634
|
+
152
|
1635
|
+
153</pre>
|
1240
1636
|
</td>
|
1241
1637
|
<td>
|
1242
|
-
<pre class="code"><span class="info file"># File '
|
1638
|
+
<pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 151</span>
|
1243
1639
|
|
1244
1640
|
<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
1641
|
<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 +1664,12 @@ canvas are processed by DXOpal.</p>
|
|
1268
1664
|
<pre class="lines">
|
1269
1665
|
|
1270
1666
|
|
1271
|
-
|
1272
|
-
|
1273
|
-
|
1667
|
+
154
|
1668
|
+
155
|
1669
|
+
156</pre>
|
1274
1670
|
</td>
|
1275
1671
|
<td>
|
1276
|
-
<pre class="code"><span class="info file"># File '
|
1672
|
+
<pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 154</span>
|
1277
1673
|
|
1278
1674
|
<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
1675
|
<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 +1677,333 @@ canvas are processed by DXOpal.</p>
|
|
1281
1677
|
</td>
|
1282
1678
|
</tr>
|
1283
1679
|
</table>
|
1680
|
+
</div>
|
1681
|
+
|
1682
|
+
<div class="method_details ">
|
1683
|
+
<h3 class="signature " id="new_touches-class_method">
|
1684
|
+
|
1685
|
+
.<strong>new_touches</strong> ⇒ <tt>Object</tt>
|
1686
|
+
|
1687
|
+
|
1688
|
+
|
1689
|
+
|
1690
|
+
|
1691
|
+
</h3><div class="docstring">
|
1692
|
+
<div class="discussion">
|
1693
|
+
|
1694
|
+
<p>Returns newly created touches</p>
|
1695
|
+
|
1696
|
+
|
1697
|
+
</div>
|
1698
|
+
</div>
|
1699
|
+
<div class="tags">
|
1700
|
+
|
1701
|
+
|
1702
|
+
</div><table class="source_code">
|
1703
|
+
<tr>
|
1704
|
+
<td>
|
1705
|
+
<pre class="lines">
|
1706
|
+
|
1707
|
+
|
1708
|
+
309
|
1709
|
+
310
|
1710
|
+
311
|
1711
|
+
312
|
1712
|
+
313</pre>
|
1713
|
+
</td>
|
1714
|
+
<td>
|
1715
|
+
<pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 309</span>
|
1716
|
+
|
1717
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_new_touches'>new_touches</span>
|
1718
|
+
<span class='id identifier rubyid_ret'>ret</span> <span class='op'>=</span> <span class='cvar'>@@new_touches</span>
|
1719
|
+
<span class='cvar'>@@new_touches</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
1720
|
+
<span class='id identifier rubyid_ret'>ret</span>
|
1721
|
+
<span class='kw'>end</span></pre>
|
1722
|
+
</td>
|
1723
|
+
</tr>
|
1724
|
+
</table>
|
1725
|
+
</div>
|
1726
|
+
|
1727
|
+
<div class="method_details ">
|
1728
|
+
<h3 class="signature " id="touch_down?-class_method">
|
1729
|
+
|
1730
|
+
.<strong>touch_down?</strong> ⇒ <tt>Boolean</tt>
|
1731
|
+
|
1732
|
+
|
1733
|
+
|
1734
|
+
|
1735
|
+
|
1736
|
+
</h3><div class="docstring">
|
1737
|
+
<div class="discussion">
|
1738
|
+
|
1739
|
+
<p>Return true if the touch is being pressed</p>
|
1740
|
+
|
1741
|
+
|
1742
|
+
</div>
|
1743
|
+
</div>
|
1744
|
+
<div class="tags">
|
1745
|
+
|
1746
|
+
<p class="tag_title">Returns:</p>
|
1747
|
+
<ul class="return">
|
1748
|
+
|
1749
|
+
<li>
|
1750
|
+
|
1751
|
+
|
1752
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
1753
|
+
|
1754
|
+
|
1755
|
+
|
1756
|
+
</li>
|
1757
|
+
|
1758
|
+
</ul>
|
1759
|
+
|
1760
|
+
</div><table class="source_code">
|
1761
|
+
<tr>
|
1762
|
+
<td>
|
1763
|
+
<pre class="lines">
|
1764
|
+
|
1765
|
+
|
1766
|
+
255
|
1767
|
+
256
|
1768
|
+
257</pre>
|
1769
|
+
</td>
|
1770
|
+
<td>
|
1771
|
+
<pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 255</span>
|
1772
|
+
|
1773
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_touch_down?'>touch_down?</span>
|
1774
|
+
<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] > 0</span><span class='tstring_end'>`</span></span>
|
1775
|
+
<span class='kw'>end</span></pre>
|
1776
|
+
</td>
|
1777
|
+
</tr>
|
1778
|
+
</table>
|
1779
|
+
</div>
|
1780
|
+
|
1781
|
+
<div class="method_details ">
|
1782
|
+
<h3 class="signature " id="touch_push?-class_method">
|
1783
|
+
|
1784
|
+
.<strong>touch_push?</strong> ⇒ <tt>Boolean</tt>
|
1785
|
+
|
1786
|
+
|
1787
|
+
|
1788
|
+
|
1789
|
+
|
1790
|
+
</h3><div class="docstring">
|
1791
|
+
<div class="discussion">
|
1792
|
+
|
1793
|
+
<p>Return true if the touch is pressed in the last tick</p>
|
1794
|
+
|
1795
|
+
|
1796
|
+
</div>
|
1797
|
+
</div>
|
1798
|
+
<div class="tags">
|
1799
|
+
|
1800
|
+
<p class="tag_title">Returns:</p>
|
1801
|
+
<ul class="return">
|
1802
|
+
|
1803
|
+
<li>
|
1804
|
+
|
1805
|
+
|
1806
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
1807
|
+
|
1808
|
+
|
1809
|
+
|
1810
|
+
</li>
|
1811
|
+
|
1812
|
+
</ul>
|
1813
|
+
|
1814
|
+
</div><table class="source_code">
|
1815
|
+
<tr>
|
1816
|
+
<td>
|
1817
|
+
<pre class="lines">
|
1818
|
+
|
1819
|
+
|
1820
|
+
260
|
1821
|
+
261
|
1822
|
+
262</pre>
|
1823
|
+
</td>
|
1824
|
+
<td>
|
1825
|
+
<pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 260</span>
|
1826
|
+
|
1827
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_touch_push?'>touch_push?</span>
|
1828
|
+
<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>
|
1829
|
+
<span class='kw'>end</span></pre>
|
1830
|
+
</td>
|
1831
|
+
</tr>
|
1832
|
+
</table>
|
1833
|
+
</div>
|
1834
|
+
|
1835
|
+
<div class="method_details ">
|
1836
|
+
<h3 class="signature " id="touch_release?-class_method">
|
1837
|
+
|
1838
|
+
.<strong>touch_release?</strong> ⇒ <tt>Boolean</tt>
|
1839
|
+
|
1840
|
+
|
1841
|
+
|
1842
|
+
|
1843
|
+
|
1844
|
+
</h3><div class="docstring">
|
1845
|
+
<div class="discussion">
|
1846
|
+
|
1847
|
+
<p>Return true if the touch is released in the last tick</p>
|
1848
|
+
|
1849
|
+
|
1850
|
+
</div>
|
1851
|
+
</div>
|
1852
|
+
<div class="tags">
|
1853
|
+
|
1854
|
+
<p class="tag_title">Returns:</p>
|
1855
|
+
<ul class="return">
|
1856
|
+
|
1857
|
+
<li>
|
1858
|
+
|
1859
|
+
|
1860
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
1861
|
+
|
1862
|
+
|
1863
|
+
|
1864
|
+
</li>
|
1865
|
+
|
1866
|
+
</ul>
|
1867
|
+
|
1868
|
+
</div><table class="source_code">
|
1869
|
+
<tr>
|
1870
|
+
<td>
|
1871
|
+
<pre class="lines">
|
1872
|
+
|
1873
|
+
|
1874
|
+
265
|
1875
|
+
266
|
1876
|
+
267</pre>
|
1877
|
+
</td>
|
1878
|
+
<td>
|
1879
|
+
<pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 265</span>
|
1880
|
+
|
1881
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_touch_release?'>touch_release?</span>
|
1882
|
+
<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>
|
1883
|
+
<span class='kw'>end</span></pre>
|
1884
|
+
</td>
|
1885
|
+
</tr>
|
1886
|
+
</table>
|
1887
|
+
</div>
|
1888
|
+
|
1889
|
+
<div class="method_details ">
|
1890
|
+
<h3 class="signature " id="touch_x-class_method">
|
1891
|
+
|
1892
|
+
.<strong>touch_x</strong> ⇒ <tt>Object</tt>
|
1893
|
+
|
1894
|
+
|
1895
|
+
|
1896
|
+
<span class="aliases">Also known as:
|
1897
|
+
<span class="names"><span id='touch_pos_x-class_method'>touch_pos_x</span></span>
|
1898
|
+
</span>
|
1899
|
+
|
1900
|
+
|
1901
|
+
|
1902
|
+
</h3><div class="docstring">
|
1903
|
+
<div class="discussion">
|
1904
|
+
|
1905
|
+
<p>Return position of touch (0, 0) is the top-left corner of the canvas</p>
|
1906
|
+
|
1907
|
+
|
1908
|
+
</div>
|
1909
|
+
</div>
|
1910
|
+
<div class="tags">
|
1911
|
+
|
1912
|
+
|
1913
|
+
</div><table class="source_code">
|
1914
|
+
<tr>
|
1915
|
+
<td>
|
1916
|
+
<pre class="lines">
|
1917
|
+
|
1918
|
+
|
1919
|
+
243
|
1920
|
+
244
|
1921
|
+
245</pre>
|
1922
|
+
</td>
|
1923
|
+
<td>
|
1924
|
+
<pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 243</span>
|
1925
|
+
|
1926
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_touch_x'>touch_x</span>
|
1927
|
+
<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>
|
1928
|
+
<span class='kw'>end</span></pre>
|
1929
|
+
</td>
|
1930
|
+
</tr>
|
1931
|
+
</table>
|
1932
|
+
</div>
|
1933
|
+
|
1934
|
+
<div class="method_details ">
|
1935
|
+
<h3 class="signature " id="touch_y-class_method">
|
1936
|
+
|
1937
|
+
.<strong>touch_y</strong> ⇒ <tt>Object</tt>
|
1938
|
+
|
1939
|
+
|
1940
|
+
|
1941
|
+
<span class="aliases">Also known as:
|
1942
|
+
<span class="names"><span id='touch_pos_y-class_method'>touch_pos_y</span></span>
|
1943
|
+
</span>
|
1944
|
+
|
1945
|
+
|
1946
|
+
|
1947
|
+
</h3><table class="source_code">
|
1948
|
+
<tr>
|
1949
|
+
<td>
|
1950
|
+
<pre class="lines">
|
1951
|
+
|
1952
|
+
|
1953
|
+
246
|
1954
|
+
247
|
1955
|
+
248</pre>
|
1956
|
+
</td>
|
1957
|
+
<td>
|
1958
|
+
<pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 246</span>
|
1959
|
+
|
1960
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_touch_y'>touch_y</span>
|
1961
|
+
<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>
|
1962
|
+
<span class='kw'>end</span></pre>
|
1963
|
+
</td>
|
1964
|
+
</tr>
|
1965
|
+
</table>
|
1966
|
+
</div>
|
1967
|
+
|
1968
|
+
<div class="method_details ">
|
1969
|
+
<h3 class="signature " id="touches-class_method">
|
1970
|
+
|
1971
|
+
.<strong>touches</strong> ⇒ <tt>Object</tt>
|
1972
|
+
|
1973
|
+
|
1974
|
+
|
1975
|
+
|
1976
|
+
|
1977
|
+
</h3><div class="docstring">
|
1978
|
+
<div class="discussion">
|
1979
|
+
|
1980
|
+
<p>Returns current touches as an array of Input::Touch</p>
|
1981
|
+
|
1982
|
+
|
1983
|
+
</div>
|
1984
|
+
</div>
|
1985
|
+
<div class="tags">
|
1986
|
+
|
1987
|
+
|
1988
|
+
</div><table class="source_code">
|
1989
|
+
<tr>
|
1990
|
+
<td>
|
1991
|
+
<pre class="lines">
|
1992
|
+
|
1993
|
+
|
1994
|
+
304
|
1995
|
+
305
|
1996
|
+
306</pre>
|
1997
|
+
</td>
|
1998
|
+
<td>
|
1999
|
+
<pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 304</span>
|
2000
|
+
|
2001
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_touches'>touches</span>
|
2002
|
+
<span class='cvar'>@@touches</span><span class='period'>.</span><span class='id identifier rubyid_values'>values</span>
|
2003
|
+
<span class='kw'>end</span></pre>
|
2004
|
+
</td>
|
2005
|
+
</tr>
|
2006
|
+
</table>
|
1284
2007
|
</div>
|
1285
2008
|
|
1286
2009
|
<div class="method_details ">
|
@@ -1309,15 +2032,15 @@ canvas are processed by DXOpal.</p>
|
|
1309
2032
|
<pre class="lines">
|
1310
2033
|
|
1311
2034
|
|
1312
|
-
|
1313
|
-
|
1314
|
-
|
1315
|
-
|
1316
|
-
|
1317
|
-
|
2035
|
+
40
|
2036
|
+
41
|
2037
|
+
42
|
2038
|
+
43
|
2039
|
+
44
|
2040
|
+
45</pre>
|
1318
2041
|
</td>
|
1319
2042
|
<td>
|
1320
|
-
<pre class="code"><span class="info file"># File '
|
2043
|
+
<pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 40</span>
|
1321
2044
|
|
1322
2045
|
<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
2046
|
<span class='id identifier rubyid_ret'>ret</span> <span class='op'>=</span> <span class='int'>0</span>
|
@@ -1356,15 +2079,15 @@ canvas are processed by DXOpal.</p>
|
|
1356
2079
|
<pre class="lines">
|
1357
2080
|
|
1358
2081
|
|
1359
|
-
|
1360
|
-
|
1361
|
-
|
1362
|
-
|
1363
|
-
|
1364
|
-
|
2082
|
+
48
|
2083
|
+
49
|
2084
|
+
50
|
2085
|
+
51
|
2086
|
+
52
|
2087
|
+
53</pre>
|
1365
2088
|
</td>
|
1366
2089
|
<td>
|
1367
|
-
<pre class="code"><span class="info file"># File '
|
2090
|
+
<pre class="code"><span class="info file"># File 'lib/dxopal/input.rb', line 48</span>
|
1368
2091
|
|
1369
2092
|
<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
2093
|
<span class='id identifier rubyid_ret'>ret</span> <span class='op'>=</span> <span class='int'>0</span>
|
@@ -1382,9 +2105,9 @@ canvas are processed by DXOpal.</p>
|
|
1382
2105
|
</div>
|
1383
2106
|
|
1384
2107
|
<div id="footer">
|
1385
|
-
Generated on
|
2108
|
+
Generated on Tue Dec 29 11:37:22 2020 by
|
1386
2109
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1387
|
-
0.9.
|
2110
|
+
0.9.26 (ruby-2.7.0).
|
1388
2111
|
</div>
|
1389
2112
|
|
1390
2113
|
</div>
|