melonjs 10.3.0 → 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 +2419 -3072
- package/dist/melonjs.min.js +3 -3
- package/dist/melonjs.module.d.ts +3417 -3816
- package/dist/melonjs.module.js +2737 -3002
- package/package.json +16 -16
- package/src/audio/audio.js +29 -30
- package/src/camera/camera2d.js +46 -56
- package/src/entity/draggable.js +12 -13
- package/src/entity/droptarget.js +13 -15
- package/src/entity/entity.js +30 -36
- package/src/game.js +21 -22
- package/src/geometries/ellipse.js +40 -46
- package/src/geometries/line.js +9 -11
- package/src/geometries/poly.js +53 -53
- package/src/geometries/rectangle.js +42 -44
- package/src/index.js +4 -14
- 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 +30 -31
- package/src/input/pointerevent.js +26 -26
- package/src/lang/deprecated.js +25 -6
- package/src/level/level.js +23 -24
- package/src/level/tiled/TMXGroup.js +7 -8
- package/src/level/tiled/TMXLayer.js +30 -32
- package/src/level/tiled/TMXObject.js +21 -21
- package/src/level/tiled/TMXTile.js +18 -18
- package/src/level/tiled/TMXTileMap.js +37 -44
- package/src/level/tiled/TMXTileset.js +12 -15
- package/src/level/tiled/TMXTilesetGroup.js +9 -9
- package/src/level/tiled/renderer/TMXHexagonalRenderer.js +7 -8
- package/src/level/tiled/renderer/TMXIsometricRenderer.js +7 -8
- package/src/level/tiled/renderer/TMXOrthogonalRenderer.js +4 -5
- package/src/level/tiled/renderer/TMXRenderer.js +24 -25
- package/src/level/tiled/renderer/TMXStaggeredRenderer.js +1 -4
- package/src/loader/loader.js +14 -15
- package/src/loader/loadingscreen.js +2 -4
- package/src/math/color.js +47 -66
- package/src/math/math.js +15 -16
- package/src/math/matrix2.js +53 -58
- package/src/math/matrix3.js +56 -62
- package/src/math/observable_vector2.js +75 -76
- package/src/math/observable_vector3.js +79 -80
- package/src/math/vector2.js +91 -92
- package/src/math/vector3.js +94 -96
- package/src/particles/emitter.js +38 -40
- package/src/particles/particle.js +4 -5
- package/src/particles/particlecontainer.js +2 -3
- package/src/physics/body.js +44 -142
- package/src/physics/bounds.js +47 -47
- package/src/physics/collision.js +13 -14
- package/src/physics/detector.js +14 -14
- package/src/physics/quadtree.js +17 -19
- package/src/physics/sat.js +26 -26
- package/src/physics/world.js +24 -28
- package/src/plugin/plugin.js +11 -14
- package/src/renderable/GUI.js +41 -46
- package/src/renderable/collectable.js +4 -8
- package/src/renderable/colorlayer.js +6 -10
- package/src/renderable/container.js +87 -72
- package/src/renderable/imagelayer.js +25 -31
- package/src/renderable/nineslicesprite.js +41 -41
- package/src/renderable/renderable.js +112 -122
- package/src/renderable/sprite.js +62 -68
- package/src/renderable/trigger.js +25 -30
- package/src/state/stage.js +13 -17
- package/src/state/state.js +26 -27
- package/src/system/device.js +74 -75
- package/src/system/event.js +71 -72
- 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 -54
- package/src/text/bitmaptextdata.js +10 -10
- package/src/text/glyph.js +3 -0
- package/src/text/text.js +44 -49
- package/src/tweens/easing.js +1 -1
- package/src/tweens/interpolation.js +1 -1
- package/src/tweens/tween.js +43 -44
- 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 +58 -59
- package/src/video/renderer.js +49 -53
- package/src/video/texture.js +98 -111
- package/src/video/texture_cache.js +2 -2
- package/src/video/video.js +15 -16
- package/src/video/webgl/glshader.js +37 -38
- package/src/video/webgl/webgl_compositor.js +31 -32
- package/src/video/webgl/webgl_renderer.js +79 -80
package/src/tweens/tween.js
CHANGED
|
@@ -22,23 +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
|
-
* @param {object} object object on which to apply the tween
|
|
28
|
-
* @example
|
|
29
|
-
* // add a tween to change the object pos.x and pos.y variable to 200 in 3 seconds
|
|
30
|
-
* tween = new me.Tween(myObject.pos).to({
|
|
31
|
-
* x: 200,
|
|
32
|
-
* y: 200,
|
|
33
|
-
* }, {
|
|
34
|
-
* duration: 3000,
|
|
35
|
-
* easing: me.Tween.Easing.Bounce.Out,
|
|
36
|
-
* autoStart : true
|
|
37
|
-
* }).onComplete(myFunc);
|
|
38
25
|
*/
|
|
39
26
|
class Tween {
|
|
40
27
|
|
|
41
|
-
|
|
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
|
+
*/
|
|
42
41
|
constructor ( object ) {
|
|
43
42
|
this.setProperties(object);
|
|
44
43
|
}
|
|
@@ -120,19 +119,19 @@ class Tween {
|
|
|
120
119
|
/**
|
|
121
120
|
* object properties to be updated and duration
|
|
122
121
|
* @name to
|
|
123
|
-
* @memberof
|
|
122
|
+
* @memberof Tween
|
|
124
123
|
* @public
|
|
125
124
|
* @function
|
|
126
125
|
* @param {object} properties hash of properties
|
|
127
126
|
* @param {object|number} [options] object of tween properties, or a duration if a numeric value is passed
|
|
128
127
|
* @param {number} [options.duration] tween duration
|
|
129
|
-
* @param {
|
|
128
|
+
* @param {Tween.Easing} [options.easing] easing function
|
|
130
129
|
* @param {number} [options.delay] delay amount expressed in milliseconds
|
|
131
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.
|
|
132
131
|
* @param {number} [options.repeat] amount of times the tween should be repeated
|
|
133
|
-
* @param {
|
|
132
|
+
* @param {Tween.Interpolation} [options.interpolation] interpolation function
|
|
134
133
|
* @param {boolean} [options.autoStart] allow this tween to start automatically. Otherwise call me.Tween.start().
|
|
135
|
-
* @returns {
|
|
134
|
+
* @returns {Tween} this instance for object chaining
|
|
136
135
|
*/
|
|
137
136
|
to( properties, options ) {
|
|
138
137
|
|
|
@@ -162,11 +161,11 @@ class Tween {
|
|
|
162
161
|
/**
|
|
163
162
|
* start the tween
|
|
164
163
|
* @name start
|
|
165
|
-
* @memberof
|
|
164
|
+
* @memberof Tween
|
|
166
165
|
* @public
|
|
167
166
|
* @function
|
|
168
167
|
* @param {number} [time] the current time when the tween was started
|
|
169
|
-
* @returns {
|
|
168
|
+
* @returns {Tween} this instance for object chaining
|
|
170
169
|
*/
|
|
171
170
|
start( time = timer.getTime() ) {
|
|
172
171
|
|
|
@@ -209,10 +208,10 @@ class Tween {
|
|
|
209
208
|
/**
|
|
210
209
|
* stop the tween
|
|
211
210
|
* @name stop
|
|
212
|
-
* @memberof
|
|
211
|
+
* @memberof Tween
|
|
213
212
|
* @public
|
|
214
213
|
* @function
|
|
215
|
-
* @returns {
|
|
214
|
+
* @returns {Tween} this instance for object chaining
|
|
216
215
|
*/
|
|
217
216
|
stop() {
|
|
218
217
|
// remove the tween from the world container
|
|
@@ -223,11 +222,11 @@ class Tween {
|
|
|
223
222
|
/**
|
|
224
223
|
* delay the tween
|
|
225
224
|
* @name delay
|
|
226
|
-
* @memberof
|
|
225
|
+
* @memberof Tween
|
|
227
226
|
* @public
|
|
228
227
|
* @function
|
|
229
228
|
* @param {number} amount delay amount expressed in milliseconds
|
|
230
|
-
* @returns {
|
|
229
|
+
* @returns {Tween} this instance for object chaining
|
|
231
230
|
*/
|
|
232
231
|
delay( amount ) {
|
|
233
232
|
|
|
@@ -239,11 +238,11 @@ class Tween {
|
|
|
239
238
|
/**
|
|
240
239
|
* Repeat the tween
|
|
241
240
|
* @name repeat
|
|
242
|
-
* @memberof
|
|
241
|
+
* @memberof Tween
|
|
243
242
|
* @public
|
|
244
243
|
* @function
|
|
245
244
|
* @param {number} times amount of times the tween should be repeated
|
|
246
|
-
* @returns {
|
|
245
|
+
* @returns {Tween} this instance for object chaining
|
|
247
246
|
*/
|
|
248
247
|
repeat( times ) {
|
|
249
248
|
|
|
@@ -256,12 +255,12 @@ class Tween {
|
|
|
256
255
|
* Allows the tween to bounce back to their original value when finished.
|
|
257
256
|
* To be used together with repeat to create endless loops.
|
|
258
257
|
* @name yoyo
|
|
259
|
-
* @memberof
|
|
258
|
+
* @memberof Tween
|
|
260
259
|
* @public
|
|
261
260
|
* @function
|
|
262
|
-
* @see
|
|
261
|
+
* @see Tween#repeat
|
|
263
262
|
* @param {boolean} yoyo
|
|
264
|
-
* @returns {
|
|
263
|
+
* @returns {Tween} this instance for object chaining
|
|
265
264
|
*/
|
|
266
265
|
yoyo( yoyo ) {
|
|
267
266
|
|
|
@@ -273,11 +272,11 @@ class Tween {
|
|
|
273
272
|
/**
|
|
274
273
|
* set the easing function
|
|
275
274
|
* @name easing
|
|
276
|
-
* @memberof
|
|
275
|
+
* @memberof Tween
|
|
277
276
|
* @public
|
|
278
277
|
* @function
|
|
279
|
-
* @param {
|
|
280
|
-
* @returns {
|
|
278
|
+
* @param {Tween.Easing} easing easing function
|
|
279
|
+
* @returns {Tween} this instance for object chaining
|
|
281
280
|
*/
|
|
282
281
|
easing( easing ) {
|
|
283
282
|
if (typeof easing !== "function") {
|
|
@@ -290,11 +289,11 @@ class Tween {
|
|
|
290
289
|
/**
|
|
291
290
|
* set the interpolation function
|
|
292
291
|
* @name interpolation
|
|
293
|
-
* @memberof
|
|
292
|
+
* @memberof Tween
|
|
294
293
|
* @public
|
|
295
294
|
* @function
|
|
296
|
-
* @param {
|
|
297
|
-
* @returns {
|
|
295
|
+
* @param {Tween.Interpolation} interpolation interpolation function
|
|
296
|
+
* @returns {Tween} this instance for object chaining
|
|
298
297
|
*/
|
|
299
298
|
interpolation( interpolation ) {
|
|
300
299
|
this._interpolationFunction = interpolation;
|
|
@@ -304,11 +303,11 @@ class Tween {
|
|
|
304
303
|
/**
|
|
305
304
|
* chain the tween
|
|
306
305
|
* @name chain
|
|
307
|
-
* @memberof
|
|
306
|
+
* @memberof Tween
|
|
308
307
|
* @public
|
|
309
308
|
* @function
|
|
310
|
-
* @param {...
|
|
311
|
-
* @returns {
|
|
309
|
+
* @param {...Tween} chainedTween Tween(s) to be chained
|
|
310
|
+
* @returns {Tween} this instance for object chaining
|
|
312
311
|
*/
|
|
313
312
|
chain() {
|
|
314
313
|
this._chainedTweens = arguments;
|
|
@@ -318,11 +317,11 @@ class Tween {
|
|
|
318
317
|
/**
|
|
319
318
|
* onStart callback
|
|
320
319
|
* @name onStart
|
|
321
|
-
* @memberof
|
|
320
|
+
* @memberof Tween
|
|
322
321
|
* @public
|
|
323
322
|
* @function
|
|
324
323
|
* @param {Function} onStartCallback callback
|
|
325
|
-
* @returns {
|
|
324
|
+
* @returns {Tween} this instance for object chaining
|
|
326
325
|
*/
|
|
327
326
|
onStart( onStartCallback ) {
|
|
328
327
|
this._onStartCallback = onStartCallback;
|
|
@@ -332,11 +331,11 @@ class Tween {
|
|
|
332
331
|
/**
|
|
333
332
|
* onUpdate callback
|
|
334
333
|
* @name onUpdate
|
|
335
|
-
* @memberof
|
|
334
|
+
* @memberof Tween
|
|
336
335
|
* @public
|
|
337
336
|
* @function
|
|
338
337
|
* @param {Function} onUpdateCallback callback
|
|
339
|
-
* @returns {
|
|
338
|
+
* @returns {Tween} this instance for object chaining
|
|
340
339
|
*/
|
|
341
340
|
onUpdate( onUpdateCallback ) {
|
|
342
341
|
this._onUpdateCallback = onUpdateCallback;
|
|
@@ -346,11 +345,11 @@ class Tween {
|
|
|
346
345
|
/**
|
|
347
346
|
* onComplete callback
|
|
348
347
|
* @name onComplete
|
|
349
|
-
* @memberof
|
|
348
|
+
* @memberof Tween
|
|
350
349
|
* @public
|
|
351
350
|
* @function
|
|
352
351
|
* @param {Function} onCompleteCallback callback
|
|
353
|
-
* @returns {
|
|
352
|
+
* @returns {Tween} this instance for object chaining
|
|
354
353
|
*/
|
|
355
354
|
onComplete( onCompleteCallback ) {
|
|
356
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
|
-
* @memberof
|
|
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
|
-
* @memberof
|
|
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
|
-
* @memberof
|
|
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
|
-
* @memberof
|
|
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
|
-
* @memberof
|
|
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
|
-
* @memberof
|
|
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
|
-
* @memberof
|
|
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
|
-
* @memberof
|
|
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
|
-
* @memberof
|
|
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
|
-
* @memberof
|
|
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
|
-
* @memberof
|
|
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
|
-
* @memberof
|
|
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
|
-
* @memberof
|
|
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
|
-
* @memberof
|
|
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
|
-
* @memberof
|
|
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
|
-
* @memberof
|
|
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
|
-
* @memberof
|
|
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
|
-
* @memberof
|
|
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.
|