dxopal 1.5.1 → 1.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/Gemfile +2 -1
  4. data/Gemfile.lock +20 -20
  5. data/README.md +3 -3
  6. data/Rakefile +2 -14
  7. data/build/dxopal.js +26114 -18554
  8. data/build/dxopal.min.js +1 -1
  9. data/doc/api/DXOpal.html +10 -10
  10. data/doc/api/DXOpal/Constants.html +115 -0
  11. data/doc/api/DXOpal/Constants/Colors.html +172 -0
  12. data/doc/api/DXOpal/Font.html +71 -17
  13. data/doc/api/DXOpal/Image.html +891 -398
  14. data/doc/api/DXOpal/Input.html +814 -91
  15. data/doc/api/DXOpal/Input/KeyCodes.html +986 -0
  16. data/doc/api/DXOpal/Input/MouseCodes.html +7 -7
  17. data/doc/api/DXOpal/Input/Touch.html +834 -0
  18. data/doc/api/DXOpal/RemoteResource.html +16 -18
  19. data/doc/api/DXOpal/Sound.html +15 -15
  20. data/doc/api/DXOpal/SoundEffect.html +11 -13
  21. data/doc/api/DXOpal/SoundEffect/WaveTypes.html +7 -7
  22. data/doc/api/DXOpal/Sprite.html +517 -40
  23. data/doc/api/DXOpal/Sprite/CollisionArea.html +126 -0
  24. data/doc/api/DXOpal/Sprite/CollisionArea/Base.html +649 -0
  25. data/doc/api/DXOpal/Sprite/CollisionArea/Circle.html +656 -0
  26. data/doc/api/DXOpal/Sprite/CollisionArea/Point.html +448 -0
  27. data/doc/api/DXOpal/Sprite/CollisionArea/Rect.html +549 -0
  28. data/doc/api/DXOpal/Sprite/CollisionArea/Triangle.html +423 -0
  29. data/doc/api/DXOpal/Sprite/CollisionCheck.html +926 -0
  30. data/doc/api/DXOpal/Sprite/CollisionCheck/ClassMethods.html +268 -0
  31. data/doc/api/DXOpal/Sprite/Physics.html +426 -0
  32. data/doc/api/DXOpal/Window.html +235 -152
  33. data/doc/api/Kernel.html +131 -0
  34. data/doc/api/_index.html +276 -4
  35. data/doc/api/class_list.html +1 -1
  36. data/doc/api/css/style.css +1 -0
  37. data/doc/api/file.README.html +6 -8
  38. data/doc/api/frames.html +1 -1
  39. data/doc/api/index.html +6 -8
  40. data/doc/api/method_list.html +1600 -0
  41. data/doc/api/top-level-namespace.html +154 -3
  42. data/lib/dxopal/input.rb +4 -2
  43. data/lib/dxopal/version.rb +1 -1
  44. metadata +21 -8
@@ -6,15 +6,15 @@
6
6
  <title>
7
7
  Class: DXOpal::Image
8
8
 
9
- &mdash; Documentation by YARD 0.9.16
9
+ &mdash; Documentation by YARD 0.9.26
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::Image";
19
19
  relpath = '../';
20
20
  </script>
@@ -96,7 +96,7 @@
96
96
 
97
97
  <dl>
98
98
  <dt>Defined in:</dt>
99
- <dd>opal/dxopal/image.rb</dd>
99
+ <dd>lib/dxopal/image.rb</dd>
100
100
  </dl>
101
101
 
102
102
  </div>
@@ -222,6 +222,60 @@
222
222
  <p>Returns the value of attribute height.</p>
223
223
  </div></span>
224
224
 
225
+ </li>
226
+
227
+
228
+ <li class="public ">
229
+ <span class="summary_signature">
230
+
231
+ <a href="#loaded-instance_method" title="#loaded (instance method)">#<strong>loaded</strong> &#x21d2; Object </a>
232
+
233
+
234
+
235
+ </span>
236
+
237
+
238
+
239
+
240
+
241
+
242
+
243
+
244
+
245
+
246
+
247
+
248
+ <span class="summary_desc"><div class='inline'>
249
+ <p>Returns the value of attribute loaded.</p>
250
+ </div></span>
251
+
252
+ </li>
253
+
254
+
255
+ <li class="public ">
256
+ <span class="summary_signature">
257
+
258
+ <a href="#promise-instance_method" title="#promise (instance method)">#<strong>promise</strong> &#x21d2; Object </a>
259
+
260
+
261
+
262
+ </span>
263
+
264
+
265
+
266
+
267
+
268
+
269
+
270
+
271
+
272
+
273
+
274
+
275
+ <span class="summary_desc"><div class='inline'>
276
+ <p>Returns the value of attribute promise.</p>
277
+ </div></span>
278
+
225
279
  </li>
226
280
 
227
281
 
@@ -288,6 +342,52 @@
288
342
  <p>Load remote image (called via Window.load_resources).</p>
289
343
  </div></span>
290
344
 
345
+ </li>
346
+
347
+
348
+ <li class="public ">
349
+ <span class="summary_signature">
350
+
351
+ <a href="#hsl2rgb-class_method" title="hsl2rgb (class method)">.<strong>hsl2rgb</strong>(h, s, l) &#x21d2; Object </a>
352
+
353
+
354
+
355
+ </span>
356
+
357
+
358
+
359
+
360
+
361
+
362
+
363
+
364
+
365
+ <span class="summary_desc"><div class='inline'>
366
+ <p>Convert HSL to RGB (DXOpal original; not in DXRuby) h: 0-359 s: 0-100 l: 0-100.</p>
367
+ </div></span>
368
+
369
+ </li>
370
+
371
+
372
+ <li class="public ">
373
+ <span class="summary_signature">
374
+
375
+ <a href="#load-class_method" title="load (class method)">.<strong>load</strong>(path_or_url) &#x21d2; Object </a>
376
+
377
+
378
+
379
+ </span>
380
+
381
+
382
+
383
+
384
+
385
+
386
+
387
+
388
+
389
+ <span class="summary_desc"><div class='inline'></div></span>
390
+
291
391
  </li>
292
392
 
293
393
 
@@ -462,8 +562,7 @@
462
562
 
463
563
 
464
564
  <span class="summary_desc"><div class='inline'>
465
- <p>Return a string like &#39;rgb(255, 255, 255)&#39; `color` is 3 or 4
466
- numbers.</p>
565
+ <p>Return a string like &#39;rgb(255, 255, 255)&#39; `color` is 3 or 4 numbers.</p>
467
566
  </div></span>
468
567
 
469
568
  </li>
@@ -487,8 +586,7 @@ numbers.</p>
487
586
 
488
587
 
489
588
  <span class="summary_desc"><div class='inline'>
490
- <p>Return a string like &#39;rgba(255, 255, 255, 128)&#39; `color` is 3 or 4
491
- numbers.</p>
589
+ <p>Return a string like &#39;rgba(255, 255, 255, 128)&#39; `color` is 3 or 4 numbers.</p>
492
590
  </div></span>
493
591
 
494
592
  </li>
@@ -750,9 +848,7 @@ numbers.</p>
750
848
 
751
849
 
752
850
  <span class="summary_desc"><div class='inline'>
753
- <p>Draw an Image on this image with rotation - angle: Rotation angle (radian)
754
- - center_x, center_y: Rotation center in the `image` (default: center of
755
- the `image`).</p>
851
+ <p>Draw an Image on this image with rotation - angle: Rotation angle (radian) - center_x, center_y: Rotation center in the `image` (default: center of the `image`).</p>
756
852
  </div></span>
757
853
 
758
854
  </li>
@@ -776,9 +872,7 @@ the `image`).</p>
776
872
 
777
873
 
778
874
  <span class="summary_desc"><div class='inline'>
779
- <p>Draw an Image on this image with scaling - scale_x, scale_y: scaling factor
780
- (eg. 1.5) - center_x, center_y: scaling center (in other words, the point
781
- which does not move by this scaling. Default: image center).</p>
875
+ <p>Draw an Image on this image with scaling - scale_x, scale_y: scaling factor (eg. 1.5) - center_x, center_y: scaling center (in other words, the point which does not move by this scaling. Default: image center).</p>
782
876
  </div></span>
783
877
 
784
878
  </li>
@@ -855,6 +949,72 @@ which does not move by this scaling. Default: image center).</p>
855
949
  <p>Draw a line on this image.</p>
856
950
  </div></span>
857
951
 
952
+ </li>
953
+
954
+
955
+ <li class="public ">
956
+ <span class="summary_signature">
957
+
958
+ <a href="#load-instance_method" title="#load (instance method)">#<strong>load</strong>(path_or_url) &#x21d2; Object </a>
959
+
960
+
961
+
962
+ </span>
963
+
964
+
965
+
966
+
967
+
968
+
969
+
970
+
971
+
972
+ <span class="summary_desc"><div class='inline'></div></span>
973
+
974
+ </li>
975
+
976
+
977
+ <li class="public ">
978
+ <span class="summary_signature">
979
+
980
+ <a href="#loaded%3F-instance_method" title="#loaded? (instance method)">#<strong>loaded?</strong> &#x21d2; Boolean </a>
981
+
982
+
983
+
984
+ </span>
985
+
986
+
987
+
988
+
989
+
990
+
991
+
992
+
993
+
994
+ <span class="summary_desc"><div class='inline'></div></span>
995
+
996
+ </li>
997
+
998
+
999
+ <li class="public ">
1000
+ <span class="summary_signature">
1001
+
1002
+ <a href="#onload-instance_method" title="#onload (instance method)">#<strong>onload</strong>(&amp;block) &#x21d2; Object </a>
1003
+
1004
+
1005
+
1006
+ </span>
1007
+
1008
+
1009
+
1010
+
1011
+
1012
+
1013
+
1014
+
1015
+
1016
+ <span class="summary_desc"><div class='inline'></div></span>
1017
+
858
1018
  </li>
859
1019
 
860
1020
 
@@ -876,8 +1036,7 @@ which does not move by this scaling. Default: image center).</p>
876
1036
 
877
1037
 
878
1038
  <span class="summary_desc"><div class='inline'>
