melonjs 15.1.5 → 15.1.6
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.mjs/_virtual/_commonjsHelpers.js +1 -1
- package/dist/melonjs.mjs/_virtual/earcut.js +1 -1
- package/dist/melonjs.mjs/_virtual/howler.js +1 -1
- package/dist/melonjs.mjs/_virtual/index.js +1 -1
- package/dist/melonjs.mjs/application/application.js +1 -1
- package/dist/melonjs.mjs/application/header.js +1 -1
- package/dist/melonjs.mjs/application/resize.js +1 -1
- package/dist/melonjs.mjs/application/settings.js +1 -1
- package/dist/melonjs.mjs/audio/audio.js +1 -1
- package/dist/melonjs.mjs/camera/camera2d.js +3 -3
- package/dist/melonjs.mjs/const.js +1 -1
- package/dist/melonjs.mjs/entity/entity.js +1 -1
- package/dist/melonjs.mjs/geometries/ellipse.js +1 -1
- package/dist/melonjs.mjs/geometries/line.js +1 -1
- package/dist/melonjs.mjs/geometries/path2d.js +1 -1
- package/dist/melonjs.mjs/geometries/point.js +1 -1
- package/dist/melonjs.mjs/geometries/poly.js +1 -1
- package/dist/melonjs.mjs/geometries/rectangle.js +1 -1
- package/dist/melonjs.mjs/geometries/roundrect.js +1 -1
- package/dist/melonjs.mjs/index.js +4 -3
- package/dist/melonjs.mjs/input/gamepad.js +1 -1
- package/dist/melonjs.mjs/input/input.js +1 -1
- package/dist/melonjs.mjs/input/keyboard.js +1 -1
- package/dist/melonjs.mjs/input/pointer.js +1 -1
- package/dist/melonjs.mjs/input/pointerevent.js +1 -1
- package/dist/melonjs.mjs/lang/console.js +1 -1
- package/dist/melonjs.mjs/lang/deprecated.js +3 -2
- package/dist/melonjs.mjs/level/level.js +1 -1
- package/dist/melonjs.mjs/level/tiled/TMXGroup.js +1 -1
- package/dist/melonjs.mjs/level/tiled/TMXLayer.js +1 -1
- package/dist/melonjs.mjs/level/tiled/TMXObject.js +1 -1
- package/dist/melonjs.mjs/level/tiled/TMXTile.js +1 -1
- package/dist/melonjs.mjs/level/tiled/TMXTileMap.js +1 -1
- package/dist/melonjs.mjs/level/tiled/TMXTileset.js +1 -1
- package/dist/melonjs.mjs/level/tiled/TMXTilesetGroup.js +1 -1
- package/dist/melonjs.mjs/level/tiled/TMXUtils.js +1 -1
- package/dist/melonjs.mjs/level/tiled/constants.js +1 -1
- package/dist/melonjs.mjs/level/tiled/renderer/TMXHexagonalRenderer.js +1 -1
- package/dist/melonjs.mjs/level/tiled/renderer/TMXIsometricRenderer.js +1 -1
- package/dist/melonjs.mjs/level/tiled/renderer/TMXOrthogonalRenderer.js +1 -1
- package/dist/melonjs.mjs/level/tiled/renderer/TMXRenderer.js +1 -1
- package/dist/melonjs.mjs/level/tiled/renderer/TMXStaggeredRenderer.js +1 -1
- package/dist/melonjs.mjs/level/tiled/renderer/autodetect.js +1 -1
- package/dist/melonjs.mjs/loader/cache.js +1 -1
- package/dist/melonjs.mjs/loader/loader.js +1 -1
- package/dist/melonjs.mjs/loader/loadingscreen.js +1 -1
- package/dist/melonjs.mjs/loader/melonjs_logo.png.js +1 -1
- package/dist/melonjs.mjs/loader/parser.js +1 -1
- package/dist/melonjs.mjs/loader/settings.js +1 -1
- package/dist/melonjs.mjs/math/color.js +1 -1
- package/dist/melonjs.mjs/math/math.js +1 -1
- package/dist/melonjs.mjs/math/matrix2.js +1 -1
- package/dist/melonjs.mjs/math/matrix3.js +1 -1
- package/dist/melonjs.mjs/math/observable_vector2.js +1 -1
- package/dist/melonjs.mjs/math/observable_vector3.js +1 -1
- package/dist/melonjs.mjs/math/vector2.js +1 -1
- package/dist/melonjs.mjs/math/vector3.js +1 -1
- package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/esm/arraymultimap.js +1 -1
- package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/esm/multimap.js +1 -1
- package/dist/melonjs.mjs/node_modules/earcut/src/earcut.js +1 -1
- package/dist/melonjs.mjs/node_modules/eventemitter3/index.js +1 -1
- package/dist/melonjs.mjs/node_modules/eventemitter3/index2.js +1 -1
- package/dist/melonjs.mjs/node_modules/howler/dist/howler.js +1 -1
- package/dist/melonjs.mjs/particles/emitter.js +1 -1
- package/dist/melonjs.mjs/particles/particle.js +1 -1
- package/dist/melonjs.mjs/particles/settings.js +1 -1
- package/dist/melonjs.mjs/physics/body.js +3 -3
- package/dist/melonjs.mjs/physics/bounds.js +1 -1
- package/dist/melonjs.mjs/physics/collision.js +1 -1
- package/dist/melonjs.mjs/physics/detector.js +4 -4
- package/dist/melonjs.mjs/physics/quadtree.js +1 -1
- package/dist/melonjs.mjs/physics/response.js +1 -1
- package/dist/melonjs.mjs/physics/sat.js +9 -9
- package/dist/melonjs.mjs/physics/world.js +1 -1
- package/dist/melonjs.mjs/plugin/plugin.js +3 -3
- package/dist/melonjs.mjs/renderable/collectable.js +1 -1
- package/dist/melonjs.mjs/renderable/colorlayer.js +1 -1
- package/dist/melonjs.mjs/renderable/container.js +14 -14
- package/dist/melonjs.mjs/renderable/draggable.js +121 -0
- package/dist/melonjs.mjs/renderable/dragndrop.js +3 -113
- package/dist/melonjs.mjs/renderable/imagelayer.js +1 -1
- package/dist/melonjs.mjs/renderable/light2d.js +1 -1
- package/dist/melonjs.mjs/renderable/nineslicesprite.js +1 -1
- package/dist/melonjs.mjs/renderable/renderable.js +2 -2
- package/dist/melonjs.mjs/renderable/sprite.js +1 -1
- package/dist/melonjs.mjs/renderable/trigger.js +2 -2
- package/dist/melonjs.mjs/renderable/ui/uibaseelement.js +1 -1
- package/dist/melonjs.mjs/renderable/ui/uispriteelement.js +1 -1
- package/dist/melonjs.mjs/renderable/ui/uitextbutton.js +1 -1
- package/dist/melonjs.mjs/state/stage.js +1 -1
- package/dist/melonjs.mjs/state/state.js +1 -1
- package/dist/melonjs.mjs/system/device.js +1 -1
- package/dist/melonjs.mjs/system/dom.js +1 -1
- package/dist/melonjs.mjs/system/event.js +1 -1
- package/dist/melonjs.mjs/system/platform.js +1 -1
- package/dist/melonjs.mjs/system/pooling.js +1 -1
- package/dist/melonjs.mjs/system/save.js +1 -1
- package/dist/melonjs.mjs/system/timer.js +1 -1
- package/dist/melonjs.mjs/text/bitmaptext.js +1 -1
- package/dist/melonjs.mjs/text/bitmaptextdata.js +1 -1
- package/dist/melonjs.mjs/text/glyph.js +1 -1
- package/dist/melonjs.mjs/text/text.js +1 -1
- package/dist/melonjs.mjs/text/textmetrics.js +1 -1
- package/dist/melonjs.mjs/text/textstyle.js +1 -1
- package/dist/melonjs.mjs/tweens/easing.js +1 -1
- package/dist/melonjs.mjs/tweens/interpolation.js +1 -1
- package/dist/melonjs.mjs/tweens/tween.js +1 -1
- package/dist/melonjs.mjs/utils/agent.js +1 -1
- package/dist/melonjs.mjs/utils/array.js +1 -1
- package/dist/melonjs.mjs/utils/file.js +1 -1
- package/dist/melonjs.mjs/utils/function.js +1 -1
- package/dist/melonjs.mjs/utils/string.js +1 -1
- package/dist/melonjs.mjs/utils/utils.js +1 -1
- package/dist/melonjs.mjs/video/canvas/canvas_renderer.js +1 -1
- package/dist/melonjs.mjs/video/renderer.js +1 -1
- package/dist/melonjs.mjs/video/texture/atlas.js +1 -1
- package/dist/melonjs.mjs/video/texture/cache.js +1 -1
- package/dist/melonjs.mjs/video/texture/canvas_texture.js +1 -1
- package/dist/melonjs.mjs/video/utils/autodetect.js +1 -1
- package/dist/melonjs.mjs/video/video.js +1 -1
- package/dist/melonjs.mjs/video/webgl/buffer/vertex.js +1 -1
- package/dist/melonjs.mjs/video/webgl/compositors/compositor.js +1 -1
- package/dist/melonjs.mjs/video/webgl/compositors/primitive_compositor.js +1 -1
- package/dist/melonjs.mjs/video/webgl/compositors/quad_compositor.js +1 -1
- package/dist/melonjs.mjs/video/webgl/glshader.js +1 -1
- package/dist/melonjs.mjs/video/webgl/shaders/primitive.frag.js +1 -1
- package/dist/melonjs.mjs/video/webgl/shaders/primitive.vert.js +1 -1
- package/dist/melonjs.mjs/video/webgl/shaders/quad.frag.js +1 -1
- package/dist/melonjs.mjs/video/webgl/shaders/quad.vert.js +1 -1
- package/dist/melonjs.mjs/video/webgl/utils/attributes.js +1 -1
- package/dist/melonjs.mjs/video/webgl/utils/precision.js +1 -1
- package/dist/melonjs.mjs/video/webgl/utils/program.js +1 -1
- package/dist/melonjs.mjs/video/webgl/utils/string.js +1 -1
- package/dist/melonjs.mjs/video/webgl/utils/uniforms.js +1 -1
- package/dist/melonjs.mjs/video/webgl/webgl_renderer.js +1 -1
- package/dist/melonjs.module.js +60 -55
- package/dist/types/camera/camera2d.d.ts +4 -4
- package/dist/types/index.d.ts +1 -1
- package/dist/types/physics/body.d.ts +4 -4
- package/dist/types/physics/detector.d.ts +5 -5
- package/dist/types/physics/sat.d.ts +12 -12
- package/dist/types/renderable/container.d.ts +25 -25
- package/dist/types/renderable/draggable.d.ts +53 -0
- package/dist/types/renderable/dragndrop.d.ts +0 -52
- package/dist/types/renderable/renderable.d.ts +2 -2
- package/package.json +8 -8
- package/src/camera/camera2d.js +2 -2
- package/src/index.js +2 -1
- package/src/lang/deprecated.js +2 -1
- package/src/physics/body.js +2 -2
- package/src/physics/detector.js +3 -3
- package/src/physics/sat.js +8 -8
- package/src/renderable/container.js +13 -13
- package/src/renderable/draggable.js +114 -0
- package/src/renderable/dragndrop.js +0 -109
- package/src/renderable/renderable.js +1 -1
- package/src/renderable/trigger.js +1 -1
package/dist/melonjs.module.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - v15.1.
|
|
2
|
+
* melonJS Game Engine - v15.1.6
|
|
3
3
|
* http://www.melonjs.org
|
|
4
4
|
* melonjs is licensed under the MIT License.
|
|
5
5
|
* http://www.opensource.org/licenses/mit-license
|
|
@@ -56,7 +56,7 @@ var check = function (it) {
|
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
|
|
59
|
-
var global$
|
|
59
|
+
var global$e =
|
|
60
60
|
// eslint-disable-next-line es/no-global-this -- safe
|
|
61
61
|
check(typeof globalThis == 'object' && globalThis) ||
|
|
62
62
|
check(typeof window == 'object' && window) ||
|
|
@@ -64,9 +64,9 @@ var global$d =
|
|
|
64
64
|
check(typeof self == 'object' && self) ||
|
|
65
65
|
check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
|
66
66
|
// eslint-disable-next-line no-new-func -- fallback
|
|
67
|
-
(function () { return this; })() || Function('return this')();
|
|
67
|
+
(function () { return this; })() || commonjsGlobal || Function('return this')();
|
|
68
68
|
|
|
69
|
-
var global$
|
|
69
|
+
var global$f = /*@__PURE__*/getDefaultExportFromCjs(global$e);
|
|
70
70
|
|
|
71
71
|
var objectGetOwnPropertyDescriptor = {};
|
|
72
72
|
|
|
@@ -253,7 +253,7 @@ var isObject$5 = $documentAll.IS_HTMLDDA ? function (it) {
|
|
|
253
253
|
|
|
254
254
|
var isObject$6 = /*@__PURE__*/getDefaultExportFromCjs(isObject$5);
|
|
255
255
|
|
|
256
|
-
var global$
|
|
256
|
+
var global$d = global$e;
|
|
257
257
|
var isCallable$9 = isCallable$b;
|
|
258
258
|
|
|
259
259
|
var aFunction = function (argument) {
|
|
@@ -261,7 +261,7 @@ var aFunction = function (argument) {
|
|
|
261
261
|
};
|
|
262
262
|
|
|
263
263
|
var getBuiltIn$2 = function (namespace, method) {
|
|
264
|
-
return arguments.length < 2 ? aFunction(global$
|
|
264
|
+
return arguments.length < 2 ? aFunction(global$d[namespace]) : global$d[namespace] && global$d[namespace][method];
|
|
265
265
|
};
|
|
266
266
|
|
|
267
267
|
var getBuiltIn$3 = /*@__PURE__*/getDefaultExportFromCjs(getBuiltIn$2);
|
|
@@ -276,11 +276,11 @@ var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAg
|
|
|
276
276
|
|
|
277
277
|
var engineUserAgent$1 = /*@__PURE__*/getDefaultExportFromCjs(engineUserAgent);
|
|
278
278
|
|
|
279
|
-
var global$
|
|
279
|
+
var global$c = global$e;
|
|
280
280
|
var userAgent = engineUserAgent;
|
|
281
281
|
|
|
282
|
-
var process = global$
|
|
283
|
-
var Deno = global$
|
|
282
|
+
var process = global$c.process;
|
|
283
|
+
var Deno = global$c.Deno;
|
|
284
284
|
var versions = process && process.versions || Deno && Deno.version;
|
|
285
285
|
var v8 = versions && versions.v8;
|
|
286
286
|
var match, version$1;
|
|
@@ -310,13 +310,18 @@ var engineV8Version$1 = /*@__PURE__*/getDefaultExportFromCjs(engineV8Version);
|
|
|
310
310
|
|
|
311
311
|
var V8_VERSION = engineV8Version;
|
|
312
312
|
var fails$5 = fails$9;
|
|
313
|
+
var global$b = global$e;
|
|
314
|
+
|
|
315
|
+
var $String$4 = global$b.String;
|
|
313
316
|
|
|
314
317
|
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
|
315
318
|
var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$5(function () {
|
|
316
319
|
var symbol = Symbol();
|
|
317
320
|
// Chrome 38 Symbol has incorrect toString conversion
|
|
318
321
|
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
|
319
|
-
|
|
322
|
+
// nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
|
|
323
|
+
// of course, fail.
|
|
324
|
+
return !$String$4(symbol) || !(Object(symbol) instanceof Symbol) ||
|
|
320
325
|
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
|
321
326
|
!Symbol.sham && V8_VERSION && V8_VERSION < 41;
|
|
322
327
|
});
|
|
@@ -410,7 +415,7 @@ var isPure = false;
|
|
|
410
415
|
|
|
411
416
|
var isPure$1 = /*@__PURE__*/getDefaultExportFromCjs(isPure);
|
|
412
417
|
|
|
413
|
-
var global$a = global$
|
|
418
|
+
var global$a = global$e;
|
|
414
419
|
|
|
415
420
|
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
|
416
421
|
var defineProperty$1 = Object.defineProperty;
|
|
@@ -425,7 +430,7 @@ var defineGlobalProperty$3 = function (key, value) {
|
|
|
425
430
|
|
|
426
431
|
var defineGlobalProperty$4 = /*@__PURE__*/getDefaultExportFromCjs(defineGlobalProperty$3);
|
|
427
432
|
|
|
428
|
-
var global$9 = global$
|
|
433
|
+
var global$9 = global$e;
|
|
429
434
|
var defineGlobalProperty$2 = defineGlobalProperty$3;
|
|
430
435
|
|
|
431
436
|
var SHARED = '__core-js_shared__';
|
|
@@ -443,10 +448,10 @@ var store$2 = sharedStore;
|
|
|
443
448
|
(shared$5.exports = function (key, value) {
|
|
444
449
|
return store$2[key] || (store$2[key] = value !== undefined ? value : {});
|
|
445
450
|
})('versions', []).push({
|
|
446
|
-
version: '3.30.
|
|
451
|
+
version: '3.30.2',
|
|
447
452
|
mode: IS_PURE ? 'pure' : 'global',
|
|
448
453
|
copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
|
|
449
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.30.
|
|
454
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.30.2/LICENSE',
|
|
450
455
|
source: 'https://github.com/zloirock/core-js'
|
|
451
456
|
});
|
|
452
457
|
|
|
@@ -491,7 +496,7 @@ var uid$2 = function (key) {
|
|
|
491
496
|
|
|
492
497
|
var uid$3 = /*@__PURE__*/getDefaultExportFromCjs(uid$2);
|
|
493
498
|
|
|
494
|
-
var global$8 = global$
|
|
499
|
+
var global$8 = global$e;
|
|
495
500
|
var shared$2 = sharedExports;
|
|
496
501
|
var hasOwn$6 = hasOwnProperty_1;
|
|
497
502
|
var uid$1 = uid$2;
|
|
@@ -552,7 +557,7 @@ var toPropertyKey$2 = function (argument) {
|
|
|
552
557
|
|
|
553
558
|
var toPropertyKey$3 = /*@__PURE__*/getDefaultExportFromCjs(toPropertyKey$2);
|
|
554
559
|
|
|
555
|
-
var global$7 = global$
|
|
560
|
+
var global$7 = global$e;
|
|
556
561
|
var isObject$2 = isObject$5;
|
|
557
562
|
|
|
558
563
|
var document$1 = global$7.document;
|
|
@@ -728,7 +733,7 @@ var inspectSource$1 = store$1.inspectSource;
|
|
|
728
733
|
|
|
729
734
|
var inspectSource$2 = /*@__PURE__*/getDefaultExportFromCjs(inspectSource$1);
|
|
730
735
|
|
|
731
|
-
var global$6 = global$
|
|
736
|
+
var global$6 = global$e;
|
|
732
737
|
var isCallable$4 = isCallable$b;
|
|
733
738
|
|
|
734
739
|
var WeakMap$1 = global$6.WeakMap;
|
|
@@ -753,7 +758,7 @@ var hiddenKeys$3 = {};
|
|
|
753
758
|
var hiddenKeys$4 = /*@__PURE__*/getDefaultExportFromCjs(hiddenKeys$3);
|
|
754
759
|
|
|
755
760
|
var NATIVE_WEAK_MAP = weakMapBasicDetection;
|
|
756
|
-
var global$5 = global$
|
|
761
|
+
var global$5 = global$e;
|
|
757
762
|
var isObject = isObject$5;
|
|
758
763
|
var createNonEnumerableProperty$1 = createNonEnumerableProperty$2;
|
|
759
764
|
var hasOwn$3 = hasOwnProperty_1;
|
|
@@ -1128,7 +1133,7 @@ var isForced_1 = isForced$1;
|
|
|
1128
1133
|
|
|
1129
1134
|
var isForced$2 = /*@__PURE__*/getDefaultExportFromCjs(isForced_1);
|
|
1130
1135
|
|
|
1131
|
-
var global$4 = global$
|
|
1136
|
+
var global$4 = global$e;
|
|
1132
1137
|
var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
|
1133
1138
|
var createNonEnumerableProperty = createNonEnumerableProperty$2;
|
|
1134
1139
|
var defineBuiltIn = defineBuiltIn$1;
|
|
@@ -1186,7 +1191,7 @@ var _export = function (options, source) {
|
|
|
1186
1191
|
var _export$1 = /*@__PURE__*/getDefaultExportFromCjs(_export);
|
|
1187
1192
|
|
|
1188
1193
|
var $$4 = _export;
|
|
1189
|
-
var global$3 = global$
|
|
1194
|
+
var global$3 = global$e;
|
|
1190
1195
|
|
|
1191
1196
|
// `globalThis` object
|
|
1192
1197
|
// https://tc39.es/ecma262/#sec-globalthis
|
|
@@ -1196,7 +1201,7 @@ $$4({ global: true, forced: global$3.globalThis !== global$3 }, {
|
|
|
1196
1201
|
|
|
1197
1202
|
// https://github.com/tc39/proposal-global
|
|
1198
1203
|
|
|
1199
|
-
var global$2 = global$
|
|
1204
|
+
var global$2 = global$e;
|
|
1200
1205
|
|
|
1201
1206
|
var globalThis$1 = global$2;
|
|
1202
1207
|
|
|
@@ -1353,7 +1358,7 @@ $$2({ target: 'String', proto: true, name: 'trimStart', forced: ''.trimStart !==
|
|
|
1353
1358
|
trimStart: trimStart$2
|
|
1354
1359
|
});
|
|
1355
1360
|
|
|
1356
|
-
var global$1 = global$
|
|
1361
|
+
var global$1 = global$e;
|
|
1357
1362
|
var uncurryThis = functionUncurryThis;
|
|
1358
1363
|
|
|
1359
1364
|
var entryUnbind$2 = function (CONSTRUCTOR, METHOD) {
|
|
@@ -18474,7 +18479,7 @@ var input = {
|
|
|
18474
18479
|
* onCollision callback, triggered in case of collision,
|
|
18475
18480
|
* when this renderable body is colliding with another one
|
|
18476
18481
|
* @param {ResponseObject} response - the collision response object
|
|
18477
|
-
* @param {Renderable} other - the other renderable touching this one (a reference to response.a or response.b)
|
|
18482
|
+
* @param {Renderable|Container|Entity|Sprite|NineSliceSprite} other - the other renderable touching this one (a reference to response.a or response.b)
|
|
18478
18483
|
* @returns {boolean} true if the object should respond to the collision (its position and velocity will be corrected)
|
|
18479
18484
|
* @example
|
|
18480
18485
|
* // colision handler
|
|
@@ -19121,7 +19126,7 @@ let targetV = new Vector2d();
|
|
|
19121
19126
|
* set the camera position around the specified object
|
|
19122
19127
|
* @name focusOn
|
|
19123
19128
|
* @memberof Camera2d
|
|
19124
|
-
* @param {Renderable} target - the renderable to focus the camera on
|
|
19129
|
+
* @param {Renderable|Entity|Sprite|NineSliceSprite} target - the renderable to focus the camera on
|
|
19125
19130
|
*/
|
|
19126
19131
|
focusOn(target) {
|
|
19127
19132
|
let bounds = target.getBounds();
|
|
@@ -19135,7 +19140,7 @@ let targetV = new Vector2d();
|
|
|
19135
19140
|
* check if the specified renderable is in the camera
|
|
19136
19141
|
* @name isVisible
|
|
19137
19142
|
* @memberof Camera2d
|
|
19138
|
-
* @param {Renderable} obj - to be checked against
|
|
19143
|
+
* @param {Renderable|Entity|Sprite|NineSliceSprite} obj - to be checked against
|
|
19139
19144
|
* @param {boolean} [floating = obj.floating] - if visibility check should be done against screen coordinates
|
|
19140
19145
|
* @returns {boolean}
|
|
19141
19146
|
*/
|
|
@@ -23672,7 +23677,7 @@ let globalFloatingCounter = 0;
|
|
|
23672
23677
|
* will not be in any container. <br>
|
|
23673
23678
|
* if the given child implements a onActivateEvent method, that method will be called
|
|
23674
23679
|
* once the child is added to this container.
|
|
23675
|
-
* @param {Renderable} child
|
|
23680
|
+
* @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child
|
|
23676
23681
|
* @param {number} [z] - forces the z index of the child to the specified value
|
|
23677
23682
|
* @returns {Renderable} the added child
|
|
23678
23683
|
*/
|
|
@@ -23754,7 +23759,7 @@ let globalFloatingCounter = 0;
|
|
|
23754
23759
|
/**
|
|
23755
23760
|
* Add a child to the container at the specified index<br>
|
|
23756
23761
|
* (the list won't be sorted after insertion)
|
|
23757
|
-
* @param {Renderable} child
|
|
23762
|
+
* @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child
|
|
23758
23763
|
* @param {number} index
|
|
23759
23764
|
* @returns {Renderable} the added child
|
|
23760
23765
|
*/
|
|
@@ -23865,8 +23870,8 @@ let globalFloatingCounter = 0;
|
|
|
23865
23870
|
|
|
23866
23871
|
/**
|
|
23867
23872
|
* Swaps the position (z-index) of 2 children
|
|
23868
|
-
* @param {Renderable} child
|
|
23869
|
-
* @param {Renderable} child2
|
|
23873
|
+
* @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child
|
|
23874
|
+
* @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child2
|
|
23870
23875
|
*/
|
|
23871
23876
|
swapChildren(child, child2) {
|
|
23872
23877
|
let index = this.getChildIndex(child);
|
|
@@ -23904,7 +23909,7 @@ let globalFloatingCounter = 0;
|
|
|
23904
23909
|
|
|
23905
23910
|
/**
|
|
23906
23911
|
* Returns the index of the given Child
|
|
23907
|
-
* @param {Renderable} child
|
|
23912
|
+
* @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child
|
|
23908
23913
|
* @returns {number} index
|
|
23909
23914
|
*/
|
|
23910
23915
|
getChildIndex(child) {
|
|
@@ -23913,7 +23918,7 @@ let globalFloatingCounter = 0;
|
|
|
23913
23918
|
|
|
23914
23919
|
/**
|
|
23915
23920
|
* Returns the next child within the container or undefined if none
|
|
23916
|
-
* @param {Renderable} child
|
|
23921
|
+
* @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child
|
|
23917
23922
|
* @returns {Renderable} child
|
|
23918
23923
|
*/
|
|
23919
23924
|
getNextChild(child) {
|
|
@@ -23926,7 +23931,7 @@ let globalFloatingCounter = 0;
|
|
|
23926
23931
|
|
|
23927
23932
|
/**
|
|
23928
23933
|
* Returns true if contains the specified Child
|
|
23929
|
-
* @param {Renderable} child
|
|
23934
|
+
* @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child
|
|
23930
23935
|
* @returns {boolean}
|
|
23931
23936
|
*/
|
|
23932
23937
|
hasChild(child) {
|
|
@@ -24134,7 +24139,7 @@ let globalFloatingCounter = 0;
|
|
|
24134
24139
|
/**
|
|
24135
24140
|
* Invokes the removeChildNow in a defer, to ensure the child is removed safely after the update & draw stack has completed. <br>
|
|
24136
24141
|
* if the given child implements a onDeactivateEvent() method, that method will be called once the child is removed from this container.
|
|
24137
|
-
* @param {
|
|
24142
|
+
* @param {RendRenderable|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapTexterable} child
|
|
24138
24143
|
* @param {boolean} [keepalive=false] - true to prevent calling child.destroy()
|
|
24139
24144
|
*/
|
|
24140
24145
|
removeChild(child, keepalive) {
|
|
@@ -24150,7 +24155,7 @@ let globalFloatingCounter = 0;
|
|
|
24150
24155
|
* Removes (and optionally destroys) a child from the container.<br>
|
|
24151
24156
|
* (removal is immediate and unconditional)<br>
|
|
24152
24157
|
* Never use keepalive=true with objects from {@link pool}. Doing so will create a memory leak.
|
|
24153
|
-
* @param {Renderable} child
|
|
24158
|
+
* @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child
|
|
24154
24159
|
* @param {boolean} [keepalive=False] - True to prevent calling child.destroy()
|
|
24155
24160
|
*/
|
|
24156
24161
|
removeChildNow(child, keepalive) {
|
|
@@ -24213,7 +24218,7 @@ let globalFloatingCounter = 0;
|
|
|
24213
24218
|
|
|
24214
24219
|
/**
|
|
24215
24220
|
* Move the child in the group one step forward (z depth).
|
|
24216
|
-
* @param {Renderable} child
|
|
24221
|
+
* @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child
|
|
24217
24222
|
*/
|
|
24218
24223
|
moveUp(child) {
|
|
24219
24224
|
let childIndex = this.getChildIndex(child);
|
|
@@ -24227,7 +24232,7 @@ let globalFloatingCounter = 0;
|
|
|
24227
24232
|
|
|
24228
24233
|
/**
|
|
24229
24234
|
* Move the child in the group one step backward (z depth).
|
|
24230
|
-
* @param {Renderable} child
|
|
24235
|
+
* @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child
|
|
24231
24236
|
*/
|
|
24232
24237
|
moveDown(child) {
|
|
24233
24238
|
let childIndex = this.getChildIndex(child);
|
|
@@ -24241,7 +24246,7 @@ let globalFloatingCounter = 0;
|
|
|
24241
24246
|
|
|
24242
24247
|
/**
|
|
24243
24248
|
* Move the specified child to the top(z depth).
|
|
24244
|
-
* @param {Renderable} child
|
|
24249
|
+
* @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child
|
|
24245
24250
|
*/
|
|
24246
24251
|
moveToTop(child) {
|
|
24247
24252
|
let childIndex = this.getChildIndex(child);
|
|
@@ -24258,7 +24263,7 @@ let globalFloatingCounter = 0;
|
|
|
24258
24263
|
|
|
24259
24264
|
/**
|
|
24260
24265
|
* Move the specified child the bottom (z depth).
|
|
24261
|
-
* @param {Renderable} child
|
|
24266
|
+
* @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child
|
|
24262
24267
|
*/
|
|
24263
24268
|
moveToBottom(child) {
|
|
24264
24269
|
let childIndex = this.getChildIndex(child);
|
|
@@ -28684,7 +28689,7 @@ var timer$1 = timer;
|
|
|
28684
28689
|
*/
|
|
28685
28690
|
class Body {
|
|
28686
28691
|
/**
|
|
28687
|
-
* @param {Renderable} ancestor - the parent object this body is attached to
|
|
28692
|
+
* @param {Renderable|Container|Entity|Sprite|NineSliceSprite} ancestor - the parent object this body is attached to
|
|
28688
28693
|
* @param {Rect|Rect[]|Polygon|Polygon[]|Line|Line[]|Ellipse|Ellipse[]|Point|Point[]|Bounds|Bounds[]|object} [shapes] - a initial shape, list of shapes, or JSON object defining the body
|
|
28689
28694
|
* @param {Function} [onBodyUpdate] - callback for when the body is updated (e.g. add/remove shapes)
|
|
28690
28695
|
*/
|
|
@@ -28694,7 +28699,7 @@ var timer$1 = timer;
|
|
|
28694
28699
|
* a reference to the parent object that contains this body,
|
|
28695
28700
|
* or undefined if it has not been added to one.
|
|
28696
28701
|
* @public
|
|
28697
|
-
* @type {Renderable}
|
|
28702
|
+
* @type {Renderable|Container|Entity|Sprite|NineSliceSprite}
|
|
28698
28703
|
* @default undefined
|
|
28699
28704
|
*/
|
|
28700
28705
|
this.ancestor = ancestor;
|
|
@@ -34925,7 +34930,7 @@ const toPX = [12, 24, 0.75, 1];
|
|
|
34925
34930
|
* @name onCollision
|
|
34926
34931
|
* @memberof Trigger
|
|
34927
34932
|
* @param {ResponseObject} response - the collision response object
|
|
34928
|
-
* @param {Renderable} other - the other renderable touching this one (a reference to response.a or response.b)
|
|
34933
|
+
* @param {Renderable|Container|Entity|Sprite|NineSliceSprite} other - the other renderable touching this one (a reference to response.a or response.b)
|
|
34929
34934
|
* @returns {boolean} true if the object should respond to the collision (its position and velocity will be corrected)
|
|
34930
34935
|
*/
|
|
34931
34936
|
onCollision(response, other) { // eslint-disable-line no-unused-vars
|
|
@@ -35725,9 +35730,9 @@ function vornoiRegion(line, point) {
|
|
|
35725
35730
|
/**
|
|
35726
35731
|
* Checks whether polygons collide.
|
|
35727
35732
|
* @ignore
|
|
35728
|
-
* @param {Renderable} a - a reference to the object A.
|
|
35733
|
+
* @param {Renderable|Container|Entity|Sprite|NineSliceSprite} a - a reference to the object A.
|
|
35729
35734
|
* @param {Polygon} polyA - a reference to the object A Polygon to be tested
|
|
35730
|
-
* @param {Renderable} b - a reference to the object B.
|
|
35735
|
+
* @param {Renderable|Container|Entity|Sprite|NineSliceSprite} b - a reference to the object B.
|
|
35731
35736
|
* @param {Polygon} polyB - a reference to the object B Polygon to be tested
|
|
35732
35737
|
* @param {Response=} response - Response object (optional) that will be populated if they intersect.
|
|
35733
35738
|
* @returns {boolean} true if they intersect, false if they don't.
|
|
@@ -35779,9 +35784,9 @@ function testPolygonPolygon(a, polyA, b, polyB, response) {
|
|
|
35779
35784
|
/**
|
|
35780
35785
|
* Check if two Ellipse collide.
|
|
35781
35786
|
* @ignore
|
|
35782
|
-
* @param {Renderable} a - a reference to the object A.
|
|
35787
|
+
* @param {Renderable|Container|Entity|Sprite|NineSliceSprite} a - a reference to the object A.
|
|
35783
35788
|
* @param {Ellipse} ellipseA - a reference to the object A Ellipse to be tested
|
|
35784
|
-
* @param {Renderable} b - a reference to the object B.
|
|
35789
|
+
* @param {Renderable|Container|Entity|Sprite|NineSliceSprite} b - a reference to the object B.
|
|
35785
35790
|
* @param {Ellipse} ellipseB - a reference to the object B Ellipse to be tested
|
|
35786
35791
|
* @param {Response=} response - Response object (optional) that will be populated if
|
|
35787
35792
|
* the circles intersect.
|
|
@@ -35820,9 +35825,9 @@ function testEllipseEllipse(a, ellipseA, b, ellipseB, response) {
|
|
|
35820
35825
|
/**
|
|
35821
35826
|
* Check if a polygon and an ellipse collide.
|
|
35822
35827
|
* @ignore
|
|
35823
|
-
* @param {Renderable} a - a reference to the object A.
|
|
35828
|
+
* @param {Renderable|Container|Entity|Sprite|NineSliceSprite} a - a reference to the object A.
|
|
35824
35829
|
* @param {Polygon} polyA - a reference to the object A Polygon to be tested
|
|
35825
|
-
* @param {Renderable} b - a reference to the object B.
|
|
35830
|
+
* @param {Renderable|Container|Entity|Sprite|NineSliceSprite} b - a reference to the object B.
|
|
35826
35831
|
* @param {Ellipse} ellipseB - a reference to the object B Ellipse to be tested
|
|
35827
35832
|
* @param {Response=} response - Response object (optional) that will be populated if they intersect.
|
|
35828
35833
|
* @returns {boolean} true if they intersect, false if they don't.
|
|
@@ -35986,9 +35991,9 @@ function testPolygonEllipse(a, polyA, b, ellipseB, response) {
|
|
|
35986
35991
|
* **NOTE:** This is slightly less efficient than testPolygonEllipse as it just
|
|
35987
35992
|
* runs testPolygonEllipse and reverses the response at the end.
|
|
35988
35993
|
* @ignore
|
|
35989
|
-
* @param {Renderable} a - a reference to the object A.
|
|
35994
|
+
* @param {Renderable|Container|Entity|Sprite|NineSliceSprite} a - a reference to the object A.
|
|
35990
35995
|
* @param {Ellipse} ellipseA - a reference to the object A Ellipse to be tested
|
|
35991
|
-
* @param {Renderable} b - a reference to the object B.
|
|
35996
|
+
* @param {Renderable|Container|Entity|Sprite|NineSliceSprite} b - a reference to the object B.
|
|
35992
35997
|
* @param {Polygon} polyB - a reference to the object B Polygon to be tested
|
|
35993
35998
|
* @param {Response=} response - Response object (optional) that will be populated if
|
|
35994
35999
|
* they intersect.
|
|
@@ -36103,8 +36108,8 @@ class Detector {
|
|
|
36103
36108
|
/**
|
|
36104
36109
|
* determine if two objects should collide (based on both respective objects body collision mask and type).<br>
|
|
36105
36110
|
* you can redefine this function if you need any specific rules over what should collide with what.
|
|
36106
|
-
* @param {Renderable} a - a reference to the object A.
|
|
36107
|
-
* @param {Renderable} b - a reference to the object B.
|
|
36111
|
+
* @param {Renderable|Container|Entity|Sprite|NineSliceSprite} a - a reference to the object A.
|
|
36112
|
+
* @param {Renderable|Container|Entity|Sprite|NineSliceSprite} b - a reference to the object B.
|
|
36108
36113
|
* @returns {boolean} true if they should collide, false otherwise
|
|
36109
36114
|
*/
|
|
36110
36115
|
shouldCollide(a, b) {
|
|
@@ -36157,7 +36162,7 @@ class Detector {
|
|
|
36157
36162
|
/**
|
|
36158
36163
|
* find all the collisions for the specified object using a broadphase algorithm
|
|
36159
36164
|
* @ignore
|
|
36160
|
-
* @param {Renderable} objA - object to be tested for collision
|
|
36165
|
+
* @param {Renderable|Container|Entity|Sprite|NineSliceSprite} objA - object to be tested for collision
|
|
36161
36166
|
* @returns {boolean} in case of collision, false otherwise
|
|
36162
36167
|
*/
|
|
36163
36168
|
collisions(objA) {
|
|
@@ -38005,10 +38010,10 @@ class BasePlugin {
|
|
|
38005
38010
|
* this can be overridden by the plugin
|
|
38006
38011
|
* @public
|
|
38007
38012
|
* @type {string}
|
|
38008
|
-
* @default "15.1.
|
|
38013
|
+
* @default "15.1.6"
|
|
38009
38014
|
* @name plugin.Base#version
|
|
38010
38015
|
*/
|
|
38011
|
-
this.version = "15.1.
|
|
38016
|
+
this.version = "15.1.6";
|
|
38012
38017
|
}
|
|
38013
38018
|
}
|
|
38014
38019
|
|
|
@@ -38236,7 +38241,7 @@ Renderer.prototype.getScreenContext = function() {
|
|
|
38236
38241
|
* @name version
|
|
38237
38242
|
* @type {string}
|
|
38238
38243
|
*/
|
|
38239
|
-
const version = "15.1.
|
|
38244
|
+
const version = "15.1.6";
|
|
38240
38245
|
|
|
38241
38246
|
/**
|
|
38242
38247
|
* a flag indicating that melonJS is fully initialized
|
|
@@ -236,18 +236,18 @@ export default class Camera2d extends Renderable {
|
|
|
236
236
|
* set the camera position around the specified object
|
|
237
237
|
* @name focusOn
|
|
238
238
|
* @memberof Camera2d
|
|
239
|
-
* @param {Renderable} target - the renderable to focus the camera on
|
|
239
|
+
* @param {Renderable|Entity|Sprite|NineSliceSprite} target - the renderable to focus the camera on
|
|
240
240
|
*/
|
|
241
|
-
focusOn(target: Renderable): void;
|
|
241
|
+
focusOn(target: Renderable | Entity | Sprite | NineSliceSprite): void;
|
|
242
242
|
/**
|
|
243
243
|
* check if the specified renderable is in the camera
|
|
244
244
|
* @name isVisible
|
|
245
245
|
* @memberof Camera2d
|
|
246
|
-
* @param {Renderable} obj - to be checked against
|
|
246
|
+
* @param {Renderable|Entity|Sprite|NineSliceSprite} obj - to be checked against
|
|
247
247
|
* @param {boolean} [floating = obj.floating] - if visibility check should be done against screen coordinates
|
|
248
248
|
* @returns {boolean}
|
|
249
249
|
*/
|
|
250
|
-
isVisible(obj: Renderable, floating?: boolean | undefined): boolean;
|
|
250
|
+
isVisible(obj: Renderable | Entity | Sprite | NineSliceSprite, floating?: boolean | undefined): boolean;
|
|
251
251
|
/**
|
|
252
252
|
* convert the given "local" (screen) coordinates into world coordinates
|
|
253
253
|
* @name localToWorld
|
package/dist/types/index.d.ts
CHANGED
|
@@ -88,7 +88,7 @@ import UISpriteElement from "./renderable/ui/uispriteelement.js";
|
|
|
88
88
|
import Collectable from "./renderable/collectable.js";
|
|
89
89
|
import Trigger from "./renderable/trigger.js";
|
|
90
90
|
import Light2d from "./renderable/light2d.js";
|
|
91
|
-
import { Draggable } from "./renderable/
|
|
91
|
+
import { Draggable } from "./renderable/draggable.js";
|
|
92
92
|
import { DropTarget } from "./renderable/dragndrop.js";
|
|
93
93
|
import TMXRenderer from "./level/tiled/renderer/TMXRenderer.js";
|
|
94
94
|
import TMXOrthogonalRenderer from "./level/tiled/renderer/TMXOrthogonalRenderer.js";
|
|
@@ -5,19 +5,19 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export default class Body {
|
|
7
7
|
/**
|
|
8
|
-
* @param {Renderable} ancestor - the parent object this body is attached to
|
|
8
|
+
* @param {Renderable|Container|Entity|Sprite|NineSliceSprite} ancestor - the parent object this body is attached to
|
|
9
9
|
* @param {Rect|Rect[]|Polygon|Polygon[]|Line|Line[]|Ellipse|Ellipse[]|Point|Point[]|Bounds|Bounds[]|object} [shapes] - a initial shape, list of shapes, or JSON object defining the body
|
|
10
10
|
* @param {Function} [onBodyUpdate] - callback for when the body is updated (e.g. add/remove shapes)
|
|
11
11
|
*/
|
|
12
|
-
constructor(ancestor: Renderable, shapes?: Rect | Rect[] | Polygon | Polygon[] | Line | Line[] | Ellipse | Ellipse[] | Point | Point[] | Bounds | Bounds[] | object, onBodyUpdate?: Function | undefined);
|
|
12
|
+
constructor(ancestor: Renderable | Container | Entity | Sprite | NineSliceSprite, shapes?: Rect | Rect[] | Polygon | Polygon[] | Line | Line[] | Ellipse | Ellipse[] | Point | Point[] | Bounds | Bounds[] | object, onBodyUpdate?: Function | undefined);
|
|
13
13
|
/**
|
|
14
14
|
* a reference to the parent object that contains this body,
|
|
15
15
|
* or undefined if it has not been added to one.
|
|
16
16
|
* @public
|
|
17
|
-
* @type {Renderable}
|
|
17
|
+
* @type {Renderable|Container|Entity|Sprite|NineSliceSprite}
|
|
18
18
|
* @default undefined
|
|
19
19
|
*/
|
|
20
|
-
public ancestor: Renderable;
|
|
20
|
+
public ancestor: Renderable | Container | Entity | Sprite | NineSliceSprite;
|
|
21
21
|
/**
|
|
22
22
|
* The AABB bounds box reprensenting this body
|
|
23
23
|
* @public
|
|
@@ -16,11 +16,11 @@ export default class Detector {
|
|
|
16
16
|
/**
|
|
17
17
|
* determine if two objects should collide (based on both respective objects body collision mask and type).<br>
|
|
18
18
|
* you can redefine this function if you need any specific rules over what should collide with what.
|
|
19
|
-
* @param {Renderable} a - a reference to the object A.
|
|
20
|
-
* @param {Renderable} b - a reference to the object B.
|
|
19
|
+
* @param {Renderable|Container|Entity|Sprite|NineSliceSprite} a - a reference to the object A.
|
|
20
|
+
* @param {Renderable|Container|Entity|Sprite|NineSliceSprite} b - a reference to the object B.
|
|
21
21
|
* @returns {boolean} true if they should collide, false otherwise
|
|
22
22
|
*/
|
|
23
|
-
shouldCollide(a: Renderable, b: Renderable): boolean;
|
|
23
|
+
shouldCollide(a: Renderable | Container | Entity | Sprite | NineSliceSprite, b: Renderable | Container | Entity | Sprite | NineSliceSprite): boolean;
|
|
24
24
|
/**
|
|
25
25
|
* detect collision between two bodies.
|
|
26
26
|
* @param {Body} bodyA - a reference to body A.
|
|
@@ -31,10 +31,10 @@ export default class Detector {
|
|
|
31
31
|
/**
|
|
32
32
|
* find all the collisions for the specified object using a broadphase algorithm
|
|
33
33
|
* @ignore
|
|
34
|
-
* @param {Renderable} objA - object to be tested for collision
|
|
34
|
+
* @param {Renderable|Container|Entity|Sprite|NineSliceSprite} objA - object to be tested for collision
|
|
35
35
|
* @returns {boolean} in case of collision, false otherwise
|
|
36
36
|
*/
|
|
37
|
-
collisions(objA: Renderable): boolean;
|
|
37
|
+
collisions(objA: Renderable | Container | Entity | Sprite | NineSliceSprite): boolean;
|
|
38
38
|
/**
|
|
39
39
|
* Checks for object colliding with the given line
|
|
40
40
|
* @ignore
|
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Checks whether polygons collide.
|
|
3
3
|
* @ignore
|
|
4
|
-
* @param {Renderable} a - a reference to the object A.
|
|
4
|
+
* @param {Renderable|Container|Entity|Sprite|NineSliceSprite} a - a reference to the object A.
|
|
5
5
|
* @param {Polygon} polyA - a reference to the object A Polygon to be tested
|
|
6
|
-
* @param {Renderable} b - a reference to the object B.
|
|
6
|
+
* @param {Renderable|Container|Entity|Sprite|NineSliceSprite} b - a reference to the object B.
|
|
7
7
|
* @param {Polygon} polyB - a reference to the object B Polygon to be tested
|
|
8
8
|
* @param {Response=} response - Response object (optional) that will be populated if they intersect.
|
|
9
9
|
* @returns {boolean} true if they intersect, false if they don't.
|
|
10
10
|
*/
|
|
11
|
-
export function testPolygonPolygon(a: Renderable, polyA: Polygon, b: Renderable, polyB: Polygon, response?: Response | undefined): boolean;
|
|
11
|
+
export function testPolygonPolygon(a: Renderable | Container | Entity | Sprite | NineSliceSprite, polyA: Polygon, b: Renderable | Container | Entity | Sprite | NineSliceSprite, polyB: Polygon, response?: Response | undefined): boolean;
|
|
12
12
|
/**
|
|
13
13
|
* Check if two Ellipse collide.
|
|
14
14
|
* @ignore
|
|
15
|
-
* @param {Renderable} a - a reference to the object A.
|
|
15
|
+
* @param {Renderable|Container|Entity|Sprite|NineSliceSprite} a - a reference to the object A.
|
|
16
16
|
* @param {Ellipse} ellipseA - a reference to the object A Ellipse to be tested
|
|
17
|
-
* @param {Renderable} b - a reference to the object B.
|
|
17
|
+
* @param {Renderable|Container|Entity|Sprite|NineSliceSprite} b - a reference to the object B.
|
|
18
18
|
* @param {Ellipse} ellipseB - a reference to the object B Ellipse to be tested
|
|
19
19
|
* @param {Response=} response - Response object (optional) that will be populated if
|
|
20
20
|
* the circles intersect.
|
|
21
21
|
* @returns {boolean} true if the circles intersect, false if they don't.
|
|
22
22
|
*/
|
|
23
|
-
export function testEllipseEllipse(a: Renderable, ellipseA: Ellipse, b: Renderable, ellipseB: Ellipse, response?: Response | undefined): boolean;
|
|
23
|
+
export function testEllipseEllipse(a: Renderable | Container | Entity | Sprite | NineSliceSprite, ellipseA: Ellipse, b: Renderable | Container | Entity | Sprite | NineSliceSprite, ellipseB: Ellipse, response?: Response | undefined): boolean;
|
|
24
24
|
/**
|
|
25
25
|
* Check if a polygon and an ellipse collide.
|
|
26
26
|
* @ignore
|
|
27
|
-
* @param {Renderable} a - a reference to the object A.
|
|
27
|
+
* @param {Renderable|Container|Entity|Sprite|NineSliceSprite} a - a reference to the object A.
|
|
28
28
|
* @param {Polygon} polyA - a reference to the object A Polygon to be tested
|
|
29
|
-
* @param {Renderable} b - a reference to the object B.
|
|
29
|
+
* @param {Renderable|Container|Entity|Sprite|NineSliceSprite} b - a reference to the object B.
|
|
30
30
|
* @param {Ellipse} ellipseB - a reference to the object B Ellipse to be tested
|
|
31
31
|
* @param {Response=} response - Response object (optional) that will be populated if they intersect.
|
|
32
32
|
* @returns {boolean} true if they intersect, false if they don't.
|
|
33
33
|
*/
|
|
34
|
-
export function testPolygonEllipse(a: Renderable, polyA: Polygon, b: Renderable, ellipseB: Ellipse, response?: Response | undefined): boolean;
|
|
34
|
+
export function testPolygonEllipse(a: Renderable | Container | Entity | Sprite | NineSliceSprite, polyA: Polygon, b: Renderable | Container | Entity | Sprite | NineSliceSprite, ellipseB: Ellipse, response?: Response | undefined): boolean;
|
|
35
35
|
/**
|
|
36
36
|
* Check if an ellipse and a polygon collide. <br>
|
|
37
37
|
* **NOTE:** This is slightly less efficient than testPolygonEllipse as it just
|
|
38
38
|
* runs testPolygonEllipse and reverses the response at the end.
|
|
39
39
|
* @ignore
|
|
40
|
-
* @param {Renderable} a - a reference to the object A.
|
|
40
|
+
* @param {Renderable|Container|Entity|Sprite|NineSliceSprite} a - a reference to the object A.
|
|
41
41
|
* @param {Ellipse} ellipseA - a reference to the object A Ellipse to be tested
|
|
42
|
-
* @param {Renderable} b - a reference to the object B.
|
|
42
|
+
* @param {Renderable|Container|Entity|Sprite|NineSliceSprite} b - a reference to the object B.
|
|
43
43
|
* @param {Polygon} polyB - a reference to the object B Polygon to be tested
|
|
44
44
|
* @param {Response=} response - Response object (optional) that will be populated if
|
|
45
45
|
* they intersect.
|
|
46
46
|
* @returns {boolean} true if they intersect, false if they don't.
|
|
47
47
|
*/
|
|
48
|
-
export function testEllipsePolygon(a: Renderable, ellipseA: Ellipse, b: Renderable, polyB: Polygon, response?: Response | undefined): boolean;
|
|
48
|
+
export function testEllipsePolygon(a: Renderable | Container | Entity | Sprite | NineSliceSprite, ellipseA: Ellipse, b: Renderable | Container | Entity | Sprite | NineSliceSprite, polyB: Polygon, response?: Response | undefined): boolean;
|