melonjs 10.1.1 → 10.2.3

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 (92) hide show
  1. package/README.md +6 -10
  2. package/dist/melonjs.js +3114 -2866
  3. package/dist/melonjs.min.js +3 -3
  4. package/dist/melonjs.module.d.ts +2588 -2498
  5. package/dist/melonjs.module.js +2694 -2479
  6. package/package.json +10 -11
  7. package/src/audio/audio.js +43 -43
  8. package/src/camera/camera2d.js +52 -74
  9. package/src/entity/draggable.js +18 -17
  10. package/src/entity/droptarget.js +19 -18
  11. package/src/entity/entity.js +22 -26
  12. package/src/game.js +3 -3
  13. package/src/index.js +15 -11
  14. package/src/input/gamepad.js +13 -13
  15. package/src/input/input.js +1 -1
  16. package/src/input/keyboard.js +14 -16
  17. package/src/input/pointer.js +42 -35
  18. package/src/input/pointerevent.js +25 -33
  19. package/src/lang/deprecated.js +3 -3
  20. package/src/level/level.js +24 -16
  21. package/src/level/tiled/TMXGroup.js +6 -6
  22. package/src/level/tiled/TMXLayer.js +31 -31
  23. package/src/level/tiled/TMXObject.js +19 -19
  24. package/src/level/tiled/TMXTile.js +11 -12
  25. package/src/level/tiled/TMXTileMap.js +23 -21
  26. package/src/level/tiled/TMXTileset.js +13 -13
  27. package/src/level/tiled/TMXTilesetGroup.js +4 -4
  28. package/src/level/tiled/TMXUtils.js +13 -11
  29. package/src/level/tiled/renderer/TMXHexagonalRenderer.js +1 -1
  30. package/src/level/tiled/renderer/TMXIsometricRenderer.js +1 -1
  31. package/src/level/tiled/renderer/TMXRenderer.js +17 -17
  32. package/src/loader/loader.js +31 -27
  33. package/src/loader/loadingscreen.js +44 -75
  34. package/src/math/color.js +45 -64
  35. package/src/math/math.js +17 -17
  36. package/src/math/matrix2.js +46 -46
  37. package/src/math/matrix3.js +64 -64
  38. package/src/math/observable_vector2.js +45 -57
  39. package/src/math/observable_vector3.js +56 -70
  40. package/src/math/vector2.js +60 -59
  41. package/src/math/vector3.js +65 -64
  42. package/src/particles/emitter.js +53 -55
  43. package/src/particles/particle.js +1 -1
  44. package/src/physics/body.js +45 -51
  45. package/src/physics/bounds.js +36 -36
  46. package/src/physics/collision.js +15 -16
  47. package/src/physics/detector.js +10 -11
  48. package/src/physics/quadtree.js +18 -16
  49. package/src/physics/sat.js +17 -17
  50. package/src/physics/world.js +12 -10
  51. package/src/plugin/plugin.js +6 -6
  52. package/src/renderable/GUI.js +13 -18
  53. package/src/renderable/collectable.js +3 -3
  54. package/src/renderable/colorlayer.js +4 -4
  55. package/src/renderable/container.js +64 -46
  56. package/src/renderable/imagelayer.js +30 -31
  57. package/src/renderable/nineslicesprite.js +158 -69
  58. package/src/renderable/renderable.js +68 -67
  59. package/src/renderable/sprite.js +57 -43
  60. package/src/renderable/trigger.js +14 -15
  61. package/src/shapes/ellipse.js +27 -26
  62. package/src/shapes/line.js +8 -7
  63. package/src/shapes/poly.js +33 -31
  64. package/src/shapes/rectangle.js +50 -96
  65. package/src/state/stage.js +8 -8
  66. package/src/state/state.js +56 -56
  67. package/src/system/device.js +97 -84
  68. package/src/system/event.js +72 -72
  69. package/src/system/pooling.js +14 -14
  70. package/src/system/save.js +6 -3
  71. package/src/system/timer.js +20 -20
  72. package/src/text/bitmaptext.js +27 -33
  73. package/src/text/bitmaptextdata.js +9 -9
  74. package/src/text/text.js +118 -59
  75. package/src/tweens/easing.js +4 -4
  76. package/src/tweens/interpolation.js +4 -4
  77. package/src/tweens/tween.js +37 -27
  78. package/src/utils/agent.js +9 -8
  79. package/src/utils/array.js +4 -4
  80. package/src/utils/file.js +4 -4
  81. package/src/utils/function.js +5 -5
  82. package/src/utils/string.js +12 -12
  83. package/src/utils/utils.js +19 -19
  84. package/src/video/canvas/canvas_renderer.js +90 -90
  85. package/src/video/renderer.js +40 -39
  86. package/src/video/texture.js +85 -76
  87. package/src/video/texture_cache.js +11 -0
  88. package/src/video/video.js +31 -31
  89. package/src/video/webgl/buffer/vertex.js +9 -1
  90. package/src/video/webgl/glshader.js +20 -20
  91. package/src/video/webgl/webgl_compositor.js +47 -46
  92. package/src/video/webgl/webgl_renderer.js +104 -104
