dxopal 1.5.2 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/DEVELOPMENT.md +4 -4
- data/Gemfile +0 -1
- data/Gemfile.lock +22 -24
- data/README.md +4 -0
- data/Rakefile +6 -1
- data/build/dxopal.js +48950 -38847
- data/build/dxopal.min.js +1 -1
- data/config.ru +1 -1
- data/doc/api/DXOpal/Constants/Colors.html +4 -4
- data/doc/api/DXOpal/Constants.html +4 -4
- data/doc/api/DXOpal/Font.html +4 -4
- data/doc/api/DXOpal/Image.html +19 -19
- data/doc/api/DXOpal/Input/KeyCodes.html +6 -6
- data/doc/api/DXOpal/Input/MouseCodes.html +4 -4
- data/doc/api/DXOpal/Input/Touch.html +47 -47
- data/doc/api/DXOpal/Input.html +87 -81
- data/doc/api/DXOpal/RemoteResource.html +164 -33
- data/doc/api/DXOpal/Sound.html +22 -16
- data/doc/api/DXOpal/SoundEffect/WaveTypes.html +4 -4
- data/doc/api/DXOpal/SoundEffect.html +6 -6
- data/doc/api/DXOpal/Sprite/CollisionArea/Base.html +5 -5
- data/doc/api/DXOpal/Sprite/CollisionArea/Circle.html +4 -4
- data/doc/api/DXOpal/Sprite/CollisionArea/Point.html +4 -4
- data/doc/api/DXOpal/Sprite/CollisionArea/Rect.html +4 -4
- data/doc/api/DXOpal/Sprite/CollisionArea/Triangle.html +4 -4
- data/doc/api/DXOpal/Sprite/CollisionArea.html +4 -4
- data/doc/api/DXOpal/Sprite/CollisionCheck/ClassMethods.html +7 -7
- data/doc/api/DXOpal/Sprite/CollisionCheck.html +8 -8
- data/doc/api/DXOpal/Sprite/Physics.html +4 -4
- data/doc/api/DXOpal/Sprite.html +10 -10
- data/doc/api/DXOpal/Window.html +120 -114
- data/doc/api/DXOpal.html +5 -5
- data/doc/api/Kernel.html +4 -4
- data/doc/api/_index.html +5 -5
- data/doc/api/file.README.html +23 -20
- data/doc/api/frames.html +10 -5
- data/doc/api/index.html +23 -20
- data/doc/api/method_list.html +214 -206
- data/doc/api/top-level-namespace.html +4 -4
- data/lib/dxopal/input.rb +5 -2
- data/lib/dxopal/remote_resource.rb +33 -1
- data/lib/dxopal/sound.rb +5 -2
- data/lib/dxopal/version.rb +1 -1
- data/lib/dxopal/window.rb +6 -3
- data/lib/dxopal.rb +1 -0
- metadata +3 -3
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Class: DXOpal::RemoteResource
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.36
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -102,9 +102,9 @@
|
|
102
102
|
<h2>Overview</h2><div class="docstring">
|
103
103
|
<div class="discussion">
|
104
104
|
|
105
|
-
<p>A base class for resources acquired through JS Promises. Provides
|
105
|
+
<p>A base class for resources acquired through JS Promises. Provides ‘<klass>.register` and `<<a href="name">klass></a>`. A subclass must impelment `<klass>._load`.</p>
|
106
106
|
|
107
|
-
<p>TODO: better name? (SoundEffect is not actually
|
107
|
+
<p>TODO: better name? (SoundEffect is not actually ‘remote’)</p>
|
108
108
|
|
109
109
|
|
110
110
|
</div>
|
@@ -169,6 +169,22 @@
|
|
169
169
|
<div class="tags">
|
170
170
|
|
171
171
|
|
172
|
+
</div>
|
173
|
+
</dt>
|
174
|
+
<dd><pre class="code"><span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_h'>h</span><span class='comma'>,</span><span class='id identifier rubyid_k'>k</span><span class='op'>|</span> <span class='id identifier rubyid_h'>h</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rbrace'>}</span></pre></dd>
|
175
|
+
|
176
|
+
<dt id="loaded-classvariable" class="">@@loaded =
|
177
|
+
<div class="docstring">
|
178
|
+
<div class="discussion">
|
179
|
+
|
180
|
+
<p>‘true` if the resource is loaded</p>
|
181
|
+
|
182
|
+
|
183
|
+
</div>
|
184
|
+
</div>
|
185
|
+
<div class="tags">
|
186
|
+
|
187
|
+
|
172
188
|
</div>
|
173
189
|
</dt>
|
174
190
|
<dd><pre class="code"><span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_h'>h</span><span class='comma'>,</span><span class='id identifier rubyid_k'>k</span><span class='op'>|</span> <span class='id identifier rubyid_h'>h</span><span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rbrace'>}</span></pre></dd>
|
@@ -272,7 +288,7 @@
|
|
272
288
|
|
273
289
|
|
274
290
|
<span class="summary_desc"><div class='inline'>
|
275
|
-
<p>Load actual content (defined on subclasses) Return
|
291
|
+
<p>Load actual content (defined on subclasses) Return ‘[instance, promise]`.</p>
|
276
292
|
</div></span>
|
277
293
|
|
278
294
|
</li>
|
@@ -299,6 +315,30 @@
|
|
299
315
|
<p>Called from Window.load_resources.</p>
|
300
316
|
</div></span>
|
301
317
|
|
318
|
+
</li>
|
319
|
+
|
320
|
+
|
321
|
+
<li class="public ">
|
322
|
+
<span class="summary_signature">
|
323
|
+
|
324
|
+
<a href="#_update_loading_status-class_method" title="_update_loading_status (class method)">.<strong>_update_loading_status</strong> ⇒ Object </a>
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
</span>
|
329
|
+
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
<span class="summary_desc"><div class='inline'>
|
339
|
+
<p>Update loading status if ‘dxopal-loading` is defined.</p>
|
340
|
+
</div></span>
|
341
|
+
|
302
342
|
</li>
|
303
343
|
|
304
344
|
|
@@ -383,16 +423,16 @@
|
|
383
423
|
<pre class="lines">
|
384
424
|
|
385
425
|
|
386
|
-
28
|
387
|
-
29
|
388
426
|
30
|
389
427
|
31
|
390
428
|
32
|
391
429
|
33
|
392
|
-
34
|
430
|
+
34
|
431
|
+
35
|
432
|
+
36</pre>
|
393
433
|
</td>
|
394
434
|
<td>
|
395
|
-
<pre class="code"><span class="info file"># File 'lib/dxopal/remote_resource.rb', line
|
435
|
+
<pre class="code"><span class="info file"># File 'lib/dxopal/remote_resource.rb', line 30</span>
|
396
436
|
|
397
437
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='op'>[]</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
398
438
|
<span class='kw'>if</span> <span class='lparen'>(</span><span class='id identifier rubyid_ret'>ret</span> <span class='op'>=</span> <span class='cvar'>@@instances</span><span class='lbracket'>[</span><span class='id identifier rubyid__klass_name'>_klass_name</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
@@ -432,12 +472,12 @@
|
|
432
472
|
<pre class="lines">
|
433
473
|
|
434
474
|
|
435
|
-
|
436
|
-
|
437
|
-
|
475
|
+
69
|
476
|
+
70
|
477
|
+
71</pre>
|
438
478
|
</td>
|
439
479
|
<td>
|
440
|
-
<pre class="code"><span class="info file"># File 'lib/dxopal/remote_resource.rb', line
|
480
|
+
<pre class="code"><span class="info file"># File 'lib/dxopal/remote_resource.rb', line 69</span>
|
441
481
|
|
442
482
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid__klass_name'>_klass_name</span>
|
443
483
|
<span class='kw'>return</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>::</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span>
|
@@ -459,7 +499,7 @@
|
|
459
499
|
</h3><div class="docstring">
|
460
500
|
<div class="discussion">
|
461
501
|
|
462
|
-
<p>Load actual content (defined on subclasses) Return
|
502
|
+
<p>Load actual content (defined on subclasses) Return ‘[instance, promise]`</p>
|
463
503
|
|
464
504
|
|
465
505
|
</div>
|
@@ -473,12 +513,12 @@
|
|
473
513
|
<pre class="lines">
|
474
514
|
|
475
515
|
|
476
|
-
|
477
|
-
|
478
|
-
|
516
|
+
64
|
517
|
+
65
|
518
|
+
66</pre>
|
479
519
|
</td>
|
480
520
|
<td>
|
481
|
-
<pre class="code"><span class="info file"># File 'lib/dxopal/remote_resource.rb', line
|
521
|
+
<pre class="code"><span class="info file"># File 'lib/dxopal/remote_resource.rb', line 64</span>
|
482
522
|
|
483
523
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid__load'>_load</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
484
524
|
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>override me</span><span class='tstring_end'>"</span></span>
|
@@ -514,8 +554,6 @@
|
|
514
554
|
<pre class="lines">
|
515
555
|
|
516
556
|
|
517
|
-
37
|
518
|
-
38
|
519
557
|
39
|
520
558
|
40
|
521
559
|
41
|
@@ -531,10 +569,16 @@
|
|
531
569
|
51
|
532
570
|
52
|
533
571
|
53
|
534
|
-
54
|
572
|
+
54
|
573
|
+
55
|
574
|
+
56
|
575
|
+
57
|
576
|
+
58
|
577
|
+
59
|
578
|
+
60</pre>
|
535
579
|
</td>
|
536
580
|
<td>
|
537
|
-
<pre class="code"><span class="info file"># File 'lib/dxopal/remote_resource.rb', line
|
581
|
+
<pre class="code"><span class="info file"># File 'lib/dxopal/remote_resource.rb', line 39</span>
|
538
582
|
|
539
583
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid__load_resources'>_load_resources</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
540
584
|
<span class='cvar'>@@resources</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_klass_name'>klass_name</span><span class='comma'>,</span> <span class='id identifier rubyid_items'>items</span><span class='op'>|</span>
|
@@ -543,7 +587,11 @@
|
|
543
587
|
<span class='kw'>if</span> <span class='op'>!</span><span class='cvar'>@@promises</span><span class='lbracket'>[</span><span class='id identifier rubyid_klass_name'>klass_name</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span>
|
544
588
|
<span class='id identifier rubyid_instance'>instance</span><span class='comma'>,</span> <span class='id identifier rubyid_promise'>promise</span> <span class='op'>=</span> <span class='id identifier rubyid_klass'>klass</span><span class='period'>.</span><span class='id identifier rubyid__load'>_load</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block2'>block2</span><span class='rparen'>)</span>
|
545
589
|
<span class='cvar'>@@instances</span><span class='lbracket'>[</span><span class='id identifier rubyid_klass_name'>klass_name</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_instance'>instance</span>
|
546
|
-
<span class='cvar'>@@
|
590
|
+
<span class='cvar'>@@loaded</span><span class='lbracket'>[</span><span class='id identifier rubyid_klass_name'>klass_name</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>false</span>
|
591
|
+
<span class='cvar'>@@promises</span><span class='lbracket'>[</span><span class='id identifier rubyid_klass_name'>klass_name</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_promise'>promise</span><span class='period'>.</span><span class='const'>JS</span><span class='period'>.</span><span class='id identifier rubyid_then'>then</span><span class='lbrace'>{</span>
|
592
|
+
<span class='cvar'>@@loaded</span><span class='lbracket'>[</span><span class='id identifier rubyid_klass_name'>klass_name</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>true</span>
|
593
|
+
<span class='const'><span class='object_link'><a href="" title="DXOpal::RemoteResource (class)">RemoteResource</a></span></span><span class='period'>.</span><span class='id identifier rubyid__update_loading_status'><span class='object_link'><a href="#_update_loading_status-class_method" title="DXOpal::RemoteResource._update_loading_status (method)">_update_loading_status</a></span></span>
|
594
|
+
<span class='rbrace'>}</span>
|
547
595
|
<span class='kw'>end</span>
|
548
596
|
<span class='kw'>end</span>
|
549
597
|
<span class='kw'>end</span>
|
@@ -557,6 +605,89 @@
|
|
557
605
|
</td>
|
558
606
|
</tr>
|
559
607
|
</table>
|
608
|
+
</div>
|
609
|
+
|
610
|
+
<div class="method_details ">
|
611
|
+
<h3 class="signature " id="_update_loading_status-class_method">
|
612
|
+
|
613
|
+
.<strong>_update_loading_status</strong> ⇒ <tt>Object</tt>
|
614
|
+
|
615
|
+
|
616
|
+
|
617
|
+
|
618
|
+
|
619
|
+
</h3><div class="docstring">
|
620
|
+
<div class="discussion">
|
621
|
+
|
622
|
+
<p>Update loading status if ‘dxopal-loading` is defined.</p>
|
623
|
+
|
624
|
+
|
625
|
+
</div>
|
626
|
+
</div>
|
627
|
+
<div class="tags">
|
628
|
+
|
629
|
+
|
630
|
+
</div><table class="source_code">
|
631
|
+
<tr>
|
632
|
+
<td>
|
633
|
+
<pre class="lines">
|
634
|
+
|
635
|
+
|
636
|
+
74
|
637
|
+
75
|
638
|
+
76
|
639
|
+
77
|
640
|
+
78
|
641
|
+
79
|
642
|
+
80
|
643
|
+
81
|
644
|
+
82
|
645
|
+
83
|
646
|
+
84
|
647
|
+
85
|
648
|
+
86
|
649
|
+
87
|
650
|
+
88
|
651
|
+
89
|
652
|
+
90
|
653
|
+
91
|
654
|
+
92
|
655
|
+
93
|
656
|
+
94
|
657
|
+
95
|
658
|
+
96
|
659
|
+
97</pre>
|
660
|
+
</td>
|
661
|
+
<td>
|
662
|
+
<pre class="code"><span class="info file"># File 'lib/dxopal/remote_resource.rb', line 74</span>
|
663
|
+
|
664
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid__update_loading_status'>_update_loading_status</span>
|
665
|
+
<span class='id identifier rubyid_done'>done</span> <span class='op'>=</span> <span class='kw'>true</span>
|
666
|
+
<span class='id identifier rubyid_report'>report</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>DXOpal loading...\n</span><span class='tstring_end'>"</span></span> <span class='op'>+</span>
|
667
|
+
<span class='cvar'>@@promises</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_klass_name'>klass_name</span><span class='comma'>,</span> <span class='id identifier rubyid_promises'>promises</span><span class='op'>|</span>
|
668
|
+
<span class='id identifier rubyid_n_total'>n_total</span> <span class='op'>=</span> <span class='cvar'>@@resources</span><span class='lbracket'>[</span><span class='id identifier rubyid_klass_name'>klass_name</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span>
|
669
|
+
<span class='id identifier rubyid_n_loaded'>n_loaded</span> <span class='op'>=</span> <span class='cvar'>@@loaded</span><span class='lbracket'>[</span><span class='id identifier rubyid_klass_name'>klass_name</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_values'>values</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span><span class='lparen'>(</span><span class='kw'>true</span><span class='rparen'>)</span>
|
670
|
+
<span class='id identifier rubyid_done'>done</span> <span class='op'>=</span> <span class='kw'>false</span> <span class='kw'>if</span> <span class='id identifier rubyid_n_loaded'>n_loaded</span> <span class='op'><</span> <span class='id identifier rubyid_n_total'>n_total</span>
|
671
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_klass_name'>klass_name</span><span class='embexpr_end'>}</span><span class='tstring_content'>: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_n_loaded'>n_loaded</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_n_total'>n_total</span><span class='embexpr_end'>}</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span>
|
672
|
+
<span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span>
|
673
|
+
<span class='id identifier rubyid_div'>div</span> <span class='op'>=</span> <span class='backtick'>`</span><span class='tstring_content'>document.getElementById('dxopal-loading')</span><span class='tstring_end'>`</span></span>
|
674
|
+
<span class='kw'>if</span> <span class='backtick'>`</span><span class='tstring_content'>div</span><span class='tstring_end'>`</span></span>
|
675
|
+
<span class='backtick'>%x{</span><span class='tstring_content'>
|
676
|
+
let pre = div.firstChild;
|
677
|
+
if (!pre) {
|
678
|
+
pre = document.createElement('pre');
|
679
|
+
div.appendChild(pre);
|
680
|
+
}
|
681
|
+
pre.textContent = </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_report'>report</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
|
682
|
+
if (</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_done'>done</span><span class='embexpr_end'>}</span><span class='tstring_content'>) {
|
683
|
+
div.style.display = 'none';
|
684
|
+
}
|
685
|
+
</span><span class='tstring_end'>}</span></span>
|
686
|
+
<span class='kw'>end</span>
|
687
|
+
<span class='kw'>end</span></pre>
|
688
|
+
</td>
|
689
|
+
</tr>
|
690
|
+
</table>
|
560
691
|
</div>
|
561
692
|
|
562
693
|
<div class="method_details ">
|
@@ -574,12 +705,12 @@
|
|
574
705
|
<pre class="lines">
|
575
706
|
|
576
707
|
|
577
|
-
|
578
|
-
|
579
|
-
|
708
|
+
19
|
709
|
+
20
|
710
|
+
21</pre>
|
580
711
|
</td>
|
581
712
|
<td>
|
582
|
-
<pre class="code"><span class="info file"># File 'lib/dxopal/remote_resource.rb', line
|
713
|
+
<pre class="code"><span class="info file"># File 'lib/dxopal/remote_resource.rb', line 19</span>
|
583
714
|
|
584
715
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_add_class'>add_class</span><span class='lparen'>(</span><span class='id identifier rubyid_subklass'>subklass</span><span class='rparen'>)</span>
|
585
716
|
<span class='cvar'>@@klasses</span><span class='lbracket'>[</span><span class='id identifier rubyid_subklass'>subklass</span><span class='period'>.</span><span class='id identifier rubyid__klass_name'>_klass_name</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_subklass'>subklass</span>
|
@@ -615,13 +746,13 @@
|
|
615
746
|
<pre class="lines">
|
616
747
|
|
617
748
|
|
618
|
-
22
|
619
|
-
23
|
620
749
|
24
|
621
|
-
25
|
750
|
+
25
|
751
|
+
26
|
752
|
+
27</pre>
|
622
753
|
</td>
|
623
754
|
<td>
|
624
|
-
<pre class="code"><span class="info file"># File 'lib/dxopal/remote_resource.rb', line
|
755
|
+
<pre class="code"><span class="info file"># File 'lib/dxopal/remote_resource.rb', line 24</span>
|
625
756
|
|
626
757
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_register'>register</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
627
758
|
<span class='cvar'>@@resources</span><span class='lbracket'>[</span><span class='id identifier rubyid__klass_name'>_klass_name</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
@@ -637,9 +768,9 @@
|
|
637
768
|
</div>
|
638
769
|
|
639
770
|
<div id="footer">
|
640
|
-
Generated on Tue
|
641
|
-
<a href="
|
642
|
-
0.9.
|
771
|
+
Generated on Tue Jul 9 22:42:34 2024 by
|
772
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
773
|
+
0.9.36 (ruby-3.2.2).
|
643
774
|
</div>
|
644
775
|
|
645
776
|
</div>
|
data/doc/api/DXOpal/Sound.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Class: DXOpal::Sound
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.36
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -238,7 +238,7 @@
|
|
238
238
|
<li class="public ">
|
239
239
|
<span class="summary_signature">
|
240
240
|
|
241
|
-
<a href="#play-instance_method" title="#play (instance method)">#<strong>play</strong> ⇒ Object </a>
|
241
|
+
<a href="#play-instance_method" title="#play (instance method)">#<strong>play</strong>(loop_ = false) ⇒ Object </a>
|
242
242
|
|
243
243
|
|
244
244
|
|
@@ -253,7 +253,7 @@
|
|
253
253
|
|
254
254
|
|
255
255
|
<span class="summary_desc"><div class='inline'>
|
256
|
-
<p>Play this sound
|
256
|
+
<p>Play this sound.</p>
|
257
257
|
</div></span>
|
258
258
|
|
259
259
|
</li>
|
@@ -296,7 +296,7 @@
|
|
296
296
|
|
297
297
|
|
298
298
|
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="RemoteResource.html" title="DXOpal::RemoteResource (class)">RemoteResource</a></span></h3>
|
299
|
-
<p class="inherited"><span class='object_link'><a href="RemoteResource.html#[]-class_method" title="DXOpal::RemoteResource.[] (method)">[]</a></span>, <span class='object_link'><a href="RemoteResource.html#_klass_name-class_method" title="DXOpal::RemoteResource._klass_name (method)">_klass_name</a></span>, <span class='object_link'><a href="RemoteResource.html#_load_resources-class_method" title="DXOpal::RemoteResource._load_resources (method)">_load_resources</a></span>, <span class='object_link'><a href="RemoteResource.html#add_class-class_method" title="DXOpal::RemoteResource.add_class (method)">add_class</a></span>, <span class='object_link'><a href="RemoteResource.html#register-class_method" title="DXOpal::RemoteResource.register (method)">register</a></span></p>
|
299
|
+
<p class="inherited"><span class='object_link'><a href="RemoteResource.html#[]-class_method" title="DXOpal::RemoteResource.[] (method)">[]</a></span>, <span class='object_link'><a href="RemoteResource.html#_klass_name-class_method" title="DXOpal::RemoteResource._klass_name (method)">_klass_name</a></span>, <span class='object_link'><a href="RemoteResource.html#_load_resources-class_method" title="DXOpal::RemoteResource._load_resources (method)">_load_resources</a></span>, <span class='object_link'><a href="RemoteResource.html#_update_loading_status-class_method" title="DXOpal::RemoteResource._update_loading_status (method)">_update_loading_status</a></span>, <span class='object_link'><a href="RemoteResource.html#add_class-class_method" title="DXOpal::RemoteResource.add_class (method)">add_class</a></span>, <span class='object_link'><a href="RemoteResource.html#register-class_method" title="DXOpal::RemoteResource.register (method)">register</a></span></p>
|
300
300
|
<div id="constructor_details" class="method_details_list">
|
301
301
|
<h2>Constructor Details</h2>
|
302
302
|
|
@@ -525,7 +525,7 @@
|
|
525
525
|
<div class="method_details first">
|
526
526
|
<h3 class="signature first" id="play-instance_method">
|
527
527
|
|
528
|
-
#<strong>play</strong> ⇒ <tt>Object</tt>
|
528
|
+
#<strong>play</strong>(loop_ = false) ⇒ <tt>Object</tt>
|
529
529
|
|
530
530
|
|
531
531
|
|
@@ -534,7 +534,7 @@
|
|
534
534
|
</h3><div class="docstring">
|
535
535
|
<div class="discussion">
|
536
536
|
|
537
|
-
<p>Play this sound
|
537
|
+
<p>Play this sound</p>
|
538
538
|
|
539
539
|
|
540
540
|
</div>
|
@@ -559,18 +559,24 @@
|
|
559
559
|
50
|
560
560
|
51
|
561
561
|
52
|
562
|
-
53
|
562
|
+
53
|
563
|
+
54
|
564
|
+
55
|
565
|
+
56</pre>
|
563
566
|
</td>
|
564
567
|
<td>
|
565
568
|
<pre class="code"><span class="info file"># File 'lib/dxopal/sound.rb', line 42</span>
|
566
569
|
|
567
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_play'>play</span>
|
570
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_play'>play</span><span class='lparen'>(</span><span class='id identifier rubyid_loop_'>loop_</span> <span class='op'>=</span> <span class='kw'>false</span><span class='rparen'>)</span>
|
568
571
|
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Sound </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_path_or_url'>path_or_url</span><span class='embexpr_end'>}</span><span class='tstring_content'> is not loaded yet</span><span class='tstring_end'>"</span></span> <span class='kw'>unless</span> <span class='ivar'>@decoded</span>
|
569
572
|
<span class='id identifier rubyid_source'>source</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
570
573
|
<span class='backtick'>%x{</span><span class='tstring_content'>
|
571
574
|
var context = </span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="" title="DXOpal::Sound (class)">Sound</a></span></span><span class='period'>.</span><span class='id identifier rubyid_audio_context'><span class='object_link'><a href="#audio_context-class_method" title="DXOpal::Sound.audio_context (method)">audio_context</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>;
|
572
575
|
source = context.createBufferSource();
|
573
576
|
source.buffer = </span><span class='embexpr_beg'>#{</span><span class='ivar'>@decoded</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
|
577
|
+
if (</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_loop_'>loop_</span><span class='embexpr_end'>}</span><span class='tstring_content'>) {
|
578
|
+
source.loop = true;
|
579
|
+
}
|
574
580
|
source.connect(context.destination);
|
575
581
|
source.start(0);
|
576
582
|
</span><span class='tstring_end'>}</span></span>
|
@@ -607,14 +613,14 @@
|
|
607
613
|
<pre class="lines">
|
608
614
|
|
609
615
|
|
610
|
-
56
|
611
|
-
57
|
612
|
-
58
|
613
616
|
59
|
614
|
-
60
|
617
|
+
60
|
618
|
+
61
|
619
|
+
62
|
620
|
+
63</pre>
|
615
621
|
</td>
|
616
622
|
<td>
|
617
|
-
<pre class="code"><span class="info file"># File 'lib/dxopal/sound.rb', line
|
623
|
+
<pre class="code"><span class="info file"># File 'lib/dxopal/sound.rb', line 59</span>
|
618
624
|
|
619
625
|
<span class='kw'>def</span> <span class='id identifier rubyid_stop'>stop</span>
|
620
626
|
<span class='kw'>return</span> <span class='kw'>unless</span> <span class='ivar'>@decoded</span>
|
@@ -631,9 +637,9 @@
|
|
631
637
|
</div>
|
632
638
|
|
633
639
|
<div id="footer">
|
634
|
-
Generated on Tue
|
635
|
-
<a href="
|
636
|
-
0.9.
|
640
|
+
Generated on Tue Jul 9 22:42:34 2024 by
|
641
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
642
|
+
0.9.36 (ruby-3.2.2).
|
637
643
|
</div>
|
638
644
|
|
639
645
|
</div>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Module: DXOpal::SoundEffect::WaveTypes
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.36
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -126,9 +126,9 @@
|
|
126
126
|
</div>
|
127
127
|
|
128
128
|
<div id="footer">
|
129
|
-
Generated on Tue
|
130
|
-
<a href="
|
131
|
-
0.9.
|
129
|
+
Generated on Tue Jul 9 22:42:33 2024 by
|
130
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
131
|
+
0.9.36 (ruby-3.2.2).
|
132
132
|
</div>
|
133
133
|
|
134
134
|
</div>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Class: DXOpal::SoundEffect
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.36
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -173,7 +173,7 @@
|
|
173
173
|
|
174
174
|
|
175
175
|
<span class="summary_desc"><div class='inline'>
|
176
|
-
<p>time : Total number of ticks When resolution=1000(default),
|
176
|
+
<p>time : Total number of ticks When resolution=1000(default), ‘time` is equivalent to the total length of the sound in milliseconds.</p>
|
177
177
|
</div></span>
|
178
178
|
|
179
179
|
</li>
|
@@ -234,7 +234,7 @@
|
|
234
234
|
|
235
235
|
|
236
236
|
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="RemoteResource.html" title="DXOpal::RemoteResource (class)">RemoteResource</a></span></h3>
|
237
|
-
<p class="inherited"><span class='object_link'><a href="RemoteResource.html#[]-class_method" title="DXOpal::RemoteResource.[] (method)">[]</a></span>, <span class='object_link'><a href="RemoteResource.html#_klass_name-class_method" title="DXOpal::RemoteResource._klass_name (method)">_klass_name</a></span>, <span class='object_link'><a href="RemoteResource.html#_load_resources-class_method" title="DXOpal::RemoteResource._load_resources (method)">_load_resources</a></span>, <span class='object_link'><a href="RemoteResource.html#add_class-class_method" title="DXOpal::RemoteResource.add_class (method)">add_class</a></span>, <span class='object_link'><a href="RemoteResource.html#register-class_method" title="DXOpal::RemoteResource.register (method)">register</a></span></p>
|
237
|
+
<p class="inherited"><span class='object_link'><a href="RemoteResource.html#[]-class_method" title="DXOpal::RemoteResource.[] (method)">[]</a></span>, <span class='object_link'><a href="RemoteResource.html#_klass_name-class_method" title="DXOpal::RemoteResource._klass_name (method)">_klass_name</a></span>, <span class='object_link'><a href="RemoteResource.html#_load_resources-class_method" title="DXOpal::RemoteResource._load_resources (method)">_load_resources</a></span>, <span class='object_link'><a href="RemoteResource.html#_update_loading_status-class_method" title="DXOpal::RemoteResource._update_loading_status (method)">_update_loading_status</a></span>, <span class='object_link'><a href="RemoteResource.html#add_class-class_method" title="DXOpal::RemoteResource.add_class (method)">add_class</a></span>, <span class='object_link'><a href="RemoteResource.html#register-class_method" title="DXOpal::RemoteResource.register (method)">register</a></span></p>
|
238
238
|
<div id="constructor_details" class="method_details_list">
|
239
239
|
<h2>Constructor Details</h2>
|
240
240
|
|
@@ -437,9 +437,9 @@ total length of the sound in milliseconds.
|
|
437
437
|
</div>
|
438
438
|
|
439
439
|
<div id="footer">
|
440
|
-
Generated on Tue
|
441
|
-
<a href="
|
442
|
-
0.9.
|
440
|
+
Generated on Tue Jul 9 22:42:34 2024 by
|
441
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
442
|
+
0.9.36 (ruby-3.2.2).
|
443
443
|
</div>
|
444
444
|
|
445
445
|
</div>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Class: DXOpal::Sprite::CollisionArea::Base
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.36
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -605,7 +605,7 @@
|
|
605
605
|
</h3><div class="docstring">
|
606
606
|
<div class="discussion">
|
607
607
|
|
608
|
-
<p>Return a string like “Point”, “Rect”, etc. Used for type checking in
|
608
|
+
<p>Return a string like “Point”, “Rect”, etc. Used for type checking in ‘collides?` (because Opal’s Class#is_a? is not very fast)</p>
|
609
609
|
|
610
610
|
|
611
611
|
</div>
|
@@ -639,9 +639,9 @@
|
|
639
639
|
</div>
|
640
640
|
|
641
641
|
<div id="footer">
|
642
|
-
Generated on Tue
|
643
|
-
<a href="
|
644
|
-
0.9.
|
642
|
+
Generated on Tue Jul 9 22:42:34 2024 by
|
643
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
644
|
+
0.9.36 (ruby-3.2.2).
|
645
645
|
</div>
|
646
646
|
|
647
647
|
</div>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Class: DXOpal::Sprite::CollisionArea::Circle
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.36
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -646,9 +646,9 @@
|
|
646
646
|
</div>
|
647
647
|
|
648
648
|
<div id="footer">
|
649
|
-
Generated on Tue
|
650
|
-
<a href="
|
651
|
-
0.9.
|
649
|
+
Generated on Tue Jul 9 22:42:34 2024 by
|
650
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
651
|
+
0.9.36 (ruby-3.2.2).
|
652
652
|
</div>
|
653
653
|
|
654
654
|
</div>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Class: DXOpal::Sprite::CollisionArea::Point
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.36
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -438,9 +438,9 @@
|
|
438
438
|
</div>
|
439
439
|
|
440
440
|
<div id="footer">
|
441
|
-
Generated on Tue
|
442
|
-
<a href="
|
443
|
-
0.9.
|
441
|
+
Generated on Tue Jul 9 22:42:34 2024 by
|
442
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
443
|
+
0.9.36 (ruby-3.2.2).
|
444
444
|
</div>
|
445
445
|
|
446
446
|
</div>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Class: DXOpal::Sprite::CollisionArea::Rect
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.36
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -539,9 +539,9 @@
|
|
539
539
|
</div>
|
540
540
|
|
541
541
|
<div id="footer">
|
542
|
-
Generated on Tue
|
543
|
-
<a href="
|
544
|
-
0.9.
|
542
|
+
Generated on Tue Jul 9 22:42:34 2024 by
|
543
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
544
|
+
0.9.36 (ruby-3.2.2).
|
545
545
|
</div>
|
546
546
|
|
547
547
|
</div>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Class: DXOpal::Sprite::CollisionArea::Triangle
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.36
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -413,9 +413,9 @@
|
|
413
413
|
</div>
|
414
414
|
|
415
415
|
<div id="footer">
|
416
|
-
Generated on Tue
|
417
|
-
<a href="
|
418
|
-
0.9.
|
416
|
+
Generated on Tue Jul 9 22:42:34 2024 by
|
417
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
418
|
+
0.9.36 (ruby-3.2.2).
|
419
419
|
</div>
|
420
420
|
|
421
421
|
</div>
|