melonjs 14.0.2 → 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/text/text.js
CHANGED
|
@@ -38,21 +38,21 @@ var getContext2d = function (renderer, text) {
|
|
|
38
38
|
*/
|
|
39
39
|
class Text extends Renderable {
|
|
40
40
|
/**
|
|
41
|
-
* @param {number} x position of the text object
|
|
42
|
-
* @param {number} y position of the text object
|
|
43
|
-
* @param {object} settings the text configuration
|
|
44
|
-
* @param {string} settings.font a CSS family font name
|
|
45
|
-
* @param {number|string} settings.size size, or size + suffix (px, em, pt)
|
|
46
|
-
* @param {Color|string} [settings.fillStyle="#000000"] a CSS color value
|
|
47
|
-
* @param {Color|string} [settings.strokeStyle="#000000"] a CSS color value
|
|
48
|
-
* @param {number} [settings.lineWidth=1] line width, in pixels, when drawing stroke
|
|
49
|
-
* @param {string} [settings.textAlign="left"] horizontal text alignment
|
|
50
|
-
* @param {string} [settings.textBaseline="top"] the text baseline
|
|
51
|
-
* @param {number} [settings.lineHeight=1.0] line spacing height
|
|
52
|
-
* @param {Vector2d} [settings.anchorPoint={x:0.0, y:0.0}] anchor point to draw the text at
|
|
53
|
-
* @param {boolean} [settings.offScreenCanvas=false] whether to draw the font to an individual "cache" texture first
|
|
54
|
-
* @param {number} [settings.wordWrapWidth] the maximum length in CSS pixel for a single segment of text
|
|
55
|
-
* @param {(string|string[])} [settings.text=""] a string, or an array of strings
|
|
41
|
+
* @param {number} x - position of the text object
|
|
42
|
+
* @param {number} y - position of the text object
|
|
43
|
+
* @param {object} settings - the text configuration
|
|
44
|
+
* @param {string} settings.font - a CSS family font name
|
|
45
|
+
* @param {number|string} settings.size - size, or size + suffix (px, em, pt)
|
|
46
|
+
* @param {Color|string} [settings.fillStyle="#000000"] - a CSS color value
|
|
47
|
+
* @param {Color|string} [settings.strokeStyle="#000000"] - a CSS color value
|
|
48
|
+
* @param {number} [settings.lineWidth=1] - line width, in pixels, when drawing stroke
|
|
49
|
+
* @param {string} [settings.textAlign="left"] - horizontal text alignment
|
|
50
|
+
* @param {string} [settings.textBaseline="top"] - the text baseline
|
|
51
|
+
* @param {number} [settings.lineHeight=1.0] - line spacing height
|
|
52
|
+
* @param {Vector2d} [settings.anchorPoint={x:0.0, y:0.0}] - anchor point to draw the text at
|
|
53
|
+
* @param {boolean} [settings.offScreenCanvas=false] - whether to draw the font to an individual "cache" texture first
|
|
54
|
+
* @param {number} [settings.wordWrapWidth] - the maximum length in CSS pixel for a single segment of text
|
|
55
|
+
* @param {(string|string[])} [settings.text=""] - a string, or an array of strings
|
|
56
56
|
* @example
|
|
57
57
|
* var font = new me.Text(0, 0, {font: "Arial", size: 8, fillStyle: this.color});
|
|
58
58
|
*/
|
|
@@ -226,8 +226,8 @@ class Text extends Renderable {
|
|
|
226
226
|
|
|
227
227
|
/**
|
|
228
228
|
* set the font family and size
|
|
229
|
-
* @param {string} font a CSS font name
|
|
230
|
-
* @param {number|string} [size=10] size in px, or size + suffix (px, em, pt)
|
|
229
|
+
* @param {string} font - a CSS font name
|
|
230
|
+
* @param {number|string} [size=10] - size in px, or size + suffix (px, em, pt)
|
|
231
231
|
* @returns {Text} this object for chaining
|
|
232
232
|
* @example
|
|
233
233
|
* font.setFont("Arial", 20);
|
|
@@ -267,7 +267,7 @@ class Text extends Renderable {
|
|
|
267
267
|
|
|
268
268
|
/**
|
|
269
269
|
* change the text to be displayed
|
|
270
|
-
* @param {number|string|string[]} value a string, or an array of strings
|
|
270
|
+
* @param {number|string|string[]} value - a string, or an array of strings
|
|
271
271
|
* @returns {Text} this object for chaining
|
|
272
272
|
*/
|
|
273
273
|
setText(value = "") {
|
|
@@ -323,8 +323,8 @@ class Text extends Renderable {
|
|
|
323
323
|
|
|
324
324
|
/**
|
|
325
325
|
* measure the given text size in pixels
|
|
326
|
-
* @param {CanvasRenderer|WebGLRenderer} renderer reference to the active renderer
|
|
327
|
-
* @param {string} [text] the text to be measured
|
|
326
|
+
* @param {CanvasRenderer|WebGLRenderer} renderer - reference to the active renderer
|
|
327
|
+
* @param {string} [text] - the text to be measured
|
|
328
328
|
* @returns {TextMetrics} a TextMetrics object defining the dimensions of the given piece of text
|
|
329
329
|
*/
|
|
330
330
|
measureText(renderer, text = this._text) {
|
|
@@ -334,11 +334,11 @@ class Text extends Renderable {
|
|
|
334
334
|
|
|
335
335
|
/**
|
|
336
336
|
* draw a text at the specified coord
|
|
337
|
-
* @param {CanvasRenderer|WebGLRenderer} renderer Reference to the destination renderer instance
|
|
337
|
+
* @param {CanvasRenderer|WebGLRenderer} renderer - Reference to the destination renderer instance
|
|
338
338
|
* @param {string} [text]
|
|
339
339
|
* @param {number} [x]
|
|
340
340
|
* @param {number} [y]
|
|
341
|
-
* @param {boolean} [stroke=false] draw stroke the the text if true
|
|
341
|
+
* @param {boolean} [stroke=false] - draw stroke the the text if true
|
|
342
342
|
*/
|
|
343
343
|
draw(renderer, text, x = this.pos.x, y = this.pos.y, stroke = false) {
|
|
344
344
|
// "hacky patch" for backward compatibilty
|
|
@@ -394,7 +394,7 @@ class Text extends Renderable {
|
|
|
394
394
|
* draw a stroke text at the specified coord, as defined <br>
|
|
395
395
|
* by the `lineWidth` and `fillStroke` properties. <br>
|
|
396
396
|
* Note : using drawStroke is not recommended for performance reasons
|
|
397
|
-
* @param {CanvasRenderer|WebGLRenderer} renderer Reference to the destination renderer instance
|
|
397
|
+
* @param {CanvasRenderer|WebGLRenderer} renderer - Reference to the destination renderer instance
|
|
398
398
|
* @param {string} text
|
|
399
399
|
* @param {number} x
|
|
400
400
|
* @param {number} y
|
package/src/text/textmetrics.js
CHANGED
|
@@ -10,7 +10,7 @@ import setContextStyle from "./textstyle.js";
|
|
|
10
10
|
class TextMetrics extends Bounds {
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* @param {Text|BitmapText} ancestor the parent object that contains this TextMetrics object
|
|
13
|
+
* @param {Text|BitmapText} ancestor - the parent object that contains this TextMetrics object
|
|
14
14
|
*/
|
|
15
15
|
constructor(ancestor) {
|
|
16
16
|
|
|
@@ -42,8 +42,8 @@ class TextMetrics extends Bounds {
|
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
44
|
* Returns the width of the given segment of inline text in CSS pixels.
|
|
45
|
-
* @param {string} text the text to be measured
|
|
46
|
-
* @param {CanvasRenderingContext2D} [context] reference to an active 2d context for canvas rendering
|
|
45
|
+
* @param {string} text - the text to be measured
|
|
46
|
+
* @param {CanvasRenderingContext2D} [context] - reference to an active 2d context for canvas rendering
|
|
47
47
|
* @returns {number} the width of the given segment of inline text in CSS pixels.
|
|
48
48
|
*/
|
|
49
49
|
lineWidth(text, context) {
|
|
@@ -68,8 +68,8 @@ class TextMetrics extends Bounds {
|
|
|
68
68
|
|
|
69
69
|
/**
|
|
70
70
|
* measure the given text size in CSS pixels
|
|
71
|
-
* @param {string} text the text to be measured
|
|
72
|
-
* @param {CanvasRenderingContext2D} [context] reference to an active 2d context for canvas rendering
|
|
71
|
+
* @param {string} text - the text to be measured
|
|
72
|
+
* @param {CanvasRenderingContext2D} [context] - reference to an active 2d context for canvas rendering
|
|
73
73
|
* @returns {TextMetrics} this
|
|
74
74
|
*/
|
|
75
75
|
measureText(text, context) {
|
|
@@ -117,9 +117,9 @@ class TextMetrics extends Bounds {
|
|
|
117
117
|
|
|
118
118
|
/**
|
|
119
119
|
* wrap the given text based on the given width
|
|
120
|
-
* @param {string|string[]} text the text to be wrapped
|
|
121
|
-
* @param {number} width maximum width of one segment of text in css pixel
|
|
122
|
-
* @param {CanvasRenderingContext2D} [context] reference to an active 2d context for canvas rendering
|
|
120
|
+
* @param {string|string[]} text - the text to be wrapped
|
|
121
|
+
* @param {number} width - maximum width of one segment of text in css pixel
|
|
122
|
+
* @param {CanvasRenderingContext2D} [context] - reference to an active 2d context for canvas rendering
|
|
123
123
|
* @returns {string[]} an array of string representing wrapped text
|
|
124
124
|
*/
|
|
125
125
|
wordWrap(text, width, context) {
|
package/src/tweens/tween.js
CHANGED
|
@@ -26,7 +26,7 @@ import { Interpolation } from "./interpolation.js";
|
|
|
26
26
|
class Tween {
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
|
-
* @param {object} object object on which to apply the tween
|
|
29
|
+
* @param {object} object - object on which to apply the tween
|
|
30
30
|
* @example
|
|
31
31
|
* // add a tween to change the object pos.x and pos.y variable to 200 in 3 seconds
|
|
32
32
|
* tween = new me.Tween(myObject.pos).to({
|
|
@@ -121,15 +121,15 @@ class Tween {
|
|
|
121
121
|
* @name to
|
|
122
122
|
* @memberof Tween
|
|
123
123
|
* @public
|
|
124
|
-
* @param {object} properties hash of properties
|
|
125
|
-
* @param {object|number} [options] object of tween properties, or a duration if a numeric value is passed
|
|
126
|
-
* @param {number} [options.duration] tween duration
|
|
127
|
-
* @param {Tween.Easing} [options.easing] easing function
|
|
128
|
-
* @param {number} [options.delay] delay amount expressed in milliseconds
|
|
129
|
-
* @param {boolean} [options.yoyo] allows the tween to bounce back to their original value when finished. To be used together with repeat to create endless loops.
|
|
130
|
-
* @param {number} [options.repeat] amount of times the tween should be repeated
|
|
131
|
-
* @param {Tween.Interpolation} [options.interpolation] interpolation function
|
|
132
|
-
* @param {boolean} [options.autoStart] allow this tween to start automatically. Otherwise call me.Tween.start().
|
|
124
|
+
* @param {object} properties - hash of properties
|
|
125
|
+
* @param {object|number} [options] - object of tween properties, or a duration if a numeric value is passed
|
|
126
|
+
* @param {number} [options.duration] - tween duration
|
|
127
|
+
* @param {Tween.Easing} [options.easing] - easing function
|
|
128
|
+
* @param {number} [options.delay] - delay amount expressed in milliseconds
|
|
129
|
+
* @param {boolean} [options.yoyo] - allows the tween to bounce back to their original value when finished. To be used together with repeat to create endless loops.
|
|
130
|
+
* @param {number} [options.repeat] - amount of times the tween should be repeated
|
|
131
|
+
* @param {Tween.Interpolation} [options.interpolation] - interpolation function
|
|
132
|
+
* @param {boolean} [options.autoStart] - allow this tween to start automatically. Otherwise call me.Tween.start().
|
|
133
133
|
* @returns {Tween} this instance for object chaining
|
|
134
134
|
*/
|
|
135
135
|
to( properties, options ) {
|
|
@@ -162,7 +162,7 @@ class Tween {
|
|
|
162
162
|
* @name start
|
|
163
163
|
* @memberof Tween
|
|
164
164
|
* @public
|
|
165
|
-
* @param {number} [time] the current time when the tween was started
|
|
165
|
+
* @param {number} [time] - the current time when the tween was started
|
|
166
166
|
* @returns {Tween} this instance for object chaining
|
|
167
167
|
*/
|
|
168
168
|
start( time = timer.getTime() ) {
|
|
@@ -221,7 +221,7 @@ class Tween {
|
|
|
221
221
|
* @name delay
|
|
222
222
|
* @memberof Tween
|
|
223
223
|
* @public
|
|
224
|
-
* @param {number} amount delay amount expressed in milliseconds
|
|
224
|
+
* @param {number} amount - delay amount expressed in milliseconds
|
|
225
225
|
* @returns {Tween} this instance for object chaining
|
|
226
226
|
*/
|
|
227
227
|
delay( amount ) {
|
|
@@ -236,7 +236,7 @@ class Tween {
|
|
|
236
236
|
* @name repeat
|
|
237
237
|
* @memberof Tween
|
|
238
238
|
* @public
|
|
239
|
-
* @param {number} times amount of times the tween should be repeated
|
|
239
|
+
* @param {number} times - amount of times the tween should be repeated
|
|
240
240
|
* @returns {Tween} this instance for object chaining
|
|
241
241
|
*/
|
|
242
242
|
repeat( times ) {
|
|
@@ -268,7 +268,7 @@ class Tween {
|
|
|
268
268
|
* @name easing
|
|
269
269
|
* @memberof Tween
|
|
270
270
|
* @public
|
|
271
|
-
* @param {Tween.Easing} easing easing function
|
|
271
|
+
* @param {Tween.Easing} easing - easing function
|
|
272
272
|
* @returns {Tween} this instance for object chaining
|
|
273
273
|
*/
|
|
274
274
|
easing( easing ) {
|
|
@@ -284,7 +284,7 @@ class Tween {
|
|
|
284
284
|
* @name interpolation
|
|
285
285
|
* @memberof Tween
|
|
286
286
|
* @public
|
|
287
|
-
* @param {Tween.Interpolation} interpolation interpolation function
|
|
287
|
+
* @param {Tween.Interpolation} interpolation - interpolation function
|
|
288
288
|
* @returns {Tween} this instance for object chaining
|
|
289
289
|
*/
|
|
290
290
|
interpolation( interpolation ) {
|
|
@@ -297,7 +297,7 @@ class Tween {
|
|
|
297
297
|
* @name chain
|
|
298
298
|
* @memberof Tween
|
|
299
299
|
* @public
|
|
300
|
-
* @param {...Tween} chainedTween Tween(s) to be chained
|
|
300
|
+
* @param {...Tween} chainedTween - Tween(s) to be chained
|
|
301
301
|
* @returns {Tween} this instance for object chaining
|
|
302
302
|
*/
|
|
303
303
|
chain() {
|
|
@@ -310,7 +310,7 @@ class Tween {
|
|
|
310
310
|
* @name onStart
|
|
311
311
|
* @memberof Tween
|
|
312
312
|
* @public
|
|
313
|
-
* @param {Function} onStartCallback callback
|
|
313
|
+
* @param {Function} onStartCallback - callback
|
|
314
314
|
* @returns {Tween} this instance for object chaining
|
|
315
315
|
*/
|
|
316
316
|
onStart( onStartCallback ) {
|
|
@@ -323,7 +323,7 @@ class Tween {
|
|
|
323
323
|
* @name onUpdate
|
|
324
324
|
* @memberof Tween
|
|
325
325
|
* @public
|
|
326
|
-
* @param {Function} onUpdateCallback callback
|
|
326
|
+
* @param {Function} onUpdateCallback - callback
|
|
327
327
|
* @returns {Tween} this instance for object chaining
|
|
328
328
|
*/
|
|
329
329
|
onUpdate( onUpdateCallback ) {
|
|
@@ -336,7 +336,7 @@ class Tween {
|
|
|
336
336
|
* @name onComplete
|
|
337
337
|
* @memberof Tween
|
|
338
338
|
* @public
|
|
339
|
-
* @param {Function} onCompleteCallback callback
|
|
339
|
+
* @param {Function} onCompleteCallback - callback
|
|
340
340
|
* @returns {Tween} this instance for object chaining
|
|
341
341
|
*/
|
|
342
342
|
onComplete( onCompleteCallback ) {
|
package/src/utils/agent.js
CHANGED
|
@@ -15,8 +15,8 @@ const vendors = [ "ms", "MS", "moz", "webkit", "o" ];
|
|
|
15
15
|
* Get a vendor-prefixed property
|
|
16
16
|
* @public
|
|
17
17
|
* @name prefixed
|
|
18
|
-
* @param {string} name Property name
|
|
19
|
-
* @param {object} [obj=globalThis] Object or element reference to access
|
|
18
|
+
* @param {string} name - Property name
|
|
19
|
+
* @param {object} [obj=globalThis] - Object or element reference to access
|
|
20
20
|
* @returns {string} Value of property
|
|
21
21
|
* @memberof utils.agent
|
|
22
22
|
*/
|
|
@@ -40,9 +40,9 @@ export function prefixed(name, obj) {
|
|
|
40
40
|
* Set a vendor-prefixed property
|
|
41
41
|
* @public
|
|
42
42
|
* @name setPrefixed
|
|
43
|
-
* @param {string} name Property name
|
|
44
|
-
* @param {string} value Property value
|
|
45
|
-
* @param {object} [obj=globalThis] Object or element reference to access
|
|
43
|
+
* @param {string} name - Property name
|
|
44
|
+
* @param {string} value - Property value
|
|
45
|
+
* @param {object} [obj=globalThis] - Object or element reference to access
|
|
46
46
|
* @returns {boolean} true if one of the vendor-prefixed property was found
|
|
47
47
|
* @memberof utils.agent
|
|
48
48
|
*/
|
package/src/utils/array.js
CHANGED
|
@@ -10,8 +10,8 @@ import {random as mathRandom, weightedRandom as mathWeightedRandom} from "./../m
|
|
|
10
10
|
* @public
|
|
11
11
|
* @memberof utils.array
|
|
12
12
|
* @name remove
|
|
13
|
-
* @param {Array} arr array from which to remove an object
|
|
14
|
-
* @param {object} obj to be removed
|
|
13
|
+
* @param {Array} arr - array from which to remove an object
|
|
14
|
+
* @param {object} obj - to be removed
|
|
15
15
|
* @returns {Array} the modified Array
|
|
16
16
|
* var arr = [ "foo", "bar", "baz" ];
|
|
17
17
|
* // remove "foo" from the array
|
|
@@ -30,7 +30,7 @@ export function remove(arr, obj) {
|
|
|
30
30
|
* @public
|
|
31
31
|
* @memberof utils.array
|
|
32
32
|
* @name random
|
|
33
|
-
* @param {Array} arr array to pick a element
|
|
33
|
+
* @param {Array} arr - array to pick a element
|
|
34
34
|
* @returns {any} random member of array
|
|
35
35
|
* @example
|
|
36
36
|
* // Select a random array element
|
|
@@ -46,7 +46,7 @@ export function random(arr) {
|
|
|
46
46
|
* @public
|
|
47
47
|
* @memberof utils.array
|
|
48
48
|
* @name weightedRandom
|
|
49
|
-
* @param {Array} arr array to pick a element
|
|
49
|
+
* @param {Array} arr - array to pick a element
|
|
50
50
|
* @returns {any} random member of array
|
|
51
51
|
*/
|
|
52
52
|
export function weightedRandom(arr) {
|
package/src/utils/file.js
CHANGED
|
@@ -14,7 +14,7 @@ const REMOVE_EXT = /\.[^\.]*$/;
|
|
|
14
14
|
* @public
|
|
15
15
|
* @memberof utils.file
|
|
16
16
|
* @name getBasename
|
|
17
|
-
* @param {string} path path containing the filename
|
|
17
|
+
* @param {string} path- - path containing the filename
|
|
18
18
|
* @returns {string} the base name without path information.
|
|
19
19
|
*/
|
|
20
20
|
export function getBasename(path) {
|
|
@@ -26,7 +26,7 @@ export function getBasename(path) {
|
|
|
26
26
|
* @public
|
|
27
27
|
* @memberof utils.file
|
|
28
28
|
* @name getExtension
|
|
29
|
-
* @param {string} path path containing the filename
|
|
29
|
+
* @param {string} path- - path containing the filename
|
|
30
30
|
* @returns {string} filename extension.
|
|
31
31
|
*/
|
|
32
32
|
export function getExtension(path) {
|
package/src/utils/function.js
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
* @public
|
|
9
9
|
* @memberof utils.function
|
|
10
10
|
* @name defer
|
|
11
|
-
* @param {Function} func The function to be deferred.
|
|
12
|
-
* @param {object} thisArg The value to be passed as the this parameter to the target function when the deferred function is called
|
|
13
|
-
* @param {...*} args Optional additional arguments to carry for the function.
|
|
11
|
+
* @param {Function} func - The function to be deferred.
|
|
12
|
+
* @param {object} thisArg - The value to be passed as the this parameter to the target function when the deferred function is called
|
|
13
|
+
* @param {...*} args - Optional additional arguments to carry for the function.
|
|
14
14
|
* @returns {number} id that can be used to clear the deferred function using
|
|
15
15
|
* clearTimeout
|
|
16
16
|
* @example
|
|
@@ -28,9 +28,9 @@ export function defer(func, thisArg, ...args) {
|
|
|
28
28
|
* @public
|
|
29
29
|
* @memberof utils.function
|
|
30
30
|
* @name throttle
|
|
31
|
-
* @param {Function} fn the function to be throttled.
|
|
32
|
-
* @param {number} delay The delay in ms
|
|
33
|
-
* @param {no_trailing} no_trailing disable the execution on the trailing edge
|
|
31
|
+
* @param {Function} fn - the function to be throttled.
|
|
32
|
+
* @param {number} delay - The delay in ms
|
|
33
|
+
* @param {no_trailing} no_trailing - disable the execution on the trailing edge
|
|
34
34
|
* @returns {Function} the function that will be throttled
|
|
35
35
|
*/
|
|
36
36
|
export function throttle(fn, delay, no_trailing) {
|
package/src/utils/string.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @public
|
|
9
9
|
* @memberof utils.string
|
|
10
10
|
* @name capitalize
|
|
11
|
-
* @param {string} str the string to be capitalized
|
|
11
|
+
* @param {string} str - the string to be capitalized
|
|
12
12
|
* @returns {string} the capitalized string
|
|
13
13
|
*/
|
|
14
14
|
export function capitalize(str) {
|
|
@@ -20,7 +20,7 @@ export function capitalize(str) {
|
|
|
20
20
|
* @public
|
|
21
21
|
* @memberof utils.string
|
|
22
22
|
* @name isNumeric
|
|
23
|
-
* @param {string} str the string to be tested
|
|
23
|
+
* @param {string} str - the string to be tested
|
|
24
24
|
* @returns {boolean} true if string contains only digits
|
|
25
25
|
*/
|
|
26
26
|
export function isNumeric(str) {
|
|
@@ -35,7 +35,7 @@ export function isNumeric(str) {
|
|
|
35
35
|
* @public
|
|
36
36
|
* @memberof utils.string
|
|
37
37
|
* @name isBoolean
|
|
38
|
-
* @param {string} str the string to be tested
|
|
38
|
+
* @param {string} str - the string to be tested
|
|
39
39
|
* @returns {boolean} true if the string is either true or false
|
|
40
40
|
*/
|
|
41
41
|
export function isBoolean(str) {
|
|
@@ -48,7 +48,7 @@ export function isBoolean(str) {
|
|
|
48
48
|
* @public
|
|
49
49
|
* @memberof utils.string
|
|
50
50
|
* @name toHex
|
|
51
|
-
* @param {string} str the string to be converted
|
|
51
|
+
* @param {string} str - the string to be converted
|
|
52
52
|
* @returns {string} the converted hexadecimal value
|
|
53
53
|
*/
|
|
54
54
|
export function toHex(str) {
|
|
@@ -65,7 +65,7 @@ export function toHex(str) {
|
|
|
65
65
|
* @public
|
|
66
66
|
* @memberof utils.string
|
|
67
67
|
* @name isDataUrl
|
|
68
|
-
* @param {string} str the string (url) to be tested
|
|
68
|
+
* @param {string} str - the string (url) to be tested
|
|
69
69
|
* @returns {boolean} true if the string is a data url
|
|
70
70
|
*/
|
|
71
71
|
export function isDataUrl(str) {
|
package/src/utils/utils.js
CHANGED
|
@@ -29,7 +29,7 @@ var utils = {
|
|
|
29
29
|
* @public
|
|
30
30
|
* @memberof utils
|
|
31
31
|
* @name getPixels
|
|
32
|
-
* @param {HTMLImageElement|HTMLCanvasElement} image Image to read
|
|
32
|
+
* @param {HTMLImageElement|HTMLCanvasElement} image - Image to read
|
|
33
33
|
* @returns {ImageData} ImageData object
|
|
34
34
|
*/
|
|
35
35
|
getPixels : function (image) {
|
|
@@ -51,8 +51,8 @@ var utils = {
|
|
|
51
51
|
* @public
|
|
52
52
|
* @memberof utils
|
|
53
53
|
* @name checkVersion
|
|
54
|
-
* @param {string} first First version string to compare
|
|
55
|
-
* @param {string} [second=version] Second version string to compare
|
|
54
|
+
* @param {string} first - First version string to compare
|
|
55
|
+
* @param {string} [second=version] - Second version string to compare
|
|
56
56
|
* @returns {number} comparison result <br>< 0 : first < second<br>
|
|
57
57
|
* 0 : first == second<br>
|
|
58
58
|
* > 0 : first > second
|
|
@@ -83,7 +83,7 @@ var utils = {
|
|
|
83
83
|
* @public
|
|
84
84
|
* @memberof utils
|
|
85
85
|
* @name getUriFragment
|
|
86
|
-
* @param {string} [url=document.location] an optional params string or URL containing fragment (hash) params to be parsed
|
|
86
|
+
* @param {string} [url=document.location] - an optional params string or URL containing fragment (hash) params to be parsed
|
|
87
87
|
* @returns {object} an object representing the deserialized params string.
|
|
88
88
|
* @property {boolean} [hitbox=false] draw the hitbox in the debug panel (if enabled)
|
|
89
89
|
* @property {boolean} [velocity=false] draw the entities velocity in the debug panel (if enabled)
|