melonjs 14.0.1 → 14.1.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.
- package/README.md +2 -0
- package/dist/melonjs.mjs/_virtual/_commonjsHelpers.js +10 -0
- package/dist/melonjs.mjs/_virtual/arraymultimap.js +10 -0
- package/dist/melonjs.mjs/_virtual/earcut.js +10 -0
- package/dist/melonjs.mjs/_virtual/howler.js +10 -0
- package/dist/melonjs.mjs/_virtual/index.js +10 -0
- package/dist/melonjs.mjs/_virtual/index2.js +10 -0
- package/dist/melonjs.mjs/_virtual/multimap.js +10 -0
- package/dist/melonjs.mjs/_virtual/setmultimap.js +10 -0
- package/dist/melonjs.mjs/application/application.js +240 -0
- package/dist/melonjs.mjs/audio/audio.js +536 -0
- package/dist/melonjs.mjs/camera/camera2d.js +732 -0
- package/dist/melonjs.mjs/entity/entity.js +248 -0
- package/dist/melonjs.mjs/game.js +29 -0
- package/dist/melonjs.mjs/geometries/ellipse.js +275 -0
- package/dist/melonjs.mjs/geometries/line.js +116 -0
- package/dist/melonjs.mjs/geometries/path2d.js +319 -0
- package/dist/melonjs.mjs/geometries/point.js +89 -0
- package/dist/melonjs.mjs/geometries/poly.js +500 -0
- package/dist/melonjs.mjs/geometries/rectangle.js +375 -0
- package/dist/melonjs.mjs/geometries/roundrect.js +168 -0
- package/dist/melonjs.mjs/index.js +248 -0
- package/dist/melonjs.mjs/input/gamepad.js +501 -0
- package/dist/melonjs.mjs/input/input.js +26 -0
- package/dist/melonjs.mjs/input/keyboard.js +470 -0
- package/dist/melonjs.mjs/input/pointer.js +393 -0
- package/dist/melonjs.mjs/input/pointerevent.js +818 -0
- package/dist/melonjs.mjs/lang/deprecated.js +157 -0
- package/dist/melonjs.mjs/level/level.js +297 -0
- package/dist/melonjs.mjs/level/tiled/TMXGroup.js +141 -0
- package/dist/melonjs.mjs/level/tiled/TMXLayer.js +448 -0
- package/dist/melonjs.mjs/level/tiled/TMXObject.js +355 -0
- package/dist/melonjs.mjs/level/tiled/TMXTile.js +194 -0
- package/dist/melonjs.mjs/level/tiled/TMXTileMap.js +639 -0
- package/dist/melonjs.mjs/level/tiled/TMXTileset.js +311 -0
- package/dist/melonjs.mjs/level/tiled/TMXTilesetGroup.js +83 -0
- package/dist/melonjs.mjs/level/tiled/TMXUtils.js +367 -0
- package/dist/melonjs.mjs/level/tiled/renderer/TMXHexagonalRenderer.js +506 -0
- package/dist/melonjs.mjs/level/tiled/renderer/TMXIsometricRenderer.js +220 -0
- package/dist/melonjs.mjs/level/tiled/renderer/TMXOrthogonalRenderer.js +157 -0
- package/dist/melonjs.mjs/level/tiled/renderer/TMXRenderer.js +125 -0
- package/dist/melonjs.mjs/level/tiled/renderer/TMXStaggeredRenderer.js +109 -0
- package/dist/melonjs.mjs/loader/loader.js +801 -0
- package/dist/melonjs.mjs/loader/loadingscreen.js +120 -0
- package/dist/melonjs.mjs/loader/melonjs_logo.png.js +11 -0
- package/dist/melonjs.mjs/math/color.js +618 -0
- package/dist/melonjs.mjs/math/math.js +218 -0
- package/dist/melonjs.mjs/math/matrix2.js +503 -0
- package/dist/melonjs.mjs/math/matrix3.js +681 -0
- package/dist/melonjs.mjs/math/observable_vector2.js +471 -0
- package/dist/melonjs.mjs/math/observable_vector3.js +561 -0
- package/dist/melonjs.mjs/math/vector2.js +528 -0
- package/dist/melonjs.mjs/math/vector3.js +569 -0
- package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/arraymultimap.js +73 -0
- package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/index.js +21 -0
- package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/multimap.js +324 -0
- package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/setmultimap.js +69 -0
- package/dist/melonjs.mjs/node_modules/earcut/src/earcut.js +691 -0
- package/dist/melonjs.mjs/node_modules/eventemitter3/index.js +350 -0
- package/dist/melonjs.mjs/node_modules/howler/dist/howler.js +3241 -0
- package/dist/melonjs.mjs/particles/emitter.js +267 -0
- package/dist/melonjs.mjs/particles/particle.js +188 -0
- package/dist/melonjs.mjs/particles/settings.js +319 -0
- package/dist/melonjs.mjs/physics/body.js +704 -0
- package/dist/melonjs.mjs/physics/bounds.js +460 -0
- package/dist/melonjs.mjs/physics/collision.js +132 -0
- package/dist/melonjs.mjs/physics/detector.js +194 -0
- package/dist/melonjs.mjs/physics/quadtree.js +391 -0
- package/dist/melonjs.mjs/physics/response.js +57 -0
- package/dist/melonjs.mjs/physics/sat.js +483 -0
- package/dist/melonjs.mjs/physics/world.js +221 -0
- package/dist/melonjs.mjs/plugin/plugin.js +141 -0
- package/dist/melonjs.mjs/renderable/collectable.js +62 -0
- package/dist/melonjs.mjs/renderable/colorlayer.js +80 -0
- package/dist/melonjs.mjs/renderable/container.js +1018 -0
- package/dist/melonjs.mjs/renderable/dragndrop.js +224 -0
- package/dist/melonjs.mjs/renderable/imagelayer.js +306 -0
- package/dist/melonjs.mjs/renderable/light2d.js +156 -0
- package/dist/melonjs.mjs/renderable/nineslicesprite.js +247 -0
- package/dist/melonjs.mjs/renderable/renderable.js +783 -0
- package/dist/melonjs.mjs/renderable/sprite.js +654 -0
- package/dist/melonjs.mjs/renderable/trigger.js +157 -0
- package/dist/melonjs.mjs/renderable/ui/uibaseelement.js +213 -0
- package/dist/melonjs.mjs/renderable/ui/uispriteelement.js +226 -0
- package/dist/melonjs.mjs/renderable/ui/uitextbutton.js +128 -0
- package/dist/melonjs.mjs/state/stage.js +237 -0
- package/dist/melonjs.mjs/state/state.js +596 -0
- package/dist/melonjs.mjs/system/device.js +909 -0
- package/dist/melonjs.mjs/system/dom.js +78 -0
- package/dist/melonjs.mjs/system/event.js +537 -0
- package/dist/melonjs.mjs/system/platform.js +41 -0
- package/dist/melonjs.mjs/system/pooling.js +209 -0
- package/dist/melonjs.mjs/system/save.js +157 -0
- package/dist/melonjs.mjs/system/timer.js +286 -0
- package/dist/melonjs.mjs/text/bitmaptext.js +364 -0
- package/dist/melonjs.mjs/text/bitmaptextdata.js +199 -0
- package/dist/melonjs.mjs/text/glyph.js +66 -0
- package/dist/melonjs.mjs/text/text.js +453 -0
- package/dist/melonjs.mjs/text/textmetrics.js +176 -0
- package/dist/melonjs.mjs/text/textstyle.js +23 -0
- package/dist/melonjs.mjs/tweens/easing.js +336 -0
- package/dist/melonjs.mjs/tweens/interpolation.js +112 -0
- package/dist/melonjs.mjs/tweens/tween.js +480 -0
- package/dist/melonjs.mjs/utils/agent.js +76 -0
- package/dist/melonjs.mjs/utils/array.js +63 -0
- package/dist/melonjs.mjs/utils/file.js +42 -0
- package/dist/melonjs.mjs/utils/function.js +70 -0
- package/dist/melonjs.mjs/utils/string.js +82 -0
- package/dist/melonjs.mjs/utils/utils.js +173 -0
- package/dist/melonjs.mjs/video/canvas/canvas_renderer.js +807 -0
- package/dist/melonjs.mjs/video/renderer.js +411 -0
- package/dist/melonjs.mjs/video/texture/atlas.js +519 -0
- package/dist/melonjs.mjs/video/texture/cache.js +143 -0
- package/dist/melonjs.mjs/video/texture/canvas_texture.js +144 -0
- package/dist/melonjs.mjs/video/video.js +462 -0
- package/dist/melonjs.mjs/video/webgl/buffer/vertex.js +143 -0
- package/dist/melonjs.mjs/video/webgl/glshader.js +168 -0
- package/dist/melonjs.mjs/video/webgl/shaders/primitive.frag.js +10 -0
- package/dist/melonjs.mjs/video/webgl/shaders/primitive.vert.js +10 -0
- package/dist/melonjs.mjs/video/webgl/shaders/quad.frag.js +10 -0
- package/dist/melonjs.mjs/video/webgl/shaders/quad.vert.js +10 -0
- package/dist/melonjs.mjs/video/webgl/utils/attributes.js +25 -0
- package/dist/melonjs.mjs/video/webgl/utils/precision.js +20 -0
- package/dist/melonjs.mjs/video/webgl/utils/program.js +67 -0
- package/dist/melonjs.mjs/video/webgl/utils/string.js +25 -0
- package/dist/melonjs.mjs/video/webgl/utils/uniforms.js +92 -0
- package/dist/melonjs.mjs/video/webgl/webgl_compositor.js +495 -0
- package/dist/melonjs.mjs/video/webgl/webgl_renderer.js +1036 -0
- package/dist/melonjs.module.d.ts +1163 -1163
- package/dist/melonjs.module.js +1903 -3274
- package/package.json +22 -17
- package/src/application/application.js +3 -3
- package/src/audio/audio.js +32 -32
- package/src/camera/camera2d.js +31 -31
- package/src/entity/entity.js +17 -17
- package/src/geometries/ellipse.js +16 -16
- package/src/geometries/line.js +5 -5
- package/src/geometries/path2d.js +32 -32
- package/src/geometries/poly.js +15 -15
- package/src/geometries/rectangle.js +18 -18
- package/src/geometries/roundrect.js +8 -8
- package/src/input/gamepad.js +15 -15
- package/src/input/keyboard.js +12 -12
- package/src/input/pointer.js +6 -6
- package/src/input/pointerevent.js +12 -12
- package/src/lang/deprecated.js +12 -12
- package/src/level/level.js +25 -25
- package/src/level/tiled/TMXLayer.js +22 -22
- package/src/level/tiled/TMXTile.js +5 -5
- package/src/level/tiled/TMXTileMap.js +6 -6
- package/src/level/tiled/TMXTileset.js +2 -2
- package/src/level/tiled/TMXUtils.js +5 -5
- package/src/level/tiled/renderer/TMXHexagonalRenderer.js +2 -2
- package/src/level/tiled/renderer/TMXIsometricRenderer.js +2 -2
- package/src/level/tiled/renderer/TMXOrthogonalRenderer.js +1 -1
- package/src/level/tiled/renderer/TMXRenderer.js +19 -19
- package/src/loader/loader.js +20 -20
- package/src/math/color.js +20 -20
- package/src/math/math.js +16 -16
- package/src/math/matrix2.js +16 -16
- package/src/math/matrix3.js +25 -25
- package/src/math/observable_vector2.js +14 -14
- package/src/math/observable_vector3.js +16 -16
- package/src/math/vector2.js +9 -9
- package/src/math/vector3.js +10 -10
- package/src/particles/emitter.js +6 -6
- package/src/particles/particle.js +2 -2
- package/src/physics/body.js +28 -28
- package/src/physics/bounds.js +8 -8
- package/src/physics/collision.js +2 -2
- package/src/physics/detector.js +6 -6
- package/src/physics/quadtree.js +11 -11
- package/src/physics/sat.js +31 -31
- package/src/physics/world.js +5 -5
- package/src/plugin/plugin.js +5 -5
- package/src/renderable/collectable.js +3 -3
- package/src/renderable/colorlayer.js +5 -5
- package/src/renderable/container.js +21 -21
- package/src/renderable/dragndrop.js +14 -14
- package/src/renderable/imagelayer.js +13 -13
- package/src/renderable/light2d.js +3 -3
- package/src/renderable/nineslicesprite.js +16 -16
- package/src/renderable/renderable.js +23 -23
- package/src/renderable/sprite.js +28 -28
- package/src/renderable/trigger.js +15 -15
- package/src/renderable/ui/uibaseelement.js +7 -7
- package/src/renderable/ui/uispriteelement.js +6 -6
- package/src/renderable/ui/uitextbutton.js +13 -13
- package/src/state/stage.js +7 -7
- package/src/state/state.js +17 -17
- package/src/system/device.js +11 -11
- package/src/system/event.js +10 -10
- package/src/system/pooling.js +9 -9
- package/src/system/save.js +2 -2
- package/src/system/timer.js +10 -10
- package/src/text/bitmaptext.js +18 -18
- package/src/text/bitmaptextdata.js +2 -2
- package/src/text/text.js +23 -23
- package/src/text/textmetrics.js +8 -8
- package/src/tweens/tween.js +19 -19
- package/src/utils/agent.js +5 -5
- package/src/utils/array.js +4 -4
- package/src/utils/file.js +2 -2
- package/src/utils/function.js +6 -6
- package/src/utils/string.js +5 -5
- package/src/utils/utils.js +4 -4
- package/src/video/canvas/canvas_renderer.js +70 -70
- package/src/video/renderer.js +26 -26
- package/src/video/texture/atlas.js +22 -22
- package/src/video/texture/canvas_texture.js +9 -9
- package/src/video/video.js +17 -17
- package/src/video/webgl/glshader.js +10 -10
- package/src/video/webgl/webgl_compositor.js +41 -41
- package/src/video/webgl/webgl_renderer.js +75 -75
package/src/geometries/path2d.js
CHANGED
|
@@ -92,8 +92,8 @@ class Path2D {
|
|
|
92
92
|
* moves the starting point of the current path to the (x, y) coordinates.
|
|
93
93
|
* @name moveTo
|
|
94
94
|
* @memberof Path2D
|
|
95
|
-
* @param {number} x the x-axis (horizontal) coordinate of the point.
|
|
96
|
-
* @param {number} y the y-axis (vertical) coordinate of the point.
|
|
95
|
+
* @param {number} x - the x-axis (horizontal) coordinate of the point.
|
|
96
|
+
* @param {number} y - the y-axis (vertical) coordinate of the point.
|
|
97
97
|
*/
|
|
98
98
|
moveTo(x, y) {
|
|
99
99
|
this.points.push(pool.pull("Vector2d", x, y));
|
|
@@ -103,8 +103,8 @@ class Path2D {
|
|
|
103
103
|
* connects the last point in the current patch to the (x, y) coordinates with a straight line.
|
|
104
104
|
* @name lineTo
|
|
105
105
|
* @memberof Path2D
|
|
106
|
-
* @param {number} x the x-axis coordinate of the line's end point.
|
|
107
|
-
* @param {number} y the y-axis coordinate of the line's end point.
|
|
106
|
+
* @param {number} x - the x-axis coordinate of the line's end point.
|
|
107
|
+
* @param {number} y - the y-axis coordinate of the line's end point.
|
|
108
108
|
*/
|
|
109
109
|
lineTo(x, y) {
|
|
110
110
|
this.points.push(pool.pull("Vector2d", x, y));
|
|
@@ -115,12 +115,12 @@ class Path2D {
|
|
|
115
115
|
* starting at startAngle and ending at endAngle going in the given direction by counterclockwise (defaulting to clockwise).
|
|
116
116
|
* @name arc
|
|
117
117
|
* @memberof Path2D
|
|
118
|
-
* @param {number} x the horizontal coordinate of the arc's center.
|
|
119
|
-
* @param {number} y the vertical coordinate of the arc's center.
|
|
120
|
-
* @param {number} radius the arc's radius. Must be positive.
|
|
121
|
-
* @param {number} startAngle the angle at which the arc starts in radians, measured from the positive x-axis.
|
|
122
|
-
* @param {number} endAngle the angle at which the arc ends in radians, measured from the positive x-axis.
|
|
123
|
-
* @param {boolean} [anticlockwise=false] an optional boolean value. If true, draws the arc counter-clockwise between the start and end angles.
|
|
118
|
+
* @param {number} x - the horizontal coordinate of the arc's center.
|
|
119
|
+
* @param {number} y - the vertical coordinate of the arc's center.
|
|
120
|
+
* @param {number} radius - the arc's radius. Must be positive.
|
|
121
|
+
* @param {number} startAngle - the angle at which the arc starts in radians, measured from the positive x-axis.
|
|
122
|
+
* @param {number} endAngle - the angle at which the arc ends in radians, measured from the positive x-axis.
|
|
123
|
+
* @param {boolean} [anticlockwise=false] - an optional boolean value. If true, draws the arc counter-clockwise between the start and end angles.
|
|
124
124
|
*/
|
|
125
125
|
arc(x, y, radius, startAngle, endAngle, anticlockwise = false) {
|
|
126
126
|
var points = this.points;
|
|
@@ -164,11 +164,11 @@ class Path2D {
|
|
|
164
164
|
* adds a circular arc to the path with the given control points and radius, connected to the previous point by a straight line.
|
|
165
165
|
* @name arcTo
|
|
166
166
|
* @memberof Path2D
|
|
167
|
-
* @param {number} x1 the x-axis coordinate of the first control point.
|
|
168
|
-
* @param {number} y1 the y-axis coordinate of the first control point.
|
|
169
|
-
* @param {number} x2 the x-axis coordinate of the second control point.
|
|
170
|
-
* @param {number} y2 the y-axis coordinate of the second control point.
|
|
171
|
-
* @param {number} radius the arc's radius. Must be positive.
|
|
167
|
+
* @param {number} x1 - the x-axis coordinate of the first control point.
|
|
168
|
+
* @param {number} y1 - the y-axis coordinate of the first control point.
|
|
169
|
+
* @param {number} x2 - the x-axis coordinate of the second control point.
|
|
170
|
+
* @param {number} y2 - the y-axis coordinate of the second control point.
|
|
171
|
+
* @param {number} radius - the arc's radius. Must be positive.
|
|
172
172
|
*/
|
|
173
173
|
arcTo(x1, y1, x2, y2, radius) {
|
|
174
174
|
var points = this.points;
|
|
@@ -212,14 +212,14 @@ class Path2D {
|
|
|
212
212
|
* starting at startAngle and ending at endAngle going in the given direction by counterclockwise.
|
|
213
213
|
* @name ellipse
|
|
214
214
|
* @memberof Path2D
|
|
215
|
-
* @param {number} x the x-axis (horizontal) coordinate of the ellipse's center.
|
|
216
|
-
* @param {number} y the y-axis (vertical) coordinate of the ellipse's center.
|
|
217
|
-
* @param {number} radiusX the ellipse's major-axis radius. Must be non-negative.
|
|
218
|
-
* @param {number} radiusY the ellipse's minor-axis radius. Must be non-negative.
|
|
219
|
-
* @param {number} rotation the rotation of the ellipse, expressed in radians.
|
|
220
|
-
* @param {number} startAngle the angle at which the ellipse starts, measured clockwise from the positive x-axis and expressed in radians.
|
|
221
|
-
* @param {number} endAngle the angle at which the ellipse ends, measured clockwise from the positive x-axis and expressed in radians.
|
|
222
|
-
* @param {boolean} [anticlockwise=false] an optional boolean value which, if true, draws the ellipse counterclockwise (anticlockwise).
|
|
215
|
+
* @param {number} x - the x-axis (horizontal) coordinate of the ellipse's center.
|
|
216
|
+
* @param {number} y - the y-axis (vertical) coordinate of the ellipse's center.
|
|
217
|
+
* @param {number} radiusX - the ellipse's major-axis radius. Must be non-negative.
|
|
218
|
+
* @param {number} radiusY - the ellipse's minor-axis radius. Must be non-negative.
|
|
219
|
+
* @param {number} rotation - the rotation of the ellipse, expressed in radians.
|
|
220
|
+
* @param {number} startAngle - the angle at which the ellipse starts, measured clockwise from the positive x-axis and expressed in radians.
|
|
221
|
+
* @param {number} endAngle - the angle at which the ellipse ends, measured clockwise from the positive x-axis and expressed in radians.
|
|
222
|
+
* @param {boolean} [anticlockwise=false] - an optional boolean value which, if true, draws the ellipse counterclockwise (anticlockwise).
|
|
223
223
|
*/
|
|
224
224
|
ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise = false) {
|
|
225
225
|
var points = this.points;
|
|
@@ -271,10 +271,10 @@ class Path2D {
|
|
|
271
271
|
* creates a path for a rectangle at position (x, y) with a size that is determined by width and height.
|
|
272
272
|
* @name rect
|
|
273
273
|
* @memberof Path2D
|
|
274
|
-
* @param {number} x the x-axis coordinate of the rectangle's starting point.
|
|
275
|
-
* @param {number} y the y-axis coordinate of the rectangle's starting point.
|
|
276
|
-
* @param {number} width the rectangle's width. Positive values are to the right, and negative to the left.
|
|
277
|
-
* @param {number} height the rectangle's height. Positive values are down, and negative are up.
|
|
274
|
+
* @param {number} x - the x-axis coordinate of the rectangle's starting point.
|
|
275
|
+
* @param {number} y - the y-axis coordinate of the rectangle's starting point.
|
|
276
|
+
* @param {number} width - the rectangle's width. Positive values are to the right, and negative to the left.
|
|
277
|
+
* @param {number} height - the rectangle's height. Positive values are down, and negative are up.
|
|
278
278
|
*/
|
|
279
279
|
rect(x, y, width, height) {
|
|
280
280
|
this.moveTo(x, y);
|
|
@@ -288,11 +288,11 @@ class Path2D {
|
|
|
288
288
|
* adds an rounded rectangle to the current path.
|
|
289
289
|
* @name roundRect
|
|
290
290
|
* @memberof Path2D
|
|
291
|
-
* @param {number} x the x-axis coordinate of the rectangle's starting point.
|
|
292
|
-
* @param {number} y the y-axis coordinate of the rectangle's starting point.
|
|
293
|
-
* @param {number} width the rectangle's width. Positive values are to the right, and negative to the left.
|
|
294
|
-
* @param {number} height the rectangle's height. Positive values are down, and negative are up.
|
|
295
|
-
* @param {number} radius the arc's radius to draw the borders. Must be positive.
|
|
291
|
+
* @param {number} x - the x-axis coordinate of the rectangle's starting point.
|
|
292
|
+
* @param {number} y - the y-axis coordinate of the rectangle's starting point.
|
|
293
|
+
* @param {number} width - the rectangle's width. Positive values are to the right, and negative to the left.
|
|
294
|
+
* @param {number} height - the rectangle's height. Positive values are down, and negative are up.
|
|
295
|
+
* @param {number} radius - the arc's radius to draw the borders. Must be positive.
|
|
296
296
|
*/
|
|
297
297
|
roundRect(x, y, width, height, radius) {
|
|
298
298
|
this.moveTo(x + radius, y);
|
package/src/geometries/poly.js
CHANGED
|
@@ -14,9 +14,9 @@ import pool from "./../system/pooling.js";
|
|
|
14
14
|
*/
|
|
15
15
|
class Polygon {
|
|
16
16
|
/**
|
|
17
|
-
* @param {number} x origin point of the Polygon
|
|
18
|
-
* @param {number} y origin point of the Polygon
|
|
19
|
-
* @param {Vector2d[]} points array of vector defining the Polygon
|
|
17
|
+
* @param {number} x - origin point of the Polygon
|
|
18
|
+
* @param {number} y - origin point of the Polygon
|
|
19
|
+
* @param {Vector2d[]} points - array of vector defining the Polygon
|
|
20
20
|
*/
|
|
21
21
|
constructor(x, y, points) {
|
|
22
22
|
/**
|
|
@@ -83,9 +83,9 @@ class Polygon {
|
|
|
83
83
|
* set new value to the Polygon
|
|
84
84
|
* @name setShape
|
|
85
85
|
* @memberof Polygon
|
|
86
|
-
* @param {number} x position of the Polygon
|
|
87
|
-
* @param {number} y position of the Polygon
|
|
88
|
-
* @param {Vector2d[]|number[]} points array of vector or vertice defining the Polygon
|
|
86
|
+
* @param {number} x - position of the Polygon
|
|
87
|
+
* @param {number} y - position of the Polygon
|
|
88
|
+
* @param {Vector2d[]|number[]} points - array of vector or vertice defining the Polygon
|
|
89
89
|
* @returns {Polygon} this instance for objecf chaining
|
|
90
90
|
*/
|
|
91
91
|
setShape(x, y, points) {
|
|
@@ -98,7 +98,7 @@ class Polygon {
|
|
|
98
98
|
* set the vertices defining this Polygon
|
|
99
99
|
* @name setVertices
|
|
100
100
|
* @memberof Polygon
|
|
101
|
-
* @param {Vector2d[]} vertices array of vector or vertice defining the Polygon
|
|
101
|
+
* @param {Vector2d[]} vertices - array of vector or vertice defining the Polygon
|
|
102
102
|
* @returns {Polygon} this instance for objecf chaining
|
|
103
103
|
*/
|
|
104
104
|
setVertices(vertices) {
|
|
@@ -137,7 +137,7 @@ class Polygon {
|
|
|
137
137
|
* apply the given transformation matrix to this Polygon
|
|
138
138
|
* @name transform
|
|
139
139
|
* @memberof Polygon
|
|
140
|
-
* @param {Matrix2d} m the transformation matrix
|
|
140
|
+
* @param {Matrix2d} m - the transformation matrix
|
|
141
141
|
* @returns {Polygon} Reference to this object for method chaining
|
|
142
142
|
*/
|
|
143
143
|
transform(m) {
|
|
@@ -175,8 +175,8 @@ class Polygon {
|
|
|
175
175
|
* Rotate this Polygon (counter-clockwise) by the specified angle (in radians).
|
|
176
176
|
* @name rotate
|
|
177
177
|
* @memberof Polygon
|
|
178
|
-
* @param {number} angle The angle to rotate (in radians)
|
|
179
|
-
* @param {Vector2d|ObservableVector2d} [v] an optional point to rotate around
|
|
178
|
+
* @param {number} angle - The angle to rotate (in radians)
|
|
179
|
+
* @param {Vector2d|ObservableVector2d} [v] - an optional point to rotate around
|
|
180
180
|
* @returns {Polygon} Reference to this object for method chaining
|
|
181
181
|
*/
|
|
182
182
|
rotate(angle, v) {
|
|
@@ -332,15 +332,15 @@ class Polygon {
|
|
|
332
332
|
* @name translate
|
|
333
333
|
* @memberof Polygon
|
|
334
334
|
* @method
|
|
335
|
-
* @param {number} x x offset
|
|
336
|
-
* @param {number} y y offset
|
|
335
|
+
* @param {number} x - x offset
|
|
336
|
+
* @param {number} y - y offset
|
|
337
337
|
* @returns {Polygon} this Polygon
|
|
338
338
|
*/
|
|
339
339
|
/**
|
|
340
340
|
* translate the Polygon by the specified vector
|
|
341
341
|
* @name translate
|
|
342
342
|
* @memberof Polygon
|
|
343
|
-
* @param {Vector2d} v vector offset
|
|
343
|
+
* @param {Vector2d} v - vector offset
|
|
344
344
|
* @returns {Polygon} Reference to this object for method chaining
|
|
345
345
|
*/
|
|
346
346
|
translate() {
|
|
@@ -410,8 +410,8 @@ class Polygon {
|
|
|
410
410
|
* bounding rect, as the function can be highly consuming with complex shapes)
|
|
411
411
|
* @name contains
|
|
412
412
|
* @memberof Polygon
|
|
413
|
-
* @param {number} x x coordinate
|
|
414
|
-
* @param {number} y y coordinate
|
|
413
|
+
* @param {number} x - x coordinate
|
|
414
|
+
* @param {number} y - y coordinate
|
|
415
415
|
* @returns {boolean} true if contains
|
|
416
416
|
*/
|
|
417
417
|
contains() {
|
|
@@ -8,10 +8,10 @@ import Polygon from "./poly.js";
|
|
|
8
8
|
*/
|
|
9
9
|
class Rect extends Polygon {
|
|
10
10
|
/**
|
|
11
|
-
* @param {number} x position of the Rectangle
|
|
12
|
-
* @param {number} y position of the Rectangle
|
|
13
|
-
* @param {number} w width of the rectangle
|
|
14
|
-
* @param {number} h height of the rectangle
|
|
11
|
+
* @param {number} x - position of the Rectangle
|
|
12
|
+
* @param {number} y - position of the Rectangle
|
|
13
|
+
* @param {number} w - width of the rectangle
|
|
14
|
+
* @param {number} h - height of the rectangle
|
|
15
15
|
*/
|
|
16
16
|
constructor(x, y, w, h) {
|
|
17
17
|
// parent constructor
|
|
@@ -33,10 +33,10 @@ class Rect extends Polygon {
|
|
|
33
33
|
* set new value to the rectangle shape
|
|
34
34
|
* @name setShape
|
|
35
35
|
* @memberof Rect
|
|
36
|
-
* @param {number} x position of the Rectangle
|
|
37
|
-
* @param {number} y position of the Rectangle
|
|
38
|
-
* @param {number|Vector2d[]} w width of the rectangle, or an array of vector defining the rectangle
|
|
39
|
-
* @param {number} [h] height of the rectangle, if a numeral width parameter is specified
|
|
36
|
+
* @param {number} x - position of the Rectangle
|
|
37
|
+
* @param {number} y - position of the Rectangle
|
|
38
|
+
* @param {number|Vector2d[]} w - width of the rectangle, or an array of vector defining the rectangle
|
|
39
|
+
* @param {number} [h] - height of the rectangle, if a numeral width parameter is specified
|
|
40
40
|
* @returns {Rect} this rectangle
|
|
41
41
|
*/
|
|
42
42
|
setShape(x, y, w, h) {
|
|
@@ -175,8 +175,8 @@ class Rect extends Polygon {
|
|
|
175
175
|
* center the rectangle position around the given coordinates
|
|
176
176
|
* @name centerOn
|
|
177
177
|
* @memberof Rect
|
|
178
|
-
* @param {number} x the x coordinate around which to center this rectangle
|
|
179
|
-
* @param {number} y the y coordinate around which to center this rectangle
|
|
178
|
+
* @param {number} x - the x coordinate around which to center this rectangle
|
|
179
|
+
* @param {number} y - the y coordinate around which to center this rectangle
|
|
180
180
|
* @returns {Rect} this rectangle
|
|
181
181
|
*/
|
|
182
182
|
centerOn(x, y) {
|
|
@@ -189,8 +189,8 @@ class Rect extends Polygon {
|
|
|
189
189
|
* resize the rectangle
|
|
190
190
|
* @name resize
|
|
191
191
|
* @memberof Rect
|
|
192
|
-
* @param {number} w new width of the rectangle
|
|
193
|
-
* @param {number} h new height of the rectangle
|
|
192
|
+
* @param {number} w - new width of the rectangle
|
|
193
|
+
* @param {number} h - new height of the rectangle
|
|
194
194
|
* @returns {Rect} this rectangle
|
|
195
195
|
*/
|
|
196
196
|
resize(w, h) {
|
|
@@ -203,8 +203,8 @@ class Rect extends Polygon {
|
|
|
203
203
|
* scale the rectangle
|
|
204
204
|
* @name scale
|
|
205
205
|
* @memberof Rect
|
|
206
|
-
* @param {number} x a number representing the abscissa of the scaling vector.
|
|
207
|
-
* @param {number} [y=x] a number representing the ordinate of the scaling vector.
|
|
206
|
+
* @param {number} x - a number representing the abscissa of the scaling vector.
|
|
207
|
+
* @param {number} [y=x] - a number representing the ordinate of the scaling vector.
|
|
208
208
|
* @returns {Rect} this rectangle
|
|
209
209
|
*/
|
|
210
210
|
scale(x, y = x) {
|
|
@@ -227,7 +227,7 @@ class Rect extends Polygon {
|
|
|
227
227
|
* copy the position and size of the given rectangle into this one
|
|
228
228
|
* @name copy
|
|
229
229
|
* @memberof Rect
|
|
230
|
-
* @param {Rect} rect Source rectangle
|
|
230
|
+
* @param {Rect} rect - Source rectangle
|
|
231
231
|
* @returns {Rect} new rectangle
|
|
232
232
|
*/
|
|
233
233
|
copy(rect) {
|
|
@@ -238,7 +238,7 @@ class Rect extends Polygon {
|
|
|
238
238
|
* merge this rectangle with another one
|
|
239
239
|
* @name union
|
|
240
240
|
* @memberof Rect
|
|
241
|
-
* @param {Rect} rect other rectangle to union with
|
|
241
|
+
* @param {Rect} rect - other rectangle to union with
|
|
242
242
|
* @returns {Rect} the union(ed) rectangle
|
|
243
243
|
*/
|
|
244
244
|
union(rect) {
|
|
@@ -285,8 +285,8 @@ class Rect extends Polygon {
|
|
|
285
285
|
* @name contains
|
|
286
286
|
* @memberof Rect
|
|
287
287
|
* @method
|
|
288
|
-
* @param {number} x x coordinate
|
|
289
|
-
* @param {number} y y coordinate
|
|
288
|
+
* @param {number} x - x coordinate
|
|
289
|
+
* @param {number} y - y coordinate
|
|
290
290
|
* @returns {boolean} true if contains
|
|
291
291
|
*/
|
|
292
292
|
|
|
@@ -9,11 +9,11 @@ import Rect from "./rectangle.js";
|
|
|
9
9
|
*/
|
|
10
10
|
class RoundRect extends Rect {
|
|
11
11
|
/**
|
|
12
|
-
* @param {number} x position of the rounded rectangle
|
|
13
|
-
* @param {number} y position of the rounded rectangle
|
|
14
|
-
* @param {number} width the rectangle width
|
|
15
|
-
* @param {number} height the rectangle height
|
|
16
|
-
* @param {number} [radius=20] the radius of the rounded corner
|
|
12
|
+
* @param {number} x - position of the rounded rectangle
|
|
13
|
+
* @param {number} y - position of the rounded rectangle
|
|
14
|
+
* @param {number} width - the rectangle width
|
|
15
|
+
* @param {number} height - the rectangle height
|
|
16
|
+
* @param {number} [radius=20] - the radius of the rounded corner
|
|
17
17
|
*/
|
|
18
18
|
constructor(x, y, width, height, radius = 20) {
|
|
19
19
|
// parent constructor
|
|
@@ -56,7 +56,7 @@ class RoundRect extends Rect {
|
|
|
56
56
|
* copy the position, size and radius of the given rounded rectangle into this one
|
|
57
57
|
* @name copy
|
|
58
58
|
* @memberof RoundRect
|
|
59
|
-
* @param {RoundRect} rrect source rounded rectangle
|
|
59
|
+
* @param {RoundRect} rrect - source rounded rectangle
|
|
60
60
|
* @returns {RoundRect} new rectangle
|
|
61
61
|
*/
|
|
62
62
|
copy(rrect) {
|
|
@@ -70,8 +70,8 @@ class RoundRect extends Rect {
|
|
|
70
70
|
* @name contains
|
|
71
71
|
* @memberof RoundRect
|
|
72
72
|
* @method
|
|
73
|
-
* @param {number} x x coordinate
|
|
74
|
-
* @param {number} y y coordinate
|
|
73
|
+
* @param {number} x - x coordinate
|
|
74
|
+
* @param {number} y - y coordinate
|
|
75
75
|
* @returns {boolean} true if contains
|
|
76
76
|
*/
|
|
77
77
|
|
package/src/input/gamepad.js
CHANGED
|
@@ -355,12 +355,12 @@ export var GAMEPAD = {
|
|
|
355
355
|
* @name bindGamepad
|
|
356
356
|
* @memberof input
|
|
357
357
|
* @public
|
|
358
|
-
* @param {number} index Gamepad index
|
|
359
|
-
* @param {object} button Button/Axis definition
|
|
360
|
-
* @param {string} button.type "buttons" or "axes"
|
|
361
|
-
* @param {number} button.code button or axis code id (See {@link input.GAMEPAD.BUTTONS}, {@link input.GAMEPAD.AXES})
|
|
362
|
-
* @param {number} [button.threshold=1] value indicating when the axis should trigger the keycode (e.g. -0.5 or 0.5)
|
|
363
|
-
* @param {number} keyCode (See {@link input.KEY})
|
|
358
|
+
* @param {number} index - Gamepad index
|
|
359
|
+
* @param {object} button - Button/Axis definition
|
|
360
|
+
* @param {string} button.type - "buttons" or "axes"
|
|
361
|
+
* @param {number} button.code - button or axis code id (See {@link input.GAMEPAD.BUTTONS}, {@link input.GAMEPAD.AXES})
|
|
362
|
+
* @param {number} [button.threshold=1] - value indicating when the axis should trigger the keycode (e.g. -0.5 or 0.5)
|
|
363
|
+
* @param {number} keyCode - (See {@link input.KEY})
|
|
364
364
|
* @example
|
|
365
365
|
* // enable the keyboard
|
|
366
366
|
* me.input.bindKey(me.input.KEY.X, "shoot");
|
|
@@ -429,8 +429,8 @@ export function bindGamepad(index, button, keyCode) {
|
|
|
429
429
|
* @name unbindGamepad
|
|
430
430
|
* @memberof input
|
|
431
431
|
* @public
|
|
432
|
-
* @param {number} index Gamepad index
|
|
433
|
-
* @param {number} button (See {@link input.GAMEPAD.BUTTONS})
|
|
432
|
+
* @param {number} index - Gamepad index
|
|
433
|
+
* @param {number} button - (See {@link input.GAMEPAD.BUTTONS})
|
|
434
434
|
* @example
|
|
435
435
|
* me.input.unbindGamepad(0, me.input.GAMEPAD.BUTTONS.FACE_1);
|
|
436
436
|
*/
|
|
@@ -447,7 +447,7 @@ export function unbindGamepad(index, button) {
|
|
|
447
447
|
* @name setGamepadDeadzone
|
|
448
448
|
* @memberof input
|
|
449
449
|
* @public
|
|
450
|
-
* @param {number} value Deadzone value
|
|
450
|
+
* @param {number} value - Deadzone value
|
|
451
451
|
*/
|
|
452
452
|
export function setGamepadDeadzone(value) {
|
|
453
453
|
deadzone = value;
|
|
@@ -460,12 +460,12 @@ export function setGamepadDeadzone(value) {
|
|
|
460
460
|
* @name setGamepadMapping
|
|
461
461
|
* @memberof input
|
|
462
462
|
* @public
|
|
463
|
-
* @param {string} id Gamepad id string
|
|
464
|
-
* @param {object} mapping A hash table
|
|
465
|
-
* @param {number[]} mapping.axes Standard analog control stick axis locations
|
|
466
|
-
* @param {number[]} mapping.buttons Standard digital button locations
|
|
467
|
-
* @param {number[]} [mapping.analog] Analog axis locations for buttons
|
|
468
|
-
* @param {Function} [mapping.normalize_fn] a function that returns a normalized value in range [-1.0..1.0] for the given value, axis and button
|
|
463
|
+
* @param {string} id - Gamepad id string
|
|
464
|
+
* @param {object} mapping - A hash table
|
|
465
|
+
* @param {number[]} mapping.axes - Standard analog control stick axis locations
|
|
466
|
+
* @param {number[]} mapping.buttons - Standard digital button locations
|
|
467
|
+
* @param {number[]} [mapping.analog] - Analog axis locations for buttons
|
|
468
|
+
* @param {Function} [mapping.normalize_fn] - a function that returns a normalized value in range [-1.0..1.0] for the given value, axis and button
|
|
469
469
|
* @example
|
|
470
470
|
* // A weird controller that has its axis mappings reversed
|
|
471
471
|
* me.input.setGamepadMapping("Generic USB Controller", {
|
package/src/input/keyboard.js
CHANGED
|
@@ -331,7 +331,7 @@ export function initKeyboardEvent() {
|
|
|
331
331
|
* @name isKeyPressed
|
|
332
332
|
* @memberof input
|
|
333
333
|
* @public
|
|
334
|
-
* @param {string} action user defined corresponding action
|
|
334
|
+
* @param {string} action - user defined corresponding action
|
|
335
335
|
* @returns {boolean} true if pressed
|
|
336
336
|
* @example
|
|
337
337
|
* if (me.input.isKeyPressed('left')) {
|
|
@@ -356,7 +356,7 @@ export function isKeyPressed(action) {
|
|
|
356
356
|
* @name keyStatus
|
|
357
357
|
* @memberof input
|
|
358
358
|
* @public
|
|
359
|
-
* @param {string} action user defined corresponding action
|
|
359
|
+
* @param {string} action - user defined corresponding action
|
|
360
360
|
* @returns {boolean} down (true) or up(false)
|
|
361
361
|
*/
|
|
362
362
|
export function keyStatus(action) {
|
|
@@ -369,9 +369,9 @@ export function keyStatus(action) {
|
|
|
369
369
|
* @name triggerKeyEvent
|
|
370
370
|
* @memberof input
|
|
371
371
|
* @public
|
|
372
|
-
* @param {number} keycode (See {@link input.KEY})
|
|
373
|
-
* @param {boolean} [status=false] true to trigger a key down event, or false for key up event
|
|
374
|
-
* @param {number} [mouseButton] the mouse button to trigger
|
|
372
|
+
* @param {number} keycode - (See {@link input.KEY})
|
|
373
|
+
* @param {boolean} [status=false] - true to trigger a key down event, or false for key up event
|
|
374
|
+
* @param {number} [mouseButton] - the mouse button to trigger
|
|
375
375
|
* @example
|
|
376
376
|
* // trigger a key press
|
|
377
377
|
* me.input.triggerKeyEvent(me.input.KEY.LEFT, true);
|
|
@@ -391,10 +391,10 @@ export function triggerKeyEvent(keycode, status, mouseButton) {
|
|
|
391
391
|
* @name bindKey
|
|
392
392
|
* @memberof input
|
|
393
393
|
* @public
|
|
394
|
-
* @param {number} keycode (See {@link input.KEY})
|
|
395
|
-
* @param {string} action user defined corresponding action
|
|
396
|
-
* @param {boolean} [lock=false] cancel the keypress event once read
|
|
397
|
-
* @param {boolean} [preventDefault=input.preventDefault] prevent default browser action
|
|
394
|
+
* @param {number} keycode - (See {@link input.KEY})
|
|
395
|
+
* @param {string} action - user defined corresponding action
|
|
396
|
+
* @param {boolean} [lock=false] - cancel the keypress event once read
|
|
397
|
+
* @param {boolean} [preventDefault=input.preventDefault] - prevent default browser action
|
|
398
398
|
* @example
|
|
399
399
|
* // enable the keyboard
|
|
400
400
|
* me.input.bindKey(me.input.KEY.LEFT, "left");
|
|
@@ -417,7 +417,7 @@ export function bindKey(keycode, action, lock, preventDefault = preventDefaultAc
|
|
|
417
417
|
* @name getBindingKey
|
|
418
418
|
* @memberof input
|
|
419
419
|
* @public
|
|
420
|
-
* @param {number} keycode (See {@link input.KEY})
|
|
420
|
+
* @param {number} keycode - (See {@link input.KEY})
|
|
421
421
|
* @returns {string} user defined associated action
|
|
422
422
|
*/
|
|
423
423
|
export function getBindingKey(keycode) {
|
|
@@ -429,7 +429,7 @@ export function getBindingKey(keycode) {
|
|
|
429
429
|
* @name unlockKey
|
|
430
430
|
* @memberof input
|
|
431
431
|
* @public
|
|
432
|
-
* @param {string} action user defined corresponding action
|
|
432
|
+
* @param {string} action - user defined corresponding action
|
|
433
433
|
* @example
|
|
434
434
|
* // Unlock jump when touching the ground
|
|
435
435
|
* if (!this.falling && !this.jumping) {
|
|
@@ -445,7 +445,7 @@ export function unlockKey(action) {
|
|
|
445
445
|
* @name unbindKey
|
|
446
446
|
* @memberof input
|
|
447
447
|
* @public
|
|
448
|
-
* @param {number} keycode (See {@link input.KEY})
|
|
448
|
+
* @param {number} keycode - (See {@link input.KEY})
|
|
449
449
|
* @example
|
|
450
450
|
* me.input.unbindKey(me.input.KEY.LEFT);
|
|
451
451
|
*/
|
package/src/input/pointer.js
CHANGED
|
@@ -310,12 +310,12 @@ class Pointer extends Bounds {
|
|
|
310
310
|
* initialize the Pointer object using the given Event Object
|
|
311
311
|
* @name Pointer#set
|
|
312
312
|
* @private
|
|
313
|
-
* @param {Event} event the original Event object
|
|
314
|
-
* @param {number} [pageX=0] the horizontal coordinate at which the event occurred, relative to the left edge of the entire document
|
|
315
|
-
* @param {number} [pageY=0] the vertical coordinate at which the event occurred, relative to the left edge of the entire document
|
|
316
|
-
* @param {number} [clientX=0] the horizontal coordinate within the application's client area at which the event occurred
|
|
317
|
-
* @param {number} [clientY=0] the vertical coordinate within the application's client area at which the event occurred
|
|
318
|
-
* @param {number} [pointerId=1] the Pointer, Touch or Mouse event Id (1)
|
|
313
|
+
* @param {Event} event - the original Event object
|
|
314
|
+
* @param {number} [pageX=0] - the horizontal coordinate at which the event occurred, relative to the left edge of the entire document
|
|
315
|
+
* @param {number} [pageY=0] - the vertical coordinate at which the event occurred, relative to the left edge of the entire document
|
|
316
|
+
* @param {number} [clientX=0] - the horizontal coordinate within the application's client area at which the event occurred
|
|
317
|
+
* @param {number} [clientY=0] - the vertical coordinate within the application's client area at which the event occurred
|
|
318
|
+
* @param {number} [pointerId=1] - the Pointer, Touch or Mouse event Id (1)
|
|
319
319
|
*/
|
|
320
320
|
setEvent(event, pageX = 0, pageY = 0, clientX = 0, clientY = 0, pointerId = 1) {
|
|
321
321
|
// the original event object
|
|
@@ -543,9 +543,9 @@ export var throttlingInterval;
|
|
|
543
543
|
* @name globalToLocal
|
|
544
544
|
* @memberof input
|
|
545
545
|
* @public
|
|
546
|
-
* @param {number} x the global x coordinate to be translated.
|
|
547
|
-
* @param {number} y the global y coordinate to be translated.
|
|
548
|
-
* @param {Vector2d} [v] an optional vector object where to set the translated coordinates
|
|
546
|
+
* @param {number} x - the global x coordinate to be translated.
|
|
547
|
+
* @param {number} y - the global y coordinate to be translated.
|
|
548
|
+
* @param {Vector2d} [v] - an optional vector object where to set the translated coordinates
|
|
549
549
|
* @returns {Vector2d} A vector object with the corresponding translated coordinates
|
|
550
550
|
* @example
|
|
551
551
|
* onMouseEvent : function (pointer) {
|
|
@@ -590,7 +590,7 @@ export function setTouchAction(element, value) {
|
|
|
590
590
|
* @name bindPointer
|
|
591
591
|
* @memberof input
|
|
592
592
|
* @public
|
|
593
|
-
* @param {number} [button=input.pointer.LEFT] (accordingly to W3C values : 0,1,2 for left, middle and right buttons)
|
|
593
|
+
* @param {number} [button=input.pointer.LEFT] - (accordingly to W3C values : 0,1,2 for left, middle and right buttons)
|
|
594
594
|
* @param {input.KEY} keyCode
|
|
595
595
|
* @example
|
|
596
596
|
* // enable the keyboard
|
|
@@ -620,7 +620,7 @@ export function bindPointer() {
|
|
|
620
620
|
* @name unbindPointer
|
|
621
621
|
* @memberof input
|
|
622
622
|
* @public
|
|
623
|
-
* @param {number} [button=input.pointer.LEFT] (accordingly to W3C values : 0,1,2 for left, middle and right buttons)
|
|
623
|
+
* @param {number} [button=input.pointer.LEFT] - (accordingly to W3C values : 0,1,2 for left, middle and right buttons)
|
|
624
624
|
* @example
|
|
625
625
|
* me.input.unbindPointer(me.input.pointer.LEFT);
|
|
626
626
|
*/
|
|
@@ -641,7 +641,7 @@ export function unbindPointer(button) {
|
|
|
641
641
|
* @name registerPointerEvent
|
|
642
642
|
* @memberof input
|
|
643
643
|
* @public
|
|
644
|
-
* @param {string} eventType The event type for which the object is registering <br>
|
|
644
|
+
* @param {string} eventType - The event type for which the object is registering <br>
|
|
645
645
|
* melonJS currently supports: <br>
|
|
646
646
|
* <ul>
|
|
647
647
|
* <li><code>"pointermove"</code></li>
|
|
@@ -653,8 +653,8 @@ export function unbindPointer(button) {
|
|
|
653
653
|
* <li><code>"pointercancel"</code></li>
|
|
654
654
|
* <li><code>"wheel"</code></li>
|
|
655
655
|
* </ul>
|
|
656
|
-
* @param {Rect|Polygon|Line|Ellipse} region a shape representing the region to register on
|
|
657
|
-
* @param {Function} callback methods to be called when the event occurs.
|
|
656
|
+
* @param {Rect|Polygon|Line|Ellipse} region - a shape representing the region to register on
|
|
657
|
+
* @param {Function} callback - methods to be called when the event occurs.
|
|
658
658
|
* Returning `false` from the defined callback will prevent the event to be propagated to other objects
|
|
659
659
|
* @example
|
|
660
660
|
* // onActivate function
|
|
@@ -712,9 +712,9 @@ export function registerPointerEvent(eventType, region, callback) {
|
|
|
712
712
|
* @name releasePointerEvent
|
|
713
713
|
* @memberof input
|
|
714
714
|
* @public
|
|
715
|
-
* @param {string} eventType The event type for which the object was registered. See {@link input.registerPointerEvent}
|
|
716
|
-
* @param {Rect|Polygon|Line|Ellipse} region the registered region to release for this event
|
|
717
|
-
* @param {Function} [callback="all"] if specified unregister the event only for the specific callback
|
|
715
|
+
* @param {string} eventType - The event type for which the object was registered. See {@link input.registerPointerEvent}
|
|
716
|
+
* @param {Rect|Polygon|Line|Ellipse} region - the registered region to release for this event
|
|
717
|
+
* @param {Function} [callback="all"] - if specified unregister the event only for the specific callback
|
|
718
718
|
* @example
|
|
719
719
|
* // release the registered region on the 'pointerdown' event
|
|
720
720
|
* me.input.releasePointerEvent('pointerdown', this);
|
|
@@ -756,7 +756,7 @@ export function releasePointerEvent(eventType, region, callback) {
|
|
|
756
756
|
* @name releaseAllPointerEvents
|
|
757
757
|
* @memberof input
|
|
758
758
|
* @public
|
|
759
|
-
* @param {Rect|Polygon|Line|Ellipse} region the registered region to release event from
|
|
759
|
+
* @param {Rect|Polygon|Line|Ellipse} region - the registered region to release event from
|
|
760
760
|
* @example
|
|
761
761
|
* // release all registered event on the
|
|
762
762
|
* me.input.releaseAllPointerEvents(this);
|
package/src/lang/deprecated.js
CHANGED
|
@@ -9,9 +9,9 @@ import UISpriteElement from "./../renderable/ui/uispriteelement.js";
|
|
|
9
9
|
/**
|
|
10
10
|
* display a deprecation warning in the console
|
|
11
11
|
* @ignore
|
|
12
|
-
* @param {string} deprecated deprecated class,function or property name
|
|
13
|
-
* @param {string} replacement the replacement class, function, or property name
|
|
14
|
-
* @param {string} version the version since when the lass,function or property is deprecated
|
|
12
|
+
* @param {string} deprecated - deprecated class,function or property name
|
|
13
|
+
* @param {string} replacement - the replacement class, function, or property name
|
|
14
|
+
* @param {string} version - the version since when the lass,function or property is deprecated
|
|
15
15
|
*/
|
|
16
16
|
export function warning(deprecated, replacement, version) {
|
|
17
17
|
var msg = "melonJS: %s is deprecated since version %s, please use %s";
|
|
@@ -71,9 +71,9 @@ Object.defineProperty(Renderer.prototype, "Texture", {
|
|
|
71
71
|
*/
|
|
72
72
|
export class DraggableEntity extends Draggable {
|
|
73
73
|
/**
|
|
74
|
-
* @param {number} x the x coordinates of the draggable object
|
|
75
|
-
* @param {number} y the y coordinates of the draggable object
|
|
76
|
-
* @param {object} settings Entity properties (see {@link Entity})
|
|
74
|
+
* @param {number} x - the x coordinates of the draggable object
|
|
75
|
+
* @param {number} y - the y coordinates of the draggable object
|
|
76
|
+
* @param {object} settings - Entity properties (see {@link Entity})
|
|
77
77
|
*/
|
|
78
78
|
constructor(x, y, settings) {
|
|
79
79
|
warning("DraggableEntity", "Draggable", "10.5.0");
|
|
@@ -90,9 +90,9 @@ export class DraggableEntity extends Draggable {
|
|
|
90
90
|
*/
|
|
91
91
|
export class DroptargetEntity extends DropTarget {
|
|
92
92
|
/**
|
|
93
|
-
* @param {number} x the x coordinates of the draggable object
|
|
94
|
-
* @param {number} y the y coordinates of the draggable object
|
|
95
|
-
* @param {object} settings Entity properties (see {@link Entity})
|
|
93
|
+
* @param {number} x - the x coordinates of the draggable object
|
|
94
|
+
* @param {number} y - the y coordinates of the draggable object
|
|
95
|
+
* @param {object} settings - Entity properties (see {@link Entity})
|
|
96
96
|
*/
|
|
97
97
|
constructor(x, y, settings) {
|
|
98
98
|
warning("DroptargetEntity", "DropTarget", "10.5.0");
|
|
@@ -136,9 +136,9 @@ Renderer.prototype.getScreenContext = function() {
|
|
|
136
136
|
*/
|
|
137
137
|
export class GUI_Object extends UISpriteElement {
|
|
138
138
|
/**
|
|
139
|
-
* @param {number} x the x coordinate of the GUI Object
|
|
140
|
-
* @param {number} y the y coordinate of the GUI Object
|
|
141
|
-
* @param {object} settings See {@link Sprite}
|
|
139
|
+
* @param {number} x - the x coordinate of the GUI Object
|
|
140
|
+
* @param {number} y - the y coordinate of the GUI Object
|
|
141
|
+
* @param {object} settings - See {@link Sprite}
|
|
142
142
|
*/
|
|
143
143
|
constructor(x, y, settings) {
|
|
144
144
|
warning("GUI_Object", "UISpriteElement", "14.0.0");
|