879
- <p>Set alpha of the pixels of the given color to 0 - color : RGB color (If
880
- ARGV color is given, A is just ignored).</p>
1039
+ <p>Set alpha of the pixels of the given color to 0 - color : RGB color (If ARGV color is given, A is just ignored).</p>
881
1040
  </div></span>
882
1041
 
883
1042
  </li>
@@ -1022,16 +1181,16 @@ ARGV color is given, A is just ignored).</p>
1022
1181
  <pre class="lines">
1023
1182
 
1024
1183
 
1025
- 32
1026
- 33
1027
- 34
1028
- 35
1029
- 36
1030
- 37
1031
- 38</pre>
1184
+ 91
1185
+ 92
1186
+ 93
1187
+ 94
1188
+ 95
1189
+ 96
1190
+ 97</pre>
1032
1191
  </td>
1033
1192
  <td>
1034
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 32</span>
1193
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 91</span>
1035
1194
 
1036
1195
  <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_width'>width</span><span class='comma'>,</span> <span class='id identifier rubyid_height'>height</span><span class='comma'>,</span> <span class='id identifier rubyid_color'>color</span><span class='op'>=</span><span class='const'>C_DEFAULT</span><span class='comma'>,</span> <span class='label'>canvas:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
1037
1196
  <span class='ivar'>@width</span><span class='comma'>,</span> <span class='ivar'>@height</span> <span class='op'>=</span> <span class='id identifier rubyid_width'>width</span><span class='comma'>,</span> <span class='id identifier rubyid_height'>height</span>
@@ -1064,7 +1223,7 @@ ARGV color is given, A is just ignored).</p>
1064
1223
  </h3><div class="docstring">
1065
1224
  <div class="discussion">
1066
1225
 
1067
- <p>Returns the value of attribute canvas</p>
1226
+ <p>Returns the value of attribute canvas.</p>
1068
1227
 
1069
1228
 
1070
1229
  </div>
@@ -1078,12 +1237,12 @@ ARGV color is given, A is just ignored).</p>
1078
1237
  <pre class="lines">
1079
1238
 
1080
1239
 
1081
- 39
1082
- 40
1083
- 41</pre>
1240
+ 98
1241
+ 99
1242
+ 100</pre>
1084
1243
  </td>
1085
1244
  <td>
1086
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 39</span>
1245
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 98</span>
1087
1246
 
1088
1247
  <span class='kw'>def</span> <span class='id identifier rubyid_canvas'>canvas</span>
1089
1248
  <span class='ivar'>@canvas</span>
@@ -1107,7 +1266,7 @@ ARGV color is given, A is just ignored).</p>
1107
1266
  </h3><div class="docstring">
1108
1267
  <div class="discussion">
1109
1268
 
1110
- <p>Returns the value of attribute ctx</p>
1269
+ <p>Returns the value of attribute ctx.</p>
1111
1270
 
1112
1271
 
1113
1272
  </div>
@@ -1121,12 +1280,12 @@ ARGV color is given, A is just ignored).</p>
1121
1280
  <pre class="lines">
1122
1281
 
1123
1282
 
1124
- 39
1125
- 40
1126
- 41</pre>
1283
+ 98
1284
+ 99
1285
+ 100</pre>
1127
1286
  </td>
1128
1287
  <td>
1129
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 39</span>
1288
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 98</span>
1130
1289
 
1131
1290
  <span class='kw'>def</span> <span class='id identifier rubyid_ctx'>ctx</span>
1132
1291
  <span class='ivar'>@ctx</span>
@@ -1150,7 +1309,7 @@ ARGV color is given, A is just ignored).</p>
1150
1309
  </h3><div class="docstring">
1151
1310
  <div class="discussion">
1152
1311
 
1153
- <p>Returns the value of attribute height</p>
1312
+ <p>Returns the value of attribute height.</p>
1154
1313
 
1155
1314
 
1156
1315
  </div>
@@ -1164,12 +1323,12 @@ ARGV color is given, A is just ignored).</p>
1164
1323
  <pre class="lines">
1165
1324
 
1166
1325
 
1167
- 39
1168
- 40
1169
- 41</pre>
1326
+ 98
1327
+ 99
1328
+ 100</pre>
1170
1329
  </td>
1171
1330
  <td>
1172
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 39</span>
1331
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 98</span>
1173
1332
 
1174
1333
  <span class='kw'>def</span> <span class='id identifier rubyid_height'>height</span>
1175
1334
  <span class='ivar'>@height</span>
@@ -1180,11 +1339,11 @@ ARGV color is given, A is just ignored).</p>
1180
1339
  </div>
1181
1340
 
1182
1341
 
1183
- <span id=""></span>
1342
+ <span id="loaded=-instance_method"></span>
1184
1343
  <div class="method_details ">
1185
- <h3 class="signature " id="width-instance_method">
1344
+ <h3 class="signature " id="loaded-instance_method">
1186
1345
 
1187
- #<strong>width</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
1346
+ #<strong>loaded</strong> &#x21d2; <tt>Object</tt>
1188
1347
 
1189
1348
 
1190
1349
 
@@ -1193,7 +1352,7 @@ ARGV color is given, A is just ignored).</p>
1193
1352
  </h3><div class="docstring">
1194
1353
  <div class="discussion">
1195
1354
 
1196
- <p>Returns the value of attribute width</p>
1355
+ <p>Returns the value of attribute loaded.</p>
1197
1356
 
1198
1357
 
1199
1358
  </div>
@@ -1207,32 +1366,27 @@ ARGV color is given, A is just ignored).</p>
1207
1366
  <pre class="lines">
1208
1367
 
1209
1368
 
1210
- 39
1211
- 40
1212
- 41</pre>
1369
+ 59
1370
+ 60
1371
+ 61</pre>
1213
1372
  </td>
1214
1373
  <td>
1215
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 39</span>
1374
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 59</span>
1216
1375
 
1217
- <span class='kw'>def</span> <span class='id identifier rubyid_width'>width</span>
1218
- <span class='ivar'>@width</span>
1376
+ <span class='kw'>def</span> <span class='id identifier rubyid_loaded'>loaded</span>
1377
+ <span class='ivar'>@loaded</span>
1219
1378
  <span class='kw'>end</span></pre>
1220
1379
  </td>
1221
1380
  </tr>
1222
1381
  </table>
1223
1382
  </div>
1224
1383
 
1225
- </div>
1226
-
1227
-
1228
- <div id="class_method_details" class="method_details_list">
1229
- <h2>Class Method Details</h2>
1230
-
1231
-
1232
- <div class="method_details first">
1233
- <h3 class="signature first" id="_load-class_method">
1384
+
1385
+ <span id="promise=-instance_method"></span>
1386
+ <div class="method_details ">
1387
+ <h3 class="signature " id="promise-instance_method">
1234
1388
 
1235
- .<strong>_load</strong>(path_or_url) &#x21d2; <tt>Object</tt>
1389
+ #<strong>promise</strong> &#x21d2; <tt>Object</tt>
1236
1390
 
1237
1391
 
1238
1392
 
@@ -1241,7 +1395,7 @@ ARGV color is given, A is just ignored).</p>
1241
1395
  </h3><div class="docstring">
1242
1396
  <div class="discussion">
1243
1397
 
1244
- <p>Load remote image (called via Window.load_resources)</p>
1398
+ <p>Returns the value of attribute promise.</p>
1245
1399
 
1246
1400
 
1247
1401
  </div>
@@ -1255,65 +1409,27 @@ ARGV color is given, A is just ignored).</p>
1255
1409
  <pre class="lines">
1256
1410
 
1257
1411
 
1258
- 10
1259
- 11
1260
- 12
1261
- 13
1262
- 14
1263
- 15
1264
- 16
1265
- 17
1266
- 18
1267
- 19
1268
- 20
1269
- 21
1270
- 22
1271
- 23
1272
- 24
1273
- 25
1274
- 26
1275
- 27
1276
- 28
1277
- 29</pre>
1412
+ 59
1413
+ 60
1414
+ 61</pre>
1278
1415
  </td>
1279
1416
  <td>
1280
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 10</span>
1281
-
1282
- <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='id identifier rubyid_path_or_url'>path_or_url</span><span class='rparen'>)</span>
1283
- <span class='id identifier rubyid_raw_img'>raw_img</span> <span class='op'>=</span> <span class='backtick'>`</span><span class='tstring_content'>new Image()</span><span class='tstring_end'>`</span></span>
1284
- <span class='id identifier rubyid_img_promise'>img_promise</span> <span class='op'>=</span> <span class='backtick'>%x{</span><span class='tstring_content'>
1285
- new Promise(function(resolve, reject) {
1286
- raw_img.onload = function() {
1287
- resolve(raw_img);
1288
- };
1289
- raw_img.src = path_or_url;
1290
- });
1291
- </span><span class='tstring_end'>}</span></span>
1417
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 59</span>
1292
1418
 
1293
- <span class='id identifier rubyid_img'>img</span> <span class='op'>=</span> <span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='int'>0</span><span class='comma'>,</span> <span class='int'>0</span><span class='rparen'>)</span>
1294
- <span class='backtick'>%x{</span><span class='tstring_content'>
1295
- </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_img_promise'>img_promise</span><span class='embexpr_end'>}</span><span class='tstring_content'>.then(function(raw_img){
1296
- img.$_resize(raw_img.width, raw_img.height);
1297
- img.$_draw_raw_image(0, 0, raw_img);
1298
- });
1299
- </span><span class='tstring_end'>}</span></span>
1300
- <span class='kw'>return</span> <span class='id identifier rubyid_img'>img</span><span class='comma'>,</span> <span class='id identifier rubyid_img_promise'>img_promise</span>
1419
+ <span class='kw'>def</span> <span class='id identifier rubyid_promise'>promise</span>
1420
+ <span class='ivar'>@promise</span>
1301
1421
  <span class='kw'>end</span></pre>
1302
1422
  </td>
1303
1423
  </tr>
1304
1424
  </table>
1305
1425
  </div>
1306
1426
 
