melonjs 10.2.2 → 10.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/dist/melonjs.js +2907 -3383
- package/dist/melonjs.min.js +4 -4
- package/dist/melonjs.module.d.ts +3620 -4528
- package/dist/melonjs.module.js +3210 -3331
- package/package.json +19 -19
- package/src/audio/audio.js +30 -31
- package/src/camera/camera2d.js +47 -58
- package/src/entity/draggable.js +11 -21
- package/src/entity/droptarget.js +12 -22
- package/src/entity/entity.js +32 -38
- package/src/game.js +21 -22
- package/src/{shapes → geometries}/ellipse.js +40 -47
- package/src/{shapes → geometries}/line.js +9 -12
- package/src/{shapes → geometries}/poly.js +100 -53
- package/src/{shapes → geometries}/rectangle.js +42 -45
- package/src/index.js +9 -20
- package/src/input/gamepad.js +11 -10
- package/src/input/input.js +2 -3
- package/src/input/keyboard.js +113 -113
- package/src/input/pointer.js +61 -29
- package/src/input/pointerevent.js +92 -29
- package/src/lang/deprecated.js +44 -14
- package/src/level/level.js +23 -24
- package/src/level/tiled/TMXGroup.js +7 -9
- package/src/level/tiled/TMXLayer.js +30 -33
- package/src/level/tiled/TMXObject.js +59 -53
- package/src/level/tiled/TMXTile.js +18 -19
- package/src/level/tiled/TMXTileMap.js +38 -46
- package/src/level/tiled/TMXTileset.js +12 -16
- package/src/level/tiled/TMXTilesetGroup.js +9 -10
- package/src/level/tiled/renderer/TMXHexagonalRenderer.js +7 -9
- package/src/level/tiled/renderer/TMXIsometricRenderer.js +7 -9
- package/src/level/tiled/renderer/TMXOrthogonalRenderer.js +4 -6
- package/src/level/tiled/renderer/TMXRenderer.js +24 -26
- package/src/level/tiled/renderer/TMXStaggeredRenderer.js +1 -5
- package/src/loader/loader.js +17 -16
- package/src/loader/loadingscreen.js +8 -10
- package/src/math/color.js +47 -67
- package/src/math/math.js +15 -16
- package/src/math/matrix2.js +53 -59
- package/src/math/matrix3.js +56 -63
- package/src/math/observable_vector2.js +87 -77
- package/src/math/observable_vector3.js +97 -80
- package/src/math/vector2.js +107 -97
- package/src/math/vector3.js +116 -100
- package/src/particles/emitter.js +66 -76
- package/src/particles/particle.js +4 -6
- package/src/particles/particlecontainer.js +2 -4
- package/src/physics/body.js +47 -146
- package/src/physics/bounds.js +48 -50
- package/src/physics/collision.js +13 -14
- package/src/physics/detector.js +14 -14
- package/src/physics/quadtree.js +18 -21
- package/src/physics/sat.js +30 -30
- package/src/physics/world.js +24 -29
- package/src/plugin/plugin.js +11 -15
- package/src/renderable/GUI.js +41 -47
- package/src/renderable/collectable.js +5 -10
- package/src/renderable/colorlayer.js +10 -15
- package/src/renderable/container.js +87 -73
- package/src/renderable/imagelayer.js +25 -32
- package/src/renderable/nineslicesprite.js +41 -42
- package/src/renderable/renderable.js +113 -124
- package/src/renderable/sprite.js +62 -69
- package/src/renderable/trigger.js +26 -32
- package/src/state/stage.js +13 -18
- package/src/state/state.js +26 -27
- package/src/system/device.js +76 -133
- package/src/system/event.js +81 -70
- package/src/system/pooling.js +11 -12
- package/src/system/save.js +3 -4
- package/src/system/timer.js +19 -20
- package/src/text/bitmaptext.js +57 -55
- package/src/text/bitmaptextdata.js +10 -11
- package/src/text/glyph.js +3 -0
- package/src/text/text.js +49 -55
- package/src/tweens/easing.js +1 -1
- package/src/tweens/interpolation.js +1 -1
- package/src/tweens/tween.js +44 -46
- package/src/utils/agent.js +3 -4
- package/src/utils/array.js +4 -5
- package/src/utils/file.js +3 -4
- package/src/utils/function.js +4 -5
- package/src/utils/string.js +7 -9
- package/src/utils/utils.js +4 -5
- package/src/video/canvas/canvas_renderer.js +60 -62
- package/src/video/renderer.js +53 -58
- package/src/video/texture.js +98 -112
- package/src/video/texture_cache.js +4 -6
- package/src/video/video.js +16 -17
- package/src/video/webgl/buffer/vertex.js +2 -2
- package/src/video/webgl/glshader.js +37 -39
- package/src/video/webgl/webgl_compositor.js +128 -110
- package/src/video/webgl/webgl_renderer.js +126 -106
package/src/tweens/tween.js
CHANGED
|
@@ -22,24 +22,22 @@ import { Interpolation } from "./interpolation.js";
|
|
|
22
22
|
* author Paul Lewis / http://www.aerotwist.com/<br>
|
|
23
23
|
* author lechecacharro<br>
|
|
24
24
|
* author Josh Faul / http://jocafa.com/
|
|
25
|
-
* @class Tween
|
|
26
|
-
* @memberOf me
|
|
27
|
-
* @constructor
|
|
28
|
-
* @param {object} object object on which to apply the tween
|
|
29
|
-
* @example
|
|
30
|
-
* // add a tween to change the object pos.x and pos.y variable to 200 in 3 seconds
|
|
31
|
-
* tween = new me.Tween(myObject.pos).to({
|
|
32
|
-
* x: 200,
|
|
33
|
-
* y: 200,
|
|
34
|
-
* }, {
|
|
35
|
-
* duration: 3000,
|
|
36
|
-
* easing: me.Tween.Easing.Bounce.Out,
|
|
37
|
-
* autoStart : true
|
|
38
|
-
* }).onComplete(myFunc);
|
|
39
25
|
*/
|
|
40
26
|
class Tween {
|
|
41
27
|
|
|
42
|
-
|
|
28
|
+
/**
|
|
29
|
+
* @param {object} object object on which to apply the tween
|
|
30
|
+
* @example
|
|
31
|
+
* // add a tween to change the object pos.x and pos.y variable to 200 in 3 seconds
|
|
32
|
+
* tween = new me.Tween(myObject.pos).to({
|
|
33
|
+
* x: 200,
|
|
34
|
+
* y: 200,
|
|
35
|
+
* }, {
|
|
36
|
+
* duration: 3000,
|
|
37
|
+
* easing: me.Tween.Easing.Bounce.Out,
|
|
38
|
+
* autoStart : true
|
|
39
|
+
* }).onComplete(myFunc);
|
|
40
|
+
*/
|
|
43
41
|
constructor ( object ) {
|
|
44
42
|
this.setProperties(object);
|
|
45
43
|
}
|
|
@@ -121,19 +119,19 @@ class Tween {
|
|
|
121
119
|
/**
|
|
122
120
|
* object properties to be updated and duration
|
|
123
121
|
* @name to
|
|
124
|
-
* @
|
|
122
|
+
* @memberof Tween
|
|
125
123
|
* @public
|
|
126
124
|
* @function
|
|
127
125
|
* @param {object} properties hash of properties
|
|
128
126
|
* @param {object|number} [options] object of tween properties, or a duration if a numeric value is passed
|
|
129
127
|
* @param {number} [options.duration] tween duration
|
|
130
|
-
* @param {
|
|
128
|
+
* @param {Tween.Easing} [options.easing] easing function
|
|
131
129
|
* @param {number} [options.delay] delay amount expressed in milliseconds
|
|
132
130
|
* @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.
|
|
133
131
|
* @param {number} [options.repeat] amount of times the tween should be repeated
|
|
134
|
-
* @param {
|
|
132
|
+
* @param {Tween.Interpolation} [options.interpolation] interpolation function
|
|
135
133
|
* @param {boolean} [options.autoStart] allow this tween to start automatically. Otherwise call me.Tween.start().
|
|
136
|
-
* @returns {
|
|
134
|
+
* @returns {Tween} this instance for object chaining
|
|
137
135
|
*/
|
|
138
136
|
to( properties, options ) {
|
|
139
137
|
|
|
@@ -163,11 +161,11 @@ class Tween {
|
|
|
163
161
|
/**
|
|
164
162
|
* start the tween
|
|
165
163
|
* @name start
|
|
166
|
-
* @
|
|
164
|
+
* @memberof Tween
|
|
167
165
|
* @public
|
|
168
166
|
* @function
|
|
169
167
|
* @param {number} [time] the current time when the tween was started
|
|
170
|
-
* @returns {
|
|
168
|
+
* @returns {Tween} this instance for object chaining
|
|
171
169
|
*/
|
|
172
170
|
start( time = timer.getTime() ) {
|
|
173
171
|
|
|
@@ -210,10 +208,10 @@ class Tween {
|
|
|
210
208
|
/**
|
|
211
209
|
* stop the tween
|
|
212
210
|
* @name stop
|
|
213
|
-
* @
|
|
211
|
+
* @memberof Tween
|
|
214
212
|
* @public
|
|
215
213
|
* @function
|
|
216
|
-
* @returns {
|
|
214
|
+
* @returns {Tween} this instance for object chaining
|
|
217
215
|
*/
|
|
218
216
|
stop() {
|
|
219
217
|
// remove the tween from the world container
|
|
@@ -224,11 +222,11 @@ class Tween {
|
|
|
224
222
|
/**
|
|
225
223
|
* delay the tween
|
|
226
224
|
* @name delay
|
|
227
|
-
* @
|
|
225
|
+
* @memberof Tween
|
|
228
226
|
* @public
|
|
229
227
|
* @function
|
|
230
228
|
* @param {number} amount delay amount expressed in milliseconds
|
|
231
|
-
* @returns {
|
|
229
|
+
* @returns {Tween} this instance for object chaining
|
|
232
230
|
*/
|
|
233
231
|
delay( amount ) {
|
|
234
232
|
|
|
@@ -240,11 +238,11 @@ class Tween {
|
|
|
240
238
|
/**
|
|
241
239
|
* Repeat the tween
|
|
242
240
|
* @name repeat
|
|
243
|
-
* @
|
|
241
|
+
* @memberof Tween
|
|
244
242
|
* @public
|
|
245
243
|
* @function
|
|
246
244
|
* @param {number} times amount of times the tween should be repeated
|
|
247
|
-
* @returns {
|
|
245
|
+
* @returns {Tween} this instance for object chaining
|
|
248
246
|
*/
|
|
249
247
|
repeat( times ) {
|
|
250
248
|
|
|
@@ -257,12 +255,12 @@ class Tween {
|
|
|
257
255
|
* Allows the tween to bounce back to their original value when finished.
|
|
258
256
|
* To be used together with repeat to create endless loops.
|
|
259
257
|
* @name yoyo
|
|
260
|
-
* @
|
|
258
|
+
* @memberof Tween
|
|
261
259
|
* @public
|
|
262
260
|
* @function
|
|
263
|
-
* @see
|
|
261
|
+
* @see Tween#repeat
|
|
264
262
|
* @param {boolean} yoyo
|
|
265
|
-
* @returns {
|
|
263
|
+
* @returns {Tween} this instance for object chaining
|
|
266
264
|
*/
|
|
267
265
|
yoyo( yoyo ) {
|
|
268
266
|
|
|
@@ -274,11 +272,11 @@ class Tween {
|
|
|
274
272
|
/**
|
|
275
273
|
* set the easing function
|
|
276
274
|
* @name easing
|
|
277
|
-
* @
|
|
275
|
+
* @memberof Tween
|
|
278
276
|
* @public
|
|
279
277
|
* @function
|
|
280
|
-
* @param {
|
|
281
|
-
* @returns {
|
|
278
|
+
* @param {Tween.Easing} easing easing function
|
|
279
|
+
* @returns {Tween} this instance for object chaining
|
|
282
280
|
*/
|
|
283
281
|
easing( easing ) {
|
|
284
282
|
if (typeof easing !== "function") {
|
|
@@ -291,11 +289,11 @@ class Tween {
|
|
|
291
289
|
/**
|
|
292
290
|
* set the interpolation function
|
|
293
291
|
* @name interpolation
|
|
294
|
-
* @
|
|
292
|
+
* @memberof Tween
|
|
295
293
|
* @public
|
|
296
294
|
* @function
|
|
297
|
-
* @param {
|
|
298
|
-
* @returns {
|
|
295
|
+
* @param {Tween.Interpolation} interpolation interpolation function
|
|
296
|
+
* @returns {Tween} this instance for object chaining
|
|
299
297
|
*/
|
|
300
298
|
interpolation( interpolation ) {
|
|
301
299
|
this._interpolationFunction = interpolation;
|
|
@@ -305,13 +303,13 @@ class Tween {
|
|
|
305
303
|
/**
|
|
306
304
|
* chain the tween
|
|
307
305
|
* @name chain
|
|
308
|
-
* @
|
|
306
|
+
* @memberof Tween
|
|
309
307
|
* @public
|
|
310
308
|
* @function
|
|
311
|
-
* @param {...
|
|
312
|
-
* @returns {
|
|
309
|
+
* @param {...Tween} chainedTween Tween(s) to be chained
|
|
310
|
+
* @returns {Tween} this instance for object chaining
|
|
313
311
|
*/
|
|
314
|
-
chain(
|
|
312
|
+
chain() {
|
|
315
313
|
this._chainedTweens = arguments;
|
|
316
314
|
return this;
|
|
317
315
|
}
|
|
@@ -319,11 +317,11 @@ class Tween {
|
|
|
319
317
|
/**
|
|
320
318
|
* onStart callback
|
|
321
319
|
* @name onStart
|
|
322
|
-
* @
|
|
320
|
+
* @memberof Tween
|
|
323
321
|
* @public
|
|
324
322
|
* @function
|
|
325
323
|
* @param {Function} onStartCallback callback
|
|
326
|
-
* @returns {
|
|
324
|
+
* @returns {Tween} this instance for object chaining
|
|
327
325
|
*/
|
|
328
326
|
onStart( onStartCallback ) {
|
|
329
327
|
this._onStartCallback = onStartCallback;
|
|
@@ -333,11 +331,11 @@ class Tween {
|
|
|
333
331
|
/**
|
|
334
332
|
* onUpdate callback
|
|
335
333
|
* @name onUpdate
|
|
336
|
-
* @
|
|
334
|
+
* @memberof Tween
|
|
337
335
|
* @public
|
|
338
336
|
* @function
|
|
339
337
|
* @param {Function} onUpdateCallback callback
|
|
340
|
-
* @returns {
|
|
338
|
+
* @returns {Tween} this instance for object chaining
|
|
341
339
|
*/
|
|
342
340
|
onUpdate( onUpdateCallback ) {
|
|
343
341
|
this._onUpdateCallback = onUpdateCallback;
|
|
@@ -347,11 +345,11 @@ class Tween {
|
|
|
347
345
|
/**
|
|
348
346
|
* onComplete callback
|
|
349
347
|
* @name onComplete
|
|
350
|
-
* @
|
|
348
|
+
* @memberof Tween
|
|
351
349
|
* @public
|
|
352
350
|
* @function
|
|
353
351
|
* @param {Function} onCompleteCallback callback
|
|
354
|
-
* @returns {
|
|
352
|
+
* @returns {Tween} this instance for object chaining
|
|
355
353
|
*/
|
|
356
354
|
onComplete( onCompleteCallback ) {
|
|
357
355
|
this._onCompleteCallback = onCompleteCallback;
|
package/src/utils/agent.js
CHANGED
|
@@ -2,8 +2,7 @@ import { capitalize } from "./string.js";
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* a collection of utility functons to ease porting between different user agents.
|
|
5
|
-
* @namespace
|
|
6
|
-
* @memberOf me
|
|
5
|
+
* @namespace utils.agent
|
|
7
6
|
*/
|
|
8
7
|
|
|
9
8
|
/**
|
|
@@ -20,7 +19,7 @@ var vendors = [ "ms", "MS", "moz", "webkit", "o" ];
|
|
|
20
19
|
* @param {string} name Property name
|
|
21
20
|
* @param {object} [obj=window] Object or element reference to access
|
|
22
21
|
* @returns {string} Value of property
|
|
23
|
-
* @
|
|
22
|
+
* @memberof utils.agent
|
|
24
23
|
*/
|
|
25
24
|
export function prefixed(name, obj) {
|
|
26
25
|
obj = obj || window;
|
|
@@ -47,7 +46,7 @@ export function prefixed(name, obj) {
|
|
|
47
46
|
* @param {string} value Property value
|
|
48
47
|
* @param {object} [obj=window] Object or element reference to access
|
|
49
48
|
* @returns {boolean} true if one of the vendor-prefixed property was found
|
|
50
|
-
* @
|
|
49
|
+
* @memberof utils.agent
|
|
51
50
|
*/
|
|
52
51
|
export function setPrefixed(name, value, obj) {
|
|
53
52
|
obj = obj || window;
|
package/src/utils/array.js
CHANGED
|
@@ -2,15 +2,14 @@ import {random as mathRandom, weightedRandom as mathWeightedRandom} from "./../m
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* a collection of array utility functions
|
|
5
|
-
* @namespace
|
|
6
|
-
* @memberOf me
|
|
5
|
+
* @namespace utils.array
|
|
7
6
|
*/
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* Remove the specified object from the given Array
|
|
11
10
|
* @public
|
|
12
11
|
* @function
|
|
13
|
-
* @
|
|
12
|
+
* @memberof utils.array
|
|
14
13
|
* @name remove
|
|
15
14
|
* @param {Array} arr array from which to remove an object
|
|
16
15
|
* @param {object} obj to be removed
|
|
@@ -31,7 +30,7 @@ export function remove(arr, obj) {
|
|
|
31
30
|
* return a random array element
|
|
32
31
|
* @public
|
|
33
32
|
* @function
|
|
34
|
-
* @
|
|
33
|
+
* @memberof utils.array
|
|
35
34
|
* @name random
|
|
36
35
|
* @param {Array} arr array to pick a element
|
|
37
36
|
* @returns {any} random member of array
|
|
@@ -48,7 +47,7 @@ export function random(arr) {
|
|
|
48
47
|
* return a weighted random array element, favoring the earlier entries
|
|
49
48
|
* @public
|
|
50
49
|
* @function
|
|
51
|
-
* @
|
|
50
|
+
* @memberof utils.array
|
|
52
51
|
* @name weightedRandom
|
|
53
52
|
* @param {Array} arr array to pick a element
|
|
54
53
|
* @returns {any} random member of array
|
package/src/utils/file.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
3
|
* a collection of file utility functions
|
|
4
|
-
* @namespace
|
|
5
|
-
* @memberOf me
|
|
4
|
+
* @namespace utils.file
|
|
6
5
|
*/
|
|
7
6
|
|
|
8
7
|
// regexp to deal with file name & path
|
|
@@ -14,7 +13,7 @@ const REMOVE_EXT = /\.[^\.]*$/;
|
|
|
14
13
|
* return the base name of the file without path info
|
|
15
14
|
* @public
|
|
16
15
|
* @function
|
|
17
|
-
* @
|
|
16
|
+
* @memberof utils.file
|
|
18
17
|
* @name getBasename
|
|
19
18
|
* @param {string} path path containing the filename
|
|
20
19
|
* @returns {string} the base name without path information.
|
|
@@ -27,7 +26,7 @@ export function getBasename(path) {
|
|
|
27
26
|
* return the extension of the file in the given path
|
|
28
27
|
* @public
|
|
29
28
|
* @function
|
|
30
|
-
* @
|
|
29
|
+
* @memberof utils.file
|
|
31
30
|
* @name getExtension
|
|
32
31
|
* @param {string} path path containing the filename
|
|
33
32
|
* @returns {string} filename extension.
|
package/src/utils/function.js
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* a collection of utility functions
|
|
3
|
-
* @namespace
|
|
4
|
-
* @memberOf me
|
|
3
|
+
* @namespace utils.function
|
|
5
4
|
*/
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* Executes a function as soon as the interpreter is idle (stack empty).
|
|
9
8
|
* @public
|
|
10
9
|
* @function
|
|
11
|
-
* @
|
|
10
|
+
* @memberof utils.function
|
|
12
11
|
* @name defer
|
|
13
12
|
* @param {Function} func The function to be deferred.
|
|
14
13
|
* @param {object} thisArg The value to be passed as the this parameter to the target function when the deferred function is called
|
|
15
|
-
* @param {...*}
|
|
14
|
+
* @param {...*} args Optional additional arguments to carry for the function.
|
|
16
15
|
* @returns {number} id that can be used to clear the deferred function using
|
|
17
16
|
* clearTimeout
|
|
18
17
|
* @example
|
|
@@ -29,7 +28,7 @@ export function defer(func, thisArg, ...args) {
|
|
|
29
28
|
* once during a given window of time
|
|
30
29
|
* @public
|
|
31
30
|
* @function
|
|
32
|
-
* @
|
|
31
|
+
* @memberof utils.function
|
|
33
32
|
* @name throttle
|
|
34
33
|
* @param {Function} fn the function to be throttled.
|
|
35
34
|
* @param {number} delay The delay in ms
|
package/src/utils/string.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* a collection of string utility functions
|
|
3
|
-
* @namespace
|
|
4
|
-
* @memberOf me
|
|
3
|
+
* @namespace utils.string
|
|
5
4
|
*/
|
|
6
5
|
|
|
7
|
-
|
|
8
6
|
/**
|
|
9
7
|
* converts the first character of the given string to uppercase
|
|
10
8
|
* @public
|
|
11
9
|
* @function
|
|
12
|
-
* @
|
|
10
|
+
* @memberof utils.string
|
|
13
11
|
* @name capitalize
|
|
14
12
|
* @param {string} str the string to be capitalized
|
|
15
13
|
* @returns {string} the capitalized string
|
|
@@ -22,7 +20,7 @@ export function capitalize(str) {
|
|
|
22
20
|
* returns the string stripped of whitespace from the left.
|
|
23
21
|
* @public
|
|
24
22
|
* @function
|
|
25
|
-
* @
|
|
23
|
+
* @memberof utils.string
|
|
26
24
|
* @name trimLeft
|
|
27
25
|
* @param {string} str the string to be trimmed
|
|
28
26
|
* @returns {string} trimmed string
|
|
@@ -35,7 +33,7 @@ export function trimLeft(str) {
|
|
|
35
33
|
* returns the string stripped of whitespace from the right.
|
|
36
34
|
* @public
|
|
37
35
|
* @function
|
|
38
|
-
* @
|
|
36
|
+
* @memberof utils.string
|
|
39
37
|
* @name trimRight
|
|
40
38
|
* @param {string} str the string to be trimmed
|
|
41
39
|
* @returns {string} trimmed string
|
|
@@ -48,7 +46,7 @@ export function trimRight(str) {
|
|
|
48
46
|
* returns true if the given string contains a numeric integer or float value
|
|
49
47
|
* @public
|
|
50
48
|
* @function
|
|
51
|
-
* @
|
|
49
|
+
* @memberof utils.string
|
|
52
50
|
* @name isNumeric
|
|
53
51
|
* @param {string} str the string to be tested
|
|
54
52
|
* @returns {boolean} true if string contains only digits
|
|
@@ -64,7 +62,7 @@ export function isNumeric(str) {
|
|
|
64
62
|
* returns true if the given string contains a true or false
|
|
65
63
|
* @public
|
|
66
64
|
* @function
|
|
67
|
-
* @
|
|
65
|
+
* @memberof utils.string
|
|
68
66
|
* @name isBoolean
|
|
69
67
|
* @param {string} str the string to be tested
|
|
70
68
|
* @returns {boolean} true if the string is either true or false
|
|
@@ -78,7 +76,7 @@ export function isBoolean(str) {
|
|
|
78
76
|
* convert a string to the corresponding hexadecimal value
|
|
79
77
|
* @public
|
|
80
78
|
* @function
|
|
81
|
-
* @
|
|
79
|
+
* @memberof utils.string
|
|
82
80
|
* @name toHex
|
|
83
81
|
* @param {string} str the string to be converted
|
|
84
82
|
* @returns {string} the converted hexadecimal value
|
package/src/utils/utils.js
CHANGED
|
@@ -10,7 +10,6 @@ import { version } from "./../index.js";
|
|
|
10
10
|
/**
|
|
11
11
|
* a collection of utility functions
|
|
12
12
|
* @namespace utils
|
|
13
|
-
* @memberOf me
|
|
14
13
|
*/
|
|
15
14
|
|
|
16
15
|
// guid default value
|
|
@@ -29,7 +28,7 @@ var utils = {
|
|
|
29
28
|
* Get image pixels
|
|
30
29
|
* @public
|
|
31
30
|
* @function
|
|
32
|
-
* @
|
|
31
|
+
* @memberof utils
|
|
33
32
|
* @name getPixels
|
|
34
33
|
* @param {HTMLImageElement|HTMLCanvasElement} image Image to read
|
|
35
34
|
* @returns {ImageData} ImageData object
|
|
@@ -52,10 +51,10 @@ var utils = {
|
|
|
52
51
|
* Compare two version strings
|
|
53
52
|
* @public
|
|
54
53
|
* @function
|
|
55
|
-
* @
|
|
54
|
+
* @memberof utils
|
|
56
55
|
* @name checkVersion
|
|
57
56
|
* @param {string} first First version string to compare
|
|
58
|
-
* @param {string} [second=
|
|
57
|
+
* @param {string} [second=version] Second version string to compare
|
|
59
58
|
* @returns {number} comparison result <br>< 0 : first < second<br>
|
|
60
59
|
* 0 : first == second<br>
|
|
61
60
|
* > 0 : first > second
|
|
@@ -85,7 +84,7 @@ var utils = {
|
|
|
85
84
|
* parse the fragment (hash) from a URL and returns them into
|
|
86
85
|
* @public
|
|
87
86
|
* @function
|
|
88
|
-
* @
|
|
87
|
+
* @memberof utils
|
|
89
88
|
* @name getUriFragment
|
|
90
89
|
* @param {string} [url=document.location] an optional params string or URL containing fragment (hash) params to be parsed
|
|
91
90
|
* @returns {object} an object representing the deserialized params string.
|