melonjs 10.3.0 → 10.5.1

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 +6 -6
  2. package/dist/melonjs.js +3147 -3293
  3. package/dist/melonjs.min.js +4 -4
  4. package/dist/melonjs.module.d.ts +3411 -3852
  5. package/dist/melonjs.module.js +3448 -3210
  6. package/package.json +18 -17
  7. package/src/audio/audio.js +29 -30
  8. package/src/camera/camera2d.js +46 -56
  9. package/src/entity/entity.js +30 -36
  10. package/src/game.js +21 -22
  11. package/src/geometries/ellipse.js +40 -46
  12. package/src/geometries/line.js +9 -11
  13. package/src/geometries/poly.js +53 -53
  14. package/src/geometries/rectangle.js +42 -44
  15. package/src/index.js +9 -26
  16. package/src/input/gamepad.js +11 -10
  17. package/src/input/input.js +2 -3
  18. package/src/input/keyboard.js +113 -113
  19. package/src/input/pointer.js +30 -31
  20. package/src/input/pointerevent.js +26 -26
  21. package/src/lang/deprecated.js +65 -6
  22. package/src/level/level.js +23 -24
  23. package/src/level/tiled/TMXGroup.js +7 -8
  24. package/src/level/tiled/TMXLayer.js +30 -32
  25. package/src/level/tiled/TMXObject.js +21 -21
  26. package/src/level/tiled/TMXTile.js +18 -18
  27. package/src/level/tiled/TMXTileMap.js +39 -44
  28. package/src/level/tiled/TMXTileset.js +12 -15
  29. package/src/level/tiled/TMXTilesetGroup.js +9 -9
  30. package/src/level/tiled/renderer/TMXHexagonalRenderer.js +7 -8
  31. package/src/level/tiled/renderer/TMXIsometricRenderer.js +7 -8
  32. package/src/level/tiled/renderer/TMXOrthogonalRenderer.js +4 -5
  33. package/src/level/tiled/renderer/TMXRenderer.js +24 -25
  34. package/src/level/tiled/renderer/TMXStaggeredRenderer.js +1 -4
  35. package/src/loader/loader.js +14 -15
  36. package/src/loader/loadingscreen.js +2 -4
  37. package/src/math/color.js +47 -66
  38. package/src/math/math.js +15 -16
  39. package/src/math/matrix2.js +53 -58
  40. package/src/math/matrix3.js +56 -62
  41. package/src/math/observable_vector2.js +75 -76
  42. package/src/math/observable_vector3.js +79 -80
  43. package/src/math/vector2.js +91 -92
  44. package/src/math/vector3.js +94 -96
  45. package/src/particles/emitter.js +38 -40
  46. package/src/particles/particle.js +4 -5
  47. package/src/particles/particlecontainer.js +2 -3
  48. package/src/physics/body.js +46 -143
  49. package/src/physics/bounds.js +47 -47
  50. package/src/physics/collision.js +13 -14
  51. package/src/physics/detector.js +18 -17
  52. package/src/physics/quadtree.js +17 -19
  53. package/src/physics/sat.js +26 -26
  54. package/src/physics/world.js +24 -28
  55. package/src/plugin/plugin.js +11 -14
  56. package/src/renderable/GUI.js +41 -46
  57. package/src/renderable/collectable.js +4 -8
  58. package/src/renderable/colorlayer.js +6 -10
  59. package/src/renderable/container.js +87 -72
  60. package/src/renderable/dragndrop.js +224 -0
  61. package/src/renderable/imagelayer.js +25 -31
  62. package/src/renderable/nineslicesprite.js +41 -41
  63. package/src/renderable/renderable.js +114 -125
  64. package/src/renderable/sprite.js +62 -68
  65. package/src/renderable/trigger.js +25 -30
  66. package/src/state/stage.js +13 -17
  67. package/src/state/state.js +26 -27
  68. package/src/system/device.js +74 -75
  69. package/src/system/event.js +71 -72
  70. package/src/system/pooling.js +11 -12
  71. package/src/system/save.js +3 -4
  72. package/src/system/timer.js +19 -20
  73. package/src/text/bitmaptext.js +57 -54
  74. package/src/text/bitmaptextdata.js +10 -10
  75. package/src/text/glyph.js +3 -0
  76. package/src/text/text.js +44 -49
  77. package/src/tweens/easing.js +1 -1
  78. package/src/tweens/interpolation.js +1 -1
  79. package/src/tweens/tween.js +43 -44
  80. package/src/utils/agent.js +3 -4
  81. package/src/utils/array.js +4 -5
  82. package/src/utils/file.js +3 -4
  83. package/src/utils/function.js +4 -5
  84. package/src/utils/string.js +7 -9
  85. package/src/utils/utils.js +4 -5
  86. package/src/video/canvas/canvas_renderer.js +58 -59
  87. package/src/video/renderer.js +49 -53
  88. package/src/video/texture.js +98 -111
  89. package/src/video/texture_cache.js +24 -6
  90. package/src/video/video.js +16 -17
  91. package/src/video/webgl/glshader.js +37 -38
  92. package/src/video/webgl/webgl_compositor.js +31 -32
  93. package/src/video/webgl/webgl_renderer.js +79 -80
  94. package/src/entity/draggable.js +0 -130
  95. package/src/entity/droptarget.js +0 -101
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "melonjs",
3
- "version": "10.3.0",
3
+ "version": "10.5.1",
4
4
  "description": "melonJS Game Engine",
