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
data/config.ru CHANGED
@@ -5,7 +5,7 @@ require 'opal/sprockets'
5
5
  opal_server = Opal::Sprockets::Server.new{|s|
6
6
  # Let javascript_include_tag to serve compiled version of lib/dxopal.rb
7
7
  s.append_path 'lib'
8
- s.main = 'dxopal.rb'
8
+ s.main = 'dxopal'
9
9
  # Serve static files
10
10
  s.public_root = __dir__
11
11
  # Just serve static ./index.html
@@ -0,0 +1,172 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Module: DXOpal::Constants::Colors
8
+
9
+ &mdash; Documentation by YARD 0.9.36
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "DXOpal::Constants::Colors";
19
+ relpath = '../../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../../_index.html">Index (C)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../../DXOpal.html" title="DXOpal (module)">DXOpal</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Constants.html" title="DXOpal::Constants (module)">Constants</a></span></span>
41
+ &raquo;
42
+ <span class="title">Colors</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Module: DXOpal::Constants::Colors
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+ <dl>
80
+ <dt>Defined in:</dt>
81
+ <dd>lib/dxopal/constants/colors.rb</dd>
82
+ </dl>
83
+
84
+ </div>
85
+
86
+ <h2>Overview</h2><div class="docstring">
87
+ <div class="discussion">
88
+
89
+ <p>Pre-defined ARGB colors</p>
90
+
91
+
92
+ </div>
93
+ </div>
94
+ <div class="tags">
95
+
96
+
97
+ </div>
98
+
99
+ <h2>
100
+ Constant Summary
101
+ <small><a href="#" class="constants_summary_toggle">collapse</a></small>
102
+ </h2>
103
+
104
+ <dl class="constants">
105
+
106
+ <dt id="C_BLACK-constant" class="">C_BLACK =
107
+
108
+ </dt>
109
+ <dd><pre class="code"><span class='lbracket'>[</span><span class='int'>255</span><span class='comma'>,</span> <span class='int'>0</span><span class='comma'>,</span> <span class='int'>0</span><span class='comma'>,</span> <span class='int'>0</span><span class='rbracket'>]</span></pre></dd>
110
+
111
+ <dt id="C_RED-constant" class="">C_RED =
112
+
113
+ </dt>
114
+ <dd><pre class="code"><span class='lbracket'>[</span><span class='int'>255</span><span class='comma'>,</span> <span class='int'>255</span><span class='comma'>,</span> <span class='int'>0</span><span class='comma'>,</span> <span class='int'>0</span><span class='rbracket'>]</span></pre></dd>
115
+
116
+ <dt id="C_GREEN-constant" class="">C_GREEN =
117
+
118
+ </dt>
119
+ <dd><pre class="code"><span class='lbracket'>[</span><span class='int'>255</span><span class='comma'>,</span> <span class='int'>0</span><span class='comma'>,</span> <span class='int'>255</span><span class='comma'>,</span> <span class='int'>0</span><span class='rbracket'>]</span></pre></dd>
120
+
121
+ <dt id="C_BLUE-constant" class="">C_BLUE =
122
+
123
+ </dt>
124
+ <dd><pre class="code"><span class='lbracket'>[</span><span class='int'>255</span><span class='comma'>,</span> <span class='int'>0</span><span class='comma'>,</span> <span class='int'>0</span><span class='comma'>,</span> <span class='int'>255</span><span class='rbracket'>]</span></pre></dd>
125
+
126
+ <dt id="C_YELLOW-constant" class="">C_YELLOW =
127
+
128
+ </dt>
129
+ <dd><pre class="code"><span class='lbracket'>[</span><span class='int'>255</span><span class='comma'>,</span> <span class='int'>255</span><span class='comma'>,</span> <span class='int'>255</span><span class='comma'>,</span> <span class='int'>0</span><span class='rbracket'>]</span></pre></dd>
130
+
131
+ <dt id="C_CYAN-constant" class="">C_CYAN =
132
+
133
+ </dt>
134
+ <dd><pre class="code"><span class='lbracket'>[</span><span class='int'>255</span><span class='comma'>,</span> <span class='int'>0</span><span class='comma'>,</span> <span class='int'>255</span><span class='comma'>,</span> <span class='int'>255</span><span class='rbracket'>]</span></pre></dd>
135
+
136
+ <dt id="C_MAGENTA-constant" class="">C_MAGENTA =
137
+
138
+ </dt>
139
+ <dd><pre class="code"><span class='lbracket'>[</span><span class='int'>255</span><span class='comma'>,</span> <span class='int'>255</span><span class='comma'>,</span> <span class='int'>0</span><span class='comma'>,</span> <span class='int'>255</span><span class='rbracket'>]</span></pre></dd>
140
+
141
+ <dt id="C_WHITE-constant" class="">C_WHITE =
142
+
143
+ </dt>
144
+ <dd><pre class="code"><span class='lbracket'>[</span><span class='int'>255</span><span class='comma'>,</span> <span class='int'>255</span><span class='comma'>,</span> <span class='int'>255</span><span class='comma'>,</span> <span class='int'>255</span><span class='rbracket'>]</span></pre></dd>
145
+
146
+ <dt id="C_DEFAULT-constant" class="">C_DEFAULT =
147
+
148
+ </dt>
149
+ <dd><pre class="code"><span class='lbracket'>[</span><span class='int'>0</span><span class='comma'>,</span> <span class='int'>0</span><span class='comma'>,</span> <span class='int'>0</span><span class='comma'>,</span> <span class='int'>0</span><span class='rbracket'>]</span></pre></dd>
150
+
151
+ </dl>
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+ </div>
163
+
164
+ <div id="footer">
165
+ Generated on Tue Jul 9 22:42:33 2024 by
166
+ <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
167
+ 0.9.36 (ruby-3.2.2).
168
+ </div>
169
+
170
+ </div>
171
+ </body>
172
+ </html>
@@ -0,0 +1,115 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Module: DXOpal::Constants
8
+
9
+ &mdash; Documentation by YARD 0.9.36
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "DXOpal::Constants";
19
+ relpath = '../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../_index.html">Index (C)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../DXOpal.html" title="DXOpal (module)">DXOpal</a></span></span>
41
+ &raquo;
42
+ <span class="title">Constants</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Module: DXOpal::Constants
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+ <dl>
80
+ <dt>Defined in:</dt>
81
+ <dd>lib/dxopal/constants/colors.rb</dd>
82
+ </dl>
83
+
84
+ </div>
85
+
86
+ <h2>Defined Under Namespace</h2>
87
+ <p class="children">
88
+
89
+
90
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="Constants/Colors.html" title="DXOpal::Constants::Colors (module)">Colors</a></span>
91
+
92
+
93
+
94
+
95
+ </p>
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+ </div>
106
+
107
+ <div id="footer">
108
+ Generated on Tue Jul 9 22:42:33 2024 by
109
+ <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
110
+ 0.9.36 (ruby-3.2.2).
111
+ </div>
112
+
113
+ </div>
114
+ </body>
115
+ </html>
@@ -6,15 +6,15 @@
6
6
  <title>
7
7
  Class: DXOpal::Font
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::Font";
19
19
  relpath = '../';
20
20
  </script>
@@ -94,7 +94,7 @@
94
94
 
95
95
  <dl>
96
96
  <dt>Defined in:</dt>
97
- <dd>opal/dxopal/font.rb</dd>
97
+ <dd>lib/dxopal/font.rb</dd>
98
98
  </dl>
99
99
 
100
100
  </div>
@@ -219,6 +219,28 @@
219
219
 
220
220
 
221
221
 
222
+ <span class="summary_desc"><div class='inline'></div></span>
223
+
224
+ </li>
225
+
226
+
227
+ <li class="public ">
228
+ <span class="summary_signature">
229
+
230
+ <a href="#get_width-instance_method" title="#get_width (instance method)">#<strong>get_width</strong>(string) &#x21d2; Object </a>
231
+
232
+
233
+
234
+ </span>
235
+
236
+
237
+
238
+
239
+
240
+
241
+
242
+
243
+
222
244
  <span class="summary_desc"><div class='inline'></div></span>
223
245
 
224
246
  </li>
@@ -290,7 +312,7 @@
290
312
  </h3><div class="docstring">
291
313
  <div class="discussion">
292
314
 
293
- <p>Returns a new instance of Font</p>
315
+ <p>Returns a new instance of Font.</p>
294
316
 
295
317
 
296
318
  </div>
@@ -311,7 +333,7 @@
311
333
  12</pre>
312
334
  </td>
313
335
  <td>
314
- <pre class="code"><span class="info file"># File 'opal/dxopal/font.rb', line 8</span>
336
+ <pre class="code"><span class="info file"># File 'lib/dxopal/font.rb', line 8</span>
315
337
 
316
338
  <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_size'>size</span><span class='comma'>,</span> <span class='id identifier rubyid_fontname'>fontname</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_option'>option</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
317
339
  <span class='ivar'>@size</span> <span class='op'>=</span> <span class='id identifier rubyid_size'>size</span>
@@ -348,7 +370,7 @@
348
370
  5</pre>
349
371
  </td>
350
372
  <td>
351
- <pre class="code"><span class="info file"># File 'opal/dxopal/font.rb', line 5</span>
373
+ <pre class="code"><span class="info file"># File 'lib/dxopal/font.rb', line 5</span>
352
374
 
353
375
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_default'>default</span><span class='semicolon'>;</span> <span class='cvar'>@@default</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="" title="DXOpal::Font (class)">Font</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="DXOpal::Font#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='int'>24</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
354
376
  </td>
@@ -374,7 +396,7 @@
374
396
  6</pre>
375
397
  </td>
376
398
  <td>
377
- <pre class="code"><span class="info file"># File 'opal/dxopal/font.rb', line 6</span>
399
+ <pre class="code"><span class="info file"># File 'lib/dxopal/font.rb', line 6</span>
378
400
 
379
401
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_default='>default=</span><span class='lparen'>(</span><span class='id identifier rubyid_f'>f</span><span class='rparen'>)</span><span class='semicolon'>;</span> <span class='cvar'>@@default</span> <span class='op'>=</span> <span class='id identifier rubyid_f'>f</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
380
402
  </td>
@@ -414,12 +436,12 @@
414
436
  <pre class="lines">
415
437
 
416
438
 
417
- 18
418
- 19
419
- 20</pre>
439
+ 23
440
+ 24
441
+ 25</pre>
420
442
  </td>
421
443
  <td>
422
- <pre class="code"><span class="info file"># File 'opal/dxopal/font.rb', line 18</span>
444
+ <pre class="code"><span class="info file"># File 'lib/dxopal/font.rb', line 23</span>
423
445
 
424
446
  <span class='kw'>def</span> <span class='id identifier rubyid__spec_str'>_spec_str</span>
425
447
  <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='ivar'>@size</span><span class='embexpr_end'>}</span><span class='tstring_content'>px </span><span class='embexpr_beg'>#{</span><span class='ivar'>@fontname</span><span class='embexpr_end'>}</span><span class='tstring_end'>&quot;</span></span>
