melonjs 10.2.1 → 10.2.2

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 (90) hide show
  1. package/README.md +1 -1
  2. package/dist/melonjs.js +2735 -2760
  3. package/dist/melonjs.min.js +3 -3
  4. package/dist/melonjs.module.d.ts +2186 -2162
  5. package/dist/melonjs.module.js +2323 -2362
  6. package/package.json +8 -9
  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 +2 -2
  13. package/src/index.js +11 -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 +18 -26
  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 +29 -25
  33. package/src/math/color.js +45 -64
  34. package/src/math/math.js +17 -17
  35. package/src/math/matrix2.js +46 -46
  36. package/src/math/matrix3.js +64 -64
  37. package/src/math/observable_vector2.js +45 -57
  38. package/src/math/observable_vector3.js +56 -70
  39. package/src/math/vector2.js +60 -59
  40. package/src/math/vector3.js +65 -64
  41. package/src/particles/emitter.js +53 -55
  42. package/src/particles/particle.js +1 -1
  43. package/src/physics/body.js +44 -44
  44. package/src/physics/bounds.js +34 -34
  45. package/src/physics/collision.js +15 -16
  46. package/src/physics/detector.js +10 -10
  47. package/src/physics/quadtree.js +19 -17
  48. package/src/physics/sat.js +17 -17
  49. package/src/physics/world.js +12 -10
  50. package/src/plugin/plugin.js +6 -6
  51. package/src/renderable/GUI.js +13 -18
  52. package/src/renderable/collectable.js +3 -3
  53. package/src/renderable/colorlayer.js +4 -4
  54. package/src/renderable/container.js +64 -46
  55. package/src/renderable/imagelayer.js +30 -31
  56. package/src/renderable/nineslicesprite.js +13 -13
  57. package/src/renderable/renderable.js +68 -66
  58. package/src/renderable/sprite.js +57 -43
  59. package/src/renderable/trigger.js +14 -15
  60. package/src/shapes/ellipse.js +27 -26
  61. package/src/shapes/line.js +8 -7
  62. package/src/shapes/poly.js +33 -31
  63. package/src/shapes/rectangle.js +50 -96
  64. package/src/state/stage.js +6 -6
  65. package/src/state/state.js +54 -54
  66. package/src/system/device.js +97 -84
  67. package/src/system/event.js +72 -72
  68. package/src/system/pooling.js +14 -14
  69. package/src/system/save.js +6 -3
  70. package/src/system/timer.js +20 -20
  71. package/src/text/bitmaptext.js +27 -33
  72. package/src/text/bitmaptextdata.js +9 -9
  73. package/src/text/text.js +39 -41
  74. package/src/tweens/easing.js +4 -4
  75. package/src/tweens/interpolation.js +4 -4
  76. package/src/tweens/tween.js +37 -27
  77. package/src/utils/agent.js +9 -8
  78. package/src/utils/array.js +4 -4
  79. package/src/utils/file.js +4 -4
  80. package/src/utils/function.js +5 -5
  81. package/src/utils/string.js +12 -12
  82. package/src/utils/utils.js +19 -19
  83. package/src/video/canvas/canvas_renderer.js +90 -90
  84. package/src/video/renderer.js +40 -39
  85. package/src/video/texture.js +74 -75
  86. package/src/video/video.js +30 -30
  87. package/src/video/webgl/buffer/vertex.js +9 -1
  88. package/src/video/webgl/glshader.js +20 -20
  89. package/src/video/webgl/webgl_compositor.js +33 -34
  90. package/src/video/webgl/webgl_renderer.js +104 -104
@@ -13,8 +13,8 @@ import {random as mathRandom, weightedRandom as mathWeightedRandom} from "./../m
13
13
  * @memberOf me.utils.array
14
14
  * @name remove
15
15
  * @param {Array} arr array from which to remove an object
16
- * @param {Object} object to be removed
17
- * @return {Array} the modified Array
16
+ * @param {object} obj to be removed
17
+ * @returns {Array} the modified Array
18
18
  * var arr = [ "foo", "bar", "baz" ];
19
19
  * // remove "foo" from the array
20
20
  * me.utils.array.remove(arr, "foo");