5
5
  "homepage": "http://www.melonjs.org/",
6
6
  "keywords": [
@@ -53,44 +53,45 @@
53
53
  "CHANGELOG"
54
54
  ],
55
55
  "dependencies": {
56
+ "@teppeis/multimaps": "^2.0.0",
56
57
  "earcut": "2.2.3",
57
58
  "eventemitter3": "^4.0.7",
58
59
  "howler": "2.2.3"
59
60
  },
60
61
  "devDependencies": {
61
62
  "@rollup/plugin-buble": "^0.21.3",
62
- "@rollup/plugin-commonjs": "^21.0.1",
63
+ "@rollup/plugin-commonjs": "^21.0.2",
63
64
  "@rollup/plugin-node-resolve": "^13.1.3",
64
- "@rollup/plugin-replace": "^3.0.1",
65
+ "@rollup/plugin-replace": "^4.0.0",
66
+ "@types/offscreencanvas": "^2019.6.4",
65
67
  "cheerio": "^1.0.0-rc.10",
66
68
  "del-cli": "^4.0.1",
67
- "eslint": "^8.8.0",
68
- "eslint-plugin-jsdoc": "^37.7.0",
69
- "jasmine-core": "^4.0.0",
69
+ "eslint": "^8.11.0",
70
+ "eslint-plugin-jsdoc": "^38.0.4",
71
+ "jasmine-core": "^4.0.1",
70
72
  "jsdoc": "^3.6.10",
71
- "karma": "^6.3.13",
72
- "karma-chrome-launcher": "^3.1.0",
73
- "karma-coverage": "^2.1.0",
73
+ "karma": "^6.3.17",
74
+ "karma-chrome-launcher": "^3.1.1",
75
+ "karma-coverage": "^2.2.0",
74
76
  "karma-html-detailed-reporter": "^2.1.0",
75
77
  "karma-jasmine": "^4.0.1",
76
78
  "karma-nyan-reporter": "0.2.5",
77
79
  "qs": "^6.10.3",
78
- "rollup": "^2.67.0",
80
+ "rollup": "^2.70.1",
79
81
  "rollup-plugin-bundle-size": "^1.0.3",
80
82
  "rollup-plugin-string": "^3.0.0",
81
- "terser": "^5.10.0",
82
- "typescript": "^4.5.5"
83
+ "terser": "^5.12.1",
84
+ "typescript": "^4.6.2"
83
85
  },
