melonjs 10.2.2 → 10.4.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 +6 -6
  2. package/dist/melonjs.js +2907 -3383
  3. package/dist/melonjs.min.js +4 -4
  4. package/dist/melonjs.module.d.ts +3620 -4528
  5. package/dist/melonjs.module.js +3210 -3331
  6. package/package.json +19 -19
  7. package/src/audio/audio.js +30 -31
  8. package/src/camera/camera2d.js +47 -58
  9. package/src/entity/draggable.js +11 -21
  10. package/src/entity/droptarget.js +12 -22
  11. package/src/entity/entity.js +32 -38
  12. package/src/game.js +21 -22
  13. package/src/{shapes → geometries}/ellipse.js +40 -47
  14. package/src/{shapes → geometries}/line.js +9 -12
  15. package/src/{shapes → geometries}/poly.js +100 -53
  16. package/src/{shapes → geometries}/rectangle.js +42 -45
  17. package/src/index.js +9 -20
  18. package/src/input/gamepad.js +11 -10
  19. package/src/input/input.js +2 -3
  20. package/src/input/keyboard.js +113 -113
  21. package/src/input/pointer.js +61 -29
  22. package/src/input/pointerevent.js +92 -29
  23. package/src/lang/deprecated.js +44 -14
  24. package/src/level/level.js +23 -24
  25. package/src/level/tiled/TMXGroup.js +7 -9
  26. package/src/level/tiled/TMXLayer.js +30 -33
  27. package/src/level/tiled/TMXObject.js +59 -53
  28. package/src/level/tiled/TMXTile.js +18 -19
  29. package/src/level/tiled/TMXTileMap.js +38 -46
  30. package/src/level/tiled/TMXTileset.js +12 -16
  31. package/src/level/tiled/TMXTilesetGroup.js +9 -10
  32. package/src/level/tiled/renderer/TMXHexagonalRenderer.js +7 -9
  33. package/src/level/tiled/renderer/TMXIsometricRenderer.js +7 -9
  34. package/src/level/tiled/renderer/TMXOrthogonalRenderer.js +4 -6
  35. package/src/level/tiled/renderer/TMXRenderer.js +24 -26
  36. package/src/level/tiled/renderer/TMXStaggeredRenderer.js +1 -5
  37. package/src/loader/loader.js +17 -16
  38. package/src/loader/loadingscreen.js +8 -10
  39. package/src/math/color.js +47 -67
  40. package/src/math/math.js +15 -16
  41. package/src/math/matrix2.js +53 -59
  42. package/src/math/matrix3.js +56 -63
  43. package/src/math/observable_vector2.js +87 -77
  44. package/src/math/observable_vector3.js +97 -80
  45. package/src/math/vector2.js +107 -97
  46. package/src/math/vector3.js +116 -100
  47. package/src/particles/emitter.js +66 -76
  48. package/src/particles/particle.js +4 -6
  49. package/src/particles/particlecontainer.js +2 -4
  50. package/src/physics/body.js +47 -146
  51. package/src/physics/bounds.js +48 -50
  52. package/src/physics/collision.js +13 -14
  53. package/src/physics/detector.js +14 -14
  54. package/src/physics/quadtree.js +18 -21
  55. package/src/physics/sat.js +30 -30
  56. package/src/physics/world.js +24 -29
  57. package/src/plugin/plugin.js +11 -15
  58. package/src/renderable/GUI.js +41 -47
  59. package/src/renderable/collectable.js +5 -10
  60. package/src/renderable/colorlayer.js +10 -15
  61. package/src/renderable/container.js +87 -73
  62. package/src/renderable/imagelayer.js +25 -32
  63. package/src/renderable/nineslicesprite.js +41 -42
  64. package/src/renderable/renderable.js +113 -124
  65. package/src/renderable/sprite.js +62 -69
  66. package/src/renderable/trigger.js +26 -32
  67. package/src/state/stage.js +13 -18
  68. package/src/state/state.js +26 -27
  69. package/src/system/device.js +76 -133
  70. package/src/system/event.js +81 -70
  71. package/src/system/pooling.js +11 -12
  72. package/src/system/save.js +3 -4
  73. package/src/system/timer.js +19 -20
  74. package/src/text/bitmaptext.js +57 -55
  75. package/src/text/bitmaptextdata.js +10 -11
  76. package/src/text/glyph.js +3 -0
  77. package/src/text/text.js +49 -55
  78. package/src/tweens/easing.js +1 -1
  79. package/src/tweens/interpolation.js +1 -1
  80. package/src/tweens/tween.js +44 -46
  81. package/src/utils/agent.js +3 -4
  82. package/src/utils/array.js +4 -5
  83. package/src/utils/file.js +3 -4
  84. package/src/utils/function.js +4 -5
  85. package/src/utils/string.js +7 -9
  86. package/src/utils/utils.js +4 -5
  87. package/src/video/canvas/canvas_renderer.js +60 -62
  88. package/src/video/renderer.js +53 -58
  89. package/src/video/texture.js +98 -112
  90. package/src/video/texture_cache.js +4 -6
  91. package/src/video/video.js +16 -17
  92. package/src/video/webgl/buffer/vertex.js +2 -2
  93. package/src/video/webgl/glshader.js +37 -39
  94. package/src/video/webgl/webgl_compositor.js +128 -110
  95. package/src/video/webgl/webgl_renderer.js +126 -106
