melonjs 10.2.3 → 10.3.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/dist/melonjs.js +1741 -1558
- package/dist/melonjs.min.js +4 -4
- package/dist/melonjs.module.d.ts +1256 -1758
- package/dist/melonjs.module.js +1734 -1582
- package/package.json +12 -12
- package/src/audio/audio.js +3 -3
- package/src/camera/camera2d.js +26 -27
- package/src/entity/draggable.js +10 -19
- package/src/entity/droptarget.js +12 -20
- package/src/entity/entity.js +13 -13
- package/src/game.js +6 -6
- package/src/{shapes → geometries}/ellipse.js +19 -20
- package/src/{shapes → geometries}/line.js +6 -7
- package/src/{shapes → geometries}/poly.js +70 -23
- package/src/{shapes → geometries}/rectangle.js +23 -24
- package/src/index.js +8 -9
- package/src/input/gamepad.js +7 -7
- package/src/input/input.js +2 -2
- package/src/input/keyboard.js +108 -108
- package/src/input/pointer.js +61 -28
- package/src/input/pointerevent.js +79 -16
- package/src/lang/deprecated.js +26 -15
- package/src/level/level.js +10 -10
- package/src/level/tiled/TMXGroup.js +6 -7
- package/src/level/tiled/TMXLayer.js +10 -11
- package/src/level/tiled/TMXObject.js +57 -51
- package/src/level/tiled/TMXTile.js +2 -3
- package/src/level/tiled/TMXTileMap.js +3 -4
- package/src/level/tiled/TMXTileset.js +1 -2
- package/src/level/tiled/TMXTilesetGroup.js +1 -2
- package/src/level/tiled/renderer/TMXHexagonalRenderer.js +2 -3
- package/src/level/tiled/renderer/TMXIsometricRenderer.js +2 -3
- package/src/level/tiled/renderer/TMXOrthogonalRenderer.js +2 -3
- package/src/level/tiled/renderer/TMXRenderer.js +1 -2
- package/src/level/tiled/renderer/TMXStaggeredRenderer.js +2 -3
- package/src/loader/loader.js +17 -15
- package/src/loader/loadingscreen.js +1 -2
- package/src/math/color.js +23 -24
- package/src/math/math.js +16 -16
- package/src/math/matrix2.js +24 -25
- package/src/math/matrix3.js +26 -27
- package/src/math/observable_vector2.js +46 -35
- package/src/math/observable_vector3.js +54 -36
- package/src/math/vector2.js +58 -47
- package/src/math/vector3.js +66 -48
- package/src/particles/emitter.js +64 -72
- package/src/particles/particle.js +3 -4
- package/src/particles/particlecontainer.js +2 -3
- package/src/physics/body.js +38 -39
- package/src/physics/bounds.js +30 -32
- package/src/physics/collision.js +6 -6
- package/src/physics/detector.js +3 -3
- package/src/physics/quadtree.js +8 -9
- package/src/physics/sat.js +4 -4
- package/src/physics/world.js +11 -12
- package/src/plugin/plugin.js +6 -7
- package/src/renderable/GUI.js +7 -8
- package/src/renderable/collectable.js +3 -4
- package/src/renderable/colorlayer.js +7 -8
- package/src/renderable/container.js +36 -37
- package/src/renderable/imagelayer.js +4 -5
- package/src/renderable/nineslicesprite.js +2 -3
- package/src/renderable/renderable.js +45 -46
- package/src/renderable/sprite.js +16 -17
- package/src/renderable/trigger.js +4 -5
- package/src/state/stage.js +8 -9
- package/src/state/state.js +24 -24
- package/src/system/device.js +41 -97
- package/src/system/event.js +45 -33
- package/src/system/pooling.js +1 -1
- package/src/system/save.js +3 -3
- package/src/system/timer.js +13 -13
- package/src/text/bitmaptext.js +12 -13
- package/src/text/bitmaptextdata.js +5 -6
- package/src/text/text.js +16 -17
- package/src/tweens/easing.js +1 -1
- package/src/tweens/interpolation.js +1 -1
- package/src/tweens/tween.js +14 -15
- package/src/utils/agent.js +3 -3
- package/src/utils/array.js +4 -4
- package/src/utils/file.js +3 -3
- package/src/utils/function.js +3 -3
- package/src/utils/string.js +7 -7
- package/src/utils/utils.js +4 -4
- package/src/video/canvas/canvas_renderer.js +39 -40
- package/src/video/renderer.js +29 -30
- package/src/video/texture.js +8 -9
- package/src/video/texture_cache.js +2 -4
- package/src/video/video.js +7 -7
- package/src/video/webgl/buffer/vertex.js +2 -2
- package/src/video/webgl/glshader.js +11 -12
- package/src/video/webgl/webgl_compositor.js +118 -90
- package/src/video/webgl/webgl_renderer.js +95 -74
package/src/text/text.js
CHANGED
|
@@ -38,9 +38,8 @@ var setContextStyle = function(context, font, stroke = false) {
|
|
|
38
38
|
* @classdesc
|
|
39
39
|
* a generic system font object.
|
|
40
40
|
* @class Text
|
|
41
|
-
* @
|
|
42
|
-
* @
|
|
43
|
-
* @constructor
|
|
41
|
+
* @augments me.Renderable
|
|
42
|
+
* @memberof me
|
|
44
43
|
* @param {number} x position of the text object
|
|
45
44
|
* @param {number} y position of the text object
|
|
46
45
|
* @param {object} settings the text configuration
|
|
@@ -161,7 +160,7 @@ class Text extends Renderable {
|
|
|
161
160
|
* @private
|
|
162
161
|
* @type {string[]}
|
|
163
162
|
* @name _text
|
|
164
|
-
* @
|
|
163
|
+
* @memberof me.Text
|
|
165
164
|
*/
|
|
166
165
|
this._text = [];
|
|
167
166
|
|
|
@@ -171,7 +170,7 @@ class Text extends Renderable {
|
|
|
171
170
|
* @type {number}
|
|
172
171
|
* @name fontSize
|
|
173
172
|
* @default 10
|
|
174
|
-
* @
|
|
173
|
+
* @memberof me.Text
|
|
175
174
|
*/
|
|
176
175
|
this.fontSize = 10;
|
|
177
176
|
|
|
@@ -215,20 +214,19 @@ class Text extends Renderable {
|
|
|
215
214
|
onDeactivateEvent() {
|
|
216
215
|
// free the canvas and potential corresponding texture when deactivated
|
|
217
216
|
if (this.offScreenCanvas === true) {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
renderer.cache.remove(this.canvas);
|
|
221
|
-
}
|
|
217
|
+
renderer.currentCompositor.deleteTexture2D(renderer.currentCompositor.getTexture2D(this.glTextureUnit));
|
|
218
|
+
renderer.cache.delete(this.canvas);
|
|
222
219
|
this.canvas.width = this.canvas.height = 0;
|
|
223
220
|
this.context = undefined;
|
|
224
221
|
this.canvas = undefined;
|
|
222
|
+
this.glTextureUnit = undefined;
|
|
225
223
|
}
|
|
226
224
|
}
|
|
227
225
|
|
|
228
226
|
/**
|
|
229
227
|
* make the font bold
|
|
230
228
|
* @name bold
|
|
231
|
-
* @
|
|
229
|
+
* @memberof me.Text.prototype
|
|
232
230
|
* @function
|
|
233
231
|
* @returns {me.Text} this object for chaining
|
|
234
232
|
*/
|
|
@@ -241,7 +239,7 @@ class Text extends Renderable {
|
|
|
241
239
|
/**
|
|
242
240
|
* make the font italic
|
|
243
241
|
* @name italic
|
|
244
|
-
* @
|
|
242
|
+
* @memberof me.Text.prototype
|
|
245
243
|
* @function
|
|
246
244
|
* @returns {me.Text} this object for chaining
|
|
247
245
|
*/
|
|
@@ -254,7 +252,7 @@ class Text extends Renderable {
|
|
|
254
252
|
/**
|
|
255
253
|
* set the font family and size
|
|
256
254
|
* @name setFont
|
|
257
|
-
* @
|
|
255
|
+
* @memberof me.Text.prototype
|
|
258
256
|
* @function
|
|
259
257
|
* @param {string} font a CSS font name
|
|
260
258
|
* @param {number|string} [size=10] size in px, or size + suffix (px, em, pt)
|
|
@@ -298,7 +296,7 @@ class Text extends Renderable {
|
|
|
298
296
|
/**
|
|
299
297
|
* change the text to be displayed
|
|
300
298
|
* @name setText
|
|
301
|
-
* @
|
|
299
|
+
* @memberof me.Text.prototype
|
|
302
300
|
* @function
|
|
303
301
|
* @param {number|string|string[]} value a string, or an array of strings
|
|
304
302
|
* @returns {me.Text} this object for chaining
|
|
@@ -319,7 +317,7 @@ class Text extends Renderable {
|
|
|
319
317
|
/**
|
|
320
318
|
* measure the given text size in pixels
|
|
321
319
|
* @name measureText
|
|
322
|
-
* @
|
|
320
|
+
* @memberof me.Text.prototype
|
|
323
321
|
* @function
|
|
324
322
|
* @param {me.CanvasRenderer|me.WebGLRenderer} [renderer] reference to the active renderer
|
|
325
323
|
* @param {string} [text] the text to be measured
|
|
@@ -380,7 +378,8 @@ class Text extends Renderable {
|
|
|
380
378
|
|
|
381
379
|
if (renderer instanceof WebGLRenderer) {
|
|
382
380
|
// invalidate the previous corresponding texture so that it can reuploaded once changed
|
|
383
|
-
renderer.
|
|
381
|
+
this.glTextureUnit = renderer.cache.getUnit(renderer.cache.get(this.canvas));
|
|
382
|
+
renderer.currentCompositor.unbindTexture2D(null, this.glTextureUnit);
|
|
384
383
|
|
|
385
384
|
if (renderer.WebGLVersion === 1) {
|
|
386
385
|
// round size to next Pow2
|
|
@@ -407,7 +406,7 @@ class Text extends Renderable {
|
|
|
407
406
|
/**
|
|
408
407
|
* draw a text at the specified coord
|
|
409
408
|
* @name draw
|
|
410
|
-
* @
|
|
409
|
+
* @memberof me.Text.prototype
|
|
411
410
|
* @function
|
|
412
411
|
* @param {me.CanvasRenderer|me.WebGLRenderer} renderer Reference to the destination renderer instance
|
|
413
412
|
* @param {string} [text]
|
|
@@ -473,7 +472,7 @@ class Text extends Renderable {
|
|
|
473
472
|
* by the `lineWidth` and `fillStroke` properties. <br>
|
|
474
473
|
* Note : using drawStroke is not recommended for performance reasons
|
|
475
474
|
* @name drawStroke
|
|
476
|
-
* @
|
|
475
|
+
* @memberof me.Text.prototype
|
|
477
476
|
* @function
|
|
478
477
|
* @param {me.CanvasRenderer|me.WebGLRenderer} renderer Reference to the destination renderer instance
|
|
479
478
|
* @param {string} text
|
package/src/tweens/easing.js
CHANGED
package/src/tweens/tween.js
CHANGED
|
@@ -23,8 +23,7 @@ import { Interpolation } from "./interpolation.js";
|
|
|
23
23
|
* author lechecacharro<br>
|
|
24
24
|
* author Josh Faul / http://jocafa.com/
|
|
25
25
|
* @class Tween
|
|
26
|
-
* @
|
|
27
|
-
* @constructor
|
|
26
|
+
* @memberof me
|
|
28
27
|
* @param {object} object object on which to apply the tween
|
|
29
28
|
* @example
|
|
30
29
|
* // add a tween to change the object pos.x and pos.y variable to 200 in 3 seconds
|
|
@@ -121,7 +120,7 @@ class Tween {
|
|
|
121
120
|
/**
|
|
122
121
|
* object properties to be updated and duration
|
|
123
122
|
* @name to
|
|
124
|
-
* @
|
|
123
|
+
* @memberof me.Tween
|
|
125
124
|
* @public
|
|
126
125
|
* @function
|
|
127
126
|
* @param {object} properties hash of properties
|
|
@@ -163,7 +162,7 @@ class Tween {
|
|
|
163
162
|
/**
|
|
164
163
|
* start the tween
|
|
165
164
|
* @name start
|
|
166
|
-
* @
|
|
165
|
+
* @memberof me.Tween
|
|
167
166
|
* @public
|
|
168
167
|
* @function
|
|
169
168
|
* @param {number} [time] the current time when the tween was started
|
|
@@ -210,7 +209,7 @@ class Tween {
|
|
|
210
209
|
/**
|
|
211
210
|
* stop the tween
|
|
212
211
|
* @name stop
|
|
213
|
-
* @
|
|
212
|
+
* @memberof me.Tween
|
|
214
213
|
* @public
|
|
215
214
|
* @function
|
|
216
215
|
* @returns {me.Tween} this instance for object chaining
|
|
@@ -224,7 +223,7 @@ class Tween {
|
|
|
224
223
|
/**
|
|
225
224
|
* delay the tween
|
|
226
225
|
* @name delay
|
|
227
|
-
* @
|
|
226
|
+
* @memberof me.Tween
|
|
228
227
|
* @public
|
|
229
228
|
* @function
|
|
230
229
|
* @param {number} amount delay amount expressed in milliseconds
|
|
@@ -240,7 +239,7 @@ class Tween {
|
|
|
240
239
|
/**
|
|
241
240
|
* Repeat the tween
|
|
242
241
|
* @name repeat
|
|
243
|
-
* @
|
|
242
|
+
* @memberof me.Tween
|
|
244
243
|
* @public
|
|
245
244
|
* @function
|
|
246
245
|
* @param {number} times amount of times the tween should be repeated
|
|
@@ -257,7 +256,7 @@ class Tween {
|
|
|
257
256
|
* Allows the tween to bounce back to their original value when finished.
|
|
258
257
|
* To be used together with repeat to create endless loops.
|
|
259
258
|
* @name yoyo
|
|
260
|
-
* @
|
|
259
|
+
* @memberof me.Tween
|
|
261
260
|
* @public
|
|
262
261
|
* @function
|
|
263
262
|
* @see me.Tween#repeat
|
|
@@ -274,7 +273,7 @@ class Tween {
|
|
|
274
273
|
/**
|
|
275
274
|
* set the easing function
|
|
276
275
|
* @name easing
|
|
277
|
-
* @
|
|
276
|
+
* @memberof me.Tween
|
|
278
277
|
* @public
|
|
279
278
|
* @function
|
|
280
279
|
* @param {me.Tween.Easing} easing easing function
|
|
@@ -291,7 +290,7 @@ class Tween {
|
|
|
291
290
|
/**
|
|
292
291
|
* set the interpolation function
|
|
293
292
|
* @name interpolation
|
|
294
|
-
* @
|
|
293
|
+
* @memberof me.Tween
|
|
295
294
|
* @public
|
|
296
295
|
* @function
|
|
297
296
|
* @param {me.Tween.Interpolation} interpolation interpolation function
|
|
@@ -305,13 +304,13 @@ class Tween {
|
|
|
305
304
|
/**
|
|
306
305
|
* chain the tween
|
|
307
306
|
* @name chain
|
|
308
|
-
* @
|
|
307
|
+
* @memberof me.Tween
|
|
309
308
|
* @public
|
|
310
309
|
* @function
|
|
311
310
|
* @param {...me.Tween} chainedTween Tween(s) to be chained
|
|
312
311
|
* @returns {me.Tween} this instance for object chaining
|
|
313
312
|
*/
|
|
314
|
-
chain(
|
|
313
|
+
chain() {
|
|
315
314
|
this._chainedTweens = arguments;
|
|
316
315
|
return this;
|
|
317
316
|
}
|
|
@@ -319,7 +318,7 @@ class Tween {
|
|
|
319
318
|
/**
|
|
320
319
|
* onStart callback
|
|
321
320
|
* @name onStart
|
|
322
|
-
* @
|
|
321
|
+
* @memberof me.Tween
|
|
323
322
|
* @public
|
|
324
323
|
* @function
|
|
325
324
|
* @param {Function} onStartCallback callback
|
|
@@ -333,7 +332,7 @@ class Tween {
|
|
|
333
332
|
/**
|
|
334
333
|
* onUpdate callback
|
|
335
334
|
* @name onUpdate
|
|
336
|
-
* @
|
|
335
|
+
* @memberof me.Tween
|
|
337
336
|
* @public
|
|
338
337
|
* @function
|
|
339
338
|
* @param {Function} onUpdateCallback callback
|
|
@@ -347,7 +346,7 @@ class Tween {
|
|
|
347
346
|
/**
|
|
348
347
|
* onComplete callback
|
|
349
348
|
* @name onComplete
|
|
350
|
-
* @
|
|
349
|
+
* @memberof me.Tween
|
|
351
350
|
* @public
|
|
352
351
|
* @function
|
|
353
352
|
* @param {Function} onCompleteCallback callback
|
package/src/utils/agent.js
CHANGED
|
@@ -3,7 +3,7 @@ import { capitalize } from "./string.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* a collection of utility functons to ease porting between different user agents.
|
|
5
5
|
* @namespace me.utils.agent
|
|
6
|
-
* @
|
|
6
|
+
* @memberof me
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -20,7 +20,7 @@ var vendors = [ "ms", "MS", "moz", "webkit", "o" ];
|
|
|
20
20
|
* @param {string} name Property name
|
|
21
21
|
* @param {object} [obj=window] Object or element reference to access
|
|
22
22
|
* @returns {string} Value of property
|
|
23
|
-
* @
|
|
23
|
+
* @memberof me.utils.agent
|
|
24
24
|
*/
|
|
25
25
|
export function prefixed(name, obj) {
|
|
26
26
|
obj = obj || window;
|
|
@@ -47,7 +47,7 @@ export function prefixed(name, obj) {
|
|
|
47
47
|
* @param {string} value Property value
|
|
48
48
|
* @param {object} [obj=window] Object or element reference to access
|
|
49
49
|
* @returns {boolean} true if one of the vendor-prefixed property was found
|
|
50
|
-
* @
|
|
50
|
+
* @memberof me.utils.agent
|
|
51
51
|
*/
|
|
52
52
|
export function setPrefixed(name, value, obj) {
|
|
53
53
|
obj = obj || window;
|
package/src/utils/array.js
CHANGED
|
@@ -3,14 +3,14 @@ import {random as mathRandom, weightedRandom as mathWeightedRandom} from "./../m
|
|
|
3
3
|
/**
|
|
4
4
|
* a collection of array utility functions
|
|
5
5
|
* @namespace me.utils.array
|
|
6
|
-
* @
|
|
6
|
+
* @memberof me
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Remove the specified object from the given Array
|
|
11
11
|
* @public
|
|
12
12
|
* @function
|
|
13
|
-
* @
|
|
13
|
+
* @memberof me.utils.array
|
|
14
14
|
* @name remove
|
|
15
15
|
* @param {Array} arr array from which to remove an object
|
|
16
16
|
* @param {object} obj to be removed
|
|
@@ -31,7 +31,7 @@ export function remove(arr, obj) {
|
|
|
31
31
|
* return a random array element
|
|
32
32
|
* @public
|
|
33
33
|
* @function
|
|
34
|
-
* @
|
|
34
|
+
* @memberof me.utils.array
|
|
35
35
|
* @name random
|
|
36
36
|
* @param {Array} arr array to pick a element
|
|
37
37
|
* @returns {any} random member of array
|
|
@@ -48,7 +48,7 @@ export function random(arr) {
|
|
|
48
48
|
* return a weighted random array element, favoring the earlier entries
|
|
49
49
|
* @public
|
|
50
50
|
* @function
|
|
51
|
-
* @
|
|
51
|
+
* @memberof me.utils.array
|
|
52
52
|
* @name weightedRandom
|
|
53
53
|
* @param {Array} arr array to pick a element
|
|
54
54
|
* @returns {any} random member of array
|
package/src/utils/file.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* a collection of file utility functions
|
|
4
4
|
* @namespace me.utils.file
|
|
5
|
-
* @
|
|
5
|
+
* @memberof me
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
// regexp to deal with file name & path
|
|
@@ -14,7 +14,7 @@ const REMOVE_EXT = /\.[^\.]*$/;
|
|
|
14
14
|
* return the base name of the file without path info
|
|
15
15
|
* @public
|
|
16
16
|
* @function
|
|
17
|
-
* @
|
|
17
|
+
* @memberof me.utils.file
|
|
18
18
|
* @name getBasename
|
|
19
19
|
* @param {string} path path containing the filename
|
|
20
20
|
* @returns {string} the base name without path information.
|
|
@@ -27,7 +27,7 @@ export function getBasename(path) {
|
|
|
27
27
|
* return the extension of the file in the given path
|
|
28
28
|
* @public
|
|
29
29
|
* @function
|
|
30
|
-
* @
|
|
30
|
+
* @memberof me.utils.file
|
|
31
31
|
* @name getExtension
|
|
32
32
|
* @param {string} path path containing the filename
|
|
33
33
|
* @returns {string} filename extension.
|
package/src/utils/function.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* a collection of utility functions
|
|
3
3
|
* @namespace me.utils.function
|
|
4
|
-
* @
|
|
4
|
+
* @memberof me
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Executes a function as soon as the interpreter is idle (stack empty).
|
|
9
9
|
* @public
|
|
10
10
|
* @function
|
|
11
|
-
* @
|
|
11
|
+
* @memberof me.utils.function
|
|
12
12
|
* @name defer
|
|
13
13
|
* @param {Function} func The function to be deferred.
|
|
14
14
|
* @param {object} thisArg The value to be passed as the this parameter to the target function when the deferred function is called
|
|
@@ -29,7 +29,7 @@ export function defer(func, thisArg, ...args) {
|
|
|
29
29
|
* once during a given window of time
|
|
30
30
|
* @public
|
|
31
31
|
* @function
|
|
32
|
-
* @
|
|
32
|
+
* @memberof me.utils.function
|
|
33
33
|
* @name throttle
|
|
34
34
|
* @param {Function} fn the function to be throttled.
|
|
35
35
|
* @param {number} delay The delay in ms
|
package/src/utils/string.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* a collection of string utility functions
|
|
3
3
|
* @namespace me.utils.string
|
|
4
|
-
* @
|
|
4
|
+
* @memberof me
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* converts the first character of the given string to uppercase
|
|
10
10
|
* @public
|
|
11
11
|
* @function
|
|
12
|
-
* @
|
|
12
|
+
* @memberof me.utils.string
|
|
13
13
|
* @name capitalize
|
|
14
14
|
* @param {string} str the string to be capitalized
|
|
15
15
|
* @returns {string} the capitalized string
|
|
@@ -22,7 +22,7 @@ export function capitalize(str) {
|
|
|
22
22
|
* returns the string stripped of whitespace from the left.
|
|
23
23
|
* @public
|
|
24
24
|
* @function
|
|
25
|
-
* @
|
|
25
|
+
* @memberof me.utils.string
|
|
26
26
|
* @name trimLeft
|
|
27
27
|
* @param {string} str the string to be trimmed
|
|
28
28
|
* @returns {string} trimmed string
|
|
@@ -35,7 +35,7 @@ export function trimLeft(str) {
|
|
|
35
35
|
* returns the string stripped of whitespace from the right.
|
|
36
36
|
* @public
|
|
37
37
|
* @function
|
|
38
|
-
* @
|
|
38
|
+
* @memberof me.utils.string
|
|
39
39
|
* @name trimRight
|
|
40
40
|
* @param {string} str the string to be trimmed
|
|
41
41
|
* @returns {string} trimmed string
|
|
@@ -48,7 +48,7 @@ export function trimRight(str) {
|
|
|
48
48
|
* returns true if the given string contains a numeric integer or float value
|
|
49
49
|
* @public
|
|
50
50
|
* @function
|
|
51
|
-
* @
|
|
51
|
+
* @memberof me.utils.string
|
|
52
52
|
* @name isNumeric
|
|
53
53
|
* @param {string} str the string to be tested
|
|
54
54
|
* @returns {boolean} true if string contains only digits
|
|
@@ -64,7 +64,7 @@ export function isNumeric(str) {
|
|
|
64
64
|
* returns true if the given string contains a true or false
|
|
65
65
|
* @public
|
|
66
66
|
* @function
|
|
67
|
-
* @
|
|
67
|
+
* @memberof me.utils.string
|
|
68
68
|
* @name isBoolean
|
|
69
69
|
* @param {string} str the string to be tested
|
|
70
70
|
* @returns {boolean} true if the string is either true or false
|
|
@@ -78,7 +78,7 @@ export function isBoolean(str) {
|
|
|
78
78
|
* convert a string to the corresponding hexadecimal value
|
|
79
79
|
* @public
|
|
80
80
|
* @function
|
|
81
|
-
* @
|
|
81
|
+
* @memberof me.utils.string
|
|
82
82
|
* @name toHex
|
|
83
83
|
* @param {string} str the string to be converted
|
|
84
84
|
* @returns {string} the converted hexadecimal value
|
package/src/utils/utils.js
CHANGED
|
@@ -10,7 +10,7 @@ import { version } from "./../index.js";
|
|
|
10
10
|
/**
|
|
11
11
|
* a collection of utility functions
|
|
12
12
|
* @namespace utils
|
|
13
|
-
* @
|
|
13
|
+
* @memberof me
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
// guid default value
|
|
@@ -29,7 +29,7 @@ var utils = {
|
|
|
29
29
|
* Get image pixels
|
|
30
30
|
* @public
|
|
31
31
|
* @function
|
|
32
|
-
* @
|
|
32
|
+
* @memberof me.utils
|
|
33
33
|
* @name getPixels
|
|
34
34
|
* @param {HTMLImageElement|HTMLCanvasElement} image Image to read
|
|
35
35
|
* @returns {ImageData} ImageData object
|
|
@@ -52,7 +52,7 @@ var utils = {
|
|
|
52
52
|
* Compare two version strings
|
|
53
53
|
* @public
|
|
54
54
|
* @function
|
|
55
|
-
* @
|
|
55
|
+
* @memberof me.utils
|
|
56
56
|
* @name checkVersion
|
|
57
57
|
* @param {string} first First version string to compare
|
|
58
58
|
* @param {string} [second=me.version] Second version string to compare
|
|
@@ -85,7 +85,7 @@ var utils = {
|
|
|
85
85
|
* parse the fragment (hash) from a URL and returns them into
|
|
86
86
|
* @public
|
|
87
87
|
* @function
|
|
88
|
-
* @
|
|
88
|
+
* @memberof me.utils
|
|
89
89
|
* @name getUriFragment
|
|
90
90
|
* @param {string} [url=document.location] an optional params string or URL containing fragment (hash) params to be parsed
|
|
91
91
|
* @returns {object} an object representing the deserialized params string.
|