84
86
  "scripts": {
85
87
  "build": "npm run lint && rollup -c --silent",
86
- "dist": " npm run build && npm run minify && mkdirp dist && cp -f build/*.js dist/ && npm run makedts",
88
+ "dist": " npm run build && npm run minify && mkdirp dist && cp -f build/*.js dist/ && npm run types",
87
89
  "minify": "terser build/melonjs.js --compress --mangle --comments '/(?:^!|@(?:license|preserve|cc_on))/' --output build/melonjs.min.js",
88
- "lint": "eslint --config .eslintrc.json src rollup.config.js",
90
+ "lint": "eslint src rollup.config.js",
89
91
  "test": "npm run build && karma start tests/karma.conf.js",
90
92
  "doc": "mkdirp docs && jsdoc -c jsdoc_conf.json",
91
93
  "release": "npm run dist && npm publish --access public",
92
- "clean": "del-cli --force build/*.js docs src/**/*.d.ts",
93
- "makedts": "npx -p typescript tsc dist/melonjs.module.js --declaration --allowJs --emitDeclarationOnly",
94
- "make-separated-src-dts": "npm run clean && npx -p typescript tsc src/**/*.js --declaration --allowJs --emitDeclarationOnly"
94
+ "clean": "del-cli --force build/*.js dist/*.js dist/*.d.ts docs src/**/*.d.ts",
95
+ "types": "tsc dist/melonjs.module.js --declaration --allowJs --emitDeclarationOnly"
95
96
  }
96
97
  }
@@ -5,7 +5,6 @@ import loader from "./../loader/loader.js";
5
5
 
6
6
  /**
7
7
  * @namespace audio
8
- * @memberof me
9
8
  */
10
9
 
11
10
  /**
@@ -70,7 +69,7 @@ var soundLoadError = function (sound_name, onerror_cb) {
70
69
  * @name stopOnAudioError
71
70
  * @type {boolean}
72
71
  * @default true
73
- * @memberof me.audio
72
+ * @memberof audio
74
73
  */
75
74
  export let stopOnAudioError = true;
76
75
 
@@ -83,7 +82,7 @@ export let stopOnAudioError = true;
83
82
  * webm has nearly full browser coverage with a great combination of compression and quality, and mp3 will fallback gracefully for other browsers.
84
83
  * It is important to remember that melonJS selects the first compatible sound based on the list of extensions and given order passed here.
85
84
  * So if you want webm to be used before mp3, you need to put the audio format in that order.
86
- * @function me.audio.init
85
+ * @function audio.init
87
86
  * @param {string} [format="mp3"] audio format to prioritize
88
87
  * @returns {boolean} Indicates whether audio initialization was successful
89
88
  * @example
@@ -102,7 +101,7 @@ export let stopOnAudioError = true;
102
101
 
103
102
  /**
104
103
  * check if the given audio format is supported
105
- * @function me.audio.hasFormat
104
+ * @function audio.hasFormat
106
105
  * @param {string} codec audio format : "mp3", "mpeg", opus", "ogg", "oga", "wav", "aac", "caf", "m4a", "m4b", "mp4", "weba", "webm", "dolby", "flac"
107
106
  * @returns {boolean} return true if the given audio format is supported
108
107
  */