@@ -34,7 +34,7 @@ export function remove(arr, obj) {
34
34
  * @memberOf me.utils.array
35
35
  * @name random
36
36
  * @param {Array} arr array to pick a element
37
- * @return {any} random member of array
37
+ * @returns {any} random member of array
38
38
  * @example
39
39
  * // Select a random array element
40
40
  * var arr = [ "foo", "bar", "baz" ];
@@ -51,7 +51,7 @@ export function random(arr) {
51
51
  * @memberOf me.utils.array
52
52
  * @name weightedRandom
53
53
  * @param {Array} arr array to pick a element
54
- * @return {any} random member of array
54
+ * @returns {any} random member of array
55
55
  */
56
56
  export function weightedRandom(arr) {
57
57
  return arr[mathWeightedRandom(0, arr.length)];
package/src/utils/file.js CHANGED
@@ -16,8 +16,8 @@ const REMOVE_EXT = /\.[^\.]*$/;
16
16
  * @function
17
17
  * @memberOf me.utils.file
18
18
  * @name getBasename
19
- * @param {String} path path containing the filename
20
- * @return {String} the base name without path information.
19
+ * @param {string} path path containing the filename
20
+ * @returns {string} the base name without path information.
21
21
  */
22
22
  export function getBasename(path) {
23
23
  return path.replace(REMOVE_PATH, "").replace(REMOVE_EXT, "");
@@ -29,8 +29,8 @@ export function getBasename(path) {
29
29
  * @function
30
30
  * @memberOf me.utils.file
31
31
  * @name getExtension
32
- * @param {String} path path containing the filename
33
- * @return {String} filename extension.
32
+ * @param {string} path path containing the filename
33
+ * @returns {string} filename extension.
34
34
  */
35
35
  export function getExtension(path) {
36
36
  return path.substring(path.lastIndexOf(".") + 1, path.length);
@@ -4,17 +4,16 @@
4
4
  * @memberOf me
5
5
  */
6
6
 
7
-
8
7
  /**
9
8
  * Executes a function as soon as the interpreter is idle (stack empty).
10
9
  * @public
11
10
  * @function
12
11
  * @memberOf me.utils.function
13
12
  * @name defer
14
- * @param {Function} fn The function to be deferred.
15
- * @param {Object} thisArg The value to be passed as the this parameter to the target function when the deferred function is called
13
+ * @param {Function} func The function to be deferred.
14
+ * @param {object} thisArg The value to be passed as the this parameter to the target function when the deferred function is called
16
15
  * @param {...*} [args] Optional additional arguments to carry for the function.
17
- * @return {Number} id that can be used to clear the deferred function using
16
+ * @returns {number} id that can be used to clear the deferred function using
18
17
  * clearTimeout
19
18
  * @example
20
19
  * // execute myFunc() when the stack is empty,
@@ -33,8 +32,9 @@ export function defer(func, thisArg, ...args) {
33
32
  * @memberOf me.utils.function
34
33
  * @name throttle
35
34
  * @param {Function} fn the function to be throttled.
36
- * @param {Number} delay The delay in ms
35
+ * @param {number} delay The delay in ms
37
36
  * @param {no_trailing} no_trailing disable the execution on the trailing edge
37
+ * @returns {Function} the function that will be throttled
38
38
  */
39
39
  export function throttle(fn, delay, no_trailing) {
40
40
  var last = window.performance.now(), deferTimer;
@@ -11,8 +11,8 @@
11
11
  * @function
12
12
  * @memberOf me.utils.string
13
13
  * @name capitalize
14
- * @param {String} string the string to be capitalized
15
- * @return {string} the capitalized string
14
+ * @param {string} str the string to be capitalized
15
+ * @returns {string} the capitalized string
16
16
  */
17
17
  export function capitalize(str) {
18
18
  return str.charAt(0).toUpperCase() + str.slice(1);
@@ -24,8 +24,8 @@ export function capitalize(str) {
24
24
  * @function
25
25
  * @memberOf me.utils.string
26
26
  * @name trimLeft
27
- * @param {String} string the string to be trimmed
28
- * @return {string} trimmed string
27
+ * @param {string} str the string to be trimmed
28
+ * @returns {string} trimmed string
29
29
  */
30
30
  export function trimLeft(str) {
31
31
  return str.replace(/^\s+/, "");
@@ -37,8 +37,8 @@ export function trimLeft(str) {
37
37
  * @function
38
38
  * @memberOf me.utils.string
39
39
  * @name trimRight
40
- * @param {String} string the string to be trimmed
41
- * @return {string} trimmed string
40
+ * @param {string} str the string to be trimmed
41
+ * @returns {string} trimmed string
42
42
  */
43
43
  export function trimRight(str) {
44
44
  return str.replace(/\s+$/, "");
@@ -50,8 +50,8 @@ export function trimRight(str) {
50
50
  * @function
51
51
  * @memberOf me.utils.string
52
52
  * @name isNumeric
53
- * @param {String} string the string to be tested
54
- * @return {Boolean} true if string contains only digits
53
+ * @param {string} str the string to be tested
54
+ * @returns {boolean} true if string contains only digits
55
55
  */
56
56
  export function isNumeric(str) {
57
57
  if (typeof str === "string") {
@@ -66,8 +66,8 @@ export function isNumeric(str) {
66
66
  * @function
67
67
  * @memberOf me.utils.string
68
68
  * @name isBoolean
69
- * @param {String} string the string to be tested
70
- * @return {Boolean} true if the string is either true or false
69
+ * @param {string} str the string to be tested
70
+ * @returns {boolean} true if the string is either true or false
71
71
  */
72
72
  export function isBoolean(str) {
73
73
  var trimmed = str.trim();
@@ -80,8 +80,8 @@ export function isBoolean(str) {
80
80
  * @function
81
81
  * @memberOf me.utils.string
82
82
  * @name toHex
83
- * @param {String} string the string to be converted
84
- * @return {String}
83
+ * @param {string} str the string to be converted
84
+ * @returns {string} the converted hexadecimal value
85
85
  */
86
86
  export function toHex(str) {
87
87
  var res = "", c = 0;
@@ -31,20 +31,20 @@ var utils = {
31
31
  * @function
32
32
  * @memberOf me.utils
33
33
  * @name getPixels
34
- * @param {Image|Canvas} image Image to read
35
- * @return {ImageData} Canvas ImageData object
34
+ * @param {HTMLImageElement|HTMLCanvasElement} image Image to read
35
+ * @returns {ImageData} ImageData object
36
36
  */
37
- getPixels : function (arg) {
38
- if (arg instanceof HTMLImageElement) {
37
+ getPixels : function (image) {
38
+ if (image instanceof HTMLImageElement) {
39
39
  var _context = CanvasRenderer.getContext2d(
40
- createCanvas(arg.width, arg.height)
40
+ createCanvas(image.width, image.height)
41
41
  );
42
- _context.drawImage(arg, 0, 0);
43
- return _context.getImageData(0, 0, arg.width, arg.height);
42
+ _context.drawImage(image, 0, 0);
43
+ return _context.getImageData(0, 0, image.width, image.height);
44
44
  }
45
45
  else {
46
46
  // canvas !
47
- return arg.getContext("2d").getImageData(0, 0, arg.width, arg.height);
47
+ return image.getContext("2d").getImageData(0, 0, image.width, image.height);
48
48
  }
49
49
  },
50
50
 
@@ -54,9 +54,9 @@ var utils = {
54
54
  * @function
55
55
  * @memberOf me.utils
56
56
  * @name checkVersion
57
- * @param {String} first First version string to compare
58
- * @param {String} [second=me.version] Second version string to compare
59
- * @return {Number} comparison result <br>&lt; 0 : first &lt; second<br>
57
+ * @param {string} first First version string to compare
58
+ * @param {string} [second=me.version] Second version string to compare
59
+ * @returns {number} comparison result <br>&lt; 0 : first &lt; second<br>
60
60
  * 0 : first == second<br>
61
61
  * &gt; 0 : first &gt; second
62
62
  * @example
@@ -87,14 +87,14 @@ var utils = {
87
87
  * @function
88
88
  * @memberOf me.utils
89
89
  * @name getUriFragment
90
- * @param {String} [url=document.location] an optional params string or URL containing fragment (hash) params to be parsed
91
- * @return {Object} an object representing the deserialized params string.
92
- * @property {Boolean} [hitbox=false] draw the hitbox in the debug panel (if enabled)
93
- * @property {Boolean} [velocity=false] draw the entities velocity in the debug panel (if enabled)
94
- * @property {Boolean} [quadtree=false] draw the quadtree in the debug panel (if enabled)
95
- * @property {Boolean} [webgl=false] force the renderer to WebGL
96
- * @property {Boolean} [debug=false] display the debug panel (if preloaded)
97
- * @property {String} [debugToggleKey="s"] show/hide the debug panel (if preloaded)
90
+ * @param {string} [url=document.location] an optional params string or URL containing fragment (hash) params to be parsed
91
+ * @returns {object} an object representing the deserialized params string.
92
+ * @property {boolean} [hitbox=false] draw the hitbox in the debug panel (if enabled)
93
+ * @property {boolean} [velocity=false] draw the entities velocity in the debug panel (if enabled)
94
+ * @property {boolean} [quadtree=false] draw the quadtree in the debug panel (if enabled)
95
+ * @property {boolean} [webgl=false] force the renderer to WebGL
96
+ * @property {boolean} [debug=false] display the debug panel (if preloaded)
97
+ * @property {string} [debugToggleKey="s"] show/hide the debug panel (if preloaded)
98
98
  * @example
99
99
  * // http://www.example.com/index.html#debug&hitbox=true&mytag=value
100
100
  * var UriFragment = me.utils.getUriFragment();
@@ -13,17 +13,17 @@ import { createCanvas } from "./../video.js";
13
13
  * @extends me.Renderer
14
14
  * @memberOf me
15
15
  * @constructor
16
- * @param {Object} options The renderer parameters
17
- * @param {Number} options.width The width of the canvas without scaling
18
- * @param {Number} options.height The height of the canvas without scaling
16
+ * @param {object} options The renderer parameters
17
+ * @param {number} options.width The width of the canvas without scaling
18
+ * @param {number} options.height The height of the canvas without scaling
19
19
  * @param {HTMLCanvasElement} [options.canvas] The html canvas to draw to on screen
20
- * @param {Boolean} [options.doubleBuffering=false] Whether to enable double buffering
21
- * @param {Boolean} [options.antiAlias=false] Whether to enable anti-aliasing
22
- * @param {Boolean} [options.transparent=false] Whether to enable transparency on the canvas (performance hit when enabled)
23
- * @param {Boolean} [options.subPixel=false] Whether to enable subpixel renderering (performance hit when enabled)
24
- * @param {Boolean} [options.textureSeamFix=true] enable the texture seam fix when rendering Tile when antiAlias is off for the canvasRenderer
25
- * @param {Number} [options.zoomX=width] The actual width of the canvas with scaling applied
26
- * @param {Number} [options.zoomY=height] The actual height of the canvas with scaling applied
20
+ * @param {boolean} [options.doubleBuffering=false] Whether to enable double buffering
21
+ * @param {boolean} [options.antiAlias=false] Whether to enable anti-aliasing
22
+ * @param {boolean} [options.transparent=false] Whether to enable transparency on the canvas (performance hit when enabled)
23
+ * @param {boolean} [options.subPixel=false] Whether to enable subpixel renderering (performance hit when enabled)
24
+ * @param {boolean} [options.textureSeamFix=true] enable the texture seam fix when rendering Tile when antiAlias is off for the canvasRenderer
25
+ * @param {number} [options.zoomX=width] The actual width of the canvas with scaling applied
26
+ * @param {number} [options.zoomY=height] The actual height of the canvas with scaling applied
27
27
  */
28
28
  class CanvasRenderer extends Renderer {
29
29
 
@@ -86,8 +86,8 @@ class CanvasRenderer extends Renderer {
86
86
  * @name setBlendMode
87
87
  * @memberOf me.CanvasRenderer.prototype
88
88
  * @function
89
- * @param {String} [mode="normal"] blend mode : "normal", "multiply"
90
- * @param {Context2d} [context]
89
+ * @param {string} [mode="normal"] blend mode : "normal", "multiply"
90
+ * @param {CanvasRenderingContext2D} [context]
91
91
  */
92
92
  setBlendMode(mode, context) {
93
93
  context = context || this.getContext();
@@ -139,14 +139,14 @@ class CanvasRenderer extends Renderer {
139
139
  * @name clearColor
140
140
  * @memberOf me.CanvasRenderer.prototype
141
141
  * @function
142
- * @param {me.Color|String} color CSS color.
143
- * @param {Boolean} [opaque=false] Allow transparency [default] or clear the surface completely [true]
142
+ * @param {me.Color|string} color CSS color.
143
+ * @param {boolean} [opaque=false] Allow transparency [default] or clear the surface completely [true]
144
144
  */
145
- clearColor(col, opaque) {
145
+ clearColor(color, opaque) {
146
146
  this.save();
147
147
  this.resetTransform();
148
148
  this.backBufferContext2D.globalCompositeOperation = opaque ? "copy" : "source-over";
149
- this.backBufferContext2D.fillStyle = (col instanceof Color) ? col.toRGBA() : col;
149
+ this.backBufferContext2D.fillStyle = (color instanceof Color) ? color.toRGBA() : color;
150
150
  this.fillRect(0, 0, this.backBufferCanvas.width, this.backBufferCanvas.height);
151
151
  this.restore();
152
152
  }
@@ -156,10 +156,10 @@ class CanvasRenderer extends Renderer {
156
156
  * @name clearRect
157
157
  * @memberOf me.CanvasRenderer.prototype
158
158
  * @function
159
- * @param {Number} x x axis of the coordinate for the rectangle starting point.
160
- * @param {Number} y y axis of the coordinate for the rectangle starting point.
161
- * @param {Number} width The rectangle's width.
162
- * @param {Number} height The rectangle's height.
159
+ * @param {number} x x axis of the coordinate for the rectangle starting point.
160
+ * @param {number} y y axis of the coordinate for the rectangle starting point.
161
+ * @param {number} width The rectangle's width.
162
+ * @param {number} height The rectangle's height.
163
163
  */
164
164
  clearRect(x, y, width, height) {
165
165
  this.backBufferContext2D.clearRect(x, y, width, height);
@@ -170,9 +170,9 @@ class CanvasRenderer extends Renderer {
170
170
  * @name createPattern
171
171
  * @memberOf me.CanvasRenderer.prototype
172
172
  * @function
173
- * @param {image} image Source image
174
- * @param {String} repeat Define how the pattern should be repeated
175
- * @return {CanvasPattern}
173
+ * @param {Image} image Source image
174
+ * @param {string} repeat Define how the pattern should be repeated
175
+ * @returns {CanvasPattern}
176
176
  * @see me.ImageLayer#repeat
177
177
  * @example
178
178
  * var tileable = renderer.createPattern(image, "repeat");
@@ -190,14 +190,14 @@ class CanvasRenderer extends Renderer {
190
190
  * @memberOf me.CanvasRenderer.prototype
191
191
  * @function
192
192
  * @param {Image} image An element to draw into the context. The specification permits any canvas image source (CanvasImageSource), specifically, a CSSImageValue, an HTMLImageElement, an SVGImageElement, an HTMLVideoElement, an HTMLCanvasElement, an ImageBitmap, or an OffscreenCanvas.
193
- * @param {Number} sx The X coordinate of the top left corner of the sub-rectangle of the source image to draw into the destination context.
194
- * @param {Number} sy The Y coordinate of the top left corner of the sub-rectangle of the source image to draw into the destination context.
195
- * @param {Number} sw The width of the sub-rectangle of the source image to draw into the destination context. If not specified, the entire rectangle from the coordinates specified by sx and sy to the bottom-right corner of the image is used.
196
- * @param {Number} sh The height of the sub-rectangle of the source image to draw into the destination context.
197
- * @param {Number} dx The X coordinate in the destination canvas at which to place the top-left corner of the source image.
198
- * @param {Number} dy The Y coordinate in the destination canvas at which to place the top-left corner of the source image.
199
- * @param {Number} dWidth The width to draw the image in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in width when drawn.
200
- * @param {Number} dHeight The height to draw the image in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in height when drawn.
193
+ * @param {number} sx The X coordinate of the top left corner of the sub-rectangle of the source image to draw into the destination context.
194
+ * @param {number} sy The Y coordinate of the top left corner of the sub-rectangle of the source image to draw into the destination context.
195
+ * @param {number} sw The width of the sub-rectangle of the source image to draw into the destination context. If not specified, the entire rectangle from the coordinates specified by sx and sy to the bottom-right corner of the image is used.
196
+ * @param {number} sh The height of the sub-rectangle of the source image to draw into the destination context.
197
+ * @param {number} dx The X coordinate in the destination canvas at which to place the top-left corner of the source image.
198
+ * @param {number} dy The Y coordinate in the destination canvas at which to place the top-left corner of the source image.
199
+ * @param {number} dw The width to draw the image in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in width when drawn.
200
+ * @param {number} dh The height to draw the image in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in height when drawn.
201
201
  * @example
202
202
  * // Position the image on the canvas:
203
203
  * renderer.drawImage(image, dx, dy);
@@ -253,10 +253,10 @@ class CanvasRenderer extends Renderer {
253
253
  * @memberOf me.CanvasRenderer.prototype
254
254
  * @function
255
255
  * @param {CanvasPattern} pattern Pattern object
256
- * @param {Number} x
257
- * @param {Number} y
258
- * @param {Number} width
259
- * @param {Number} height
256
+ * @param {number} x
257
+ * @param {number} y
258
+ * @param {number} width
259
+ * @param {number} height
260
260
  * @see me.CanvasRenderer#createPattern
261
261
  */
262
262
  drawPattern(pattern, x, y, width, height) {
@@ -275,13 +275,13 @@ class CanvasRenderer extends Renderer {
275
275
  * @name strokeArc
276
276
  * @memberOf me.CanvasRenderer.prototype
277
277
  * @function
278
- * @param {Number} x arc center point x-axis
279
- * @param {Number} y arc center point y-axis
280
- * @param {Number} radius
281
- * @param {Number} start start angle in radians
282
- * @param {Number} end end angle in radians
283
- * @param {Boolean} [antiClockwise=false] draw arc anti-clockwise
284
- * @param {Boolean} [fill=false] also fill the shape with the current color if true
278
+ * @param {number} x arc center point x-axis
279
+ * @param {number} y arc center point y-axis
280
+ * @param {number} radius
281
+ * @param {number} start start angle in radians
282
+ * @param {number} end end angle in radians
283
+ * @param {boolean} [antiClockwise=false] draw arc anti-clockwise
284
+ * @param {boolean} [fill=false] also fill the shape with the current color if true
285
285
  */
286
286
  strokeArc(x, y, radius, start, end, antiClockwise, fill = false) {
287
287
  var context = this.backBufferContext2D;
@@ -302,12 +302,12 @@ class CanvasRenderer extends Renderer {
302
302
  * @name fillArc
303
303
  * @memberOf me.CanvasRenderer.prototype
304
304
  * @function
305
- * @param {Number} x arc center point x-axis
306
- * @param {Number} y arc center point y-axis
307
- * @param {Number} radius
308
- * @param {Number} start start angle in radians
309
- * @param {Number} end end angle in radians
310
- * @param {Boolean} [antiClockwise=false] draw arc anti-clockwise
305
+ * @param {number} x arc center point x-axis
306
+ * @param {number} y arc center point y-axis
307
+ * @param {number} radius
308
+ * @param {number} start start angle in radians
309
+ * @param {number} end end angle in radians
310
+ * @param {boolean} [antiClockwise=false] draw arc anti-clockwise
311
311
  */
312
312
  fillArc(x, y, radius, start, end, antiClockwise) {
313
313
  this.strokeArc(x, y, radius, start, end, antiClockwise || false, true);
@@ -318,11 +318,11 @@ class CanvasRenderer extends Renderer {
318
318
  * @name strokeEllipse
319
319
  * @memberOf me.CanvasRenderer.prototype
320
320
  * @function
321
- * @param {Number} x ellipse center point x-axis
322
- * @param {Number} y ellipse center point y-axis
323
- * @param {Number} w horizontal radius of the ellipse
324
- * @param {Number} h vertical radius of the ellipse
325
- * @param {Boolean} [fill=false] also fill the shape with the current color if true
321
+ * @param {number} x ellipse center point x-axis
322
+ * @param {number} y ellipse center point y-axis
323
+ * @param {number} w horizontal radius of the ellipse
324
+ * @param {number} h vertical radius of the ellipse
325
+ * @param {boolean} [fill=false] also fill the shape with the current color if true
326
326
  */
327
327
  strokeEllipse(x, y, w, h, fill = false) {
328
328
  var context = this.backBufferContext2D;
@@ -361,10 +361,10 @@ class CanvasRenderer extends Renderer {
361
361
  * @name fillEllipse
362
362
  * @memberOf me.CanvasRenderer.prototype
363
363
  * @function
364
- * @param {Number} x ellipse center point x-axis
365
- * @param {Number} y ellipse center point y-axis
366
- * @param {Number} w horizontal radius of the ellipse
367
- * @param {Number} h vertical radius of the ellipse
364
+ * @param {number} x ellipse center point x-axis
365
+ * @param {number} y ellipse center point y-axis
366
+ * @param {number} w horizontal radius of the ellipse
367
+ * @param {number} h vertical radius of the ellipse
368
368
  */
369
369
  fillEllipse(x, y, w, h) {
370
370
  this.strokeEllipse(x, y, w, h, true);
@@ -375,10 +375,10 @@ class CanvasRenderer extends Renderer {
375
375
  * @name strokeLine
376
376
  * @memberOf me.CanvasRenderer.prototype
377
377
  * @function
378
- * @param {Number} startX the start x coordinate
379
- * @param {Number} startY the start y coordinate
380
- * @param {Number} endX the end x coordinate
381
- * @param {Number} endY the end y coordinate
378
+ * @param {number} startX the start x coordinate
379
+ * @param {number} startY the start y coordinate
380
+ * @param {number} endX the end x coordinate
381
+ * @param {number} endY the end y coordinate
382
382
  */
383
383
  strokeLine(startX, startY, endX, endY) {
384
384
  var context = this.backBufferContext2D;
@@ -399,10 +399,10 @@ class CanvasRenderer extends Renderer {
399
399
  * @name fillLine
400
400
  * @memberOf me.CanvasRenderer.prototype
401
401
  * @function
402
- * @param {Number} startX the start x coordinate
403
- * @param {Number} startY the start y coordinate
404
- * @param {Number} endX the end x coordinate
405
- * @param {Number} endY the end y coordinate
402
+ * @param {number} startX the start x coordinate
403
+ * @param {number} startY the start y coordinate
404
+ * @param {number} endX the end x coordinate
405
+ * @param {number} endY the end y coordinate
406
406
  */
407
407
  fillLine(startX, startY, endX, endY) {
408
408
  this.strokeLine(startX, startY, endX, endY);
@@ -414,7 +414,7 @@ class CanvasRenderer extends Renderer {
414
414
  * @memberOf me.CanvasRenderer.prototype
415
415
  * @function
416
416
  * @param {me.Polygon} poly the shape to draw
417
- * @param {Boolean} [fill=false] also fill the shape with the current color if true
417
+ * @param {boolean} [fill=false] also fill the shape with the current color if true
418
418
  */
419
419
  strokePolygon(poly, fill = false) {
420
420
  var context = this.backBufferContext2D;
@@ -454,11 +454,11 @@ class CanvasRenderer extends Renderer {
454
454
  * @name strokeRect
455
455
  * @memberOf me.CanvasRenderer.prototype
456
456
  * @function
457
- * @param {Number} x
458
- * @param {Number} y
459
- * @param {Number} width
460
- * @param {Number} height
461
- * @param {Boolean} [fill=false] also fill the shape with the current color if true
457
+ * @param {number} x
458
+ * @param {number} y
459
+ * @param {number} width
460
+ * @param {number} height
461
+ * @param {boolean} [fill=false] also fill the shape with the current color if true
462
462
  */
463
463
  strokeRect(x, y, width, height, fill = false) {
464
464
  if (fill === true ) {
@@ -477,10 +477,10 @@ class CanvasRenderer extends Renderer {
477
477
  * @name fillRect
478
478
  * @memberOf me.CanvasRenderer.prototype
479
479
  * @function
480
- * @param {Number} x
481
- * @param {Number} y
482
- * @param {Number} width
483
- * @param {Number} height
480
+ * @param {number} x
481
+ * @param {number} y
482
+ * @param {number} width
483
+ * @param {number} height
484
484
  */
485
485
  fillRect(x, y, width, height) {
486
486
  if (this.backBufferContext2D.globalAlpha < 1 / 255) {
@@ -496,7 +496,7 @@ class CanvasRenderer extends Renderer {
496
496
  * @name getContext
497
497
  * @memberOf me.CanvasRenderer.prototype
498
498
  * @function
499
- * @return {CanvasRenderingContext2D}
499
+ * @returns {CanvasRenderingContext2D}
500
500
  */
501
501
  getContext() {
502
502
  return this.backBufferContext2D;
@@ -541,7 +541,7 @@ class CanvasRenderer extends Renderer {
541
541
  * @name rotate
542
542
  * @memberOf me.CanvasRenderer.prototype
543
543
  * @function
544
- * @param {Number} angle in radians
544
+ * @param {number} angle in radians
545
545
  */
546
546
  rotate(angle) {
547
547
  this.backBufferContext2D.rotate(angle);
@@ -552,8 +552,8 @@ class CanvasRenderer extends Renderer {
552
552
  * @name scale
553
553
  * @memberOf me.CanvasRenderer.prototype
554
554
  * @function
555
- * @param {Number} x
556
- * @param {Number} y
555
+ * @param {number} x
556
+ * @param {number} y
557
557
  */
558
558
  scale(x, y) {
559
559
  this.backBufferContext2D.scale(x, y);
@@ -565,7 +565,7 @@ class CanvasRenderer extends Renderer {
565
565
  * @name setColor
566
566
  * @memberOf me.CanvasRenderer.prototype
567
567
  * @function
568
- * @param {Color|String} color css color value
568
+ * @param {me.Color|string} color css color value
569
569
  */
570
570
  setColor(color) {
571
571
  this.backBufferContext2D.strokeStyle =
@@ -581,10 +581,10 @@ class CanvasRenderer extends Renderer {
581
581
  * @name setGlobalAlpha
582
582
  * @memberOf me.CanvasRenderer.prototype
583
583
  * @function
584
- * @param {Number} alpha 0.0 to 1.0 values accepted.
584
+ * @param {number} alpha 0.0 to 1.0 values accepted.
585
585
  */
586
- setGlobalAlpha(a) {
587
- this.backBufferContext2D.globalAlpha = this.currentColor.glArray[3] = a;
586
+ setGlobalAlpha(alpha) {
587
+ this.backBufferContext2D.globalAlpha = this.currentColor.glArray[3] = alpha;
588
588
  }
589
589
 
590
590
  /**
@@ -592,7 +592,7 @@ class CanvasRenderer extends Renderer {
592
592
  * @name setLineWidth
593
593
  * @memberOf me.CanvasRenderer.prototype
594
594
  * @function
595
- * @param {Number} width Line width
595
+ * @param {number} width Line width
596
596
  */
597
597
  setLineWidth(width) {
598
598
  this.backBufferContext2D.lineWidth = width;
@@ -640,8 +640,8 @@ class CanvasRenderer extends Renderer {
640
640
  * @name translate
641
641
  * @memberOf me.CanvasRenderer.prototype
642
642
  * @function
643
- * @param {Number} x
644
- * @param {Number} y
643
+ * @param {number} x
644
+ * @param {number} y
645
645
  */
646
646
  translate(x, y) {
647
647
  if (this.settings.subPixel === false) {
@@ -660,10 +660,10 @@ class CanvasRenderer extends Renderer {
660
660
  * @name clipRect
661
661
  * @memberOf me.CanvasRenderer.prototype
662
662
  * @function
663
- * @param {Number} x
664
- * @param {Number} y
665
- * @param {Number} width
666
- * @param {Number} height
663
+ * @param {number} x
664
+ * @param {number} y
665
+ * @param {number} width
666
+ * @param {number} height
667
667
  */
668
668
  clipRect(x, y, width, height) {
669
669
  var canvas = this.backBufferCanvas;