package/src/math/color.js CHANGED
@@ -175,10 +175,10 @@ var cssToRGB = new Map();
175
175
  * @class Color
176
176
  * @memberOf me
177
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
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
182
182
  */
183
183
  class Color {
184
184
 
@@ -203,21 +203,16 @@ class Color {
203
203
 
204
204
  /**
205
205
  * Color Red Component [0 .. 255]
206
- * @type Number
206
+ * @type {number}
207
207
  * @name r
208
208
  * @readonly
209
209
  * @memberOf me.Color
210
210
  */
211
211
 
212
- /**
213
- * @ignore
214
- */
215
212
  get r() {
216
213
  return ~~(this.glArray[0] * 255);
217
214
  }
218
- /**
219
- * @ignore
220
- */
215
+
221
216
  set r(value) {
222
217
  this.glArray[0] = clamp(~~value || 0, 0, 255) / 255.0;
223
218
  }
@@ -225,21 +220,16 @@ class Color {
225
220
 
226
221
  /**
227
222
  * Color Green Component [0 .. 255]
228
- * @type Number
223
+ * @type {number}
229
224
  * @name g
230
225
  * @readonly
231
226
  * @memberOf me.Color
232
227
  */
233
228
 
234
- /**
235
- * @ignore
236
- */
237
229
  get g() {
238
230
  return ~~(this.glArray[1] * 255);
239
231
  }
240
- /**
241
- * @ignore
242
- */
232
+
243
233
  set g(value) {
244
234
  this.glArray[1] = clamp(~~value || 0, 0, 255) / 255.0;
245
235
  }
@@ -247,41 +237,32 @@ class Color {
247
237
 
248
238
  /**
249
239
  * Color Blue Component [0 .. 255]
250
- * @type Number
240
+ * @type {number}
251
241
  * @name b
252
242
  * @readonly
253
243
  * @memberOf me.Color
254
244
  */
255
- /**
256
- * @ignore
257
- */
245
+
258
246
  get b() {
259
247
  return ~~(this.glArray[2] * 255);
260
248
  }
261
- /**
262
- * @ignore
263
- */
249
+
264
250
  set b(value) {
265
251
  this.glArray[2] = clamp(~~value || 0, 0, 255) / 255.0;
266
252
  }
267
253
 
268
254
  /**
269
255
  * Color Alpha Component [0.0 .. 1.0]
270
- * @type Number
256
+ * @type {number}
271
257
  * @name alpha
272
258
  * @readonly
273
259
  * @memberOf me.Color
274
260
  */
275
261
 
276
- /**
277
- * @ignore
278
- */
279
262
  get alpha() {
280
263
  return this.glArray[3];
281
264
  }
282
- /**
283
- * @ignore
284
- */
265
+
285
266
  set alpha(value) {
286
267
  this.glArray[3] = typeof(value) === "undefined" ? 1.0 : clamp(+value, 0, 1.0);
287
268
  }
@@ -292,11 +273,11 @@ class Color {
292
273
  * @name setColor
293
274
  * @memberOf me.Color
294
275
  * @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
276
+ * @param {number} r red component [0 .. 255]
277
+ * @param {number} g green component [0 .. 255]
278
+ * @param {number} b blue component [0 .. 255]
279
+ * @param {number} [alpha=1.0] alpha value [0.0 .. 1.0]
280
+ * @returns {me.Color} Reference to this object for method chaining
300
281
  */
301
282
  setColor(r, g, b, alpha = 1.0) {
302
283
  // Private initialization: copy Color value directly
@@ -316,7 +297,7 @@ class Color {
316
297
  * @name clone
317
298
  * @memberOf me.Color
318
299
  * @function
319
- * @return {me.Color} Reference to the newly cloned object
300
+ * @returns {me.Color} Reference to the newly cloned object
320
301
  */
321
302
  clone() {
322
303
  return pool.pull("Color", this);
@@ -327,8 +308,8 @@ class Color {
327
308
  * @name copy
328
309
  * @memberOf me.Color
329
310
  * @function
330
- * @param {me.Color|String} color
331
- * @return {me.Color} Reference to this object for method chaining
311
+ * @param {me.Color|string} color
312
+ * @returns {me.Color} Reference to this object for method chaining
332
313
  */
333
314
  copy(color) {
334
315
  if (color instanceof Color) {
@@ -345,7 +326,7 @@ class Color {
345
326
  * @memberOf me.Color
346
327
  * @function
347
328
  * @param {me.Color} color
348
- * @return {me.Color} Reference to this object for method chaining
329
+ * @returns {me.Color} Reference to this object for method chaining
349
330
  */
350
331
  add(color) {
351
332
  this.glArray[0] = clamp(this.glArray[0] + color.glArray[0], 0, 1);
@@ -361,8 +342,8 @@ class Color {
361
342
  * @name darken
362
343
  * @memberOf me.Color
363
344
  * @function
364
- * @param {Number} scale
365
- * @return {me.Color} Reference to this object for method chaining
345
+ * @param {number} scale
346
+ * @returns {me.Color} Reference to this object for method chaining
366
347
  */
367
348
  darken(scale) {
368
349
  scale = clamp(scale, 0, 1);
@@ -379,8 +360,8 @@ class Color {
379
360
  * @memberOf me.Color
380
361
  * @function
381
362
  * @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
363
+ * @param {number} alpha with alpha = 0 being this color, and alpha = 1 being the given one.
364
+ * @returns {me.Color} Reference to this object for method chaining
384
365
  */
385
366
  lerp(color, alpha) {
386
367
  alpha = clamp(alpha, 0, 1);
@@ -396,8 +377,8 @@ class Color {
396
377
  * @name lighten
397
378
  * @memberOf me.Color
398
379
  * @function
399
- * @param {Number} scale
400
- * @return {me.Color} Reference to this object for method chaining
380
+ * @param {number} scale
381
+ * @returns {me.Color} Reference to this object for method chaining
401
382
  */
402
383
  lighten(scale) {
403
384
  scale = clamp(scale, 0, 1);
@@ -413,9 +394,9 @@ class Color {
413
394
  * @name random
414
395
  * @memberOf me.Color
415
396
  * @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
397
+ * @param {number} [min=0] minimum value for the random range
398
+ * @param {number} [max=255] maxmium value for the random range
399
+ * @returns {me.Color} Reference to this object for method chaining
419
400
  */
420
401
  random(min = 0, max = 255) {
421
402
  if (min < 0) {
@@ -440,7 +421,7 @@ class Color {
440
421
  * @memberOf me.Color
441
422
  * @function
442
423
  * @param {me.Color} color
443
- * @return {Boolean}
424
+ * @returns {boolean}
444
425
  */
445
426
  equals(color) {
446
427
  return (
@@ -457,8 +438,8 @@ class Color {
457
438
  * @name parseCSS
458
439
  * @memberOf me.Color
459
440
  * @function
460
- * @param {String} color
461
- * @return {me.Color} Reference to this object for method chaining
441
+ * @param {string} cssColor
442
+ * @returns {me.Color} Reference to this object for method chaining
462
443
  */
463
444
  parseCSS(cssColor) {
464
445
  // TODO : Memoize this function by caching its input
@@ -475,8 +456,8 @@ class Color {
475
456
  * @name parseRGB
476
457
  * @memberOf me.Color
477
458
  * @function
478
- * @param {String} color
479
- * @return {me.Color} Reference to this object for method chaining
459
+ * @param {string} rgbColor
460
+ * @returns {me.Color} Reference to this object for method chaining
480
461
  */
481
462
  parseRGB(rgbColor) {
482
463
  // TODO : Memoize this function by caching its input
@@ -495,9 +476,9 @@ class Color {
495
476
  * @name parseHex
496
477
  * @memberOf me.Color
497
478
  * @function
498
- * @param {String} color
479
+ * @param {string} hexColor
499
480
  * @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
481
+ * @returns {me.Color} Reference to this object for method chaining
501
482
  */
502
483
  parseHex(hexColor, argb = false) {
503
484
  // TODO : Memoize this function by caching its input
@@ -555,8 +536,8 @@ class Color {
555
536
  * @name toUint32
556
537
  * @memberOf me.Color
557
538
  * @function
558
- * @param {Number} [alpha=1.0] alpha value [0.0 .. 1.0]
559
- * @return {Uint32}
539
+ * @param {number} [alpha=1.0] alpha value [0.0 .. 1.0]
540
+ * @returns {Uint32}
560
541
  */
561
542
  toUint32(alpha = this.alpha) {
562
543
  var ur = this.r & 0xff;
@@ -572,7 +553,7 @@ class Color {
572
553
  * @name toArray
573
554
  * @memberOf me.Color
574
555
  * @function
575
- * @return {Float32Array}
556
+ * @returns {Float32Array}
576
557
  */
577
558
  toArray() {
578
559
  return this.glArray;
@@ -584,7 +565,7 @@ class Color {
584
565
  * @name toHex
585
566
  * @memberOf me.Color
586
567
  * @function
587
- * @return {String}
568
+ * @returns {string}
588
569
  */
589
570
  toHex() {
590
571
  // TODO : Memoize this function by caching its result until any of
@@ -598,7 +579,7 @@ class Color {
598
579
  * @name toHex8
599
580
  * @memberOf me.Color
600
581
  * @function
601
- * @return {String}
582
+ * @returns {string}
602
583
  */
603
584
  toHex8() {
604
585
  // TODO : Memoize this function by caching its result until any of
@@ -612,7 +593,7 @@ class Color {
612
593
  * @name toRGB
613
594
  * @memberOf me.Color
614
595
  * @function
615
- * @return {String}
596
+ * @returns {string}
616
597
  */
617
598
  toRGB() {
618
599
  // TODO : Memoize this function by caching its result until any of
@@ -630,7 +611,7 @@ class Color {
630
611
  * @name toRGBA
631
612
  * @memberOf me.Color
632
613
  * @function
633
- * @return {String}
614
+ * @returns {string}
634
615
  */
635
616
  toRGBA() {
636
617
  // TODO : Memoize this function by caching its result until any of
package/src/math/math.js CHANGED
@@ -7,7 +7,7 @@
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
12
  * @memberOf me.Math
13
13
  */
@@ -16,7 +16,7 @@ export const DEG_TO_RAD = Math.PI / 180.0;
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
21
  * @memberOf me.Math
22
22
  */
@@ -25,7 +25,7 @@ export const RAD_TO_DEG = 180.0 / Math.PI;
25
25
  /**
26
26
  * constant equals to 2 times pi
27
27
  * @public
28
- * @type {Number}
28
+ * @type {number}
29
29
  * @name TAU
30
30
  * @memberOf me.Math
31
31
  */
@@ -34,7 +34,7 @@ export const TAU = Math.PI * 2;
34
34
  /**
35
35
  * constant equals to half pi
36
36
  * @public
37
- * @type {Number}
37
+ * @type {number}
38
38
  * @name ETA
39
39
  * @memberOf me.Math
40
40
  */
@@ -43,7 +43,7 @@ export const ETA = Math.PI * 0.5;
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
48
  * @memberOf me.Math
49
49
  */
@@ -55,8 +55,8 @@ export const EPSILON = 0.000001;
55
55
  * @function
56
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;
@@ -68,8 +68,8 @@ export function isPowerOfTwo(val) {
68
68
  * @function
69
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 --;
@@ -89,7 +89,7 @@ export function nextPowerOfTwo(val) {
89
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...
@@ -105,7 +105,7 @@ export function degToRad(angle) {
105
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
@@ -123,7 +123,7 @@ export function radToDeg(radians) {
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;
@@ -137,7 +137,7 @@ export function clamp(val, low, high) {
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) );
@@ -154,7 +154,7 @@ export function random(min, max) {
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) );
@@ -171,7 +171,7 @@ export function randomFloat(min, max) {
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) );
@@ -188,7 +188,7 @@ export function weightedRandom(min, max) {
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
@@ -208,7 +208,7 @@ export function round(num, dec = 0) {
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)) {
@@ -10,7 +10,7 @@ import Matrix3d from "./matrix3.js";
10
10
  * @memberOf me
11
11
  * @constructor
12
12
  * @param {me.Matrix2d} [mat2d] An instance of me.Matrix2d to copy from
13
- * @param {Number[]} [arguments...] Matrix elements. See {@link me.Matrix2d.setTransform}
13
+ * @param {number[]} [arguments...] Matrix elements. See {@link me.Matrix2d.setTransform}
14
14
  */
15
15
 
16
16
  class Matrix2d {
@@ -45,7 +45,7 @@ class Matrix2d {
45
45
  /**
46
46
  * tx component of the matrix
47
47
  * @public
48
- * @type {Number}
48
+ * @type {number}
49
49
  * @readonly
50
50
  * @see me.Matrix2d.translate
51
51
  * @name tx
@@ -58,7 +58,7 @@ class Matrix2d {
58
58
  /**
59
59
  * ty component of the matrix
60
60
  * @public
61
- * @type {Number}
61
+ * @type {number}
62
62
  * @readonly
63
63
  * @see me.Matrix2d.translate
64
64
  * @name ty
@@ -75,7 +75,7 @@ class Matrix2d {
75
75
  * @name identity
76
76
  * @memberOf me.Matrix2d
77
77
  * @function
78
- * @return {me.Matrix2d} Reference to this object for method chaining
78
+ * @returns {me.Matrix2d} Reference to this object for method chaining
79
79
  */
80
80
  identity() {
81
81
  this.setTransform(
@@ -91,16 +91,16 @@ class Matrix2d {
91
91
  * @name setTransform
92
92
  * @memberOf me.Matrix2d
93
93
  * @function
94
- * @param {Number} a
95
- * @param {Number} b
96
- * @param {Number} c
97
- * @param {Number} d
98
- * @param {Number} e
99
- * @param {Number} f
100
- * @param {Number} [g=0]
101
- * @param {Number} [h=0]
102
- * @param {Number} [i=1]
103
- * @return {me.Matrix2d} Reference to this object for method chaining
94
+ * @param {number} a
95
+ * @param {number} b
96
+ * @param {number} c
97
+ * @param {number} d
98
+ * @param {number} e
99
+ * @param {number} f
100
+ * @param {number} [g=0]
101
+ * @param {number} [h=0]
102
+ * @param {number} [i=1]
103
+ * @returns {me.Matrix2d} Reference to this object for method chaining
104
104
  */
105
105
  setTransform() {
106
106
  var a = this.val;
@@ -136,10 +136,10 @@ class Matrix2d {
136
136
  * @memberOf me.Matrix2d
137
137
  * @function
138
138
  * @param {me.Matrix2d} m the matrix object to copy from
139
- * @return {me.Matrix2d} Reference to this object for method chaining
139
+ * @returns {me.Matrix2d} Reference to this object for method chaining
140
140
  */
141
- copy(b) {
142
- this.val.set(b.val);
141
+ copy(m) {
142
+ this.val.set(m.val);
143
143
  return this;
144
144
  }
145
145
 
@@ -149,7 +149,7 @@ class Matrix2d {
149
149
  * @memberOf me.Matrix2d
150
150
  * @function
151
151
  * @param {me.Matrix3d} m the matrix object to copy from
152
- * @return {me.Matrix2d} Reference to this object for method chaining
152
+ * @returns {me.Matrix2d} Reference to this object for method chaining
153
153
  */
154
154
  fromMat3d(m) {
155
155
  var b = m.val;
@@ -174,7 +174,7 @@ class Matrix2d {
174
174
  * @memberOf me.Matrix2d
175
175
  * @function
176
176
  * @param {me.Matrix2d} m the other matrix
177
- * @return {me.Matrix2d} Reference to this object for method chaining
177
+ * @returns {me.Matrix2d} Reference to this object for method chaining
178
178
  */
179
179
  multiply(m) {
180
180
  var b = m.val;
@@ -205,7 +205,7 @@ class Matrix2d {
205
205
  * @name transpose
206
206
  * @memberOf me.Matrix2d
207
207
  * @function
208
- * @return {me.Matrix2d} Reference to this object for method chaining
208
+ * @returns {me.Matrix2d} Reference to this object for method chaining
209
209
  */
210
210
  transpose() {
211
211
  var a = this.val,
@@ -228,7 +228,7 @@ class Matrix2d {
228
228
  * @name invert
229
229
  * @memberOf me.Matrix2d
230
230
  * @function
231
- * @return {me.Matrix2d} Reference to this object for method chaining
231
+ * @returns {me.Matrix2d} Reference to this object for method chaining
232
232
  */
233
233
  invert() {
234
234
  var val = this.val;
@@ -263,8 +263,8 @@ class Matrix2d {
263
263
  * @name apply
264
264
  * @memberOf me.Matrix2d
265
265
  * @function
266
- * @param {me.Vector2d} vector the vector object to be transformed
267
- * @return {me.Vector2d} result vector object.
266
+ * @param {me.Vector2d} v the vector object to be transformed
267
+ * @returns {me.Vector2d} result vector object.
268
268
  */
269
269
  apply(v) {
270
270
  var a = this.val,
@@ -282,8 +282,8 @@ class Matrix2d {
282
282
  * @name applyInverse
283
283
  * @memberOf me.Matrix2d
284
284
  * @function
285
- * @param {me.Vector2d} vector the vector object to be transformed
286
- * @return {me.Vector2d} result vector object.
285
+ * @param {me.Vector2d} v the vector object to be transformed
286
+ * @returns {me.Vector2d} result vector object.
287
287
  */
288
288
  applyInverse(v) {
289
289
  var a = this.val,
@@ -303,9 +303,9 @@ class Matrix2d {
303
303
  * @name scale
304
304
  * @memberOf me.Matrix2d
305
305
  * @function
306
- * @param {Number} x a number representing the abscissa of the scaling vector.
307
- * @param {Number} [y=x] a number representing the ordinate of the scaling vector.
308
- * @return {me.Matrix2d} Reference to this object for method chaining
306
+ * @param {number} x a number representing the abscissa of the scaling vector.
307
+ * @param {number} [y=x] a number representing the ordinate of the scaling vector.
308
+ * @returns {me.Matrix2d} Reference to this object for method chaining
309
309
  */
310
310
  scale(x, y) {
311
311
  var a = this.val,
@@ -325,8 +325,8 @@ class Matrix2d {
325
325
  * @name scaleV
326
326
  * @memberOf me.Matrix2d
327
327
  * @function
328
- * @param {me.Vector2d} vector scaling vector
329
- * @return {me.Matrix2d} Reference to this object for method chaining
328
+ * @param {me.Vector2d} v scaling vector
329
+ * @returns {me.Matrix2d} Reference to this object for method chaining
330
330
  */
331
331
  scaleV(v) {
332
332
  return this.scale(v.x, v.y);
@@ -337,8 +337,8 @@ class Matrix2d {
337
337
  * @name scaleX
338
338
  * @memberOf me.Matrix2d
339
339
  * @function
340
- * @param {Number} x x scaling vector
341
- * @return {me.Matrix2d} Reference to this object for method chaining
340
+ * @param {number} x x scaling vector
341
+ * @returns {me.Matrix2d} Reference to this object for method chaining
342
342
  */
343
343
  scaleX(x) {
344
344
  return this.scale(x, 1);
@@ -349,8 +349,8 @@ class Matrix2d {
349
349
  * @name scaleY
350
350
  * @memberOf me.Matrix2d
351
351
  * @function
352
- * @param {Number} y y scaling vector
353
- * @return {me.Matrix2d} Reference to this object for method chaining
352
+ * @param {number} y y scaling vector
353
+ * @returns {me.Matrix2d} Reference to this object for method chaining
354
354
  */
355
355
  scaleY(y) {
356
356
  return this.scale(1, y);
@@ -361,8 +361,8 @@ class Matrix2d {
361
361
  * @name rotate
362
362
  * @memberOf me.Matrix2d
363
363
  * @function
364
- * @param {Number} angle Rotation angle in radians.
365
- * @return {me.Matrix2d} Reference to this object for method chaining
364
+ * @param {number} angle Rotation angle in radians.
365
+ * @returns {me.Matrix2d} Reference to this object for method chaining
366
366
  */
367
367
  rotate(angle) {
368
368
  if (angle !== 0) {
@@ -392,9 +392,9 @@ class Matrix2d {
392
392
  * @name translate
393
393
  * @memberOf me.Matrix2d
394
394
  * @function
395
- * @param {Number} x the x coordindates to translate the matrix by
396
- * @param {Number} y the y coordindates to translate the matrix by
397
- * @return {me.Matrix2d} Reference to this object for method chaining
395
+ * @param {number} x the x coordindates to translate the matrix by
396
+ * @param {number} y the y coordindates to translate the matrix by
397
+ * @returns {me.Matrix2d} Reference to this object for method chaining
398
398
  */
399
399
  /**
400
400
  * translate the matrix by a vector on the horizontal and vertical axis
@@ -402,7 +402,7 @@ class Matrix2d {
402
402
  * @memberOf me.Matrix2d
403
403
  * @function
404
404
  * @param {me.Vector2d} v the vector to translate the matrix by
405
- * @return {me.Matrix2d} Reference to this object for method chaining
405
+ * @returns {me.Matrix2d} Reference to this object for method chaining
406
406
  */
407
407
  translate() {
408
408
  var a = this.val;
@@ -429,8 +429,8 @@ class Matrix2d {
429
429
  * @name isIdentity
430
430
  * @memberOf me.Matrix2d
431
431
  * @function
432
- * @return {Boolean}
433
- **/
432
+ * @returns {boolean}
433
+ */
434
434
  isIdentity() {
435
435
  var a = this.val;
436
436
 
@@ -453,7 +453,7 @@ class Matrix2d {
453
453
  * @memberOf me.Matrix2d
454
454
  * @function
455
455
  * @param {me.Matrix2d} m the other matrix
456
- * @return {Boolean} true if both are equals
456
+ * @returns {boolean} true if both are equals
457
457
  */
458
458
  equals(m) {
459
459
  var b = m.val;
@@ -477,7 +477,7 @@ class Matrix2d {
477
477
  * @name clone
478
478
  * @memberOf me.Matrix2d
479
479
  * @function
480
- * @return {me.Matrix2d}
480
+ * @returns {me.Matrix2d}
481
481
  */
482
482
  clone() {
483
483
  return pool.pull("Matrix2d", this);
@@ -488,7 +488,7 @@ class Matrix2d {
488
488
  * @name toArray
489
489
  * @memberOf me.Matrix2d
490
490
  * @function
491
- * @return {Float32Array}
491
+ * @returns {Float32Array}
492
492
  */
493
493
  toArray() {
494
494
  return this.val;
@@ -499,7 +499,7 @@ class Matrix2d {
499
499
  * @name toString
500
500
  * @memberOf me.Matrix2d
501
501
  * @function
502
- * @return {String}
502
+ * @returns {string}
503
503
  */
504
504
  toString() {
505
505
  var a = this.val;