@@ -112,7 +111,7 @@ export function hasFormat(codec) {
112
111
 
113
112
  /**
114
113
  * check if audio (HTML5 or WebAudio) is supported
115
- * @function me.audio.hasAudio
114
+ * @function audio.hasAudio
116
115
  * @returns {boolean} return true if audio (HTML5 or WebAudio) is supported
117
116
  */
118
117
  export function hasAudio() {
@@ -122,8 +121,8 @@ export function hasAudio() {
122
121
  /**
123
122
  * enable audio output <br>
124
123
  * only useful if audio supported and previously disabled through
125
- * @function me.audio.enable
126
- * @see me.audio#disable
124
+ * @function audio.enable
125
+ * @see audio#disable
127
126
  */
128
127
  export function enable() {
129
128
  unmuteAll();
@@ -131,7 +130,7 @@ export function enable() {
131
130
 
132
131
  /**
133
132
  * disable audio output
134
- * @function me.audio.disable
133
+ * @function audio.disable
135
134
  */
136
135
  export function disable() {
137
136
  muteAll();
@@ -180,7 +179,7 @@ export function load(sound, html5, onload_cb, onerror_cb) {
180
179
 
181
180
  /**
182
181
  * play the specified sound
183
- * @function me.audio.play
182
+ * @function audio.play
184
183
  * @param {string} sound_name audio clip name - case sensitive
185
184
  * @param {boolean} [loop=false] loop audio
186
185
  * @param {Function} [onend] Function to call when sound instance ends playing.
@@ -221,7 +220,7 @@ export function play(sound_name, loop = false, onend, volume) {
221
220
 
222
221
  /**
223
222
  * Fade a currently playing sound between two volumee.
224
- * @function me.audio.fade
223
+ * @function audio.fade
225
224
  * @param {string} sound_name audio clip name - case sensitive
226
225
  * @param {number} from Volume to fade from (0.0 to 1.0).
227
226
  * @param {number} to Volume to fade to (0.0 to 1.0).
@@ -239,7 +238,7 @@ export function fade(sound_name, from, to, duration, id) {
239
238
 
240
239
  /**
241
240
  * get/set the position of playback for a sound.
242
- * @function me.audio.seek
241
+ * @function audio.seek
243
242
  * @param {string} sound_name audio clip name - case sensitive
244
243
  * @param {number} [seek] the position to move current playback to (in seconds).
245
244
  * @param {number} [id] the sound instance ID. If none is passed, all sounds in group will changed.
@@ -261,7 +260,7 @@ export function seek(sound_name, ...args) {
261
260
 
262
261
  /**
263
262
  * get or set the rate of playback for a sound.
264
- * @function me.audio.rate
263
+ * @function audio.rate
265
264
  * @param {string} sound_name audio clip name - case sensitive
266
265
  * @param {number} [rate] playback rate : 0.5 to 4.0, with 1.0 being normal speed.
267
266
  * @param {number} [id] the sound instance ID. If none is passed, all sounds in group will be changed.
@@ -283,7 +282,7 @@ export function rate(sound_name, ...args) {
283
282
 
284
283
  /**
285
284
  * stop the specified sound on all channels
286
- * @function me.audio.stop
285
+ * @function audio.stop
287
286
  * @param {string} [sound_name] audio clip name (case sensitive). If none is passed, all sounds are stopped.
288
287
  * @param {number} [id] the sound instance ID. If none is passed, all sounds in group will stop.
289
288
  * @example
@@ -307,7 +306,7 @@ export function stop(sound_name, id) {
307
306
  /**
308
307
  * pause the specified sound on all channels<br>
309
308
  * this function does not reset the currentTime property
310
- * @function me.audio.pause
309
+ * @function audio.pause
311
310
  * @param {string} sound_name audio clip name - case sensitive
312
311
  * @param {number} [id] the sound instance ID. If none is passed, all sounds in group will pause.
313
312
  * @example
@@ -324,7 +323,7 @@ export function pause(sound_name, id) {
324
323
 
325
324
  /**
326
325
  * resume the specified sound on all channels<br>
327
- * @function me.audio.resume
326
+ * @function audio.resume
328
327
  * @param {string} sound_name audio clip name - case sensitive
329
328
  * @param {number} [id] the sound instance ID. If none is passed, all sounds in group will resume.
330
329
  * @example
@@ -350,7 +349,7 @@ export function resume(sound_name, id) {
350
349
  * play the specified audio track<br>
351
350
  * this function automatically set the loop property to true<br>
352
351
  * and keep track of the current sound being played.
353
- * @function me.audio.playTrack
352
+ * @function audio.playTrack
354
353
  * @param {string} sound_name audio track name - case sensitive
355
354
  * @param {number} [volume=default] Float specifying volume (0.0 - 1.0 values accepted).
356
355
  * @returns {number} the sound instance ID.
@@ -369,8 +368,8 @@ export function playTrack(sound_name, volume) {
369
368
 
370
369
  /**
371
370
  * stop the current audio track
372
- * @function me.audio.stopTrack
373
- * @see me.audio#playTrack
371
+ * @function audio.stopTrack
372
+ * @see audio#playTrack
374
373
  * @example
375
374
  * // play a awesome music
376
375
  * me.audio.playTrack("awesome_music");
@@ -386,7 +385,7 @@ export function stopTrack() {
386
385
 
387
386
  /**
388
387
  * pause the current audio track
389
- * @function me.audio.pauseTrack
388
+ * @function audio.pauseTrack
390
389
  * @example
391
390
  * me.audio.pauseTrack();
392
391
  */
@@ -398,7 +397,7 @@ export function pauseTrack() {
398
397
 
399
398
  /**
400
399
  * resume the previously paused audio track
401
- * @function me.audio.resumeTrack
400
+ * @function audio.resumeTrack
402
401
  * @example
403
402
  * // play an awesome music
404
403
  * me.audio.playTrack("awesome_music");
@@ -415,7 +414,7 @@ export function resumeTrack() {
415
414
 
416
415
  /**
417
416
  * returns the current track Id
418
- * @function me.audio.getCurrentTrack
417
+ * @function audio.getCurrentTrack
419
418
  * @returns {string} audio track name
420
419
  */
421
420
  export function getCurrentTrack() {
@@ -424,7 +423,7 @@ export function getCurrentTrack() {
424
423
 
425
424
  /**
426
425
  * set the default global volume
427
- * @function me.audio.setVolume
426
+ * @function audio.setVolume
428
427
  * @param {number} volume Float specifying volume (0.0 - 1.0 values accepted).
429
428
  */
430
429
  export function setVolume(volume) {
@@ -433,7 +432,7 @@ export function setVolume(volume) {
433
432
 
434
433
  /**
435
434
  * get the default global volume
436
- * @function me.audio.getVolume
435
+ * @function audio.getVolume
437
436
  * @returns {number} current volume value in Float [0.0 - 1.0] .
438
437
  */
439
438
  export function getVolume() {
@@ -442,7 +441,7 @@ export function getVolume() {
442
441
 
443
442
  /**
444
443
  * mute or unmute the specified sound, but does not pause the playback.
445
- * @function me.audio.mute
444
+ * @function audio.mute
446
445
  * @param {string} sound_name audio clip name - case sensitive
447
446
  * @param {number} [id] the sound instance ID. If none is passed, all sounds in group will mute.
448
447
  * @param {boolean} [mute=true] True to mute and false to unmute
@@ -463,7 +462,7 @@ export function mute(sound_name, id, mute) {
463
462
 
464
463
  /**
465
464
  * unmute the specified sound
466
- * @function me.audio.unmute
465
+ * @function audio.unmute
467
466
  * @param {string} sound_name audio clip name
468
467
  * @param {number} [id] the sound instance ID. If none is passed, all sounds in group will unmute.
469
468
  */
@@ -473,7 +472,7 @@ export function unmute(sound_name, id) {
473
472
 
474
473
  /**
475
474
  * mute all audio
476
- * @function me.audio.muteAll
475
+ * @function audio.muteAll
477
476
  */
478
477
  export function muteAll() {
479
478
  Howler.mute(true);
@@ -481,7 +480,7 @@ export function muteAll() {
481
480
 
482
481
  /**
483
482
  * unmute all audio
484
- * @function me.audio.unmuteAll
483
+ * @function audio.unmuteAll
485
484
  */
486
485
  export function unmuteAll() {
487
486
  Howler.mute(false);
@@ -489,7 +488,7 @@ export function unmuteAll() {
489
488
 
490
489
  /**
491
490
  * Returns true if audio is muted globally.
492
- * @function me.audio.muted
491
+ * @function audio.muted
493
492
  * @returns {boolean} true if audio is muted globally
494
493
  */
495
494
  export function muted() {
@@ -498,7 +497,7 @@ export function muted() {
498
497
 
499
498
  /**
500
499
  * unload specified audio track to free memory
501
- * @function me.audio.unload
500
+ * @function audio.unload
502
501
  * @param {string} sound_name audio track name - case sensitive
503
502
  * @returns {boolean} true if unloaded
504
503
  * @example
@@ -517,7 +516,7 @@ export function unload(sound_name) {
517
516
 
518
517
  /**
519
518
  * unload all audio to free memory
520
- * @function me.audio.unloadAll
519
+ * @function audio.unloadAll
521
520
  * @function
522
521
  * @example
523
522
  * me.audio.unloadAll();
@@ -21,33 +21,28 @@ var targetV = new Vector2d();
21
21
  /**
22
22
  * @classdesc
23
23
  * a 2D orthographic camera
24
- * @class Camera2d
25
- * @augments me.Renderable
26
- * @memberof me
27
- * @param {number} minX start x offset
28
- * @param {number} minY start y offset
29
- * @param {number} maxX end x offset
30
- * @param {number} maxY end y offset
24
+ * @augments Renderable
31
25
  */
32
26
  class Camera2d extends Renderable {
33
-
34
27
  /**
35
- * @ignore
28
+ * @param {number} minX start x offset
29
+ * @param {number} minY start y offset
30
+ * @param {number} maxX end x offset
31
+ * @param {number} maxY end y offset
36
32
  */
37
33
  constructor(minX, minY, maxX, maxY) {
38
34
  super(minX, minY, maxX - minX, maxY - minY);
39
35
 
40
36
  /**
41
37
  * Axis definition
38
+ * @enum {number}
42
39
  * @property {number} NONE no axis
43
40
  * @property {number} HORIZONTAL horizontal axis only
44
41
  * @property {number} VERTICAL vertical axis only
45
42
  * @property {number} BOTH both axis
46
- * @public
47
- * @constant
48
- * @enum {number}
43
+ * @readonly
49
44
  * @name AXIS
50
- * @memberof me.Camera2d
45
+ * @memberof Camera2d
51
46
  */
52
47
  this.AXIS = {
53
48
  NONE : 0,
@@ -59,20 +54,16 @@ class Camera2d extends Renderable {
59
54
  /**
60
55
  * Camera bounds
61
56
  * @public
62
- * @type {me.Bounds}
57
+ * @type {Bounds}
63
58
  * @name bounds
64
- * @memberof me.Camera2d
59
+ * @memberof Camera2d
65
60
  */
66
61
  this.bounds = pool.pull("Bounds");
67
62
 
68
63
  /**
69
- * [IMTERNAL] enable or disable damping
64
+ * enable or disable damping
70
65
  * @private
71
- * @type {boolean}
72
- * @name smoothFollow
73
- * @see me.Camera2d.damping
74
66
  * @default true
75
- * @memberof me.Camera2d
76
67
  */
77
68
  this.smoothFollow = true;
78
69
 
@@ -83,7 +74,7 @@ class Camera2d extends Renderable {
83
74
  * @type {number}
84
75
  * @name damping
85
76
  * @default 1.0
86
- * @memberof me.Camera2d
77
+ * @memberof Camera2d
87
78
  */
88
79
  this.damping = 1.0;
89
80
 
@@ -93,7 +84,7 @@ class Camera2d extends Renderable {
93
84
  * @type {number}
94
85
  * @name near
95
86
  * @default -1000
96
- * @memberof me.Camera2d
87
+ * @memberof Camera2d
97
88
  */
98
89
  this.near = -1000;
99
90
 
@@ -103,7 +94,7 @@ class Camera2d extends Renderable {
103
94
  * @type {number}
104
95
  * @name far
105
96
  * @default 1000
106
- * @memberof me.Camera2d
97
+ * @memberof Camera2d
107
98
  */
108
99
  this.far = 1000;
109
100
 
@@ -111,18 +102,18 @@ class Camera2d extends Renderable {
111
102
  * the default camera projection matrix
112
103
  * (2d cameras use an orthographic projection by default).
113
104
  * @public
114
- * @type {me.Matrix3d}
105
+ * @type {Matrix3d}
115
106
  * @name projectionMatrix
116
- * @memberof me.Camera2d
107
+ * @memberof Camera2d
117
108
  */
118
109
  this.projectionMatrix = new Matrix3d();
119
110
 
120
111
  /**
121
112
  * the invert camera transform used to unproject points
122
113
  * @ignore
123
- * @type {me.Matrix2d}
114
+ * @type {Matrix2d}
124
115
  * @name invCurrentTransform
125
- * @memberof me.Camera2d
116
+ * @memberof Camera2d
126
117
  */
127
118
  this.invCurrentTransform = new Matrix2d();
128
119
 
@@ -215,7 +206,7 @@ class Camera2d extends Renderable {
215
206
  /**
216
207
  * reset the camera position to specified coordinates
217
208
  * @name reset
218
- * @memberof me.Camera2d
209
+ * @memberof Camera2d
219
210
  * @function
220
211
  * @param {number} [x=0]
221
212
  * @param {number} [y=0]
@@ -245,8 +236,8 @@ class Camera2d extends Renderable {
245
236
  * the "deadzone" defines an area within the current camera in which
246
237
  * the followed renderable can move without scrolling the camera.
247
238
  * @name setDeadzone
248
- * @see me.Camera2d.follow
249
- * @memberof me.Camera2d
239
+ * @see Camera2d.follow
240
+ * @memberof Camera2d
250
241
  * @function
251
242
  * @param {number} w deadzone width
252
243
  * @param {number} h deadzone height
@@ -274,11 +265,11 @@ class Camera2d extends Renderable {
274
265
  /**
275
266
  * resize the camera
276
267
  * @name resize
277
- * @memberof me.Camera2d
268
+ * @memberof Camera2d
278
269
  * @function
279
270
  * @param {number} w new width of the camera
280
271
  * @param {number} h new height of the camera
281
- * @returns {me.Camera2d} this camera
272
+ * @returns {Camera2d} this camera
282
273
  */
283
274
  resize(w, h) {
284
275
  // parent consctructor, resize camera rect
@@ -306,7 +297,7 @@ class Camera2d extends Renderable {
306
297
  * set the camera boundaries (set to the world limit by default).
307
298
  * the camera is bound to the given coordinates and cannot move/be scrolled outside of it.
308
299
  * @name setBounds
309
- * @memberof me.Camera2d
300
+ * @memberof Camera2d
310
301
  * @function
311
302
  * @param {number} x world left limit
312
303
  * @param {number} y world top limit
@@ -325,10 +316,10 @@ class Camera2d extends Renderable {
325
316
  * set the camera to follow the specified renderable. <br>
326
317
  * (this will put the camera center around the given target)
327
318
  * @name follow
328
- * @memberof me.Camera2d
319
+ * @memberof Camera2d
329
320
  * @function
330
- * @param {me.Renderable|me.Vector2d} target renderable or position vector to follow
331
- * @param {me.Camera2d.AXIS} [axis=this.AXIS.BOTH] Which axis to follow
321
+ * @param {Renderable|Vector2d} target renderable or position vector to follow
322
+ * @param {number} [axis=me.game.viewport.AXIS.BOTH] Which axis to follow (see {@link Camera2d.AXIS})
332
323
  * @param {number} [damping=1] default damping value
333
324
  * @example
334
325
  * // set the camera to follow this renderable on both axis, and enable damping
@@ -367,7 +358,7 @@ class Camera2d extends Renderable {
367
358
  /**
368
359
  * unfollow the current target
369
360
  * @name unfollow
370
- * @memberof me.Camera2d
361
+ * @memberof Camera2d
371
362
  * @function
372
363
  */
373
364
  unfollow() {
@@ -378,8 +369,8 @@ class Camera2d extends Renderable {
378
369
  /**
379
370
  * move the camera upper-left position by the specified offset.
380
371
  * @name move
381
- * @memberof me.Camera2d
382
- * @see me.Camera2d.focusOn
372
+ * @memberof Camera2d
373
+ * @see Camera2d.focusOn
383
374
  * @function
384
375
  * @param {number} x
385
376
  * @param {number} y
@@ -394,8 +385,8 @@ class Camera2d extends Renderable {
394
385
  /**
395
386
  * move the camera upper-left position to the specified coordinates
396
387
  * @name moveTo
397
- * @memberof me.Camera2d
398
- * @see me.Camera2d.focusOn
388
+ * @memberof Camera2d
389
+ * @see Camera2d.focusOn
399
390
  * @function
400
391
  * @param {number} x
401
392
  * @param {number} y
@@ -518,13 +509,12 @@ class Camera2d extends Renderable {
518
509
  /**
519
510
  * shake the camera
520
511
  * @name shake
521
- * @memberof me.Camera2d
512
+ * @memberof Camera2d
522
513
  * @function
523
514
  * @param {number} intensity maximum offset that the screen can be moved
524
515
  * while shaking
525
516
  * @param {number} duration expressed in milliseconds
526
- * @param {me.Camera2d.AXIS} [axis=this.AXIS.BOTH] specify on which axis you
527
- * want the shake effect
517
+ * @param {number} [axis=me.game.viewport.AXIS.BOTH] specify on which axis to apply the shake effect (see {@link Camera2d.AXIS})
528
518
  * @param {Function} [onComplete] callback once shaking effect is over
529
519
  * @param {boolean} [force] if true this will override the current effect
530
520
  * @example
@@ -544,9 +534,9 @@ class Camera2d extends Renderable {
544
534
  * fadeOut(flash) effect<p>
545
535
  * screen is filled with the specified color and slowly goes back to normal
546
536
  * @name fadeOut
547
- * @memberof me.Camera2d
537
+ * @memberof Camera2d
548
538
  * @function
549
- * @param {me.Color|string} color a CSS color value
539
+ * @param {Color|string} color a CSS color value
550
540
  * @param {number} [duration=1000] expressed in milliseconds
551
541
  * @param {Function} [onComplete] callback once effect is over
552
542
  * @example
@@ -570,9 +560,9 @@ class Camera2d extends Renderable {
570
560
  * fadeIn effect <p>
571
561
  * fade to the specified color
572
562
  * @name fadeIn
573
- * @memberof me.Camera2d
563
+ * @memberof Camera2d
574
564
  * @function
575
- * @param {me.Color|string} color a CSS color value
565
+ * @param {Color|string} color a CSS color value
576
566
  * @param {number} [duration=1000] expressed in milliseconds
577
567
  * @param {Function} [onComplete] callback once effect is over
578
568
  * @example
@@ -593,9 +583,9 @@ class Camera2d extends Renderable {
593
583
  /**
594
584
  * set the camera position around the specified object
595
585
  * @name focusOn
596
- * @memberof me.Camera2d
586
+ * @memberof Camera2d
597
587
  * @function
598
- * @param {me.Renderable} target the renderable to focus the camera on
588
+ * @param {Renderable} target the renderable to focus the camera on
599
589
  */
600
590
  focusOn(target) {
601
591
  var bounds = target.getBounds();
@@ -608,9 +598,9 @@ class Camera2d extends Renderable {
608
598
  /**
609
599
  * check if the specified renderable is in the camera
610
600
  * @name isVisible
611
- * @memberof me.Camera2d
601
+ * @memberof Camera2d
612
602
  * @function
613
- * @param {me.Renderable} obj to be checked against
603
+ * @param {Renderable} obj to be checked against
614
604
  * @param {boolean} [floating = obj.floating] if visibility check should be done against screen coordinates
615
605
  * @returns {boolean}
616
606
  */
@@ -627,13 +617,13 @@ class Camera2d extends Renderable {
627
617
  /**
628
618
  * convert the given "local" (screen) coordinates into world coordinates
629
619
  * @name localToWorld
630
- * @memberof me.Camera2d
620
+ * @memberof Camera2d
631
621
  * @function
632
622
  * @param {number} x
633
623
  * @param {number} y
634
624
  * @param {number} [v] an optional vector object where to set the
635
625
  * converted value
636
- * @returns {me.Vector2d}
626
+ * @returns {Vector2d}
637
627
  */
638
628
  localToWorld(x, y, v) {
639
629
  // TODO memoization for one set of coords (multitouch)
@@ -648,13 +638,13 @@ class Camera2d extends Renderable {
648
638
  /**
649
639
  * convert the given world coordinates into "local" (screen) coordinates
650
640
  * @name worldToLocal
651
- * @memberof me.Camera2d
641
+ * @memberof Camera2d
652
642
  * @function
653
643
  * @param {number} x
654
644
  * @param {number} y
655
645
  * @param {number} [v] an optional vector object where to set the
656
646
  * converted value
657
- * @returns {me.Vector2d}
647
+ * @returns {Vector2d}
658
648
  */
659
649
  worldToLocal(x, y, v) {
660
650
  // TODO memoization for one set of coords (multitouch)