1307
- </div>
1308
-
1309
- <div id="instance_method_details" class="method_details_list">
1310
- <h2>Instance Method Details</h2>
1311
-
1312
-
1313
- <div class="method_details first">
1314
- <h3 class="signature first" id="[]-instance_method">
1427
+
1428
+ <span id=""></span>
1429
+ <div class="method_details ">
1430
+ <h3 class="signature " id="width-instance_method">
1315
1431
 
1316
- #<strong>[]</strong>(x, y) &#x21d2; <tt>Object</tt>
1432
+ #<strong>width</strong> &#x21d2; <tt>Object</tt> <span class="extras">(readonly)</span>
1317
1433
 
1318
1434
 
1319
1435
 
@@ -1322,7 +1438,7 @@ ARGV color is given, A is just ignored).</p>
1322
1438
  </h3><div class="docstring">
1323
1439
  <div class="discussion">
1324
1440
 
1325
- <p>Get a pixel as ARGB array</p>
1441
+ <p>Returns the value of attribute width.</p>
1326
1442
 
1327
1443
 
1328
1444
  </div>
@@ -1336,21 +1452,261 @@ ARGV color is given, A is just ignored).</p>
1336
1452
  <pre class="lines">
1337
1453
 
1338
1454
 
1339
- 116
1340
- 117
1341
- 118
1342
- 119
1343
- 120
1344
- 121
1345
- 122
1346
- 123
1347
- 124
1348
- 125</pre>
1455
+ 98
1456
+ 99
1457
+ 100</pre>
1349
1458
  </td>
1350
1459
  <td>
1351
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 116</span>
1460
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 98</span>
1352
1461
 
