melonjs 10.2.0 → 10.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/README.md +1 -1
  2. package/dist/melonjs.js +4435 -4283
  3. package/dist/melonjs.min.js +4 -4
  4. package/dist/melonjs.module.d.ts +3348 -3833
  5. package/dist/melonjs.module.js +4025 -3920
  6. package/package.json +13 -14
  7. package/src/audio/audio.js +45 -45
  8. package/src/camera/camera2d.js +78 -101
  9. package/src/entity/draggable.js +21 -29
  10. package/src/entity/droptarget.js +24 -31
  11. package/src/entity/entity.js +34 -38
  12. package/src/game.js +8 -8
  13. package/src/{shapes → geometries}/ellipse.js +46 -46
  14. package/src/{shapes → geometries}/line.js +14 -14
  15. package/src/{shapes → geometries}/poly.js +103 -54
  16. package/src/{shapes → geometries}/rectangle.js +73 -120
  17. package/src/index.js +18 -19
  18. package/src/input/gamepad.js +20 -20
  19. package/src/input/input.js +3 -3
  20. package/src/input/keyboard.js +122 -124
  21. package/src/input/pointer.js +102 -62
  22. package/src/input/pointerevent.js +97 -42
  23. package/src/lang/deprecated.js +29 -18
  24. package/src/level/level.js +34 -26
  25. package/src/level/tiled/TMXGroup.js +12 -13
  26. package/src/level/tiled/TMXLayer.js +41 -42
  27. package/src/level/tiled/TMXObject.js +76 -70
  28. package/src/level/tiled/TMXTile.js +13 -15
  29. package/src/level/tiled/TMXTileMap.js +26 -25
  30. package/src/level/tiled/TMXTileset.js +14 -15
  31. package/src/level/tiled/TMXTilesetGroup.js +5 -6
  32. package/src/level/tiled/TMXUtils.js +13 -11
  33. package/src/level/tiled/renderer/TMXHexagonalRenderer.js +3 -4
  34. package/src/level/tiled/renderer/TMXIsometricRenderer.js +3 -4
  35. package/src/level/tiled/renderer/TMXOrthogonalRenderer.js +2 -3
  36. package/src/level/tiled/renderer/TMXRenderer.js +18 -19
  37. package/src/level/tiled/renderer/TMXStaggeredRenderer.js +2 -3
  38. package/src/loader/loader.js +46 -40
  39. package/src/loader/loadingscreen.js +7 -7
  40. package/src/math/color.js +68 -88
  41. package/src/math/math.js +33 -33
  42. package/src/math/matrix2.js +70 -71
  43. package/src/math/matrix3.js +90 -91
  44. package/src/math/observable_vector2.js +91 -92
  45. package/src/math/observable_vector3.js +110 -106
  46. package/src/math/vector2.js +116 -104
  47. package/src/math/vector3.js +129 -110
  48. package/src/particles/emitter.js +116 -126
  49. package/src/particles/particle.js +4 -5
  50. package/src/particles/particlecontainer.js +2 -3
  51. package/src/physics/body.js +82 -83
  52. package/src/physics/bounds.js +64 -66
  53. package/src/physics/collision.js +21 -22
  54. package/src/physics/detector.js +13 -13
  55. package/src/physics/quadtree.js +26 -25
  56. package/src/physics/sat.js +21 -21
  57. package/src/physics/world.js +23 -22
  58. package/src/plugin/plugin.js +12 -13
  59. package/src/renderable/GUI.js +20 -26
  60. package/src/renderable/collectable.js +6 -7
  61. package/src/renderable/colorlayer.js +11 -12
  62. package/src/renderable/container.js +98 -81
  63. package/src/renderable/imagelayer.js +33 -35
  64. package/src/renderable/nineslicesprite.js +15 -16
  65. package/src/renderable/renderable.js +112 -111
  66. package/src/renderable/sprite.js +71 -58
  67. package/src/renderable/trigger.js +17 -19
  68. package/src/state/stage.js +14 -15
  69. package/src/state/state.js +78 -78
  70. package/src/system/device.js +137 -180
  71. package/src/system/event.js +116 -104
  72. package/src/system/pooling.js +15 -15
  73. package/src/system/save.js +9 -6
  74. package/src/system/timer.js +33 -33
  75. package/src/text/bitmaptext.js +39 -46
  76. package/src/text/bitmaptextdata.js +14 -15
  77. package/src/text/text.js +55 -58
  78. package/src/tweens/easing.js +5 -5
  79. package/src/tweens/interpolation.js +5 -5
  80. package/src/tweens/tween.js +49 -40
  81. package/src/utils/agent.js +12 -11
  82. package/src/utils/array.js +8 -8
  83. package/src/utils/file.js +7 -7
  84. package/src/utils/function.js +8 -8
  85. package/src/utils/string.js +19 -19
  86. package/src/utils/utils.js +23 -23
  87. package/src/video/canvas/canvas_renderer.js +127 -128
  88. package/src/video/renderer.js +69 -69
  89. package/src/video/texture.js +80 -82
  90. package/src/video/texture_cache.js +2 -4
  91. package/src/video/video.js +38 -38
  92. package/src/video/webgl/buffer/vertex.js +11 -3
  93. package/src/video/webgl/glshader.js +31 -32
  94. package/src/video/webgl/webgl_compositor.js +145 -127
  95. package/src/video/webgl/webgl_renderer.js +196 -175