@@ -447,12 +469,44 @@
447
469
  15</pre>
448
470
  </td>
449
471
  <td>
450
- <pre class="code"><span class="info file"># File 'opal/dxopal/font.rb', line 15</span>
472
+ <pre class="code"><span class="info file"># File 'lib/dxopal/font.rb', line 15</span>
451
473
 
452
474
  <span class='kw'>def</span> <span class='id identifier rubyid_fontname'>fontname</span><span class='semicolon'>;</span> <span class='ivar'>@orig_fontname</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
453
475
  </td>
454
476
  </tr>
455
477
  </table>
478
+ </div>
479
+
480
+ <div class="method_details ">
481
+ <h3 class="signature " id="get_width-instance_method">
482
+
483
+ #<strong>get_width</strong>(string) &#x21d2; <tt>Object</tt>
484
+
485
+
486
+
487
+
488
+
489
+ </h3><table class="source_code">
490
+ <tr>
491
+ <td>
492
+ <pre class="lines">
493
+
494
+
495
+ 17
496
+ 18
497
+ 19
498
+ 20</pre>
499
+ </td>
500
+ <td>
501
+ <pre class="code"><span class="info file"># File 'lib/dxopal/font.rb', line 17</span>
502
+
503
+ <span class='kw'>def</span> <span class='id identifier rubyid_get_width'>get_width</span><span class='lparen'>(</span><span class='id identifier rubyid_string'>string</span><span class='rparen'>)</span>
504
+ <span class='id identifier rubyid_canvas'>canvas</span> <span class='op'>=</span> <span class='const'>Native</span><span class='lparen'>(</span><span class='backtick'>`</span><span class='tstring_content'>document.getElementById(&#39;dxopal-canvas&#39;)</span><span class='tstring_end'>`</span></span><span class='rparen'>)</span>
505
+ <span class='id identifier rubyid_canvas'>canvas</span><span class='period'>.</span><span class='id identifier rubyid_getContext'>getContext</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>2d</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_measureText'>measureText</span><span class='lparen'>(</span><span class='id identifier rubyid_string'>string</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_width'>width</span>
506
+ <span class='kw'>end</span></pre>
507
+ </td>
508
+ </tr>
509
+ </table>
456
510
  </div>
457
511
 
458
512
  <div class="method_details ">
@@ -473,7 +527,7 @@
473
527
  14</pre>
474
528
  </td>
475
529
  <td>
476
- <pre class="code"><span class="info file"># File 'opal/dxopal/font.rb', line 14</span>
530
+ <pre class="code"><span class="info file"># File 'lib/dxopal/font.rb', line 14</span>
477
531
 
478
532
  <span class='kw'>def</span> <span class='id identifier rubyid_size'>size</span><span class='semicolon'>;</span> <span class='ivar'>@size</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
479
533
  </td>
@@ -486,9 +540,9 @@
486
540
  </div>
487
541
 
488
542
  <div id="footer">
489
- Generated on Sat Sep 29 15:56:47 2018 by
490
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
491
- 0.9.16 (ruby-2.5.1).
543
+ Generated on Tue Jul 9 22:42:34 2024 by
544
+ <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
545
+ 0.9.36 (ruby-3.2.2).
492
546
  </div>
493
547
 
494
548
  </div>