1353
- <span class='kw'>def</span> <span class='op'>[]</span><span class='lparen'>(</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span><span class='rparen'>)</span>
1462
+ <span class='kw'>def</span> <span class='id identifier rubyid_width'>width</span>
1463
+ <span class='ivar'>@width</span>
1464
+ <span class='kw'>end</span></pre>
1465
+ </td>
1466
+ </tr>
1467
+ </table>
1468
+ </div>
1469
+
1470
+ </div>
1471
+
1472
+
1473
+ <div id="class_method_details" class="method_details_list">
1474
+ <h2>Class Method Details</h2>
1475
+
1476
+
1477
+ <div class="method_details first">
1478
+ <h3 class="signature first" id="_load-class_method">
1479
+
1480
+ .<strong>_load</strong>(path_or_url) &#x21d2; <tt>Object</tt>
1481
+
1482
+
1483
+
1484
+
1485
+
1486
+ </h3><div class="docstring">
1487
+ <div class="discussion">
1488
+
1489
+ <p>Load remote image (called via Window.load_resources)</p>
1490
+
1491
+
1492
+ </div>
1493
+ </div>
1494
+ <div class="tags">
1495
+
1496
+
1497
+ </div><table class="source_code">
1498
+ <tr>
1499
+ <td>
1500
+ <pre class="lines">
1501
+
1502
+
1503
+ 38
1504
+ 39
1505
+ 40
1506
+ 41
1507
+ 42
1508
+ 43
1509
+ 44
1510
+ 45
1511
+ 46
1512
+ 47
1513
+ 48
1514
+ 49
1515
+ 50
1516
+ 51
1517
+ 52
1518
+ 53
1519
+ 54
1520
+ 55
1521
+ 56
1522
+ 57</pre>
1523
+ </td>
1524
+ <td>
1525
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 38</span>
1526
+
1527
+ <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='id identifier rubyid_path_or_url'>path_or_url</span><span class='rparen'>)</span>
1528
+ <span class='id identifier rubyid_raw_img'>raw_img</span> <span class='op'>=</span> <span class='backtick'>`</span><span class='tstring_content'>new Image()</span><span class='tstring_end'>`</span></span>
1529
+ <span class='id identifier rubyid_img_promise'>img_promise</span> <span class='op'>=</span> <span class='backtick'>%x{</span><span class='tstring_content'>
1530
+ new Promise(function(resolve, reject) {
1531
+ raw_img.onload = function() {
1532
+ resolve(raw_img);
1533
+ };
1534
+ raw_img.src = path_or_url;
1535
+ });
1536
+ </span><span class='tstring_end'>}</span></span>
1537
+
1538
+ <span class='id identifier rubyid_img'>img</span> <span class='op'>=</span> <span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='int'>0</span><span class='comma'>,</span> <span class='int'>0</span><span class='rparen'>)</span>
1539
+ <span class='backtick'>%x{</span><span class='tstring_content'>
1540
+ </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_img_promise'>img_promise</span><span class='embexpr_end'>}</span><span class='tstring_content'>.then(function(raw_img){
1541
+ img.$_resize(raw_img.width, raw_img.height);
1542
+ img.$_draw_raw_image(0, 0, raw_img);
1543
+ });
1544
+ </span><span class='tstring_end'>}</span></span>
1545
+ <span class='kw'>return</span> <span class='id identifier rubyid_img'>img</span><span class='comma'>,</span> <span class='id identifier rubyid_img_promise'>img_promise</span>
1546
+ <span class='kw'>end</span></pre>
1547
+ </td>
1548
+ </tr>
1549
+ </table>
1550
+ </div>
1551
+
1552
+ <div class="method_details ">
1553
+ <h3 class="signature " id="hsl2rgb-class_method">
1554
+
1555
+ .<strong>hsl2rgb</strong>(h, s, l) &#x21d2; <tt>Object</tt>
1556
+
1557
+
1558
+
1559
+
1560
+
1561
+ </h3><div class="docstring">
1562
+ <div class="discussion">
1563
+
1564
+ <p>Convert HSL to RGB (DXOpal original; not in DXRuby) h: 0-359 s: 0-100 l: 0-100</p>
1565
+
1566
+
1567
+ </div>
1568
+ </div>
1569
+ <div class="tags">
1570
+
1571
+
1572
+ </div><table class="source_code">
1573
+ <tr>
1574
+ <td>
1575
+ <pre class="lines">
1576
+
1577
+
1578
+ 13
1579
+ 14
1580
+ 15
1581
+ 16
1582
+ 17
1583
+ 18
1584
+ 19
1585
+ 20
1586
+ 21
1587
+ 22
1588
+ 23
1589
+ 24
1590
+ 25
1591
+ 26
1592
+ 27
1593
+ 28
1594
+ 29
1595
+ 30
1596
+ 31
1597
+ 32
1598
+ 33
1599
+ 34
1600
+ 35</pre>
1601
+ </td>
1602
+ <td>
1603
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 13</span>
1604
+
1605
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_hsl2rgb'>hsl2rgb</span><span class='lparen'>(</span><span class='id identifier rubyid_h'>h</span><span class='comma'>,</span> <span class='id identifier rubyid_s'>s</span><span class='comma'>,</span> <span class='id identifier rubyid_l'>l</span><span class='rparen'>)</span>
1606
+ <span class='kw'>if</span> <span class='id identifier rubyid_l'>l</span> <span class='op'>&lt;</span> <span class='int'>50</span>
1607
+ <span class='id identifier rubyid_max'>max</span> <span class='op'>=</span> <span class='float'>2.55</span> <span class='op'>*</span> <span class='lparen'>(</span><span class='id identifier rubyid_l'>l</span> <span class='op'>+</span> <span class='id identifier rubyid_l'>l</span><span class='op'>*</span><span class='lparen'>(</span><span class='id identifier rubyid_s'>s</span><span class='op'>/</span><span class='float'>100.0</span><span class='rparen'>)</span><span class='rparen'>)</span>
1608
+ <span class='id identifier rubyid_min'>min</span> <span class='op'>=</span> <span class='float'>2.55</span> <span class='op'>*</span> <span class='lparen'>(</span><span class='id identifier rubyid_l'>l</span> <span class='op'>-</span> <span class='id identifier rubyid_l'>l</span><span class='op'>*</span><span class='lparen'>(</span><span class='id identifier rubyid_s'>s</span><span class='op'>/</span><span class='float'>100.0</span><span class='rparen'>)</span><span class='rparen'>)</span>
1609
+ <span class='kw'>else</span>
1610
+ <span class='id identifier rubyid_max'>max</span> <span class='op'>=</span> <span class='float'>2.55</span> <span class='op'>*</span> <span class='lparen'>(</span><span class='id identifier rubyid_l'>l</span> <span class='op'>+</span> <span class='lparen'>(</span><span class='int'>100</span><span class='op'>-</span><span class='id identifier rubyid_l'>l</span><span class='rparen'>)</span><span class='op'>*</span><span class='lparen'>(</span><span class='id identifier rubyid_s'>s</span><span class='op'>/</span><span class='float'>100.0</span><span class='rparen'>)</span><span class='rparen'>)</span>
1611
+ <span class='id identifier rubyid_min'>min</span> <span class='op'>=</span> <span class='float'>2.55</span> <span class='op'>*</span> <span class='lparen'>(</span><span class='id identifier rubyid_l'>l</span> <span class='op'>-</span> <span class='lparen'>(</span><span class='int'>100</span><span class='op'>-</span><span class='id identifier rubyid_l'>l</span><span class='rparen'>)</span><span class='op'>*</span><span class='lparen'>(</span><span class='id identifier rubyid_s'>s</span><span class='op'>/</span><span class='float'>100.0</span><span class='rparen'>)</span><span class='rparen'>)</span>
1612
+ <span class='kw'>end</span>
1613
+ <span class='kw'>case</span> <span class='id identifier rubyid_h'>h</span>
1614
+ <span class='kw'>when</span> <span class='int'>0</span><span class='op'>...</span><span class='int'>60</span>
1615
+ <span class='lbracket'>[</span><span class='id identifier rubyid_max'>max</span><span class='comma'>,</span> <span class='lparen'>(</span><span class='id identifier rubyid_h'>h</span><span class='op'>/</span><span class='float'>60.0</span><span class='rparen'>)</span><span class='op'>*</span><span class='lparen'>(</span><span class='id identifier rubyid_max'>max</span><span class='op'>-</span><span class='id identifier rubyid_min'>min</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='id identifier rubyid_min'>min</span><span class='comma'>,</span> <span class='id identifier rubyid_min'>min</span><span class='rbracket'>]</span>
1616
+ <span class='kw'>when</span> <span class='int'>60</span><span class='op'>...</span><span class='int'>120</span>
1617
+ <span class='lbracket'>[</span><span class='lparen'>(</span><span class='lparen'>(</span><span class='int'>120</span><span class='op'>-</span><span class='id identifier rubyid_h'>h</span><span class='rparen'>)</span><span class='op'>/</span><span class='float'>60.0</span><span class='rparen'>)</span><span class='op'>*</span><span class='lparen'>(</span><span class='id identifier rubyid_max'>max</span><span class='op'>-</span><span class='id identifier rubyid_min'>min</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='id identifier rubyid_min'>min</span><span class='comma'>,</span> <span class='id identifier rubyid_max'>max</span><span class='comma'>,</span> <span class='id identifier rubyid_min'>min</span><span class='rbracket'>]</span>
1618
+ <span class='kw'>when</span> <span class='int'>120</span><span class='op'>...</span><span class='int'>180</span>
1619
+ <span class='lbracket'>[</span><span class='id identifier rubyid_min'>min</span><span class='comma'>,</span> <span class='id identifier rubyid_max'>max</span><span class='comma'>,</span> <span class='lparen'>(</span><span class='lparen'>(</span><span class='id identifier rubyid_h'>h</span><span class='op'>-</span><span class='int'>120</span><span class='rparen'>)</span><span class='op'>/</span><span class='float'>60.0</span><span class='rparen'>)</span><span class='op'>*</span><span class='lparen'>(</span><span class='id identifier rubyid_max'>max</span><span class='op'>-</span><span class='id identifier rubyid_min'>min</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='id identifier rubyid_min'>min</span><span class='rbracket'>]</span>
1620
+ <span class='kw'>when</span> <span class='int'>180</span><span class='op'>...</span><span class='int'>240</span>
1621
+ <span class='lbracket'>[</span><span class='id identifier rubyid_min'>min</span><span class='comma'>,</span> <span class='lparen'>(</span><span class='lparen'>(</span><span class='int'>240</span><span class='op'>-</span><span class='id identifier rubyid_h'>h</span><span class='rparen'>)</span><span class='op'>/</span><span class='float'>60.0</span><span class='rparen'>)</span><span class='op'>*</span><span class='lparen'>(</span><span class='id identifier rubyid_max'>max</span><span class='op'>-</span><span class='id identifier rubyid_min'>min</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='id identifier rubyid_min'>min</span><span class='comma'>,</span> <span class='id identifier rubyid_max'>max</span><span class='rbracket'>]</span>
1622
+ <span class='kw'>when</span> <span class='int'>240</span><span class='op'>...</span><span class='int'>300</span>
1623
+ <span class='lbracket'>[</span><span class='lparen'>(</span><span class='lparen'>(</span><span class='id identifier rubyid_h'>h</span><span class='op'>-</span><span class='int'>240</span><span class='rparen'>)</span><span class='op'>/</span><span class='float'>60.0</span><span class='rparen'>)</span><span class='op'>*</span><span class='lparen'>(</span><span class='id identifier rubyid_max'>max</span><span class='op'>-</span><span class='id identifier rubyid_min'>min</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='id identifier rubyid_min'>min</span><span class='comma'>,</span> <span class='id identifier rubyid_min'>min</span><span class='comma'>,</span> <span class='id identifier rubyid_max'>max</span><span class='rbracket'>]</span>
1624
+ <span class='kw'>else</span>
1625
+ <span class='lbracket'>[</span><span class='id identifier rubyid_max'>max</span><span class='comma'>,</span> <span class='id identifier rubyid_min'>min</span><span class='comma'>,</span> <span class='lparen'>(</span><span class='lparen'>(</span><span class='int'>360</span><span class='op'>-</span><span class='id identifier rubyid_h'>h</span><span class='rparen'>)</span><span class='op'>/</span><span class='float'>60.0</span><span class='rparen'>)</span><span class='op'>*</span><span class='lparen'>(</span><span class='id identifier rubyid_max'>max</span><span class='op'>-</span><span class='id identifier rubyid_min'>min</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='id identifier rubyid_min'>min</span><span class='rbracket'>]</span>
1626
+ <span class='kw'>end</span>
1627
+ <span class='kw'>end</span></pre>
1628
+ </td>
1629
+ </tr>
1630
+ </table>
1631
+ </div>
1632
+
1633
+ <div class="method_details ">
1634
+ <h3 class="signature " id="load-class_method">
1635
+
1636
+ .<strong>load</strong>(path_or_url) &#x21d2; <tt>Object</tt>
1637
+
1638
+
1639
+
1640
+
1641
+
1642
+ </h3><table class="source_code">
1643
+ <tr>
1644
+ <td>
1645
+ <pre class="lines">
1646
+
1647
+
1648
+ 62
1649
+ 63
1650
+ 64</pre>
1651
+ </td>
1652
+ <td>
1653
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 62</span>
1654
+
1655
+ <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='id identifier rubyid_path_or_url'>path_or_url</span><span class='rparen'>)</span>
1656
+ <span class='kw'>return</span> <span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='int'>1</span><span class='comma'>,</span> <span class='int'>1</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_load'>load</span><span class='lparen'>(</span><span class='id identifier rubyid_path_or_url'>path_or_url</span><span class='rparen'>)</span>
1657
+ <span class='kw'>end</span></pre>
1658
+ </td>
1659
+ </tr>
1660
+ </table>
1661
+ </div>
1662
+
1663
+ </div>
1664
+
1665
+ <div id="instance_method_details" class="method_details_list">
1666
+ <h2>Instance Method Details</h2>
1667
+
1668
+
1669
+ <div class="method_details first">
1670
+ <h3 class="signature first" id="[]-instance_method">
1671
+
1672
+ #<strong>[]</strong>(x, y) &#x21d2; <tt>Object</tt>
1673
+
1674
+
1675
+
1676
+
1677
+
1678
+ </h3><div class="docstring">
1679
+ <div class="discussion">
1680
+
1681
+ <p>Get a pixel as ARGB array</p>
1682
+
1683
+
1684
+ </div>
1685
+ </div>
1686
+ <div class="tags">
1687
+
1688
+
1689
+ </div><table class="source_code">
1690
+ <tr>
1691
+ <td>
1692
+ <pre class="lines">
1693
+
1694
+
1695
+ 175
1696
+ 176
1697
+ 177
1698
+ 178
1699
+ 179
1700
+ 180
1701
+ 181
1702
+ 182
1703
+ 183
1704
+ 184</pre>
1705
+ </td>
1706
+ <td>
1707
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 175</span>
1708
+
1709
+ <span class='kw'>def</span> <span class='op'>[]</span><span class='lparen'>(</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span><span class='rparen'>)</span>
1354
1710
  <span class='id identifier rubyid_ctx'>ctx</span> <span class='op'>=</span> <span class='ivar'>@ctx</span>
1355
1711
  <span class='id identifier rubyid_ret'>ret</span> <span class='op'>=</span> <span class='kw'>nil</span>
1356
1712
  <span class='backtick'>%x{</span><span class='tstring_content'>
@@ -1391,15 +1747,15 @@ ARGV color is given, A is just ignored).</p>
1391
1747
  <pre class="lines">
1392
1748
 
1393
1749
 
1394
- 128
1395
- 129
1396
- 130</pre>
1750
+ 187
1751
+ 188
1752
+ 189</pre>
1397
1753
  </td>
1398
1754
  <td>
1399
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 128</span>
1755
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 187</span>
1400
1756
 
1401
1757
  <span class='kw'>def</span> <span class='op'>[]=</span><span class='lparen'>(</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span><span class='comma'>,</span> <span class='id identifier rubyid_color'>color</span><span class='rparen'>)</span>
1402
- <span class='id identifier rubyid_box_fill'>box_fill</span><span class='lparen'>(</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span><span class='comma'>,</span> <span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span><span class='comma'>,</span> <span class='id identifier rubyid_color'>color</span><span class='rparen'>)</span>
1758
+ <span class='id identifier rubyid_box_fill'>box_fill</span><span class='lparen'>(</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span><span class='comma'>,</span> <span class='id identifier rubyid_x'>x</span><span class='op'>+</span><span class='int'>1</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span><span class='op'>+</span><span class='int'>1</span><span class='comma'>,</span> <span class='id identifier rubyid_color'>color</span><span class='rparen'>)</span>
1403
1759
  <span class='kw'>end</span></pre>
1404
1760
  </td>
1405
1761
  </tr>
@@ -1432,14 +1788,14 @@ ARGV color is given, A is just ignored).</p>
1432
1788
  <pre class="lines">
1433
1789
 
1434
1790
 
1435
- 286
1436
- 287
1437
- 288
1438
- 289
1439
- 290</pre>
1791
+ 345
1792
+ 346
1793
+ 347
1794
+ 348
1795
+ 349</pre>
1440
1796
  </td>
1441
1797
  <td>
1442
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 286</span>
1798
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 345</span>
1443
1799
 
1444
1800
  <span class='kw'>def</span> <span class='id identifier rubyid__draw_raw_image'>_draw_raw_image</span><span class='lparen'>(</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span><span class='comma'>,</span> <span class='id identifier rubyid_raw_img'>raw_img</span><span class='rparen'>)</span>
1445
1801
  <span class='backtick'>%x{</span><span class='tstring_content'>
@@ -1477,12 +1833,12 @@ ARGV color is given, A is just ignored).</p>
1477
1833
  <pre class="lines">
1478
1834
 
1479
1835
 
1480
- 293
1481
- 294
1482
- 295</pre>
1836
+ 352
1837
+ 353
1838
+ 354</pre>
1483
1839
  </td>
1484
1840
  <td>
1485
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 293</span>
1841
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 352</span>
1486
1842
 
1487
1843
  <span class='kw'>def</span> <span class='id identifier rubyid__image_data'>_image_data</span><span class='lparen'>(</span><span class='id identifier rubyid_x'>x</span><span class='op'>=</span><span class='int'>0</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span><span class='op'>=</span><span class='int'>0</span><span class='comma'>,</span> <span class='id identifier rubyid_w'>w</span><span class='op'>=</span><span class='ivar'>@width</span><span class='comma'>,</span> <span class='id identifier rubyid_h'>h</span><span class='op'>=</span><span class='ivar'>@height</span><span class='rparen'>)</span>
1488
1844
  <span class='kw'>return</span> <span class='backtick'>`</span><span class='embexpr_beg'>#{</span><span class='ivar'>@ctx</span><span class='embexpr_end'>}</span><span class='tstring_content'>.getImageData(x, y, w, h)</span><span class='tstring_end'>`</span></span>
@@ -1518,12 +1874,12 @@ ARGV color is given, A is just ignored).</p>
1518
1874
  <pre class="lines">
1519
1875
 
1520
1876
 
1521
- 298
1522
- 299
1523
- 300</pre>
1877
+ 357
1878
+ 358
1879
+ 359</pre>
1524
1880
  </td>
1525
1881
  <td>
1526
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 298</span>
1882
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 357</span>
1527
1883
 
1528
1884
  <span class='kw'>def</span> <span class='id identifier rubyid__put_image_data'>_put_image_data</span><span class='lparen'>(</span><span class='id identifier rubyid_image_data'>image_data</span><span class='comma'>,</span> <span class='id identifier rubyid_x'>x</span><span class='op'>=</span><span class='int'>0</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span><span class='op'>=</span><span class='int'>0</span><span class='rparen'>)</span>
1529
1885
  <span class='backtick'>`</span><span class='embexpr_beg'>#{</span><span class='ivar'>@ctx</span><span class='embexpr_end'>}</span><span class='tstring_content'>.putImageData(image_data, x, y)</span><span class='tstring_end'>`</span></span>
@@ -1559,16 +1915,16 @@ ARGV color is given, A is just ignored).</p>
1559
1915
  <pre class="lines">
1560
1916
 
1561
1917
 
1562
- 42
1563
- 43
1564
- 44
1565
- 45
1566
- 46
1567
- 47
1568
- 48</pre>
1918
+ 101
1919
+ 102
1920
+ 103
1921
+ 104
1922
+ 105
1923
+ 106
1924
+ 107</pre>
1569
1925
  </td>
1570
1926
  <td>
1571
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 42</span>
1927
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 101</span>
1572
1928
 
1573
1929
  <span class='kw'>def</span> <span class='id identifier rubyid__resize'>_resize</span><span class='lparen'>(</span><span class='id identifier rubyid_w'>w</span><span class='comma'>,</span> <span class='id identifier rubyid_h'>h</span><span class='rparen'>)</span>
1574
1930
  <span class='ivar'>@width</span><span class='comma'>,</span> <span class='ivar'>@height</span> <span class='op'>=</span> <span class='id identifier rubyid_w'>w</span><span class='comma'>,</span> <span class='id identifier rubyid_h'>h</span>
@@ -1608,21 +1964,21 @@ ARGV color is given, A is just ignored).</p>
1608
1964
  <pre class="lines">
1609
1965
 
1610
1966
 
1611
- 304
1612
- 305
1613
- 306
1614
- 307
1615
- 308
1616
- 309
1617
- 310
1618
- 311
1619
- 312
1620
- 313
1621
- 314
1622
- 315</pre>
1967
+ 363
1968
+ 364
1969
+ 365
1970
+ 366
1971
+ 367
1972
+ 368
1973
+ 369
1974
+ 370
1975
+ 371
1976
+ 372
1977
+ 373
1978
+ 374</pre>
1623
1979
  </td>
1624
1980
  <td>
1625
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 304</span>
1981
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 363</span>
1626
1982
 
1627
1983
  <span class='kw'>def</span> <span class='id identifier rubyid__rgb'>_rgb</span><span class='lparen'>(</span><span class='id identifier rubyid_color'>color</span><span class='rparen'>)</span>
1628
1984
  <span class='kw'>case</span> <span class='id identifier rubyid_color'>color</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span>
@@ -1653,8 +2009,7 @@ ARGV color is given, A is just ignored).</p>
1653
2009
  </h3><div class="docstring">