package/src/math/color.js CHANGED
@@ -173,12 +173,11 @@ var cssToRGB = new Map();
173
173
  * @classdesc
174
174
  * A color manipulation object.
175
175
  * @class Color
176
- * @memberOf me
177
- * @constructor
178
- * @param {Number|Float32Array} [r=0] red component or array of color components
179
- * @param {Number} [g=0] green component
180
- * @param {Number} [b=0] blue component
181
- * @param {Number} [alpha=1.0] alpha value
176
+ * @memberof me
177
+ * @param {number|Float32Array} [r=0] red component or array of color components
178
+ * @param {number} [g=0] green component
179
+ * @param {number} [b=0] blue component
180
+ * @param {number} [alpha=1.0] alpha value
182
181
  */
183
182
  class Color {
184
183
 
@@ -203,21 +202,16 @@ class Color {
203
202
 
204
203
  /**
205
204
  * Color Red Component [0 .. 255]
206
- * @type Number
205
+ * @type {number}
207
206
  * @name r
208
207
  * @readonly
209
- * @memberOf me.Color
208
+ * @memberof me.Color
210
209
  */
211
210
 
212
- /**
213
- * @ignore
214
- */
215
211
  get r() {
216
212
  return ~~(this.glArray[0] * 255);
217
213
  }
218
- /**
219
- * @ignore
220
- */
214
+
221
215
  set r(value) {
222
216
  this.glArray[0] = clamp(~~value || 0, 0, 255) / 255.0;
223
217
  }
@@ -225,21 +219,16 @@ class Color {
225
219
 
226
220
  /**
227
221
  * Color Green Component [0 .. 255]
228
- * @type Number
222
+ * @type {number}
229
223
  * @name g
230
224
  * @readonly
231
- * @memberOf me.Color
225
+ * @memberof me.Color
232
226
  */
233
227
 
234
- /**
235
- * @ignore
236
- */
237
228
  get g() {
238
229
  return ~~(this.glArray[1] * 255);
239
230
  }
240
- /**
241
- * @ignore
242
- */
231
+
243
232
  set g(value) {
244
233
  this.glArray[1] = clamp(~~value || 0, 0, 255) / 255.0;
245
234
  }
@@ -247,41 +236,32 @@ class Color {
247
236
 
248
237
  /**
249
238
  * Color Blue Component [0 .. 255]
250
- * @type Number
239
+ * @type {number}
251
240
  * @name b
252
241
  * @readonly
253
- * @memberOf me.Color
254
- */
255
- /**
256
- * @ignore
242
+ * @memberof me.Color
257
243
  */
244
+
258
245
  get b() {
259
246
  return ~~(this.glArray[2] * 255);
260
247
  }
261
- /**
262
- * @ignore
263
- */
248
+
264
249
  set b(value) {
265
250
  this.glArray[2] = clamp(~~value || 0, 0, 255) / 255.0;
266
251
  }
267
252
 
268
253
  /**
269
254
  * Color Alpha Component [0.0 .. 1.0]
270
- * @type Number
255
+ * @type {number}
271
256
  * @name alpha
272
257
  * @readonly
273
- * @memberOf me.Color
258
+ * @memberof me.Color
274
259
  */
275
260
 
276
- /**
277
- * @ignore
278
- */
279
261
  get alpha() {
280
262
  return this.glArray[3];
281
263
  }
282
- /**
283
- * @ignore
284
- */
264
+
285
265
  set alpha(value) {
286
266
  this.glArray[3] = typeof(value) === "undefined" ? 1.0 : clamp(+value, 0, 1.0);
287
267
  }
@@ -290,13 +270,13 @@ class Color {
290
270
  /**
291
271
  * Set this color to the specified value.
292
272
  * @name setColor
293
- * @memberOf me.Color
273
+ * @memberof me.Color
294
274
  * @function
295
- * @param {Number} r red component [0 .. 255]
296
- * @param {Number} g green component [0 .. 255]
297
- * @param {Number} b blue component [0 .. 255]
298
- * @param {Number} [alpha=1.0] alpha value [0.0 .. 1.0]
299
- * @return {me.Color} Reference to this object for method chaining
275
+ * @param {number} r red component [0 .. 255]
276
+ * @param {number} g green component [0 .. 255]
277
+ * @param {number} b blue component [0 .. 255]
278
+ * @param {number} [alpha=1.0] alpha value [0.0 .. 1.0]
279
+ * @returns {me.Color} Reference to this object for method chaining
300
280
  */
301
281
  setColor(r, g, b, alpha = 1.0) {
302
282
  // Private initialization: copy Color value directly
@@ -314,9 +294,9 @@ class Color {
314
294
  /**
315
295
  * Create a new copy of this color object.
316
296
  * @name clone
317
- * @memberOf me.Color
297
+ * @memberof me.Color
318
298
  * @function
319
- * @return {me.Color} Reference to the newly cloned object
299
+ * @returns {me.Color} Reference to the newly cloned object
320
300
  */
321
301
  clone() {
322
302
  return pool.pull("Color", this);
@@ -325,10 +305,10 @@ class Color {
325
305
  /**
326
306
  * Copy a color object or CSS color into this one.
327
307
  * @name copy
328
- * @memberOf me.Color
308
+ * @memberof me.Color
329
309
  * @function
330
- * @param {me.Color|String} color
331
- * @return {me.Color} Reference to this object for method chaining
310
+ * @param {me.Color|string} color
311
+ * @returns {me.Color} Reference to this object for method chaining
332
312
  */
333
313
  copy(color) {
334
314
  if (color instanceof Color) {
@@ -342,10 +322,10 @@ class Color {
342
322
  /**
343
323
  * Blend this color with the given one using addition.
344
324
  * @name add
345
- * @memberOf me.Color
325
+ * @memberof me.Color
346
326
  * @function
347
327
  * @param {me.Color} color
348
- * @return {me.Color} Reference to this object for method chaining
328
+ * @returns {me.Color} Reference to this object for method chaining
349
329
  */
350
330
  add(color) {
351
331
  this.glArray[0] = clamp(this.glArray[0] + color.glArray[0], 0, 1);
@@ -359,10 +339,10 @@ class Color {
359
339
  /**
360
340
  * Darken this color value by 0..1
361
341
  * @name darken
362
- * @memberOf me.Color
342
+ * @memberof me.Color
363
343
  * @function
364
- * @param {Number} scale
365
- * @return {me.Color} Reference to this object for method chaining
344
+ * @param {number} scale
345
+ * @returns {me.Color} Reference to this object for method chaining
366
346
  */
367
347
  darken(scale) {
368
348
  scale = clamp(scale, 0, 1);
@@ -376,11 +356,11 @@ class Color {
376
356
  /**
377
357
  * Linearly interpolate between this color and the given one.
378
358
  * @name lerp
379
- * @memberOf me.Color
359
+ * @memberof me.Color
380
360
  * @function
381
361
  * @param {me.Color} color
382
- * @param {Number} alpha with alpha = 0 being this color, and alpha = 1 being the given one.
383
- * @return {me.Color} Reference to this object for method chaining
362
+ * @param {number} alpha with alpha = 0 being this color, and alpha = 1 being the given one.
363
+ * @returns {me.Color} Reference to this object for method chaining
384
364
  */
385
365
  lerp(color, alpha) {
386
366
  alpha = clamp(alpha, 0, 1);
@@ -394,10 +374,10 @@ class Color {
394
374
  /**
395
375
  * Lighten this color value by 0..1
396
376
  * @name lighten
397
- * @memberOf me.Color
377
+ * @memberof me.Color
398
378
  * @function
399
- * @param {Number} scale
400
- * @return {me.Color} Reference to this object for method chaining
379
+ * @param {number} scale
380
+ * @returns {me.Color} Reference to this object for method chaining
401
381
  */
402
382
  lighten(scale) {
403
383
  scale = clamp(scale, 0, 1);
@@ -411,11 +391,11 @@ class Color {
411
391
  /**
412
392
  * Generate random r,g,b values for this color object
413
393
  * @name random
414
- * @memberOf me.Color
394
+ * @memberof me.Color
415
395
  * @function
416
- * @param {Number} [min=0] minimum value for the random range
417
- * @param {Number} [max=255] maxmium value for the random range
418
- * @return {me.Color} Reference to this object for method chaining
396
+ * @param {number} [min=0] minimum value for the random range
397
+ * @param {number} [max=255] maxmium value for the random range
398
+ * @returns {me.Color} Reference to this object for method chaining
419
399
  */
420
400
  random(min = 0, max = 255) {
421
401
  if (min < 0) {
@@ -437,10 +417,10 @@ class Color {
437
417
  * Return true if the r,g,b,a values of this color are equal with the
438
418
  * given one.
439
419
  * @name equals
440
- * @memberOf me.Color
420
+ * @memberof me.Color
441
421
  * @function
442
422
  * @param {me.Color} color
443
- * @return {Boolean}
423
+ * @returns {boolean}
444
424
  */
445
425
  equals(color) {
446
426
  return (
@@ -455,10 +435,10 @@ class Color {
455
435
  * Parse a CSS color string and set this color to the corresponding
456
436
  * r,g,b values
457
437
  * @name parseCSS
458
- * @memberOf me.Color
438
+ * @memberof me.Color
459
439
  * @function
460
- * @param {String} color
461
- * @return {me.Color} Reference to this object for method chaining
440
+ * @param {string} cssColor
441
+ * @returns {me.Color} Reference to this object for method chaining
462
442
  */
463
443
  parseCSS(cssColor) {
464
444
  // TODO : Memoize this function by caching its input
@@ -473,10 +453,10 @@ class Color {
473
453
  /**
474
454
  * Parse an RGB or RGBA CSS color string
475
455
  * @name parseRGB
476
- * @memberOf me.Color
456
+ * @memberof me.Color
477
457
  * @function
478
- * @param {String} color
479
- * @return {me.Color} Reference to this object for method chaining
458
+ * @param {string} rgbColor
459
+ * @returns {me.Color} Reference to this object for method chaining
480
460
  */
481
461
  parseRGB(rgbColor) {
482
462
  // TODO : Memoize this function by caching its input
@@ -493,11 +473,11 @@ class Color {
493
473
  * Parse a Hex color ("#RGB", "#RGBA" or "#RRGGBB", "#RRGGBBAA" format) and set this color to
494
474
  * the corresponding r,g,b,a values
495
475
  * @name parseHex
496
- * @memberOf me.Color
476
+ * @memberof me.Color
497
477
  * @function
498
- * @param {String} color
478
+ * @param {string} hexColor
499
479
  * @param {boolean} [argb = false] true if format is #ARGB, or #AARRGGBB (as opposed to #RGBA or #RGGBBAA)
500
- * @return {me.Color} Reference to this object for method chaining
480
+ * @returns {me.Color} Reference to this object for method chaining
501
481
  */
502
482
  parseHex(hexColor, argb = false) {
503
483
  // TODO : Memoize this function by caching its input
@@ -553,10 +533,10 @@ class Color {
553
533
  /**
554
534
  * Pack this color into a Uint32 ARGB representation
555
535
  * @name toUint32
556
- * @memberOf me.Color
536
+ * @memberof me.Color
557
537
  * @function
558
- * @param {Number} [alpha=1.0] alpha value [0.0 .. 1.0]
559
- * @return {Uint32}
538
+ * @param {number} [alpha=1.0] alpha value [0.0 .. 1.0]
539
+ * @returns {Uint32}
560
540
  */
561
541
  toUint32(alpha = this.alpha) {
562
542
  var ur = this.r & 0xff;
@@ -570,9 +550,9 @@ class Color {
570
550
  /**
571
551
  * return an array representation of this object
572
552
  * @name toArray
573
- * @memberOf me.Color
553
+ * @memberof me.Color
574
554
  * @function
575
- * @return {Float32Array}
555
+ * @returns {Float32Array}
576
556
  */
577
557
  toArray() {
578
558
  return this.glArray;
@@ -582,9 +562,9 @@ class Color {
582
562
  /**
583
563
  * Get the color in "#RRGGBB" format
584
564
  * @name toHex
585
- * @memberOf me.Color
565
+ * @memberof me.Color
586
566
  * @function
587
- * @return {String}
567
+ * @returns {string}
588
568
  */
589
569
  toHex() {
590
570
  // TODO : Memoize this function by caching its result until any of
@@ -596,9 +576,9 @@ class Color {
596
576
  /**
597
577
  * Get the color in "#RRGGBBAA" format
598
578
  * @name toHex8
599
- * @memberOf me.Color
579
+ * @memberof me.Color
600
580
  * @function
601
- * @return {String}
581
+ * @returns {string}
602
582
  */
603
583
  toHex8() {
604
584
  // TODO : Memoize this function by caching its result until any of
@@ -610,9 +590,9 @@ class Color {
610
590
  /**
611
591
  * Get the color in "rgb(R,G,B)" format
612
592
  * @name toRGB
613
- * @memberOf me.Color
593
+ * @memberof me.Color
614
594
  * @function
615
- * @return {String}
595
+ * @returns {string}
616
596
  */
617
597
  toRGB() {
618
598
  // TODO : Memoize this function by caching its result until any of
@@ -628,9 +608,9 @@ class Color {
628
608
  /**
629
609
  * Get the color in "rgba(R,G,B,A)" format
630
610
  * @name toRGBA
631
- * @memberOf me.Color
611
+ * @memberof me.Color
632
612
  * @function
633
- * @return {String}
613
+ * @returns {string}
634
614
  */
635
615
  toRGBA() {
636
616
  // TODO : Memoize this function by caching its result until any of
package/src/math/math.js CHANGED
@@ -1,51 +1,51 @@
1
1
  /**
2
2
  * a collection of math utility functions
3
3
  * @namespace Math
4
- * @memberOf me
4
+ * @memberof me
5
5
  */
6
6
 
7
7
  /**
8
8
  * constant to convert from degrees to radians
9
9
  * @public
10
- * @type {Number}
10
+ * @type {number}
11
11
  * @name DEG_TO_RAD
12
- * @memberOf me.Math
12
+ * @memberof me.Math
13
13
  */
14
14
  export const DEG_TO_RAD = Math.PI / 180.0;
15
15
 
16
16
  /**
17
17
  * constant to convert from radians to degrees
18
18
  * @public
19
- * @type {Number}
19
+ * @type {number}
20
20
  * @name RAD_TO_DEG
21
- * @memberOf me.Math
21
+ * @memberof me.Math
22
22
  */
23
23
  export const RAD_TO_DEG = 180.0 / Math.PI;
24
24
 
25
25
  /**
26
26
  * constant equals to 2 times pi
27
27
  * @public
28
- * @type {Number}
28
+ * @type {number}
29
29
  * @name TAU
30
- * @memberOf me.Math
30
+ * @memberof me.Math
31
31
  */
32
32
  export const TAU = Math.PI * 2;
33
33
 
34
34
  /**
35
35
  * constant equals to half pi
36
36
  * @public
37
- * @type {Number}
37
+ * @type {number}
38
38
  * @name ETA
39
- * @memberOf me.Math
39
+ * @memberof me.Math
40
40
  */
41
41
  export const ETA = Math.PI * 0.5;
42
42
 
43
43
  /**
44
44
  * the difference between 1 and the smallest floating point number greater than 1
45
45
  * @public
46
- * @type {Number}
46
+ * @type {number}
47
47
  * @name EPSILON
48
- * @memberOf me.Math
48
+ * @memberof me.Math
49
49
  */
50
50
  export const EPSILON = 0.000001;
51
51
 
@@ -53,10 +53,10 @@ export const EPSILON = 0.000001;
53
53
  * returns true if the given value is a power of two
54
54
  * @public
55
55
  * @function
56
- * @memberOf me.Math
56
+ * @memberof me.Math
57
57
  * @name isPowerOfTwo
58
- * @param {Number} val
59
- * @return {boolean}
58
+ * @param {number} val
59
+ * @returns {boolean}
60
60
  */
61
61
  export function isPowerOfTwo(val) {
62
62
  return (val & (val - 1)) === 0;
@@ -66,10 +66,10 @@ export function isPowerOfTwo(val) {
66
66
  * returns the next power of two for the given value
67
67
  * @public
68
68
  * @function
69
- * @memberOf me.Math
69
+ * @memberof me.Math
70
70
  * @name nextPowerOfTwo
71
- * @param {Number} val
72
- * @return {boolean}
71
+ * @param {number} val
72
+ * @returns {boolean}
73
73
  */
74
74
  export function nextPowerOfTwo(val) {
75
75
  val --;
@@ -86,10 +86,10 @@ export function nextPowerOfTwo(val) {
86
86
  * Converts an angle in degrees to an angle in radians
87
87
  * @public
88
88
  * @function
89
- * @memberOf me.Math
89
+ * @memberof me.Math
90
90
  * @name degToRad
91
91
  * @param {number} angle angle in degrees
92
- * @return {number} corresponding angle in radians
92
+ * @returns {number} corresponding angle in radians
93
93
  * @example
94
94
  * // convert a specific angle
95
95
  * me.Math.degToRad(60); // return 1.0471...
@@ -102,10 +102,10 @@ export function degToRad(angle) {
102
102
  * Converts an angle in radians to an angle in degrees.
103
103
  * @public
104
104
  * @function
105
- * @memberOf me.Math
105
+ * @memberof me.Math
106
106
  * @name radToDeg
107
107
  * @param {number} radians angle in radians
108
- * @return {number} corresponding angle in degrees
108
+ * @returns {number} corresponding angle in degrees
109
109
  * @example
110
110
  * // convert a specific angle
111
111
  * me.Math.radToDeg(1.0471975511965976); // return 60
@@ -118,12 +118,12 @@ export function radToDeg(radians) {
118
118
  * clamp the given value
119
119
  * @public
120
120
  * @function
121
- * @memberOf me.Math
121
+ * @memberof me.Math
122
122
  * @name clamp
123
123
  * @param {number} val the value to clamp
124
124
  * @param {number} low lower limit
125
125
  * @param {number} high higher limit
126
- * @return {number} clamped value
126
+ * @returns {number} clamped value
127
127
  */
128
128
  export function clamp(val, low, high) {
129
129
  return val < low ? low : val > high ? high : +val;
@@ -133,11 +133,11 @@ export function clamp(val, low, high) {
133
133
  * return a random integer between min (included) and max (excluded)
134
134
  * @public
135
135
  * @function
136
- * @memberOf me.Math
136
+ * @memberof me.Math
137
137
  * @name random
138
138
  * @param {number} min minimum value.
139
139
  * @param {number} max maximum value.
140
- * @return {number} random value
140
+ * @returns {number} random value
141
141
  * @example
142
142
  * // Print a random number; one of 5, 6, 7, 8, 9
143
143
  * console.log(me.Math.random(5, 10) );
@@ -150,11 +150,11 @@ export function random(min, max) {
150
150
  * return a random float between min, max (exclusive)
151
151
  * @public
152
152
  * @function
153
- * @memberOf me.Math
153
+ * @memberof me.Math
154
154
  * @name randomFloat
155
155
  * @param {number} min minimum value.
156
156
  * @param {number} max maximum value.
157
- * @return {number} random value
157
+ * @returns {number} random value
158
158
  * @example
159
159
  * // Print a random number; one of 5, 6, 7, 8, 9
160
160
  * console.log(me.Math.randomFloat(5, 10) );
@@ -167,11 +167,11 @@ export function randomFloat(min, max) {
167
167
  * return a weighted random between min, max (exclusive)
168
168
  * @public
169
169
  * @function
170
- * @memberOf me.Math
170
+ * @memberof me.Math
171
171
  * @name weightedRandom
172
172
  * @param {number} min minimum value.
173
173
  * @param {number} max maximum value.
174
- * @return {number} random value
174
+ * @returns {number} random value
175
175
  * @example
176
176
  * // Print a random number; one of 5, 6, 7, 8, 9
177
177
  * console.log(me.Math.weightedRandom(5, 10) );
@@ -184,11 +184,11 @@ export function weightedRandom(min, max) {
184
184
  * round a value to the specified number of digit
185
185
  * @public
186
186
  * @function
187
- * @memberOf me.Math
187
+ * @memberof me.Math
188
188
  * @name round
189
189
  * @param {number} num value to be rounded.
190
190
  * @param {number} [dec=0] number of decimal digit to be rounded to.
191
- * @return {number} rounded value
191
+ * @returns {number} rounded value
192
192
  * @example
193
193
  * // round a specific value to 2 digits
194
194
  * me.Math.round(10.33333, 2); // return 10.33
@@ -203,12 +203,12 @@ export function round(num, dec = 0) {
203
203
  * check if the given value is close to the expected one
204
204
  * @public
205
205
  * @function
206
- * @memberOf me.Math
206
+ * @memberof me.Math
207
207
  * @name toBeCloseTo
208
208
  * @param {number} expected value to be compared with.
209
209
  * @param {number} actual actual value to compare
210
210
  * @param {number} [precision=2] float precision for the comparison
211
- * @return {boolean} if close to
211
+ * @returns {boolean} if close to
212
212
  * @example
213
213
  * // test if the given value is close to 10
214
214
  * if (me.Math.toBeCloseTo(10, value)) {