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
@@ -1,7 +1,7 @@
1
1
  import Color from "./../../math/color.js";
2
2
  import Renderer from "./../renderer.js";
3
3
  import TextureCache from "./../texture_cache.js";
4
- import Ellipse from "./../../shapes/ellipse.js";
4
+ import Ellipse from "./../../geometries/ellipse.js";
5
5
  import { createCanvas } from "./../video.js";
6
6
 
7
7
 
@@ -10,20 +10,19 @@ import { createCanvas } from "./../video.js";
10
10
  * @classdesc
11
11
  * a canvas renderer object
12
12
  * @class CanvasRenderer
13
- * @extends me.Renderer
14
- * @memberOf me
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
13
+ * @augments me.Renderer
14
+ * @memberof me
15
+ * @param {object} options The renderer parameters
16
+ * @param {number} options.width The width of the canvas without scaling
17
+ * @param {number} options.height The height of the canvas without scaling
19
18
  * @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
19
+ * @param {boolean} [options.doubleBuffering=false] Whether to enable double buffering
20
+ * @param {boolean} [options.antiAlias=false] Whether to enable anti-aliasing
21
+ * @param {boolean} [options.transparent=false] Whether to enable transparency on the canvas (performance hit when enabled)
22
+ * @param {boolean} [options.subPixel=false] Whether to enable subpixel renderering (performance hit when enabled)
23
+ * @param {boolean} [options.textureSeamFix=true] enable the texture seam fix when rendering Tile when antiAlias is off for the canvasRenderer
24
+ * @param {number} [options.zoomX=width] The actual width of the canvas with scaling applied
25
+ * @param {number} [options.zoomY=height] The actual height of the canvas with scaling applied
27
26
  */