1654
2010
  <div class="discussion">
1655
2011
 
1656
- <p>Return a string like &#39;rgba(255, 255, 255, 128)&#39; `color` is 3 or 4
1657
- numbers</p>
2012
+ <p>Return a string like &#39;rgba(255, 255, 255, 128)&#39; `color` is 3 or 4 numbers</p>
1658
2013
 
1659
2014
 
1660
2015
  </div>
@@ -1668,12 +2023,12 @@ numbers</p>
1668
2023
  <pre class="lines">
1669
2024
 
1670
2025
 
1671
- 319
1672
- 320
1673
- 321</pre>
2026
+ 378
2027
+ 379
2028
+ 380</pre>
1674
2029
  </td>
1675
2030
  <td>
1676
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 319</span>
2031
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 378</span>
1677
2032
 
1678
2033
  <span class='kw'>def</span> <span class='id identifier rubyid__rgba'>_rgba</span><span class='lparen'>(</span><span class='id identifier rubyid_color'>color</span><span class='rparen'>)</span>
1679
2034
  <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>rgba(</span><span class='tstring_end'>&quot;</span></span> <span class='op'>+</span> <span class='id identifier rubyid__rgba_ary'>_rgba_ary</span><span class='lparen'>(</span><span class='id identifier rubyid_color'>color</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>, </span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>)</span><span class='tstring_end'>&quot;</span></span>
@@ -1709,21 +2064,21 @@ numbers</p>
1709
2064
  <pre class="lines">
1710
2065
 
1711
2066
 
1712
- 324
1713
- 325
1714
- 326
1715
- 327
1716
- 328
1717
- 329
1718
- 330
1719
- 331
1720
- 332
1721
- 333
1722
- 334
1723
- 335</pre>
2067
+ 383
2068
+ 384
2069
+ 385
2070
+ 386
2071
+ 387
2072
+ 388
2073
+ 389
2074
+ 390
2075
+ 391
2076
+ 392
2077
+ 393
2078
+ 394</pre>
1724
2079
  </td>
1725
2080
  <td>
1726
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 324</span>
2081
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 383</span>
1727
2082
 
1728
2083
  <span class='kw'>def</span> <span class='id identifier rubyid__rgba_ary'>_rgba_ary</span><span class='lparen'>(</span><span class='id identifier rubyid_color'>color</span><span class='rparen'>)</span>
1729
2084
  <span class='kw'>case</span> <span class='id identifier rubyid_color'>color</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span>
@@ -1768,26 +2123,26 @@ numbers</p>
1768
2123
  <pre class="lines">
1769
2124
 
1770
2125
 
1771
- 164
1772
- 165
1773
- 166
1774
- 167
1775
- 168
1776
- 169
1777
- 170
1778
- 171
1779
- 172
1780
- 173</pre>
2126
+ 223
2127
+ 224
2128
+ 225
2129
+ 226
2130
+ 227
2131
+ 228
2132
+ 229
2133
+ 230
2134
+ 231
2135
+ 232</pre>
1781
2136
  </td>
1782
2137
  <td>
1783
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 164</span>
2138
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 223</span>
1784
2139
 
1785
2140
  <span class='kw'>def</span> <span class='id identifier rubyid_box'>box</span><span class='lparen'>(</span><span class='id identifier rubyid_x1'>x1</span><span class='comma'>,</span> <span class='id identifier rubyid_y1'>y1</span><span class='comma'>,</span> <span class='id identifier rubyid_x2'>x2</span><span class='comma'>,</span> <span class='id identifier rubyid_y2'>y2</span><span class='comma'>,</span> <span class='id identifier rubyid_color'>color</span><span class='rparen'>)</span>
1786
2141
  <span class='id identifier rubyid_ctx'>ctx</span> <span class='op'>=</span> <span class='ivar'>@ctx</span>
1787
2142
  <span class='backtick'>%x{</span><span class='tstring_content'>
1788
2143
  ctx.beginPath();
1789
2144
  ctx.strokeStyle = </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid__rgba'>_rgba</span><span class='lparen'>(</span><span class='id identifier rubyid_color'>color</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
1790
- ctx.rect(x1, y1, x2-x1+1, y2-y1+1);
2145
+ ctx.rect(x1+0.5, y1+0.5, x2-x1, y2-y1);
1791
2146
  ctx.stroke();
1792
2147
  </span><span class='tstring_end'>}</span></span>
1793
2148
  <span class='kw'>return</span> <span class='kw'>self</span>
@@ -1823,25 +2178,25 @@ numbers</p>
1823
2178
  <pre class="lines">
1824
2179
 
1825
2180
 
1826
- 176
1827
- 177
1828
- 178
1829
- 179
1830
- 180
1831
- 181
1832
- 182
1833
- 183
1834
- 184</pre>
2181
+ 235
2182
+ 236
2183
+ 237
2184
+ 238
2185
+ 239
2186
+ 240
2187
+ 241
2188
+ 242
2189
+ 243</pre>
1835
2190
  </td>
1836
2191
  <td>
1837
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 176</span>
2192
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 235</span>
1838
2193
 
1839
2194
  <span class='kw'>def</span> <span class='id identifier rubyid_box_fill'>box_fill</span><span class='lparen'>(</span><span class='id identifier rubyid_x1'>x1</span><span class='comma'>,</span> <span class='id identifier rubyid_y1'>y1</span><span class='comma'>,</span> <span class='id identifier rubyid_x2'>x2</span><span class='comma'>,</span> <span class='id identifier rubyid_y2'>y2</span><span class='comma'>,</span> <span class='id identifier rubyid_color'>color</span><span class='rparen'>)</span>
1840
2195
  <span class='id identifier rubyid_ctx'>ctx</span> <span class='op'>=</span> <span class='ivar'>@ctx</span>
1841
2196
  <span class='backtick'>%x{</span><span class='tstring_content'>
1842
2197
  ctx.beginPath();
1843
2198
  ctx.fillStyle = </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid__rgba'>_rgba</span><span class='lparen'>(</span><span class='id identifier rubyid_color'>color</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
1844
- ctx.fillRect(x1, y1, x2-x1+1, y2-y1+1);
2199
+ ctx.fillRect(x1, y1, x2-x1, y2-y1);
1845
2200
  </span><span class='tstring_end'>}</span></span>
1846
2201
  <span class='kw'>return</span> <span class='kw'>self</span>
1847
2202
  <span class='kw'>end</span></pre>
@@ -1876,26 +2231,26 @@ numbers</p>
1876
2231
  <pre class="lines">
1877
2232
 
1878
2233
 
1879
- 187
1880
- 188
1881
- 189
1882
- 190
1883
- 191
1884
- 192
1885
- 193
1886
- 194
1887
- 195
1888
- 196</pre>
2234
+ 246
2235
+ 247
2236
+ 248
2237
+ 249
2238
+ 250
2239
+ 251
2240
+ 252
2241
+ 253
2242
+ 254
2243
+ 255</pre>
1889
2244
  </td>
1890
2245
  <td>
1891
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 187</span>
2246
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 246</span>
1892
2247
 
1893
2248
  <span class='kw'>def</span> <span class='id identifier rubyid_circle'>circle</span><span class='lparen'>(</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span><span class='comma'>,</span> <span class='id identifier rubyid_r'>r</span><span class='comma'>,</span> <span class='id identifier rubyid_color'>color</span><span class='rparen'>)</span>
1894
2249
  <span class='id identifier rubyid_ctx'>ctx</span> <span class='op'>=</span> <span class='ivar'>@ctx</span>
1895
2250
  <span class='backtick'>%x{</span><span class='tstring_content'>
1896
2251
  ctx.beginPath();
1897
2252
  ctx.strokeStyle = </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid__rgba'>_rgba</span><span class='lparen'>(</span><span class='id identifier rubyid_color'>color</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
1898
- ctx.arc(x, y, r, 0, Math.PI*2, false)
2253
+ ctx.arc(x+0.5, y+0.5, r, 0, Math.PI*2, false)
1899
2254
  ctx.stroke();
1900
2255
  </span><span class='tstring_end'>}</span></span>
1901
2256
  <span class='kw'>return</span> <span class='kw'>self</span>
@@ -1931,19 +2286,19 @@ numbers</p>
1931
2286
  <pre class="lines">
1932
2287
 
1933
2288
 
1934
- 199
1935
- 200
1936
- 201
1937
- 202
1938
- 203
1939
- 204
1940
- 205
1941
- 206
1942
- 207
1943
- 208</pre>
2289
+ 258
2290
+ 259
2291
+ 260
2292
+ 261
2293
+ 262
2294
+ 263
2295
+ 264
2296
+ 265
2297
+ 266
2298
+ 267</pre>
1944
2299
  </td>
1945
2300
  <td>
1946
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 199</span>
2301
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 258</span>
1947
2302
 
1948
2303
  <span class='kw'>def</span> <span class='id identifier rubyid_circle_fill'>circle_fill</span><span class='lparen'>(</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span><span class='comma'>,</span> <span class='id identifier rubyid_r'>r</span><span class='comma'>,</span> <span class='id identifier rubyid_color'>color</span><span class='rparen'>)</span>
1949
2304
  <span class='id identifier rubyid_ctx'>ctx</span> <span class='op'>=</span> <span class='ivar'>@ctx</span>
@@ -1986,12 +2341,12 @@ numbers</p>
1986
2341
  <pre class="lines">
1987
2342
 
1988
2343
 
1989
- 245
1990
- 246
1991
- 247</pre>
2344
+ 304
2345
+ 305
2346
+ 306</pre>
1992
2347
  </td>
1993
2348
  <td>
1994
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 245</span>
2349
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 304</span>
1995
2350
 
1996
2351
  <span class='kw'>def</span> <span class='id identifier rubyid_clear'>clear</span>
1997
2352
  <span class='id identifier rubyid_fill'>fill</span><span class='lparen'>(</span><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><span class='rparen'>)</span>
@@ -2027,25 +2382,25 @@ numbers</p>
2027
2382
  <pre class="lines">
2028
2383
 
2029
2384
 
2030
- 133
2031
- 134
2032
- 135
2033
- 136
2034
- 137
2035
- 138
2036
- 139
2037
- 140
2038
- 141
2039
- 142
2040
- 143
2041
- 144
2042
- 145
2043
- 146
2044
- 147
2045
- 148</pre>
2385
+ 192
2386
+ 193
2387
+ 194
2388
+ 195
2389
+ 196
2390
+ 197
2391
+ 198
2392
+ 199
2393
+ 200
2394
+ 201
2395
+ 202
2396
+ 203
2397
+ 204
2398
+ 205
2399
+ 206
2400
+ 207</pre>
2046
2401
  </td>
2047
2402
  <td>
2048
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 133</span>
2403
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 192</span>
2049
2404
 
2050
2405
  <span class='kw'>def</span> <span class='id identifier rubyid_compare'>compare</span><span class='lparen'>(</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span><span class='comma'>,</span> <span class='id identifier rubyid_color'>color</span><span class='rparen'>)</span>
2051
2406
  <span class='id identifier rubyid_ctx'>ctx</span> <span class='op'>=</span> <span class='ivar'>@ctx</span>
@@ -2094,15 +2449,15 @@ numbers</p>
2094
2449
  <pre class="lines">
2095
2450
 
2096
2451
 
2097
- 51
2098
- 52
2099
- 53
2100
- 54
2101
- 55
2102
- 56</pre>
2452
+ 110
2453
+ 111
2454
+ 112
2455
+ 113
2456
+ 114
2457
+ 115</pre>
2103
2458
  </td>
2104
2459
  <td>
2105
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 51</span>
2460
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 110</span>
2106
2461
 
2107
2462
  <span class='kw'>def</span> <span class='id identifier rubyid_draw'>draw</span><span class='lparen'>(</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span><span class='comma'>,</span> <span class='id identifier rubyid_image'>image</span><span class='rparen'>)</span>
2108
2463
  <span class='backtick'>%x{</span><span class='tstring_content'>
@@ -2119,44 +2474,44 @@ numbers</p>
2119
2474
  <h3 class="signature " id="draw_ex-instance_method">
2120
2475
 
2121
2476
  #<strong>draw_ex</strong>(x, y, image, options = {}) &#x21d2; <tt>Object</tt>
2122
-
2123
-
2124
-
2125
-
2126
-
2127
- </h3><table class="source_code">
2128
- <tr>
2129
- <td>
2130
- <pre class="lines">
2131
-
2132
-
2133
- 78
2134
- 79
2135
- 80
2136
- 81
2137
- 82
2138
- 83
2139
- 84
2140
- 85
2141
- 86
2142
- 87
2143
- 88
2144
- 89
2145
- 90
2146
- 91
2147
- 92
2148
- 93
2149
- 94
2150
- 95
2151
- 96
2152
- 97
2153
- 98
2154
- 99
2155
- 100
2156
- 101</pre>
2477
+
2478
+
2479
+
2480
+
2481
+
2482
+ </h3><table class="source_code">
2483
+ <tr>
2484
+ <td>
2485
+ <pre class="lines">
2486
+
2487
+
2488
+ 137
2489
+ 138
2490
+ 139
2491
+ 140
2492
+ 141
2493
+ 142
2494
+ 143
2495
+ 144
2496
+ 145
2497
+ 146
2498
+ 147
2499
+ 148
2500
+ 149
2501
+ 150
2502
+ 151
2503
+ 152
2504
+ 153
2505
+ 154
2506
+ 155
2507
+ 156
2508
+ 157
2509
+ 158
2510
+ 159
2511
+ 160</pre>
2157
2512
  </td>
2158
2513
  <td>
2159
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 78</span>
2514
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 137</span>
2160
2515
 
2161
2516
  <span class='kw'>def</span> <span class='id identifier rubyid_draw_ex'>draw_ex</span><span class='lparen'>(</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span><span class='comma'>,</span> <span class='id identifier rubyid_image'>image</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
2162
2517
  <span class='id identifier rubyid_scale_x'>scale_x</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:scale_x</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='int'>1</span>
@@ -2213,19 +2568,19 @@ numbers</p>
2213
2568
  <pre class="lines">
2214
2569
 
2215
2570
 
2216
- 104
2217
- 105
2218
- 106
2219
- 107
2220
- 108
2221
- 109
2222
- 110
2223
- 111
2224
- 112
2225
- 113</pre>
2571
+ 163
2572
+ 164
2573
+ 165
2574
+ 166
2575
+ 167
2576
+ 168
2577
+ 169
2578
+ 170
2579
+ 171
2580
+ 172</pre>
2226
2581
  </td>
2227
2582
  <td>
2228
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 104</span>
2583
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 163</span>
2229
2584
 
2230
2585
  <span class='kw'>def</span> <span class='id identifier rubyid_draw_font'>draw_font</span><span class='lparen'>(</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span><span class='comma'>,</span> <span class='id identifier rubyid_string'>string</span><span class='comma'>,</span> <span class='id identifier rubyid_font'>font</span><span class='comma'>,</span> <span class='id identifier rubyid_color'>color</span><span class='op'>=</span><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='rbracket'>]</span><span class='rparen'>)</span>
2231
2586
  <span class='id identifier rubyid_ctx'>ctx</span> <span class='op'>=</span> <span class='ivar'>@ctx</span>
@@ -2258,8 +2613,7 @@ numbers</p>
2258
2613
  <ul><li>
2259
2614
  <p>angle: Rotation angle (radian)</p>
2260
2615
  </li><li>
2261
- <p>center_x, center_y: Rotation center in the `image` (default: center of the
2262
- `image`)</p>
2616
+ <p>center_x, center_y: Rotation center in the `image` (default: center of the `image`)</p>
2263
2617
  </li></ul>
2264
2618
 
2265
2619
 
@@ -2274,12 +2628,12 @@ numbers</p>
2274
2628
  <pre class="lines">
2275
2629
 
2276
2630
 
2277
- 69
2278
- 70
2279
- 71</pre>
2631
+ 128
2632
+ 129
2633
+ 130</pre>
2280
2634
  </td>
2281
2635
  <td>
2282
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 69</span>
2636
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 128</span>
2283
2637
 
2284
2638
  <span class='kw'>def</span> <span class='id identifier rubyid_draw_rot'>draw_rot</span><span class='lparen'>(</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span><span class='comma'>,</span> <span class='id identifier rubyid_image'>image</span><span class='comma'>,</span> <span class='id identifier rubyid_angle'>angle</span><span class='comma'>,</span> <span class='id identifier rubyid_center_x'>center_x</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_center_y'>center_y</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
2285
2639
  <span class='id identifier rubyid_draw_ex'>draw_ex</span><span class='lparen'>(</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span><span class='comma'>,</span> <span class='id identifier rubyid_image'>image</span><span class='comma'>,</span> <span class='label'>angle:</span> <span class='id identifier rubyid_angle'>angle</span><span class='comma'>,</span> <span class='label'>center_x:</span> <span class='id identifier rubyid_center_x'>center_x</span><span class='comma'>,</span> <span class='label'>center_y:</span> <span class='id identifier rubyid_center_y'>center_y</span><span class='rparen'>)</span>
@@ -2305,8 +2659,7 @@ numbers</p>
2305
2659
  <ul><li>
2306
2660
  <p>scale_x, scale_y: scaling factor (eg. 1.5)</p>
2307
2661
  </li><li>
2308
- <p>center_x, center_y: scaling center (in other words, the point which does
2309
- not move by this scaling. Default: image center)</p>
2662
+ <p>center_x, center_y: scaling center (in other words, the point which does not move by this scaling. Default: image center)</p>
2310
2663
  </li></ul>
2311
2664
 
2312
2665
 
@@ -2321,12 +2674,12 @@ not move by this scaling. Default: image center)</p>
2321
2674
  <pre class="lines">
2322
2675
 
2323
2676
 
2324
- 62
2325
- 63
2326
- 64</pre>
2677
+ 121
2678
+ 122
2679
+ 123</pre>
2327
2680
  </td>
2328
2681
  <td>
2329
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 62</span>
2682
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 121</span>
2330
2683
 
2331
2684
  <span class='kw'>def</span> <span class='id identifier rubyid_draw_scale'>draw_scale</span><span class='lparen'>(</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span><span class='comma'>,</span> <span class='id identifier rubyid_image'>image</span><span class='comma'>,</span> <span class='id identifier rubyid_scale_x'>scale_x</span><span class='comma'>,</span> <span class='id identifier rubyid_scale_y'>scale_y</span><span class='comma'>,</span> <span class='id identifier rubyid_center_x'>center_x</span><span class='op'>=</span><span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_center_y'>center_y</span><span class='op'>=</span><span class='kw'>nil</span><span class='rparen'>)</span>
2332
2685
  <span class='id identifier rubyid_draw_ex'>draw_ex</span><span class='lparen'>(</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span><span class='comma'>,</span> <span class='id identifier rubyid_image'>image</span><span class='comma'>,</span> <span class='label'>scale_x:</span> <span class='id identifier rubyid_scale_x'>scale_x</span><span class='comma'>,</span> <span class='label'>scale_y:</span> <span class='id identifier rubyid_scale_y'>scale_y</span><span class='comma'>,</span> <span class='label'>center_x:</span> <span class='id identifier rubyid_center_x'>center_x</span><span class='comma'>,</span> <span class='label'>center_y:</span> <span class='id identifier rubyid_center_y'>center_y</span><span class='rparen'>)</span>
@@ -2362,12 +2715,12 @@ not move by this scaling. Default: image center)</p>
2362
2715
  <pre class="lines">
2363
2716
 
2364
2717
 
2365
- 240
2366
- 241
2367
- 242</pre>
2718
+ 299
2719
+ 300
2720
+ 301</pre>
2368
2721
  </td>
2369
2722
  <td>
2370
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 240</span>
2723
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 299</span>
2371
2724
 
2372
2725
  <span class='kw'>def</span> <span class='id identifier rubyid_fill'>fill</span><span class='lparen'>(</span><span class='id identifier rubyid_color'>color</span><span class='rparen'>)</span>
2373
2726
  <span class='id identifier rubyid_box_fill'>box_fill</span><span class='lparen'>(</span><span class='int'>0</span><span class='comma'>,</span> <span class='int'>0</span><span class='comma'>,</span> <span class='ivar'>@width</span><span class='op'>-</span><span class='int'>1</span><span class='comma'>,</span> <span class='ivar'>@height</span><span class='op'>-</span><span class='int'>1</span><span class='comma'>,</span> <span class='id identifier rubyid_color'>color</span><span class='rparen'>)</span>
@@ -2403,28 +2756,28 @@ not move by this scaling. Default: image center)</p>
2403
2756
  <pre class="lines">
2404
2757
 
2405
2758
 
2406
- 151
2407
- 152
2408
- 153
2409
- 154
2410
- 155
2411
- 156
2412
- 157
2413
- 158
2414
- 159
2415
- 160
2416
- 161</pre>
2759
+ 210
2760
+ 211
2761
+ 212
2762
+ 213
2763
+ 214
2764
+ 215
2765
+ 216
2766
+ 217
2767
+ 218
2768
+ 219
2769
+ 220</pre>
2417
2770
  </td>
2418
2771
  <td>
2419
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 151</span>
2772
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 210</span>
2420
2773
 
2421
2774
  <span class='kw'>def</span> <span class='id identifier rubyid_line'>line</span><span class='lparen'>(</span><span class='id identifier rubyid_x1'>x1</span><span class='comma'>,</span> <span class='id identifier rubyid_y1'>y1</span><span class='comma'>,</span> <span class='id identifier rubyid_x2'>x2</span><span class='comma'>,</span> <span class='id identifier rubyid_y2'>y2</span><span class='comma'>,</span> <span class='id identifier rubyid_color'>color</span><span class='rparen'>)</span>
2422
2775
  <span class='id identifier rubyid_ctx'>ctx</span> <span class='op'>=</span> <span class='ivar'>@ctx</span>
2423
2776
  <span class='backtick'>%x{</span><span class='tstring_content'>
2424
2777
  ctx.beginPath();
2425
2778
  ctx.strokeStyle = </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid__rgba'>_rgba</span><span class='lparen'>(</span><span class='id identifier rubyid_color'>color</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
2426
- ctx.moveTo(x1, y1);
2427
- ctx.lineTo(x2, y2);
2779
+ ctx.moveTo(x1+0.5, y1+0.5);
2780
+ ctx.lineTo(x2+0.5, y2+0.5);
2428
2781
  ctx.stroke();
2429
2782
  </span><span class='tstring_end'>}</span></span>
2430
2783
  <span class='kw'>return</span> <span class='kw'>self</span>
@@ -2432,6 +2785,146 @@ not move by this scaling. Default: image center)</p>
2432
2785
  </td>
