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.
- package/README.md +1 -1
- package/dist/melonjs.js +2735 -2760
- package/dist/melonjs.min.js +3 -3
- package/dist/melonjs.module.d.ts +2186 -2162
- package/dist/melonjs.module.js +2323 -2362
- package/package.json +8 -9
- package/src/audio/audio.js +43 -43
- package/src/camera/camera2d.js +52 -74
- package/src/entity/draggable.js +18 -17
- package/src/entity/droptarget.js +19 -18
- package/src/entity/entity.js +22 -26
- package/src/game.js +2 -2
- package/src/index.js +11 -11
- package/src/input/gamepad.js +13 -13
- package/src/input/input.js +1 -1
- package/src/input/keyboard.js +14 -16
- package/src/input/pointer.js +42 -35
- package/src/input/pointerevent.js +18 -26
- package/src/lang/deprecated.js +3 -3
- package/src/level/level.js +24 -16
- package/src/level/tiled/TMXGroup.js +6 -6
- package/src/level/tiled/TMXLayer.js +31 -31
- package/src/level/tiled/TMXObject.js +19 -19
- package/src/level/tiled/TMXTile.js +11 -12
- package/src/level/tiled/TMXTileMap.js +23 -21
- package/src/level/tiled/TMXTileset.js +13 -13
- package/src/level/tiled/TMXTilesetGroup.js +4 -4
- package/src/level/tiled/TMXUtils.js +13 -11
- package/src/level/tiled/renderer/TMXHexagonalRenderer.js +1 -1
- package/src/level/tiled/renderer/TMXIsometricRenderer.js +1 -1
- package/src/level/tiled/renderer/TMXRenderer.js +17 -17
- package/src/loader/loader.js +29 -25
- package/src/math/color.js +45 -64
- package/src/math/math.js +17 -17
- package/src/math/matrix2.js +46 -46
- package/src/math/matrix3.js +64 -64
- package/src/math/observable_vector2.js +45 -57
- package/src/math/observable_vector3.js +56 -70
- package/src/math/vector2.js +60 -59
- package/src/math/vector3.js +65 -64
- package/src/particles/emitter.js +53 -55
- package/src/particles/particle.js +1 -1
- package/src/physics/body.js +44 -44
- package/src/physics/bounds.js +34 -34
- package/src/physics/collision.js +15 -16
- package/src/physics/detector.js +10 -10
- package/src/physics/quadtree.js +19 -17
- package/src/physics/sat.js +17 -17
- package/src/physics/world.js +12 -10
- package/src/plugin/plugin.js +6 -6
- package/src/renderable/GUI.js +13 -18
- package/src/renderable/collectable.js +3 -3
- package/src/renderable/colorlayer.js +4 -4
- package/src/renderable/container.js +64 -46
- package/src/renderable/imagelayer.js +30 -31
- package/src/renderable/nineslicesprite.js +13 -13
- package/src/renderable/renderable.js +68 -66
- package/src/renderable/sprite.js +57 -43
- package/src/renderable/trigger.js +14 -15
- package/src/shapes/ellipse.js +27 -26
- package/src/shapes/line.js +8 -7
- package/src/shapes/poly.js +33 -31
- package/src/shapes/rectangle.js +50 -96
- package/src/state/stage.js +6 -6
- package/src/state/state.js +54 -54
- package/src/system/device.js +97 -84
- package/src/system/event.js +72 -72
- package/src/system/pooling.js +14 -14
- package/src/system/save.js +6 -3
- package/src/system/timer.js +20 -20
- package/src/text/bitmaptext.js +27 -33
- package/src/text/bitmaptextdata.js +9 -9
- package/src/text/text.js +39 -41
- package/src/tweens/easing.js +4 -4
- package/src/tweens/interpolation.js +4 -4
- package/src/tweens/tween.js +37 -27
- package/src/utils/agent.js +9 -8
- package/src/utils/array.js +4 -4
- package/src/utils/file.js +4 -4
- package/src/utils/function.js +5 -5
- package/src/utils/string.js +12 -12
- package/src/utils/utils.js +19 -19
- package/src/video/canvas/canvas_renderer.js +90 -90
- package/src/video/renderer.js +40 -39
- package/src/video/texture.js +74 -75
- package/src/video/video.js +30 -30
- package/src/video/webgl/buffer/vertex.js +9 -1
- package/src/video/webgl/glshader.js +20 -20
- package/src/video/webgl/webgl_compositor.js +33 -34
- package/src/video/webgl/webgl_renderer.js +104 -104
|
@@ -12,19 +12,19 @@ import { world, viewport } from "./../game.js";
|
|
|
12
12
|
* @extends me.Renderable
|
|
13
13
|
* @memberOf me
|
|
14
14
|
* @constructor
|
|
15
|
-
* @param {
|
|
16
|
-
* @param {
|
|
17
|
-
* @param {
|
|
18
|
-
* @param {
|
|
15
|
+
* @param {number} x the x coordinates of the trigger area
|
|
16
|
+
* @param {number} y the y coordinates of the trigger area
|
|
17
|
+
* @param {number} [settings.width] width of the trigger area
|
|
18
|
+
* @param {number} [settings.height] height of the trigger area
|
|
19
19
|
* @param {me.Rect[]|me.Polygon[]|me.Line[]|me.Ellipse[]} [settings.shapes] collision shape(s) that will trigger the event
|
|
20
|
-
* @param {
|
|
21
|
-
* @param {
|
|
22
|
-
* @param {
|
|
23
|
-
* @param {
|
|
24
|
-
* @param {
|
|
20
|
+
* @param {string} [settings.duration] Fade duration (in ms)
|
|
21
|
+
* @param {string|me.Color} [settings.color] Fade color
|
|
22
|
+
* @param {string} [settings.event="level"] the type of event to trigger (only "level" supported for now)
|
|
23
|
+
* @param {string} [settings.to] level to load if level trigger
|
|
24
|
+
* @param {string|me.Container} [settings.container] Target container. See {@link me.level.load}
|
|
25
25
|
* @param {Function} [settings.onLoaded] Level loaded callback. See {@link me.level.load}
|
|
26
|
-
* @param {
|
|
27
|
-
* @param {
|
|
26
|
+
* @param {boolean} [settings.flatten] Flatten all objects into the target container. See {@link me.level.load}
|
|
27
|
+
* @param {boolean} [settings.setViewportBounds] Resize the viewport to match the level. See {@link me.level.load}
|
|
28
28
|
* @example
|
|
29
29
|
* me.game.world.addChild(new me.Trigger(
|
|
30
30
|
* x, y, {
|
|
@@ -102,11 +102,10 @@ class Trigger extends Renderable {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
/**
|
|
105
|
-
*
|
|
106
|
-
* @name
|
|
107
|
-
* @memberOf me.
|
|
105
|
+
* trigger this event
|
|
106
|
+
* @name triggerEvent
|
|
107
|
+
* @memberOf me.Trigger
|
|
108
108
|
* @function
|
|
109
|
-
* @param {String} [level=this.nextlevel] name of the level to load
|
|
110
109
|
* @protected
|
|
111
110
|
*/
|
|
112
111
|
triggerEvent() {
|
package/src/shapes/ellipse.js
CHANGED
|
@@ -8,10 +8,10 @@ import pool from "./../system/pooling.js";
|
|
|
8
8
|
* @extends me.Object
|
|
9
9
|
* @memberOf me
|
|
10
10
|
* @constructor
|
|
11
|
-
* @param {
|
|
12
|
-
* @param {
|
|
13
|
-
* @param {
|
|
14
|
-
* @param {
|
|
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
15
|
*/
|
|
16
16
|
|
|
17
17
|
class Ellipse {
|
|
@@ -38,7 +38,7 @@ class Ellipse {
|
|
|
38
38
|
/**
|
|
39
39
|
* Maximum radius of the ellipse
|
|
40
40
|
* @public
|
|
41
|
-
* @type {
|
|
41
|
+
* @type {number}
|
|
42
42
|
* @name radius
|
|
43
43
|
* @memberOf me.Ellipse
|
|
44
44
|
*/
|
|
@@ -86,10 +86,11 @@ class Ellipse {
|
|
|
86
86
|
* @name setShape
|
|
87
87
|
* @memberOf me.Ellipse.prototype
|
|
88
88
|
* @function
|
|
89
|
-
* @param {
|
|
90
|
-
* @param {
|
|
91
|
-
* @param {
|
|
92
|
-
* @param {
|
|
89
|
+
* @param {number} x the center x coordinate of the ellipse
|
|
90
|
+
* @param {number} y the center y coordinate of the ellipse
|
|
91
|
+
* @param {number} w width (diameter) of the ellipse
|
|
92
|
+
* @param {number} h height (diameter) of the ellipse
|
|
93
|
+
* @returns {me.Ellipse} this instance for objecf chaining
|
|
93
94
|
*/
|
|
94
95
|
setShape(x, y, w, h) {
|
|
95
96
|
var hW = w / 2;
|
|
@@ -115,9 +116,9 @@ class Ellipse {
|
|
|
115
116
|
* @name rotate
|
|
116
117
|
* @memberOf me.Ellipse.prototype
|
|
117
118
|
* @function
|
|
118
|
-
* @param {
|
|
119
|
+
* @param {number} angle The angle to rotate (in radians)
|
|
119
120
|
* @param {me.Vector2d|me.ObservableVector2d} [v] an optional point to rotate around
|
|
120
|
-
* @
|
|
121
|
+
* @returns {me.Ellipse} Reference to this object for method chaining
|
|
121
122
|
*/
|
|
122
123
|
rotate(angle, v) {
|
|
123
124
|
// TODO : only works for circle
|
|
@@ -132,9 +133,9 @@ class Ellipse {
|
|
|
132
133
|
* @name scale
|
|
133
134
|
* @memberOf me.Ellipse.prototype
|
|
134
135
|
* @function
|
|
135
|
-
* @param {
|
|
136
|
-
* @param {
|
|
137
|
-
* @
|
|
136
|
+
* @param {number} x
|
|
137
|
+
* @param {number} [y=x]
|
|
138
|
+
* @returns {me.Ellipse} Reference to this object for method chaining
|
|
138
139
|
*/
|
|
139
140
|
scale(x, y) {
|
|
140
141
|
y = typeof (y) !== "undefined" ? y : x;
|
|
@@ -152,7 +153,7 @@ class Ellipse {
|
|
|
152
153
|
* @memberOf me.Ellipse.prototype
|
|
153
154
|
* @function
|
|
154
155
|
* @param {me.Vector2d} v
|
|
155
|
-
* @
|
|
156
|
+
* @returns {me.Ellipse} Reference to this object for method chaining
|
|
156
157
|
*/
|
|
157
158
|
scaleV(v) {
|
|
158
159
|
return this.scale(v.x, v.y);
|
|
@@ -164,7 +165,7 @@ class Ellipse {
|
|
|
164
165
|
* @memberOf me.Ellipse.prototype
|
|
165
166
|
* @function
|
|
166
167
|
* @param {me.Matrix2d} matrix the transformation matrix
|
|
167
|
-
* @
|
|
168
|
+
* @returns {me.Polygon} Reference to this object for method chaining
|
|
168
169
|
*/
|
|
169
170
|
transform(/* m */) {
|
|
170
171
|
// TODO
|
|
@@ -176,9 +177,9 @@ class Ellipse {
|
|
|
176
177
|
* @name translate
|
|
177
178
|
* @memberOf me.Ellipse.prototype
|
|
178
179
|
* @function
|
|
179
|
-
* @param {
|
|
180
|
-
* @param {
|
|
181
|
-
* @
|
|
180
|
+
* @param {number} x x offset
|
|
181
|
+
* @param {number} y y offset
|
|
182
|
+
* @returns {me.Ellipse} this ellipse
|
|
182
183
|
*/
|
|
183
184
|
/**
|
|
184
185
|
* translate the circle/ellipse by the specified vector
|
|
@@ -186,7 +187,7 @@ class Ellipse {
|
|
|
186
187
|
* @memberOf me.Ellipse.prototype
|
|
187
188
|
* @function
|
|
188
189
|
* @param {me.Vector2d} v vector offset
|
|
189
|
-
* @
|
|
190
|
+
* @returns {me.Ellipse} this ellipse
|
|
190
191
|
*/
|
|
191
192
|
translate() {
|
|
192
193
|
var _x, _y;
|
|
@@ -214,7 +215,7 @@ class Ellipse {
|
|
|
214
215
|
* @memberOf me.Ellipse.prototype
|
|
215
216
|
* @function
|
|
216
217
|
* @param {me.Vector2d} point
|
|
217
|
-
* @
|
|
218
|
+
* @returns {boolean} true if contains
|
|
218
219
|
*/
|
|
219
220
|
|
|
220
221
|
/**
|
|
@@ -222,9 +223,9 @@ class Ellipse {
|
|
|
222
223
|
* @name contains
|
|
223
224
|
* @memberOf me.Ellipse.prototype
|
|
224
225
|
* @function
|
|
225
|
-
* @param {
|
|
226
|
-
* @param {
|
|
227
|
-
* @
|
|
226
|
+
* @param {number} x x coordinate
|
|
227
|
+
* @param {number} y y coordinate
|
|
228
|
+
* @returns {boolean} true if contains
|
|
228
229
|
*/
|
|
229
230
|
contains() {
|
|
230
231
|
var _x, _y;
|
|
@@ -254,7 +255,7 @@ class Ellipse {
|
|
|
254
255
|
* @name getBounds
|
|
255
256
|
* @memberOf me.Ellipse.prototype
|
|
256
257
|
* @function
|
|
257
|
-
* @
|
|
258
|
+
* @returns {me.Bounds} this shape bounding box Rectangle object
|
|
258
259
|
*/
|
|
259
260
|
getBounds() {
|
|
260
261
|
if (typeof this._bounds === "undefined") {
|
|
@@ -268,7 +269,7 @@ class Ellipse {
|
|
|
268
269
|
* @name clone
|
|
269
270
|
* @memberOf me.Ellipse.prototype
|
|
270
271
|
* @function
|
|
271
|
-
* @
|
|
272
|
+
* @returns {me.Ellipse} new Ellipse
|
|
272
273
|
*/
|
|
273
274
|
clone() {
|
|
274
275
|
return new Ellipse(
|
package/src/shapes/line.js
CHANGED
|
@@ -8,8 +8,8 @@ import Polygon from "./poly.js";
|
|
|
8
8
|
* @extends me.Polygon
|
|
9
9
|
* @memberOf me
|
|
10
10
|
* @constructor
|
|
11
|
-
* @param {
|
|
12
|
-
* @param {
|
|
11
|
+
* @param {number} x origin point of the Line
|
|
12
|
+
* @param {number} y origin point of the Line
|
|
13
13
|
* @param {me.Vector2d[]} points array of vectors defining the Line
|
|
14
14
|
*/
|
|
15
15
|
|
|
@@ -21,7 +21,7 @@ class Line extends Polygon {
|
|
|
21
21
|
* @memberOf me.Line.prototype
|
|
22
22
|
* @function
|
|
23
23
|
* @param {me.Vector2d} point
|
|
24
|
-
* @
|
|
24
|
+
* @returns {boolean} true if contains
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
27
|
/**
|
|
@@ -29,9 +29,9 @@ class Line extends Polygon {
|
|
|
29
29
|
* @name contains
|
|
30
30
|
* @memberOf me.Line.prototype
|
|
31
31
|
* @function
|
|
32
|
-
* @param {
|
|
33
|
-
* @param {
|
|
34
|
-
* @
|
|
32
|
+
* @param {number} x x coordinate
|
|
33
|
+
* @param {number} y y coordinate
|
|
34
|
+
* @returns {boolean} true if contains
|
|
35
35
|
*/
|
|
36
36
|
contains() {
|
|
37
37
|
var _x, _y;
|
|
@@ -63,6 +63,7 @@ class Line extends Polygon {
|
|
|
63
63
|
* @name recalc
|
|
64
64
|
* @memberOf me.Line.prototype
|
|
65
65
|
* @function
|
|
66
|
+
* @returns {me.Line} this instance for objecf chaining
|
|
66
67
|
*/
|
|
67
68
|
recalc() {
|
|
68
69
|
var edges = this.edges;
|
|
@@ -98,7 +99,7 @@ class Line extends Polygon {
|
|
|
98
99
|
* @name clone
|
|
99
100
|
* @memberOf me.Line.prototype
|
|
100
101
|
* @function
|
|
101
|
-
* @
|
|
102
|
+
* @returns {me.Line} new Line
|
|
102
103
|
*/
|
|
103
104
|
clone() {
|
|
104
105
|
var copy = [];
|
package/src/shapes/poly.js
CHANGED
|
@@ -13,8 +13,8 @@ import pool from "./../system/pooling.js";
|
|
|
13
13
|
* @class Polygon
|
|
14
14
|
* @memberOf me
|
|
15
15
|
* @constructor
|
|
16
|
-
* @param {
|
|
17
|
-
* @param {
|
|
16
|
+
* @param {number} x origin point of the Polygon
|
|
17
|
+
* @param {number} y origin point of the Polygon
|
|
18
18
|
* @param {me.Vector2d[]} points array of vector defining the Polygon
|
|
19
19
|
*/
|
|
20
20
|
|
|
@@ -86,9 +86,10 @@ class Polygon {
|
|
|
86
86
|
* @name setShape
|
|
87
87
|
* @memberOf me.Polygon.prototype
|
|
88
88
|
* @function
|
|
89
|
-
* @param {
|
|
90
|
-
* @param {
|
|
91
|
-
* @param {me.Vector2d[]|
|
|
89
|
+
* @param {number} x position of the Polygon
|
|
90
|
+
* @param {number} y position of the Polygon
|
|
91
|
+
* @param {me.Vector2d[]|number[]} points array of vector or vertice defining the Polygon
|
|
92
|
+
* @returns {me.Polygon} this instance for objecf chaining
|
|
92
93
|
*/
|
|
93
94
|
setShape(x, y, points) {
|
|
94
95
|
this.pos.set(x, y);
|
|
@@ -101,7 +102,8 @@ class Polygon {
|
|
|
101
102
|
* @name setVertices
|
|
102
103
|
* @memberOf me.Polygon.prototype
|
|
103
104
|
* @function
|
|
104
|
-
* @param {me.Vector2d[]}
|
|
105
|
+
* @param {me.Vector2d[]} vertices array of vector or vertice defining the Polygon
|
|
106
|
+
* @returns {me.Polygon} this instance for objecf chaining
|
|
105
107
|
*/
|
|
106
108
|
setVertices(vertices) {
|
|
107
109
|
|
|
@@ -140,8 +142,8 @@ class Polygon {
|
|
|
140
142
|
* @name transform
|
|
141
143
|
* @memberOf me.Polygon.prototype
|
|
142
144
|
* @function
|
|
143
|
-
* @param {me.Matrix2d}
|
|
144
|
-
* @
|
|
145
|
+
* @param {me.Matrix2d} m the transformation matrix
|
|
146
|
+
* @returns {me.Polygon} Reference to this object for method chaining
|
|
145
147
|
*/
|
|
146
148
|
transform(m) {
|
|
147
149
|
var points = this.points;
|
|
@@ -159,7 +161,7 @@ class Polygon {
|
|
|
159
161
|
* @name toIso
|
|
160
162
|
* @memberOf me.Polygon.prototype
|
|
161
163
|
* @function
|
|
162
|
-
* @
|
|
164
|
+
* @returns {me.Polygon} Reference to this object for method chaining
|
|
163
165
|
*/
|
|
164
166
|
toIso() {
|
|
165
167
|
return this.rotate(Math.PI / 4).scale(Math.SQRT2, Math.SQRT1_2);
|
|
@@ -170,7 +172,7 @@ class Polygon {
|
|
|
170
172
|
* @name to2d
|
|
171
173
|
* @memberOf me.Polygon.prototype
|
|
172
174
|
* @function
|
|
173
|
-
* @
|
|
175
|
+
* @returns {me.Polygon} Reference to this object for method chaining
|
|
174
176
|
*/
|
|
175
177
|
to2d() {
|
|
176
178
|
return this.scale(Math.SQRT1_2, Math.SQRT2).rotate(-Math.PI / 4);
|
|
@@ -181,9 +183,9 @@ class Polygon {
|
|
|
181
183
|
* @name rotate
|
|
182
184
|
* @memberOf me.Polygon.prototype
|
|
183
185
|
* @function
|
|
184
|
-
* @param {
|
|
186
|
+
* @param {number} angle The angle to rotate (in radians)
|
|
185
187
|
* @param {me.Vector2d|me.ObservableVector2d} [v] an optional point to rotate around
|
|
186
|
-
* @
|
|
188
|
+
* @returns {me.Polygon} Reference to this object for method chaining
|
|
187
189
|
*/
|
|
188
190
|
rotate(angle, v) {
|
|
189
191
|
if (angle !== 0) {
|
|
@@ -203,9 +205,9 @@ class Polygon {
|
|
|
203
205
|
* @name scale
|
|
204
206
|
* @memberOf me.Polygon.prototype
|
|
205
207
|
* @function
|
|
206
|
-
* @param {
|
|
207
|
-
* @param {
|
|
208
|
-
* @
|
|
208
|
+
* @param {number} x
|
|
209
|
+
* @param {number} [y=x]
|
|
210
|
+
* @returns {me.Polygon} Reference to this object for method chaining
|
|
209
211
|
*/
|
|
210
212
|
scale(x, y) {
|
|
211
213
|
y = typeof (y) !== "undefined" ? y : x;
|
|
@@ -226,7 +228,7 @@ class Polygon {
|
|
|
226
228
|
* @memberOf me.Polygon.prototype
|
|
227
229
|
* @function
|
|
228
230
|
* @param {me.Vector2d} v
|
|
229
|
-
* @
|
|
231
|
+
* @returns {me.Polygon} Reference to this object for method chaining
|
|
230
232
|
*/
|
|
231
233
|
scaleV(v) {
|
|
232
234
|
return this.scale(v.x, v.y);
|
|
@@ -238,7 +240,7 @@ class Polygon {
|
|
|
238
240
|
* @name recalc
|
|
239
241
|
* @memberOf me.Polygon.prototype
|
|
240
242
|
* @function
|
|
241
|
-
* @
|
|
243
|
+
* @returns {me.Polygon} Reference to this object for method chaining
|
|
242
244
|
*/
|
|
243
245
|
recalc() {
|
|
244
246
|
var i;
|
|
@@ -281,7 +283,7 @@ class Polygon {
|
|
|
281
283
|
* @name getIndices
|
|
282
284
|
* @memberOf me.Polygon.prototype
|
|
283
285
|
* @function
|
|
284
|
-
* @
|
|
286
|
+
* @returns {Array} an array of vertex indices for all triangles forming this polygon.
|
|
285
287
|
*/
|
|
286
288
|
getIndices() {
|
|
287
289
|
if (this.indices.length === 0) {
|
|
@@ -295,9 +297,9 @@ class Polygon {
|
|
|
295
297
|
* @name translate
|
|
296
298
|
* @memberOf me.Polygon.prototype
|
|
297
299
|
* @function
|
|
298
|
-
* @param {
|
|
299
|
-
* @param {
|
|
300
|
-
* @
|
|
300
|
+
* @param {number} x x offset
|
|
301
|
+
* @param {number} y y offset
|
|
302
|
+
* @returns {me.Polygon} this Polygon
|
|
301
303
|
*/
|
|
302
304
|
/**
|
|
303
305
|
* translate the Polygon by the specified vector
|
|
@@ -305,7 +307,7 @@ class Polygon {
|
|
|
305
307
|
* @memberOf me.Polygon.prototype
|
|
306
308
|
* @function
|
|
307
309
|
* @param {me.Vector2d} v vector offset
|
|
308
|
-
* @
|
|
310
|
+
* @returns {me.Polygon} Reference to this object for method chaining
|
|
309
311
|
*/
|
|
310
312
|
translate() {
|
|
311
313
|
var _x, _y;
|
|
@@ -339,8 +341,8 @@ class Polygon {
|
|
|
339
341
|
* @name shift
|
|
340
342
|
* @memberOf me.Polygon
|
|
341
343
|
* @function
|
|
342
|
-
* @param {
|
|
343
|
-
* @param {
|
|
344
|
+
* @param {number} x
|
|
345
|
+
* @param {number} y
|
|
344
346
|
*/
|
|
345
347
|
shift() {
|
|
346
348
|
var _x, _y;
|
|
@@ -366,7 +368,7 @@ class Polygon {
|
|
|
366
368
|
* @memberOf me.Polygon.prototype
|
|
367
369
|
* @function
|
|
368
370
|
* @param {me.Vector2d} point
|
|
369
|
-
* @
|
|
371
|
+
* @returns {boolean} true if contains
|
|
370
372
|
*/
|
|
371
373
|
|
|
372
374
|
/**
|
|
@@ -376,9 +378,9 @@ class Polygon {
|
|
|
376
378
|
* @name contains
|
|
377
379
|
* @memberOf me.Polygon.prototype
|
|
378
380
|
* @function
|
|
379
|
-
* @param {
|
|
380
|
-
* @param {
|
|
381
|
-
* @
|
|
381
|
+
* @param {number} x x coordinate
|
|
382
|
+
* @param {number} y y coordinate
|
|
383
|
+
* @returns {boolean} true if contains
|
|
382
384
|
*/
|
|
383
385
|
contains() {
|
|
384
386
|
var _x, _y;
|
|
@@ -414,7 +416,7 @@ class Polygon {
|
|
|
414
416
|
* @name getBounds
|
|
415
417
|
* @memberOf me.Polygon.prototype
|
|
416
418
|
* @function
|
|
417
|
-
* @
|
|
419
|
+
* @returns {me.Bounds} this shape bounding box Rectangle object
|
|
418
420
|
*/
|
|
419
421
|
getBounds() {
|
|
420
422
|
if (typeof this._bounds === "undefined") {
|
|
@@ -429,7 +431,7 @@ class Polygon {
|
|
|
429
431
|
* @name updateBounds
|
|
430
432
|
* @memberOf me.Polygon.prototype
|
|
431
433
|
* @function
|
|
432
|
-
* @
|
|
434
|
+
* @returns {me.Bounds} this shape bounding box Rectangle object
|
|
433
435
|
*/
|
|
434
436
|
updateBounds() {
|
|
435
437
|
var bounds = this.getBounds();
|
|
@@ -445,7 +447,7 @@ class Polygon {
|
|
|
445
447
|
* @name clone
|
|
446
448
|
* @memberOf me.Polygon.prototype
|
|
447
449
|
* @function
|
|
448
|
-
* @
|
|
450
|
+
* @returns {me.Polygon} new Polygon
|
|
449
451
|
*/
|
|
450
452
|
clone() {
|
|
451
453
|
var copy = [];
|