@@ -4,25 +4,15 @@ import * as event from "./../system/event.js";
4
4
  import Entity from "./entity.js";
5
5
 
6
6
  /**
7
+ * @classdesc
7
8
  * Used to make a game entity draggable
8
- * @class
9
- * @extends me.Entity
10
- * @memberOf me
11
- * @constructor
12
- * @param {number} x the x coordinates of the entity object
13
- * @param {number} y the y coordinates of the entity object
14
- * @param {object} settings Entity properties (see {@link me.Entity})
9
+ * @augments Entity
15
10
  */
16
11
  class DraggableEntity extends Entity {
17
-
18
12
  /**
19
- * Constructor
20
- * @name init
21
- * @memberOf me.DraggableEntity
22
- * @function
23
- * @param {number} x the x postion of the entity
24
- * @param {number} y the y postion of the entity
25
- * @param {object} settings the additional entity settings
13
+ * @param {number} x the x coordinates of the entity object
14
+ * @param {number} y the y coordinates of the entity object
15
+ * @param {object} settings Entity properties (see {@link Entity})
26
16
  */
27
17
  constructor(x, y, settings) {
28
18
  super(x, y, settings);
@@ -41,7 +31,7 @@ class DraggableEntity extends Entity {
41
31
  * this module testable. Then we subscribe this module to the
42
32
  * transformed events.
43
33
  * @name initEvents
44
- * @memberOf me.DraggableEntity
34
+ * @memberof DraggableEntity
45
35
  * @function
46
36
  */
47
37
  initEvents() {
@@ -68,7 +58,7 @@ class DraggableEntity extends Entity {
68
58
  /**
69
59
  * Translates a pointer event to a me.event
70
60
  * @name translatePointerEvent
71
- * @memberOf me.DraggableEntity
61
+ * @memberof DraggableEntity
72
62
  * @function
73
63
  * @param {object} e the pointer event you want to translate
74
64
  * @param {string} translation the me.event you want to translate the event to
@@ -80,7 +70,7 @@ class DraggableEntity extends Entity {
80
70
  /**
81
71
  * Gets called when the user starts dragging the entity
82
72
  * @name dragStart
83
- * @memberOf me.DraggableEntity
73
+ * @memberof DraggableEntity
84
74
  * @function
85
75
  * @param {object} e the pointer event
86
76
  * @returns {boolean} false if the object is being dragged
@@ -97,7 +87,7 @@ class DraggableEntity extends Entity {
97
87
  /**
98
88
  * Gets called when the user drags this entity around
99
89
  * @name dragMove
100
- * @memberOf me.DraggableEntity
90
+ * @memberof DraggableEntity
101
91
  * @function
102
92
  * @param {object} e the pointer event
103
93
  */
@@ -111,7 +101,7 @@ class DraggableEntity extends Entity {
111
101
  /**
112
102
  * Gets called when the user stops dragging the entity
113
103
  * @name dragEnd
114
- * @memberOf me.DraggableEntity
104
+ * @memberof DraggableEntity
115
105
  * @function
116
106
  * @returns {boolean} false if the object stopped being dragged
117
107
  */
@@ -125,7 +115,7 @@ class DraggableEntity extends Entity {
125
115
  /**
126
116
  * Destructor
127
117
  * @name destroy
128
- * @memberOf me.DraggableEntity
118
+ * @memberof DraggableEntity
129
119
  * @function
130
120
  */
131
121
  destroy() {
@@ -2,25 +2,15 @@ import * as event from "./../system/event.js";
2
2
  import Entity from "./entity.js";
3
3
 
4
4
  /**
5
+ * @classdesc
5
6
  * Used to make a game entity a droptarget
6
- * @class
7
- * @extends me.Entity
8
- * @memberOf me
9
- * @constructor
10
- * @param {number} x the x coordinates of the entity object
11
- * @param {number} y the y coordinates of the entity object
12
- * @param {object} settings Entity properties (see {@link me.Entity})
7
+ * @augments Entity
13
8
  */
14
-
15
9
  class DroptargetEntity extends Entity {
16
10
  /**
17
- * Constructor
18
- * @name init
19
- * @memberOf me.DroptargetEntity
20
- * @function
21
- * @param {number} x the x postion of the entity
22
- * @param {number} y the y postion of the entity
23
- * @param {object} settings the additional entity settings
11
+ * @param {number} x the x coordinates of the entity object
12
+ * @param {number} y the y coordinates of the entity object
13
+ * @param {object} settings Entity properties (see {@link Entity})
24
14
  */
25
15
  constructor(x, y, settings) {
26
16
  super(x, y, settings);
@@ -30,7 +20,7 @@ class DroptargetEntity extends Entity {
30
20
  * @constant
31
21
  * @type {string}
32
22
  * @name CHECKMETHOD_OVERLAP
33
- * @memberOf me.DroptargetEntity
23
+ * @memberof DroptargetEntity
34
24
  */
35
25
  this.CHECKMETHOD_OVERLAP = "overlaps";
36
26
  /**
@@ -39,7 +29,7 @@ class DroptargetEntity extends Entity {
39
29
  * @constant
40
30
  * @type {string}
41
31
  * @name CHECKMETHOD_CONTAINS
42
- * @memberOf me.DroptargetEntity
32
+ * @memberof DroptargetEntity
43
33
  */
44
34
  this.CHECKMETHOD_CONTAINS = "contains";
45
35
  /**
@@ -48,7 +38,7 @@ class DroptargetEntity extends Entity {
48
38
  * @constant
49
39
  * @type {string}
50
40
  * @name checkMethod
51
- * @memberOf me.DroptargetEntity
41
+ * @memberof DroptargetEntity
52
42
  */
53
43
  this.checkMethod = null;
54
44
  event.on(event.DRAGEND, this.checkOnMe, this);
@@ -58,7 +48,7 @@ class DroptargetEntity extends Entity {
58
48
  /**
59
49
  * Sets the collision method which is going to be used to check a valid drop
60
50
  * @name setCheckMethod
61
- * @memberOf me.DroptargetEntity
51
+ * @memberof DroptargetEntity
62
52
  * @function
63
53
  * @param {string} checkMethod the checkmethod (defaults to CHECKMETHOD_OVERLAP)
64
54
  */
@@ -73,7 +63,7 @@ class DroptargetEntity extends Entity {
73
63
  /**
74
64
  * Checks if a dropped entity is dropped on the current entity
75
65
  * @name checkOnMe
76
- * @memberOf me.DroptargetEntity
66
+ * @memberof DroptargetEntity
77
67
  * @function
78
68
  * @param {object} e the triggering event
79
69
  * @param {object} draggableEntity the draggable entity that is dropped
@@ -88,7 +78,7 @@ class DroptargetEntity extends Entity {
88
78
  /**
89
79
  * Gets called when a draggable entity is dropped on the current entity
90
80
  * @name drop
91
- * @memberOf me.DroptargetEntity
81
+ * @memberof DroptargetEntity
92
82
  * @function
93
83
  * @param {object} draggableEntity the draggable entity that is dropped
94
84
  */
@@ -99,7 +89,7 @@ class DroptargetEntity extends Entity {
99
89
  /**
100
90
  * Destructor
101
91
  * @name destroy
102
- * @memberOf me.DroptargetEntity
92
+ * @memberof DroptargetEntity
103
93
  * @function
104
94
  */
105
95
  destroy() {
@@ -2,38 +2,32 @@ import Vector2d from "./../math/vector2.js";
2
2
  import Renderable from "./../renderable/renderable.js";
3
3
  import Sprite from "./../renderable/sprite.js";
4
4
  import Body from "./../physics/body.js";
5
- import Polygon from "./../shapes/poly.js";
5
+ import Polygon from "./../geometries/poly.js";
6
6
 
7
7
 
8
8
  /**
9
+ * @classdesc
9
10
  * a Generic Object Entity
10
- * @class Entity
11
- * @extends me.Renderable
12
- * @memberOf me
13
- * @see me.Renderable
14
- * @constructor
15
- * @param {number} x the x coordinates of the entity object
16
- * @param {number} y the y coordinates of the entity object
17
- * @param {object} settings Entity properties, to be defined through Tiled or when calling the entity constructor
18
- * <img src="images/object_properties.png"/>
19
- * @param {number} settings.width the physical width the entity takes up in game
20
- * @param {number} settings.height the physical height the entity takes up in game
21
- * @param {string} [settings.name] object entity name
22
- * @param {string} [settings.id] object unique IDs
23
- * @param {Image|string} [settings.image] resource name of a spritesheet to use for the entity renderable component
24
- * @param {me.Vector2d} [settings.anchorPoint=0.0] Entity anchor point
25
- * @param {number} [settings.framewidth=settings.width] width of a single frame in the given spritesheet
26
- * @param {number} [settings.frameheight=settings.width] height of a single frame in the given spritesheet
27
- * @param {string} [settings.type] object type
28
- * @param {number} [settings.collisionMask] Mask collision detection for this object
29
- * @param {me.Rect[]|me.Polygon[]|me.Line[]|me.Ellipse[]} [settings.shapes] the initial list of collision shapes (usually populated through Tiled)
11
+ * @augments Renderable
12
+ * @see Renderable
30
13
  */
31
-
32
14
  class Entity extends Renderable {
33
-
34
-
35
15
  /**
36
- * @ignore
16
+ * @param {number} x the x coordinates of the entity object
17
+ * @param {number} y the y coordinates of the entity object
18
+ * @param {object} settings Entity properties, to be defined through Tiled or when calling the entity constructor
19
+ * <img src="images/object_properties.png"/>
20
+ * @param {number} settings.width the physical width the entity takes up in game
21
+ * @param {number} settings.height the physical height the entity takes up in game
22
+ * @param {string} [settings.name] object entity name
23
+ * @param {string} [settings.id] object unique IDs
24
+ * @param {Image|string} [settings.image] resource name of a spritesheet to use for the entity renderable component
25
+ * @param {Vector2d} [settings.anchorPoint=0.0] Entity anchor point
26
+ * @param {number} [settings.framewidth=settings.width] width of a single frame in the given spritesheet
27
+ * @param {number} [settings.frameheight=settings.width] height of a single frame in the given spritesheet
28
+ * @param {string} [settings.type] object type
29
+ * @param {number} [settings.collisionMask] Mask collision detection for this object
30
+ * @param {Rect[]|Polygon[]|Line[]|Ellipse[]} [settings.shapes] the initial list of collision shapes (usually populated through Tiled)
37
31
  */
38
32
  constructor(x, y, settings) {
39
33
 
@@ -76,7 +70,7 @@ class Entity extends Renderable {
76
70
  * @public
77
71
  * @type {string}
78
72
  * @name type
79
- * @memberOf me.Entity
73
+ * @memberof Entity
80
74
  */
81
75
  this.type = settings.type || "";
82
76
 
@@ -85,7 +79,7 @@ class Entity extends Renderable {
85
79
  * @public
86
80
  * @type {number}
87
81
  * @name id
88
- * @memberOf me.Entity
82
+ * @memberof Entity
89
83
  */
90
84
  this.id = settings.id || "";
91
85
 
@@ -95,16 +89,16 @@ class Entity extends Renderable {
95
89
  * @public
96
90
  * @type {boolean}
97
91
  * @name alive
98
- * @memberOf me.Entity
92
+ * @memberof Entity
99
93
  */
100
94
  this.alive = true;
101
95
 
102
96
  /**
103
97
  * the entity body object
104
98
  * @public
105
- * @type {me.Body}
99
+ * @type {Body}
106
100
  * @name body
107
- * @memberOf me.Entity
101
+ * @memberof Entity
108
102
  */
109
103
  // initialize the default body
110
104
  if (typeof settings.shapes === "undefined") {
@@ -134,9 +128,9 @@ class Entity extends Renderable {
134
128
  /**
135
129
  * The entity renderable component (can be any objects deriving from me.Renderable, like me.Sprite for example)
136
130
  * @public
137
- * @type {me.Renderable}
131
+ * @type {Renderable}
138
132
  * @name renderable
139
- * @memberOf me.Entity
133
+ * @memberof Entity
140
134
  */
141
135
 
142
136
  get renderable() {
@@ -164,9 +158,9 @@ class Entity extends Renderable {
164
158
  * update the bounds position when the body is modified
165
159
  * @ignore
166
160
  * @name onBodyUpdate
167
- * @memberOf me.Entity
161
+ * @memberof Entity
168
162
  * @function
169
- * @param {me.Body} the body whose bounds to update
163
+ * @param {Body} body the body whose bounds to update
170
164
  */
171
165
  onBodyUpdate(body) {
172
166
  // update the entity bounds to include the body bounds
@@ -200,11 +194,11 @@ class Entity extends Renderable {
200
194
  * not to be called by the end user<br>
201
195
  * called by the game manager on each game loop
202
196
  * @name draw
203
- * @memberOf me.Entity
197
+ * @memberof Entity
204
198
  * @function
205
199
  * @protected
206
- * @param {me.CanvasRenderer|me.WebGLRenderer} renderer a renderer object
207
- * @param {me.Rect} rect region to draw
200
+ * @param {CanvasRenderer|WebGLRenderer} renderer a renderer object
201
+ * @param {Rect} rect region to draw
208
202
  */
209
203
  draw(renderer, rect) {
210
204
  var renderable = this.renderable;
@@ -239,7 +233,7 @@ class Entity extends Renderable {
239
233
  * onDeactivateEvent Notification function<br>
240
234
  * Called by engine before deleting the object
241
235
  * @name onDeactivateEvent
242
- * @memberOf me.Entity
236
+ * @memberof Entity
243
237
  * @function
244
238
  */
245
239
  onDeactivateEvent() {
package/src/game.js CHANGED
@@ -8,8 +8,7 @@ import World from "./physics/world.js";
8
8
  * me.game represents your current game, it contains all the objects,
9
9
  * tilemap layers, current viewport, collision map, etc...<br>
10
10
  * me.game is also responsible for updating (each frame) the object status and draw them.
11
- * @namespace me.game
12
- * @memberOf me
11
+ * @namespace game
13
12
  */
14
13
 
15
14
  // to know when we have to refresh the display
@@ -47,9 +46,9 @@ event.on(event.BOOT, () => {
47
46
  /**
48
47
  * a reference to the current active stage "default" camera
49
48
  * @public
50
- * @type {me.Camera2d}
49
+ * @type {Camera2d}
51
50
  * @name viewport
52
- * @memberOf me.game
51
+ * @memberof game
53
52
  */
54
53
  export let viewport;
55
54
 
@@ -57,9 +56,9 @@ export let viewport;
57
56
  * a reference to the game world, <br>
58
57
  * a world is a virtual environment containing all the game objects
59
58
  * @public
60
- * @type {me.World}
59
+ * @type {World}
61
60
  * @name world
62
- * @memberOf me.game
61
+ * @memberof game
63
62
  */
64
63
  export let world;
65
64
 
@@ -70,7 +69,7 @@ export let world;
70
69
  * @type {boolean}
71
70
  * @default true
72
71
  * @name mergeGroup
73
- * @memberOf me.game
72
+ * @memberof game
74
73
  */
75
74
  export let mergeGroup = true;
76
75
 
@@ -81,7 +80,7 @@ export let mergeGroup = true;
81
80
  * @type {string}
82
81
  * @default "z"
83
82
  * @name sortOn
84
- * @memberOf me.game
83
+ * @memberof game
85
84
  */
86
85
  export let sortOn = "z";
87
86
 
@@ -93,14 +92,14 @@ export let sortOn = "z";
93
92
  * @public
94
93
  * @type {DOMHighResTimeStamp}
95
94
  * @name lastUpdate
96
- * @memberOf me.game
95
+ * @memberof game
97
96
  */
98
97
  export let lastUpdate = window.performance.now();
99
98
 
100
99
  /**
101
100
  * Fired when a level is fully loaded and all entities instantiated. <br>
102
101
  * Additionnaly the level id will also be passed to the called function.
103
- * @function me.game.onLevelLoaded
102
+ * @function game.onLevelLoaded
104
103
  * @example
105
104
  * // call myFunction () everytime a level is loaded
106
105
  * me.game.onLevelLoaded = this.myFunction.bind(this);
@@ -110,7 +109,7 @@ export function onLevelLoaded() {};
110
109
  /**
111
110
  * reset the game Object manager<br>
112
111
  * destroy all current objects
113
- * @function me.game.reset
112
+ * @function game.reset
114
113
  */
115
114
  export function reset () {
116
115
  // point to the current active stage "default" camera
@@ -128,9 +127,9 @@ export function reset () {
128
127
 
129
128
  /**
130
129
  * Update the renderer framerate using the system config variables.
131
- * @function me.game.updateFrameRate
132
- * @see me.timer.maxfps
133
- * @see me.World.fps
130
+ * @function game.updateFrameRate
131
+ * @see timer.maxfps
132
+ * @see World.fps
134
133
  */
135
134
  export function updateFrameRate() {
136
135
  // reset the frame counter
@@ -149,9 +148,9 @@ export function updateFrameRate() {
149
148
 
150
149
  /**
151
150
  * Returns the parent container of the specified Child in the game world
152
- * @function me.game.getParentContainer
153
- * @param {me.Renderable} child
154
- * @returns {me.Container}
151
+ * @function game.getParentContainer
152
+ * @param {Renderable} child
153
+ * @returns {Container}
155
154
  */
156
155
  export function getParentContainer(child) {
157
156
  return child.ancestor;
@@ -159,7 +158,7 @@ export function getParentContainer(child) {
159
158
 
160
159
  /**
161
160
  * force the redraw (not update) of all objects
162
- * @function me.game.repaint
161
+ * @function game.repaint
163
162
  */
164
163
  export function repaint() {
165
164
  isDirty = true;
@@ -169,9 +168,9 @@ export function repaint() {
169
168
  /**
170
169
  * update all objects of the game manager
171
170
  * @ignore
172
- * @function me.game.update
171
+ * @function game.update
173
172
  * @param {number} time current timestamp as provided by the RAF callback
174
- * @param {me.Stage} stage the current stage
173
+ * @param {Stage} stage the current stage
175
174
  */
176
175
  export function update(time, stage) {
177
176
  // handle frame skipping if required
@@ -216,9 +215,9 @@ export function update(time, stage) {
216
215
 
217
216
  /**
218
217
  * draw the current scene/stage
219
- * @function me.game.draw
218
+ * @function game.draw
220
219
  * @ignore
221
- * @param {me.Stage} stage the current stage
220
+ * @param {Stage} stage the current stage
222
221
  */
223
222
  export function draw(stage) {
224
223
 
@@ -4,34 +4,27 @@ import pool from "./../system/pooling.js";
4
4
  /**
5
5
  * @classdesc
6
6
  * an ellipse Object
7
- * @class Ellipse
8
- * @extends me.Object
9
- * @memberOf me
10
- * @constructor
11
- * @param {number} x the center x coordinate of the ellipse
12
- * @param {number} y the center y coordinate of the ellipse
13
- * @param {number} w width (diameter) of the ellipse
14
- * @param {number} h height (diameter) of the ellipse
15
7
  */
16
-
17
8
  class Ellipse {
18
-
9
+ /**
10
+ * @param {number} x the center x coordinate of the ellipse
11
+ * @param {number} y the center y coordinate of the ellipse
12
+ * @param {number} w width (diameter) of the ellipse
13
+ * @param {number} h height (diameter) of the ellipse
14
+ */
19
15
  constructor(x, y, w, h) {
20
16
  /**
21
17
  * the center coordinates of the ellipse
22
18
  * @public
23
- * @type {me.Vector2d}
19
+ * @type {Vector2d}
24
20
  * @name pos
25
- * @memberOf me.Ellipse#
21
+ * @memberof Ellipse#
26
22
  */
27
23
  this.pos = new Vector2d();
28
24
 
29
25
  /**
30
26
  * The bounding rectangle for this shape
31
27
  * @private
32
- * @type {me.Bounds}
33
- * @name _bounds
34
- * @memberOf me.Ellipse#
35
28
  */
36
29
  this._bounds = undefined;
37
30
 
@@ -40,34 +33,34 @@ class Ellipse {
40
33
  * @public
41
34
  * @type {number}
42
35
  * @name radius
43
- * @memberOf me.Ellipse
36
+ * @memberof Ellipse
44
37
  */
45
38
  this.radius = NaN;
46
39
 
47
40
  /**
48
41
  * Pre-scaled radius vector for ellipse
49
42
  * @public
50
- * @type {me.Vector2d}
43
+ * @type {Vector2d}
51
44
  * @name radiusV
52
- * @memberOf me.Ellipse#
45
+ * @memberof Ellipse#
53
46
  */
54
47
  this.radiusV = new Vector2d();
55
48
 
56
49
  /**
57
50
  * Radius squared, for pythagorean theorom
58
51
  * @public
59
- * @type {me.Vector2d}
52
+ * @type {Vector2d}
60
53
  * @name radiusSq
61
- * @memberOf me.Ellipse#
54
+ * @memberof Ellipse#
62
55
  */
63
56
  this.radiusSq = new Vector2d();
64
57
 
65
58
  /**
66
59
  * x/y scaling ratio for ellipse
67
60
  * @public
68
- * @type {me.Vector2d}
61
+ * @type {Vector2d}
69
62
  * @name ratio
70
- * @memberOf me.Ellipse#
63
+ * @memberof Ellipse#
71
64
  */
72
65
  this.ratio = new Vector2d();
73
66
 
@@ -84,13 +77,13 @@ class Ellipse {
84
77
  /**
85
78
  * set new value to the Ellipse shape
86
79
  * @name setShape
87
- * @memberOf me.Ellipse.prototype
80
+ * @memberof Ellipse.prototype
88
81
  * @function
89
82
  * @param {number} x the center x coordinate of the ellipse
90
83
  * @param {number} y the center y coordinate of the ellipse
91
84
  * @param {number} w width (diameter) of the ellipse
92
85
  * @param {number} h height (diameter) of the ellipse
93
- * @returns {me.Ellipse} this instance for objecf chaining
86
+ * @returns {Ellipse} this instance for objecf chaining
94
87
  */
95
88
  setShape(x, y, w, h) {
96
89
  var hW = w / 2;
@@ -114,11 +107,11 @@ class Ellipse {
114
107
  /**
115
108
  * Rotate this Ellipse (counter-clockwise) by the specified angle (in radians).
116
109
  * @name rotate
117
- * @memberOf me.Ellipse.prototype
110
+ * @memberof Ellipse.prototype
118
111
  * @function
119
112
  * @param {number} angle The angle to rotate (in radians)
120
- * @param {me.Vector2d|me.ObservableVector2d} [v] an optional point to rotate around
121
- * @returns {me.Ellipse} Reference to this object for method chaining
113
+ * @param {Vector2d|ObservableVector2d} [v] an optional point to rotate around
114
+ * @returns {Ellipse} Reference to this object for method chaining
122
115
  */
123
116
  rotate(angle, v) {
124
117
  // TODO : only works for circle
@@ -131,11 +124,11 @@ class Ellipse {
131
124
  /**
132
125
  * Scale this Ellipse by the specified scalar.
133
126
  * @name scale
134
- * @memberOf me.Ellipse.prototype
127
+ * @memberof Ellipse.prototype
135
128
  * @function
136
129
  * @param {number} x
137
130
  * @param {number} [y=x]
138
- * @returns {me.Ellipse} Reference to this object for method chaining
131
+ * @returns {Ellipse} Reference to this object for method chaining
139
132
  */
140
133
  scale(x, y) {
141
134
  y = typeof (y) !== "undefined" ? y : x;
@@ -150,10 +143,10 @@ class Ellipse {
150
143
  /**
151
144
  * Scale this Ellipse by the specified vector.
152
145
  * @name scale
153
- * @memberOf me.Ellipse.prototype
146
+ * @memberof Ellipse.prototype
154
147
  * @function
155
- * @param {me.Vector2d} v
156
- * @returns {me.Ellipse} Reference to this object for method chaining
148
+ * @param {Vector2d} v
149
+ * @returns {Ellipse} Reference to this object for method chaining
157
150
  */
158
151
  scaleV(v) {
159
152
  return this.scale(v.x, v.y);
@@ -162,10 +155,10 @@ class Ellipse {
162
155
  /**
163
156
  * apply the given transformation matrix to this ellipse
164
157
  * @name transform
165
- * @memberOf me.Ellipse.prototype
158
+ * @memberof Ellipse.prototype
166
159
  * @function
167
- * @param {me.Matrix2d} matrix the transformation matrix
168
- * @returns {me.Polygon} Reference to this object for method chaining
160
+ * @param {Matrix2d} matrix the transformation matrix
161
+ * @returns {Polygon} Reference to this object for method chaining
169
162
  */
170
163
  transform(/* m */) {
171
164
  // TODO
@@ -175,19 +168,19 @@ class Ellipse {
175
168
  /**
176
169
  * translate the circle/ellipse by the specified offset
177
170
  * @name translate
178
- * @memberOf me.Ellipse.prototype
171
+ * @memberof Ellipse.prototype
179
172
  * @function
180
173
  * @param {number} x x offset
181
174
  * @param {number} y y offset
182
- * @returns {me.Ellipse} this ellipse
175
+ * @returns {Ellipse} this ellipse
183
176
  */
184
177
  /**
185
178
  * translate the circle/ellipse by the specified vector
186
179
  * @name translate
187
- * @memberOf me.Ellipse.prototype
180
+ * @memberof Ellipse.prototype
188
181
  * @function
189
- * @param {me.Vector2d} v vector offset
190
- * @returns {me.Ellipse} this ellipse
182
+ * @param {Vector2d} v vector offset
183
+ * @returns {Ellipse} this ellipse
191
184
  */
192
185
  translate() {
193
186
  var _x, _y;
@@ -212,16 +205,16 @@ class Ellipse {
212
205
  /**
213
206
  * check if this circle/ellipse contains the specified point
214
207
  * @name contains
215
- * @memberOf me.Ellipse.prototype
208
+ * @memberof Ellipse.prototype
216
209
  * @function
217
- * @param {me.Vector2d} point
210
+ * @param {Vector2d} point
218
211
  * @returns {boolean} true if contains
219
212
  */
220
213
 
221
214
  /**
222
215
  * check if this circle/ellipse contains the specified point
223
216
  * @name contains
224
- * @memberOf me.Ellipse.prototype
217
+ * @memberof Ellipse.prototype
225
218
  * @function
226
219
  * @param {number} x x coordinate
227
220
  * @param {number} y y coordinate
@@ -253,9 +246,9 @@ class Ellipse {
253
246
  /**
254
247
  * returns the bounding box for this shape, the smallest Rectangle object completely containing this shape.
255
248
  * @name getBounds
256
- * @memberOf me.Ellipse.prototype
249
+ * @memberof Ellipse.prototype
257
250
  * @function
258
- * @returns {me.Bounds} this shape bounding box Rectangle object
251
+ * @returns {Bounds} this shape bounding box Rectangle object
259
252
  */
260
253
  getBounds() {
261
254
  if (typeof this._bounds === "undefined") {
@@ -267,9 +260,9 @@ class Ellipse {
267
260
  /**
268
261
  * clone this Ellipse
269
262
  * @name clone
270
- * @memberOf me.Ellipse.prototype
263
+ * @memberof Ellipse.prototype
271
264
  * @function
272
- * @returns {me.Ellipse} new Ellipse
265
+ * @returns {Ellipse} new Ellipse
273
266
  */
274
267
  clone() {
275
268
  return new Ellipse(