2433
2786
  </tr>
2434
2787
  </table>
2788
+ </div>
2789
+
2790
+ <div class="method_details ">
2791
+ <h3 class="signature " id="load-instance_method">
2792
+
2793
+ #<strong>load</strong>(path_or_url) &#x21d2; <tt>Object</tt>
2794
+
2795
+
2796
+
2797
+
2798
+
2799
+ </h3><table class="source_code">
2800
+ <tr>
2801
+ <td>
2802
+ <pre class="lines">
2803
+
2804
+
2805
+ 66
2806
+ 67
2807
+ 68
2808
+ 69
2809
+ 70
2810
+ 71
2811
+ 72
2812
+ 73
2813
+ 74
2814
+ 75
2815
+ 76
2816
+ 77
2817
+ 78
2818
+ 79
2819
+ 80</pre>
2820
+ </td>
2821
+ <td>
2822
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 66</span>
2823
+
2824
+ <span class='kw'>def</span> <span class='id identifier rubyid_load'>load</span><span class='lparen'>(</span><span class='id identifier rubyid_path_or_url'>path_or_url</span><span class='rparen'>)</span>
2825
+ <span class='id identifier rubyid_raw_img'>raw_img</span> <span class='op'>=</span> <span class='backtick'>`</span><span class='tstring_content'>new Image()</span><span class='tstring_end'>`</span></span>
2826
+ <span class='ivar'>@promise</span> <span class='op'>=</span> <span class='backtick'>%x{</span><span class='tstring_content'>
2827
+ new Promise(function(resolve, reject) {
2828
+ raw_img.onload = function() {
2829
+ self.$_resize(raw_img.width, raw_img.height);
2830
+ self.$_draw_raw_image(0, 0, raw_img);
2831
+ self.loaded = </span><span class='embexpr_beg'>#{</span><span class='kw'>true</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
2832
+ resolve();
2833
+ };
2834
+ raw_img.src = path_or_url;
2835
+ });
2836
+ </span><span class='tstring_end'>}</span></span>
2837
+ <span class='kw'>return</span> <span class='kw'>self</span>
2838
+ <span class='kw'>end</span></pre>
2839
+ </td>
2840
+ </tr>
2841
+ </table>
2842
+ </div>
2843
+
2844
+ <div class="method_details ">
2845
+ <h3 class="signature " id="loaded?-instance_method">
2846
+
2847
+ #<strong>loaded?</strong> &#x21d2; <tt>Boolean</tt>
2848
+
2849
+
2850
+
2851
+
2852
+
2853
+ </h3><div class="docstring">
2854
+ <div class="discussion">
2855
+
2856
+
2857
+ </div>
2858
+ </div>
2859
+ <div class="tags">
2860
+
2861
+ <p class="tag_title">Returns:</p>
2862
+ <ul class="return">
2863
+
2864
+ <li>
2865
+
2866
+
2867
+ <span class='type'>(<tt>Boolean</tt>)</span>
2868
+
2869
+
2870
+
2871
+ </li>
2872
+
2873
+ </ul>
2874
+
2875
+ </div><table class="source_code">
2876
+ <tr>
2877
+ <td>
2878
+ <pre class="lines">
2879
+
2880
+
2881
+ 60</pre>
2882
+ </td>
2883
+ <td>
2884
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 60</span>
2885
+
2886
+ <span class='kw'>def</span> <span class='id identifier rubyid_loaded?'>loaded?</span><span class='semicolon'>;</span> <span class='id identifier rubyid_loaded'>loaded</span><span class='semicolon'>;</span> <span class='kw'>end</span></pre>
2887
+ </td>
2888
+ </tr>
2889
+ </table>
2890
+ </div>
2891
+
2892
+ <div class="method_details ">
2893
+ <h3 class="signature " id="onload-instance_method">
2894
+
2895
+ #<strong>onload</strong>(&amp;block) &#x21d2; <tt>Object</tt>
2896
+
2897
+
2898
+
2899
+
2900
+
2901
+ </h3><table class="source_code">
2902
+ <tr>
2903
+ <td>
2904
+ <pre class="lines">
2905
+
2906
+
2907
+ 82
2908
+ 83
2909
+ 84
2910
+ 85
2911
+ 86
2912
+ 87
2913
+ 88</pre>
2914
+ </td>
2915
+ <td>
2916
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 82</span>
2917
+
2918
+ <span class='kw'>def</span> <span class='id identifier rubyid_onload'>onload</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
2919
+ <span class='backtick'>%x{</span><span class='tstring_content'>
2920
+ </span><span class='embexpr_beg'>#{</span><span class='ivar'>@promise</span><span class='embexpr_end'>}</span><span class='tstring_content'>.then(function(response){
2921
+ </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>
2922
+ });
2923
+ </span><span class='tstring_end'>}</span></span>
2924
+ <span class='kw'>end</span></pre>
2925
+ </td>
2926
+ </tr>
2927
+ </table>
2435
2928
  </div>