28
27
  class CanvasRenderer extends Renderer {
29
28
 
@@ -63,7 +62,7 @@ class CanvasRenderer extends Renderer {
63
62
  /**
64
63
  * Reset context state
65
64
  * @name reset
66
- * @memberOf me.CanvasRenderer.prototype
65
+ * @memberof me.CanvasRenderer.prototype
67
66
  * @function
68
67
  */
69
68
  reset() {
@@ -74,7 +73,7 @@ class CanvasRenderer extends Renderer {
74
73
  /**
75
74
  * Reset the canvas transform to identity
76
75
  * @name resetTransform
77
- * @memberOf me.CanvasRenderer.prototype
76
+ * @memberof me.CanvasRenderer.prototype
78
77
  * @function
79
78
  */
80
79
  resetTransform() {
@@ -84,10 +83,10 @@ class CanvasRenderer extends Renderer {
84
83
  /**
85
84
  * Set a blend mode for the given context
86
85
  * @name setBlendMode
87
- * @memberOf me.CanvasRenderer.prototype
86
+ * @memberof me.CanvasRenderer.prototype
88
87
  * @function
89
- * @param {String} [mode="normal"] blend mode : "normal", "multiply"
90
- * @param {Context2d} [context]
88
+ * @param {string} [mode="normal"] blend mode : "normal", "multiply"
89
+ * @param {CanvasRenderingContext2D} [context]
91
90
  */
92
91
  setBlendMode(mode, context) {
93
92
  context = context || this.getContext();
@@ -113,7 +112,7 @@ class CanvasRenderer extends Renderer {
113
112
  /**
114
113
  * prepare the framebuffer for drawing a new frame
115
114
  * @name clear
116
- * @memberOf me.CanvasRenderer.prototype
115
+ * @memberof me.CanvasRenderer.prototype
117
116
  * @function
118
117
  */
119
118
  clear() {
@@ -125,7 +124,7 @@ class CanvasRenderer extends Renderer {
125
124
  /**
126
125
  * render the main framebuffer on screen
127
126
  * @name flush
128
- * @memberOf me.CanvasRenderer.prototype
127
+ * @memberof me.CanvasRenderer.prototype
129
128
  * @function
130
129
  */
131
130
  flush() {
@@ -137,16 +136,16 @@ class CanvasRenderer extends Renderer {
137
136
  /**
138
137
  * Clears the main framebuffer with the given color
139
138
  * @name clearColor
140
- * @memberOf me.CanvasRenderer.prototype
139
+ * @memberof me.CanvasRenderer.prototype
141
140
  * @function
142
- * @param {me.Color|String} color CSS color.
143
- * @param {Boolean} [opaque=false] Allow transparency [default] or clear the surface completely [true]
141
+ * @param {me.Color|string} [color="#000000"] CSS color.
142
+ * @param {boolean} [opaque=false] Allow transparency [default] or clear the surface completely [true]
144
143
  */
145
- clearColor(col, opaque) {
144
+ clearColor(color = "#000000", opaque) {
146
145
  this.save();
147
146
  this.resetTransform();
148
147
  this.backBufferContext2D.globalCompositeOperation = opaque ? "copy" : "source-over";
149
- this.backBufferContext2D.fillStyle = (col instanceof Color) ? col.toRGBA() : col;
148
+ this.backBufferContext2D.fillStyle = (color instanceof Color) ? color.toRGBA() : color;
150
149
  this.fillRect(0, 0, this.backBufferCanvas.width, this.backBufferCanvas.height);
151
150
  this.restore();
152
151
  }
@@ -154,12 +153,12 @@ class CanvasRenderer extends Renderer {
154
153
  /**
155
154
  * Erase the pixels in the given rectangular area by setting them to transparent black (rgba(0,0,0,0)).
156
155
  * @name clearRect
157
- * @memberOf me.CanvasRenderer.prototype
156
+ * @memberof me.CanvasRenderer.prototype
158
157
  * @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.
158
+ * @param {number} x x axis of the coordinate for the rectangle starting point.
159
+ * @param {number} y y axis of the coordinate for the rectangle starting point.
160
+ * @param {number} width The rectangle's width.
161
+ * @param {number} height The rectangle's height.
163
162
  */
164
163
  clearRect(x, y, width, height) {
165
164
  this.backBufferContext2D.clearRect(x, y, width, height);
@@ -168,11 +167,11 @@ class CanvasRenderer extends Renderer {
168
167
  /**
169
168
  * Create a pattern with the specified repetition
170
169
  * @name createPattern
171
- * @memberOf me.CanvasRenderer.prototype
170
+ * @memberof me.CanvasRenderer.prototype
172
171
  * @function
173
- * @param {image} image Source image
174
- * @param {String} repeat Define how the pattern should be repeated
175
- * @return {CanvasPattern}
172
+ * @param {Image} image Source image
173
+ * @param {string} repeat Define how the pattern should be repeated
174
+ * @returns {CanvasPattern}
176
175
  * @see me.ImageLayer#repeat
177
176
  * @example
178
177
  * var tileable = renderer.createPattern(image, "repeat");
@@ -187,17 +186,17 @@ class CanvasRenderer extends Renderer {
187
186
  /**
188
187
  * Draw an image onto the main using the canvas api
189
188
  * @name drawImage
190
- * @memberOf me.CanvasRenderer.prototype
189
+ * @memberof me.CanvasRenderer.prototype
191
190
  * @function
192
191
  * @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.
192
+ * @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.
193
+ * @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.
194
+ * @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.
195
+ * @param {number} sh The height of the sub-rectangle of the source image to draw into the destination context.
196
+ * @param {number} dx The X coordinate in the destination canvas at which to place the top-left corner of the source image.
197
+ * @param {number} dy The Y coordinate in the destination canvas at which to place the top-left corner of the source image.
198
+ * @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.
199
+ * @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
200
  * @example
202
201
  * // Position the image on the canvas:
203
202
  * renderer.drawImage(image, dx, dy);
@@ -250,13 +249,13 @@ class CanvasRenderer extends Renderer {
250
249
  /**
251
250
  * Draw a pattern within the given rectangle.
252
251
  * @name drawPattern
253
- * @memberOf me.CanvasRenderer.prototype
252
+ * @memberof me.CanvasRenderer.prototype
254
253
  * @function
255
254
  * @param {CanvasPattern} pattern Pattern object
256
- * @param {Number} x
257
- * @param {Number} y
258
- * @param {Number} width
259
- * @param {Number} height
255
+ * @param {number} x
256
+ * @param {number} y
257
+ * @param {number} width
258
+ * @param {number} height
260
259
  * @see me.CanvasRenderer#createPattern
261
260
  */
262
261
  drawPattern(pattern, x, y, width, height) {
@@ -273,15 +272,15 @@ class CanvasRenderer extends Renderer {
273
272
  /**
274
273
  * Stroke an arc at the specified coordinates with given radius, start and end points
275
274
  * @name strokeArc
276
- * @memberOf me.CanvasRenderer.prototype
275
+ * @memberof me.CanvasRenderer.prototype
277
276
  * @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
277
+ * @param {number} x arc center point x-axis
278
+ * @param {number} y arc center point y-axis
279
+ * @param {number} radius
280
+ * @param {number} start start angle in radians
281
+ * @param {number} end end angle in radians
282
+ * @param {boolean} [antiClockwise=false] draw arc anti-clockwise
283
+ * @param {boolean} [fill=false] also fill the shape with the current color if true
285
284
  */
286
285
  strokeArc(x, y, radius, start, end, antiClockwise, fill = false) {
287
286
  var context = this.backBufferContext2D;
@@ -300,14 +299,14 @@ class CanvasRenderer extends Renderer {
300
299
  /**
301
300
  * Fill an arc at the specified coordinates with given radius, start and end points
302
301
  * @name fillArc
303
- * @memberOf me.CanvasRenderer.prototype
302
+ * @memberof me.CanvasRenderer.prototype
304
303
  * @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
304
+ * @param {number} x arc center point x-axis
305
+ * @param {number} y arc center point y-axis
306
+ * @param {number} radius
307
+ * @param {number} start start angle in radians
308
+ * @param {number} end end angle in radians
309
+ * @param {boolean} [antiClockwise=false] draw arc anti-clockwise
311
310
  */
312
311
  fillArc(x, y, radius, start, end, antiClockwise) {
313
312
  this.strokeArc(x, y, radius, start, end, antiClockwise || false, true);
@@ -316,13 +315,13 @@ class CanvasRenderer extends Renderer {
316
315
  /**
317
316
  * Stroke an ellipse at the specified coordinates with given radius
318
317
  * @name strokeEllipse
319
- * @memberOf me.CanvasRenderer.prototype
318
+ * @memberof me.CanvasRenderer.prototype
320
319
  * @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
320
+ * @param {number} x ellipse center point x-axis
321
+ * @param {number} y ellipse center point y-axis
322
+ * @param {number} w horizontal radius of the ellipse
323
+ * @param {number} h vertical radius of the ellipse
324
+ * @param {boolean} [fill=false] also fill the shape with the current color if true
326
325
  */
327
326
  strokeEllipse(x, y, w, h, fill = false) {
328
327
  var context = this.backBufferContext2D;
@@ -359,12 +358,12 @@ class CanvasRenderer extends Renderer {
359
358
  /**
360
359
  * Fill an ellipse at the specified coordinates with given radius
361
360
  * @name fillEllipse
362
- * @memberOf me.CanvasRenderer.prototype
361
+ * @memberof me.CanvasRenderer.prototype
363
362
  * @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
363
+ * @param {number} x ellipse center point x-axis
364
+ * @param {number} y ellipse center point y-axis
365
+ * @param {number} w horizontal radius of the ellipse
366
+ * @param {number} h vertical radius of the ellipse
368
367
  */
369
368
  fillEllipse(x, y, w, h) {
370
369
  this.strokeEllipse(x, y, w, h, true);
@@ -373,12 +372,12 @@ class CanvasRenderer extends Renderer {
373
372
  /**
374
373
  * Stroke a line of the given two points
375
374
  * @name strokeLine
376
- * @memberOf me.CanvasRenderer.prototype
375
+ * @memberof me.CanvasRenderer.prototype
377
376
  * @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
377
+ * @param {number} startX the start x coordinate
378
+ * @param {number} startY the start y coordinate
379
+ * @param {number} endX the end x coordinate
380
+ * @param {number} endY the end y coordinate
382
381
  */
383
382
  strokeLine(startX, startY, endX, endY) {
384
383
  var context = this.backBufferContext2D;
@@ -397,12 +396,12 @@ class CanvasRenderer extends Renderer {
397
396
  /**
398
397
  * Fill a line of the given two points
399
398
  * @name fillLine
400
- * @memberOf me.CanvasRenderer.prototype
399
+ * @memberof me.CanvasRenderer.prototype
401
400
  * @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
401
+ * @param {number} startX the start x coordinate
402
+ * @param {number} startY the start y coordinate
403
+ * @param {number} endX the end x coordinate
404
+ * @param {number} endY the end y coordinate
406
405
  */
407
406
  fillLine(startX, startY, endX, endY) {
408
407
  this.strokeLine(startX, startY, endX, endY);
@@ -411,10 +410,10 @@ class CanvasRenderer extends Renderer {
411
410
  /**
412
411
  * Stroke the given me.Polygon on the screen
413
412
  * @name strokePolygon
414
- * @memberOf me.CanvasRenderer.prototype
413
+ * @memberof me.CanvasRenderer.prototype
415
414
  * @function
416
415
  * @param {me.Polygon} poly the shape to draw
417
- * @param {Boolean} [fill=false] also fill the shape with the current color if true
416
+ * @param {boolean} [fill=false] also fill the shape with the current color if true
418
417
  */
419
418
  strokePolygon(poly, fill = false) {
420
419
  var context = this.backBufferContext2D;
@@ -441,7 +440,7 @@ class CanvasRenderer extends Renderer {
441
440
  /**
442
441
  * Fill the given me.Polygon on the screen
443
442
  * @name fillPolygon
444
- * @memberOf me.CanvasRenderer.prototype
443
+ * @memberof me.CanvasRenderer.prototype
445
444
  * @function
446
445
  * @param {me.Polygon} poly the shape to draw
447
446
  */
@@ -452,13 +451,13 @@ class CanvasRenderer extends Renderer {
452
451
  /**
453
452
  * Stroke a rectangle at the specified coordinates
454
453
  * @name strokeRect
455
- * @memberOf me.CanvasRenderer.prototype
454
+ * @memberof me.CanvasRenderer.prototype
456
455
  * @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
456
+ * @param {number} x
457
+ * @param {number} y
458
+ * @param {number} width
459
+ * @param {number} height
460
+ * @param {boolean} [fill=false] also fill the shape with the current color if true
462
461
  */
463
462
  strokeRect(x, y, width, height, fill = false) {
464
463
  if (fill === true ) {
@@ -475,12 +474,12 @@ class CanvasRenderer extends Renderer {
475
474
  /**
476
475
  * Draw a filled rectangle at the specified coordinates
477
476
  * @name fillRect
478
- * @memberOf me.CanvasRenderer.prototype
477
+ * @memberof me.CanvasRenderer.prototype
479
478
  * @function
480
- * @param {Number} x
481
- * @param {Number} y
482
- * @param {Number} width
483
- * @param {Number} height
479
+ * @param {number} x
480
+ * @param {number} y
481
+ * @param {number} width
482
+ * @param {number} height
484
483
  */
485
484
  fillRect(x, y, width, height) {
486
485
  if (this.backBufferContext2D.globalAlpha < 1 / 255) {
@@ -494,9 +493,9 @@ class CanvasRenderer extends Renderer {
494
493
  /**
495
494
  * return a reference to the system 2d Context
496
495
  * @name getContext
497
- * @memberOf me.CanvasRenderer.prototype
496
+ * @memberof me.CanvasRenderer.prototype
498
497
  * @function
499
- * @return {CanvasRenderingContext2D}
498
+ * @returns {CanvasRenderingContext2D}
500
499
  */
501
500
  getContext() {
502
501
  return this.backBufferContext2D;
@@ -514,7 +513,7 @@ class CanvasRenderer extends Renderer {
514
513
  /**
515
514
  * save the canvas context
516
515
  * @name save
517
- * @memberOf me.CanvasRenderer.prototype
516
+ * @memberof me.CanvasRenderer.prototype
518
517
  * @function
519
518
  */
520
519
  save() {
@@ -524,7 +523,7 @@ class CanvasRenderer extends Renderer {
524
523
  /**
525
524
  * restores the canvas context
526
525
  * @name restore
527
- * @memberOf me.CanvasRenderer.prototype
526
+ * @memberof me.CanvasRenderer.prototype
528
527
  * @function
529
528
  */
530
529
  restore() {
@@ -539,9 +538,9 @@ class CanvasRenderer extends Renderer {
539
538
  /**
540
539
  * rotates the canvas context
541
540
  * @name rotate
542
- * @memberOf me.CanvasRenderer.prototype
541
+ * @memberof me.CanvasRenderer.prototype
543
542
  * @function
544
- * @param {Number} angle in radians
543
+ * @param {number} angle in radians
545
544
  */
546
545
  rotate(angle) {
547
546
  this.backBufferContext2D.rotate(angle);
@@ -550,10 +549,10 @@ class CanvasRenderer extends Renderer {
550
549
  /**
551
550
  * scales the canvas context
552
551
  * @name scale
553
- * @memberOf me.CanvasRenderer.prototype
552
+ * @memberof me.CanvasRenderer.prototype
554
553
  * @function
555
- * @param {Number} x
556
- * @param {Number} y
554
+ * @param {number} x
555
+ * @param {number} y
557
556
  */
558
557
  scale(x, y) {
559
558
  this.backBufferContext2D.scale(x, y);
@@ -563,9 +562,9 @@ class CanvasRenderer extends Renderer {
563
562
  * Set the current fill & stroke style color.
564
563
  * By default, or upon reset, the value is set to #000000.
565
564
  * @name setColor
566
- * @memberOf me.CanvasRenderer.prototype
565
+ * @memberof me.CanvasRenderer.prototype
567
566
  * @function
568
- * @param {Color|String} color css color value
567
+ * @param {me.Color|string} color css color value
569
568
  */
570
569
  setColor(color) {
571
570
  this.backBufferContext2D.strokeStyle =
@@ -579,20 +578,20 @@ class CanvasRenderer extends Renderer {
579
578
  /**
580
579
  * Set the global alpha on the canvas context
581
580
  * @name setGlobalAlpha
582
- * @memberOf me.CanvasRenderer.prototype
581
+ * @memberof me.CanvasRenderer.prototype
583
582
  * @function
584
- * @param {Number} alpha 0.0 to 1.0 values accepted.
583
+ * @param {number} alpha 0.0 to 1.0 values accepted.
585
584
  */
586
- setGlobalAlpha(a) {
587
- this.backBufferContext2D.globalAlpha = this.currentColor.glArray[3] = a;
585
+ setGlobalAlpha(alpha) {
586
+ this.backBufferContext2D.globalAlpha = this.currentColor.glArray[3] = alpha;
588
587
  }
589
588
 
590
589
  /**
591
590
  * Set the line width on the context
592
591
  * @name setLineWidth
593
- * @memberOf me.CanvasRenderer.prototype
592
+ * @memberof me.CanvasRenderer.prototype
594
593
  * @function
595
- * @param {Number} width Line width
594
+ * @param {number} width Line width
596
595
  */
597
596
  setLineWidth(width) {
598
597
  this.backBufferContext2D.lineWidth = width;
@@ -602,7 +601,7 @@ class CanvasRenderer extends Renderer {
602
601
  * Reset (overrides) the renderer transformation matrix to the
603
602
  * identity one, and then apply the given transformation matrix.
604
603
  * @name setTransform
605
- * @memberOf me.CanvasRenderer.prototype
604
+ * @memberof me.CanvasRenderer.prototype
606
605
  * @function
607
606
  * @param {me.Matrix2d} mat2d Matrix to transform by
608
607
  */
@@ -614,7 +613,7 @@ class CanvasRenderer extends Renderer {
614
613
  /**
615
614
  * Multiply given matrix into the renderer tranformation matrix
616
615
  * @name transform
617
- * @memberOf me.CanvasRenderer.prototype
616
+ * @memberof me.CanvasRenderer.prototype
618
617
  * @function
619
618
  * @param {me.Matrix2d} mat2d Matrix to transform by
620
619
  */
@@ -638,10 +637,10 @@ class CanvasRenderer extends Renderer {
638
637
  /**
639
638
  * Translates the context to the given position
640
639
  * @name translate
641
- * @memberOf me.CanvasRenderer.prototype
640
+ * @memberof me.CanvasRenderer.prototype
642
641
  * @function
643
- * @param {Number} x
644
- * @param {Number} y
642
+ * @param {number} x
643
+ * @param {number} y
645
644
  */
646
645
  translate(x, y) {
647
646
  if (this.settings.subPixel === false) {
@@ -658,12 +657,12 @@ class CanvasRenderer extends Renderer {
658
657
  * and restore it (with the restore() method) any time in the future.
659
658
  * (<u>this is an experimental feature !</u>)
660
659
  * @name clipRect
661
- * @memberOf me.CanvasRenderer.prototype
660
+ * @memberof me.CanvasRenderer.prototype
662
661
  * @function
663
- * @param {Number} x
664
- * @param {Number} y
665
- * @param {Number} width
666
- * @param {Number} height
662
+ * @param {number} x
663
+ * @param {number} y
664
+ * @param {number} width
665
+ * @param {number} height
667
666
  */
668
667
  clipRect(x, y, width, height) {
669
668
  var canvas = this.backBufferCanvas;
@@ -691,7 +690,7 @@ class CanvasRenderer extends Renderer {
691
690
  * So, if the renderable is larger than the mask, only the intersecting part of the renderable will be visible.
692
691
  * Mask are not preserved through renderer context save and restore.
693
692
  * @name setMask
694
- * @memberOf me.CanvasRenderer.prototype
693
+ * @memberof me.CanvasRenderer.prototype
695
694
  * @function
696
695
  * @param {me.Rect|me.Polygon|me.Line|me.Ellipse} [mask] the shape defining the mask to be applied
697
696
  */
@@ -740,7 +739,7 @@ class CanvasRenderer extends Renderer {
740
739
  * disable (remove) the rendering mask set through setMask.
741
740
  * @name clearMask
742
741
  * @see me.CanvasRenderer#setMask
743
- * @memberOf me.CanvasRenderer.prototype
742
+ * @memberof me.CanvasRenderer.prototype
744
743
  * @function
745
744
  */
746
745
  clearMask() {