2436
2929
 
2437
2930
  <div class="method_details ">
@@ -2463,23 +2956,23 @@ not move by this scaling. Default: image center)</p>
2463
2956
  <pre class="lines">
2464
2957
 
2465
2958
 
2466
- 270
2467
- 271
2468
- 272
2469
- 273
2470
- 274
2471
- 275
2472
- 276
2473
- 277
2474
- 278
2475
- 279
2476
- 280
2477
- 281
2478
- 282
2479
- 283</pre>
2959
+ 329
2960
+ 330
2961
+ 331
2962
+ 332
2963
+ 333
2964
+ 334
2965
+ 335
2966
+ 336
2967
+ 337
2968
+ 338
2969
+ 339
2970
+ 340
2971
+ 341
2972
+ 342</pre>
2480
2973
  </td>
2481
2974
  <td>
2482
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 270</span>
2975
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 329</span>
2483
2976
 
2484
2977
  <span class='kw'>def</span> <span class='id identifier rubyid_set_color_key'>set_color_key</span><span class='lparen'>(</span><span class='id identifier rubyid_color'>color</span><span class='rparen'>)</span>
2485
2978
  <span class='id identifier rubyid_r'>r</span><span class='comma'>,</span> <span class='id identifier rubyid_g'>g</span><span class='comma'>,</span> <span class='id identifier rubyid_b'>b</span><span class='comma'>,</span> <span class='id identifier rubyid__'>_</span> <span class='op'>=</span> <span class='id identifier rubyid__rgba_ary'>_rgba_ary</span><span class='lparen'>(</span><span class='id identifier rubyid_color'>color</span><span class='rparen'>)</span>
@@ -2526,15 +3019,15 @@ not move by this scaling. Default: image center)</p>
2526
3019
  <pre class="lines">
2527
3020
 
2528
3021
 
2529
- 250
2530
- 251
2531
- 252
2532
- 253
2533
- 254
2534
- 255</pre>
3022
+ 309
3023
+ 310
3024
+ 311
3025
+ 312
3026
+ 313
3027
+ 314</pre>
2535
3028
  </td>
2536
3029
  <td>
2537
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 250</span>
3030
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 309</span>
2538
3031
 
2539
3032
  <span class='kw'>def</span> <span class='id identifier rubyid_slice'>slice</span><span class='lparen'>(</span><span class='id identifier rubyid_x'>x</span><span class='comma'>,</span> <span class='id identifier rubyid_y'>y</span><span class='comma'>,</span> <span class='id identifier rubyid_width'>width</span><span class='comma'>,</span> <span class='id identifier rubyid_height'>height</span><span class='rparen'>)</span>
2540
3033
  <span class='id identifier rubyid_newimg'>newimg</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="" title="DXOpal::Image (class)">Image</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="DXOpal::Image#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_width'>width</span><span class='comma'>,</span> <span class='id identifier rubyid_height'>height</span><span class='rparen'>)</span>
@@ -2573,18 +3066,18 @@ not move by this scaling. Default: image center)</p>
2573
3066
  <pre class="lines">
2574
3067
 
2575
3068
 
2576
- 258
2577
- 259
2578
- 260
2579
- 261
2580
- 262
2581
- 263
2582
- 264
2583
- 265
2584
- 266</pre>
3069
+ 317
3070
+ 318
3071
+ 319
3072
+ 320
3073
+ 321
3074
+ 322
3075
+ 323
3076
+ 324
3077
+ 325</pre>
2585
3078
  </td>
2586
3079
  <td>
2587
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 258</span>
3080
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 317</span>
2588
3081
 
2589
3082
  <span class='kw'>def</span> <span class='id identifier rubyid_slice_tiles'>slice_tiles</span><span class='lparen'>(</span><span class='id identifier rubyid_xcount'>xcount</span><span class='comma'>,</span> <span class='id identifier rubyid_ycount'>ycount</span><span class='rparen'>)</span>
2590
3083
  <span class='id identifier rubyid_tile_w'>tile_w</span> <span class='op'>=</span> <span class='ivar'>@width</span> <span class='op'>/</span> <span class='id identifier rubyid_xcount'>xcount</span>
@@ -2626,32 +3119,32 @@ not move by this scaling. Default: image center)</p>
2626
3119
  <pre class="lines">
2627
3120
 
2628
3121
 
2629
- 211
2630
- 212
2631
- 213
2632
- 214
2633
- 215
2634
- 216
2635
- 217
2636
- 218
2637
- 219
2638
- 220
2639
- 221
2640
- 222
2641
- 223</pre>
3122
+ 270
3123
+ 271
3124
+ 272
3125
+ 273
3126
+ 274
3127
+ 275
3128
+ 276
3129
+ 277
3130
+ 278
3131
+ 279
3132
+ 280
3133
+ 281
3134
+ 282</pre>
2642
3135
  </td>
2643
3136
  <td>
2644
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 211</span>
3137
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 270</span>
2645
3138
 
2646
3139
  <span class='kw'>def</span> <span class='id identifier rubyid_triangle'>triangle</span><span class='lparen'>(</span><span class='id identifier rubyid_x1'>x1</span><span class='comma'>,</span> <span class='id identifier rubyid_y1'>y1</span><span class='comma'>,</span> <span class='id identifier rubyid_x2'>x2</span><span class='comma'>,</span> <span class='id identifier rubyid_y2'>y2</span><span class='comma'>,</span> <span class='id identifier rubyid_x3'>x3</span><span class='comma'>,</span> <span class='id identifier rubyid_y3'>y3</span><span class='comma'>,</span> <span class='id identifier rubyid_color'>color</span><span class='rparen'>)</span>
2647
3140
  <span class='id identifier rubyid_ctx'>ctx</span> <span class='op'>=</span> <span class='ivar'>@ctx</span>
2648
3141
  <span class='backtick'>%x{</span><span class='tstring_content'>
2649
3142
  ctx.beginPath();
2650
3143
  ctx.strokeStyle = </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid__rgba'>_rgba</span><span class='lparen'>(</span><span class='id identifier rubyid_color'>color</span><span class='rparen'>)</span><span class='embexpr_end'>}</span><span class='tstring_content'>;
2651
- ctx.moveTo(x1, y1);
2652
- ctx.lineTo(x2, y2);
2653
- ctx.lineTo(x3, y3);
2654
- ctx.lineTo(x1, y1);
3144
+ ctx.moveTo(x1+0.5, y1+0.5);
3145
+ ctx.lineTo(x2+0.5, y2+0.5);
3146
+ ctx.lineTo(x3+0.5, y3+0.5);
3147
+ ctx.lineTo(x1+0.5, y1+0.5);
2655
3148
  ctx.stroke();
2656
3149
  </span><span class='tstring_end'>}</span></span>
2657
3150
  <span class='kw'>return</span> <span class='kw'>self</span>
@@ -2687,21 +3180,21 @@ not move by this scaling. Default: image center)</p>
2687
3180
  <pre class="lines">
2688
3181
 
2689
3182
 
2690
- 226
2691
- 227
2692
- 228
2693
- 229
2694
- 230
2695
- 231
2696
- 232
2697
- 233
2698
- 234
2699
- 235
2700
- 236
2701
- 237</pre>
3183
+ 285
3184
+ 286
3185
+ 287
3186
+ 288
3187
+ 289
3188
+ 290
3189
+ 291
3190
+ 292
3191
+ 293
3192
+ 294
3193
+ 295
3194
+ 296</pre>
2702
3195
  </td>
2703
3196
  <td>
2704
- <pre class="code"><span class="info file"># File 'opal/dxopal/image.rb', line 226</span>
3197
+ <pre class="code"><span class="info file"># File 'lib/dxopal/image.rb', line 285</span>
2705
3198
 
2706
3199
  <span class='kw'>def</span> <span class='id identifier rubyid_triangle_fill'>triangle_fill</span><span class='lparen'>(</span><span class='id identifier rubyid_x1'>x1</span><span class='comma'>,</span> <span class='id identifier rubyid_y1'>y1</span><span class='comma'>,</span> <span class='id identifier rubyid_x2'>x2</span><span class='comma'>,</span> <span class='id identifier rubyid_y2'>y2</span><span class='comma'>,</span> <span class='id identifier rubyid_x3'>x3</span><span class='comma'>,</span> <span class='id identifier rubyid_y3'>y3</span><span class='comma'>,</span> <span class='id identifier rubyid_color'>color</span><span class='rparen'>)</span>
2707
3200
  <span class='id identifier rubyid_ctx'>ctx</span> <span class='op'>=</span> <span class='ivar'>@ctx</span>
@@ -2725,9 +3218,9 @@ not move by this scaling. Default: image center)</p>
2725
3218
  </div>
2726
3219
 
2727
3220
  <div id="footer">
2728
- Generated on Sat Sep 29 15:56:48 2018 by
3221
+ Generated on Tue Dec 29 11:37:24 2020 by
2729
3222
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
2730
- 0.9.16 (ruby-2.5.1).
3223
+ 0.9.26 (ruby-2.7.0).
2731
3224
  </div>
2732
3225
 
2733
3226
  </div>