melonjs 17.3.0 → 18.0.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/types → build}/application/application.d.ts +16 -10
- package/build/application/application.d.ts.map +1 -0
- package/build/application/defaultApplicationSettings.d.ts +18 -0
- package/build/application/defaultApplicationSettings.d.ts.map +1 -0
- package/build/application/header.d.ts +11 -0
- package/build/application/header.d.ts.map +1 -0
- package/{dist/types → build}/application/resize.d.ts +2 -0
- package/build/application/resize.d.ts.map +1 -0
- package/build/application/scaleMethods.d.ts +44 -0
- package/build/application/scaleMethods.d.ts.map +1 -0
- package/build/application/settings.d.ts +85 -0
- package/build/application/settings.d.ts.map +1 -0
- package/{dist/types → build}/audio/audio.d.ts +37 -59
- package/build/audio/audio.d.ts.map +1 -0
- package/{dist/types → build}/camera/camera2d.d.ts +42 -75
- package/build/camera/camera2d.d.ts.map +1 -0
- package/build/const.d.ts +14 -0
- package/build/const.d.ts.map +1 -0
- package/build/geometries/earcut.d.ts +3 -0
- package/build/geometries/earcut.d.ts.map +1 -0
- package/build/geometries/ellipse.d.ts +117 -0
- package/build/geometries/ellipse.d.ts.map +1 -0
- package/build/geometries/line.d.ts +39 -0
- package/build/geometries/line.d.ts.map +1 -0
- package/build/geometries/observablePoint.d.ts +75 -0
- package/build/geometries/observablePoint.d.ts.map +1 -0
- package/{dist/types → build}/geometries/path2d.d.ts +11 -5
- package/build/geometries/path2d.d.ts.map +1 -0
- package/build/geometries/point.d.ts +44 -0
- package/build/geometries/point.d.ts.map +1 -0
- package/build/geometries/polygon.d.ts +182 -0
- package/build/geometries/polygon.d.ts.map +1 -0
- package/build/geometries/rectangle.d.ts +135 -0
- package/build/geometries/rectangle.d.ts.map +1 -0
- package/build/geometries/roundrect.d.ts +67 -0
- package/build/geometries/roundrect.d.ts.map +1 -0
- package/build/geometries/toarccanvas.d.ts +28 -0
- package/build/geometries/toarccanvas.d.ts.map +1 -0
- package/{dist/types → build}/index.d.ts +41 -45
- package/build/index.d.ts.map +1 -0
- package/build/index.js +28318 -0
- package/build/index.js.map +7 -0
- package/{dist/types → build}/input/gamepad.d.ts +3 -11
- package/build/input/gamepad.d.ts.map +1 -0
- package/{dist/types → build}/input/input.d.ts +4 -2
- package/build/input/input.d.ts.map +1 -0
- package/build/input/key.d.ts +105 -0
- package/build/input/key.d.ts.map +1 -0
- package/build/input/keyboard.d.ts +72 -0
- package/build/input/keyboard.d.ts.map +1 -0
- package/build/input/pointer.d.ts +180 -0
- package/build/input/pointer.d.ts.map +1 -0
- package/{dist/types → build}/input/pointerevent.d.ts +17 -15
- package/build/input/pointerevent.d.ts.map +1 -0
- package/{dist/types → build}/lang/console.d.ts +1 -0
- package/build/lang/console.d.ts.map +1 -0
- package/build/lang/deprecated.d.ts +24 -0
- package/build/lang/deprecated.d.ts.map +1 -0
- package/{dist/types → build}/level/level.d.ts +7 -7
- package/build/level/level.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/TMXGroup.d.ts +2 -2
- package/build/level/tiled/TMXGroup.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/TMXLayer.d.ts +4 -4
- package/build/level/tiled/TMXLayer.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/TMXObject.d.ts +3 -3
- package/build/level/tiled/TMXObject.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/TMXTile.d.ts +4 -5
- package/build/level/tiled/TMXTile.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/TMXTileMap.d.ts +4 -4
- package/build/level/tiled/TMXTileMap.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/TMXTileset.d.ts +3 -3
- package/build/level/tiled/TMXTileset.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/TMXTilesetGroup.d.ts +1 -1
- package/build/level/tiled/TMXTilesetGroup.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/TMXUtils.d.ts +2 -1
- package/build/level/tiled/TMXUtils.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/constants.d.ts +1 -0
- package/build/level/tiled/constants.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/renderer/TMXHexagonalRenderer.d.ts +3 -4
- package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/renderer/TMXIsometricRenderer.d.ts +2 -3
- package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/renderer/TMXOrthogonalRenderer.d.ts +1 -2
- package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/renderer/TMXRenderer.d.ts +7 -7
- package/build/level/tiled/renderer/TMXRenderer.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/renderer/TMXStaggeredRenderer.d.ts +1 -2
- package/build/level/tiled/renderer/TMXStaggeredRenderer.d.ts.map +1 -0
- package/{dist/types → build}/level/tiled/renderer/autodetect.d.ts +4 -3
- package/build/level/tiled/renderer/autodetect.d.ts.map +1 -0
- package/build/loader/cache.d.ts +10 -0
- package/build/loader/cache.d.ts.map +1 -0
- package/{dist/types → build}/loader/loader.d.ts +29 -53
- package/build/loader/loader.d.ts.map +1 -0
- package/{dist/types → build}/loader/loadingscreen.d.ts +1 -0
- package/build/loader/loadingscreen.d.ts.map +1 -0
- package/{dist/types → build}/loader/parsers/binary.d.ts +2 -1
- package/build/loader/parsers/binary.d.ts.map +1 -0
- package/{dist/types → build}/loader/parsers/compressed_textures/compressed_image.d.ts +1 -0
- package/build/loader/parsers/compressed_textures/compressed_image.d.ts.map +1 -0
- package/build/loader/parsers/compressed_textures/parseDDS.d.ts +2 -0
- package/build/loader/parsers/compressed_textures/parseDDS.d.ts.map +1 -0
- package/build/loader/parsers/compressed_textures/parseKTX.d.ts +2 -0
- package/build/loader/parsers/compressed_textures/parseKTX.d.ts.map +1 -0
- package/build/loader/parsers/compressed_textures/parseKTX2.d.ts +2 -0
- package/build/loader/parsers/compressed_textures/parseKTX2.d.ts.map +1 -0
- package/build/loader/parsers/compressed_textures/parsePKM.d.ts +2 -0
- package/build/loader/parsers/compressed_textures/parsePKM.d.ts.map +1 -0
- package/build/loader/parsers/compressed_textures/parsePVR.d.ts +2 -0
- package/build/loader/parsers/compressed_textures/parsePVR.d.ts.map +1 -0
- package/{dist/types → build}/loader/parsers/fetchdata.d.ts +2 -1
- package/build/loader/parsers/fetchdata.d.ts.map +1 -0
- package/{dist/types → build}/loader/parsers/fontface.d.ts +2 -1
- package/build/loader/parsers/fontface.d.ts.map +1 -0
- package/{dist/types → build}/loader/parsers/image.d.ts +2 -1
- package/build/loader/parsers/image.d.ts.map +1 -0
- package/{dist/types → build}/loader/parsers/json.d.ts +2 -1
- package/build/loader/parsers/json.d.ts.map +1 -0
- package/{dist/types → build}/loader/parsers/script.d.ts +2 -1
- package/build/loader/parsers/script.d.ts.map +1 -0
- package/{dist/types → build}/loader/parsers/tmx.d.ts +2 -1
- package/build/loader/parsers/tmx.d.ts.map +1 -0
- package/{dist/types → build}/loader/parsers/video.d.ts +2 -1
- package/build/loader/parsers/video.d.ts.map +1 -0
- package/build/math/color.d.ts +192 -0
- package/build/math/color.d.ts.map +1 -0
- package/build/math/math.d.ts +128 -0
- package/build/math/math.d.ts.map +1 -0
- package/build/math/matrix2d.d.ts +163 -0
- package/build/math/matrix2d.d.ts.map +1 -0
- package/build/math/matrix3d.d.ts +188 -0
- package/build/math/matrix3d.d.ts.map +1 -0
- package/build/math/observableVector2d.d.ts +286 -0
- package/build/math/observableVector2d.d.ts.map +1 -0
- package/build/math/observableVector2d_old.d.ts +76 -0
- package/build/math/observableVector2d_old.d.ts.map +1 -0
- package/build/math/observableVector3d.d.ts +283 -0
- package/build/math/observableVector3d.d.ts.map +1 -0
- package/build/math/observableVector3d_old.d.ts +81 -0
- package/build/math/observableVector3d_old.d.ts.map +1 -0
- package/build/math/vector2d.d.ts +253 -0
- package/build/math/vector2d.d.ts.map +1 -0
- package/build/math/vector3d.d.ts +242 -0
- package/build/math/vector3d.d.ts.map +1 -0
- package/{dist/types → build}/particles/emitter.d.ts +16 -40
- package/build/particles/emitter.d.ts.map +1 -0
- package/build/particles/particle.d.ts +47 -0
- package/build/particles/particle.d.ts.map +1 -0
- package/{dist/types → build}/particles/settings.d.ts +1 -0
- package/build/particles/settings.d.ts.map +1 -0
- package/{dist/types → build}/physics/body.d.ts +39 -21
- package/build/physics/body.d.ts.map +1 -0
- package/build/physics/bounds.d.ts +192 -0
- package/build/physics/bounds.d.ts.map +1 -0
- package/{dist/types → build}/physics/collision.d.ts +6 -4
- package/build/physics/collision.d.ts.map +1 -0
- package/{dist/types → build}/physics/detector.d.ts +13 -5
- package/build/physics/detector.d.ts.map +1 -0
- package/{dist/types → build}/physics/quadtree.d.ts +7 -18
- package/build/physics/quadtree.d.ts.map +1 -0
- package/{dist/types → build}/physics/response.d.ts +46 -5
- package/build/physics/response.d.ts.map +1 -0
- package/{dist/types → build}/physics/sat.d.ts +8 -0
- package/build/physics/sat.d.ts.map +1 -0
- package/{dist/types → build}/physics/world.d.ts +9 -4
- package/build/physics/world.d.ts.map +1 -0
- package/{dist/types → build}/plugin/plugin.d.ts +11 -18
- package/build/plugin/plugin.d.ts.map +1 -0
- package/build/polyfill/console.d.ts +2 -0
- package/build/polyfill/console.d.ts.map +1 -0
- package/build/polyfill/index.d.ts +6 -0
- package/build/polyfill/index.d.ts.map +1 -0
- package/build/polyfill/roundrect.d.ts +2 -0
- package/build/polyfill/roundrect.d.ts.map +1 -0
- package/build/pool.d.ts +39 -0
- package/build/pool.d.ts.map +1 -0
- package/{dist/types → build}/renderable/collectable.d.ts +2 -2
- package/build/renderable/collectable.d.ts.map +1 -0
- package/build/renderable/colorlayer.d.ts +41 -0
- package/build/renderable/colorlayer.d.ts.map +1 -0
- package/{dist/types → build}/renderable/container.d.ts +50 -19
- package/build/renderable/container.d.ts.map +1 -0
- package/{dist/types → build}/renderable/draggable.d.ts +5 -13
- package/build/renderable/draggable.d.ts.map +1 -0
- package/{dist/types → build}/renderable/dragndrop.d.ts +12 -21
- package/build/renderable/dragndrop.d.ts.map +1 -0
- package/{dist/types → build}/renderable/entity/entity.d.ts +17 -11
- package/build/renderable/entity/entity.d.ts.map +1 -0
- package/{dist/types → build}/renderable/imagelayer.d.ts +28 -8
- package/build/renderable/imagelayer.d.ts.map +1 -0
- package/build/renderable/light2d.d.ts +73 -0
- package/build/renderable/light2d.d.ts.map +1 -0
- package/{dist/types → build}/renderable/nineslicesprite.d.ts +9 -3
- package/build/renderable/nineslicesprite.d.ts.map +1 -0
- package/{dist/types → build}/renderable/renderable.d.ts +71 -50
- package/build/renderable/renderable.d.ts.map +1 -0
- package/{dist/types → build}/renderable/sprite.d.ts +34 -13
- package/build/renderable/sprite.d.ts.map +1 -0
- package/{dist/types → build}/renderable/text/bitmaptext.d.ts +7 -8
- package/build/renderable/text/bitmaptext.d.ts.map +1 -0
- package/build/renderable/text/bitmaptextdata.d.ts +17 -0
- package/build/renderable/text/bitmaptextdata.d.ts.map +1 -0
- package/{dist/types → build}/renderable/text/glyph.d.ts +15 -3
- package/build/renderable/text/glyph.d.ts.map +1 -0
- package/{dist/types → build}/renderable/text/text.d.ts +7 -16
- package/build/renderable/text/text.d.ts.map +1 -0
- package/{dist/types → build}/renderable/text/textmetrics.d.ts +8 -9
- package/build/renderable/text/textmetrics.d.ts.map +1 -0
- package/{dist/types → build}/renderable/text/textstyle.d.ts +1 -0
- package/build/renderable/text/textstyle.d.ts.map +1 -0
- package/{dist/types → build}/renderable/trigger.d.ts +22 -7
- package/build/renderable/trigger.d.ts.map +1 -0
- package/{dist/types → build}/renderable/ui/uibaseelement.d.ts +7 -7
- package/build/renderable/ui/uibaseelement.d.ts.map +1 -0
- package/{dist/types → build}/renderable/ui/uispriteelement.d.ts +4 -6
- package/build/renderable/ui/uispriteelement.d.ts.map +1 -0
- package/{dist/types → build}/renderable/ui/uitextbutton.d.ts +17 -4
- package/build/renderable/ui/uitextbutton.d.ts.map +1 -0
- package/{dist/types → build}/state/stage.d.ts +3 -3
- package/build/state/stage.d.ts.map +1 -0
- package/{dist/types → build}/state/state.d.ts +10 -9
- package/build/state/state.d.ts.map +1 -0
- package/{dist/types → build}/system/device.d.ts +49 -80
- package/build/system/device.d.ts.map +1 -0
- package/build/system/dom.d.ts +2 -0
- package/build/system/dom.d.ts.map +1 -0
- package/{dist/types → build}/system/event.d.ts +124 -291
- package/build/system/event.d.ts.map +1 -0
- package/build/system/eventEmitter.d.ts +19 -0
- package/build/system/eventEmitter.d.ts.map +1 -0
- package/build/system/eventEmitter.spec.d.ts +2 -0
- package/build/system/eventEmitter.spec.d.ts.map +1 -0
- package/{dist/types/system/pooling.d.ts → build/system/legacy_pool.d.ts} +22 -7
- package/build/system/legacy_pool.d.ts.map +1 -0
- package/build/system/platform.d.ts +34 -0
- package/build/system/platform.d.ts.map +1 -0
- package/build/system/pool.d.ts +26 -0
- package/build/system/pool.d.ts.map +1 -0
- package/build/system/save.d.ts +3 -0
- package/build/system/save.d.ts.map +1 -0
- package/build/system/timer.d.ts +118 -0
- package/build/system/timer.d.ts.map +1 -0
- package/build/tweens/easing.d.ts +93 -0
- package/build/tweens/easing.d.ts.map +1 -0
- package/build/tweens/interpolation.d.ts +7 -0
- package/build/tweens/interpolation.d.ts.map +1 -0
- package/build/tweens/tween.d.ts +234 -0
- package/build/tweens/tween.d.ts.map +1 -0
- package/build/utils/agent.d.ts +16 -0
- package/build/utils/agent.d.ts.map +1 -0
- package/build/utils/array-multimap.d.ts +14 -0
- package/build/utils/array-multimap.d.ts.map +1 -0
- package/build/utils/array.d.ts +30 -0
- package/build/utils/array.d.ts.map +1 -0
- package/build/utils/file.d.ts +16 -0
- package/build/utils/file.d.ts.map +1 -0
- package/build/utils/function.d.ts +24 -0
- package/build/utils/function.d.ts.map +1 -0
- package/build/utils/semver.d.ts +2 -0
- package/build/utils/semver.d.ts.map +1 -0
- package/build/utils/string.d.ts +35 -0
- package/build/utils/string.d.ts.map +1 -0
- package/build/utils/types.d.ts +5 -0
- package/build/utils/types.d.ts.map +1 -0
- package/build/utils/utils.d.ts +49 -0
- package/build/utils/utils.d.ts.map +1 -0
- package/build/version.d.ts +5 -0
- package/build/version.d.ts.map +1 -0
- package/{dist/types → build}/video/canvas/canvas_renderer.d.ts +58 -22
- package/build/video/canvas/canvas_renderer.d.ts.map +1 -0
- package/{dist/types → build}/video/renderer.d.ts +38 -17
- package/build/video/renderer.d.ts.map +1 -0
- package/{dist/types → build}/video/rendertarget/canvasrendertarget.d.ts +20 -10
- package/build/video/rendertarget/canvasrendertarget.d.ts.map +1 -0
- package/{dist/types → build}/video/texture/atlas.d.ts +14 -9
- package/build/video/texture/atlas.d.ts.map +1 -0
- package/{dist/types → build}/video/texture/cache.d.ts +4 -3
- package/build/video/texture/cache.d.ts.map +1 -0
- package/{dist/types → build}/video/texture/parser/aseprite.d.ts +1 -0
- package/build/video/texture/parser/aseprite.d.ts.map +1 -0
- package/{dist/types → build}/video/texture/parser/spritesheet.d.ts +1 -0
- package/build/video/texture/parser/spritesheet.d.ts.map +1 -0
- package/{dist/types → build}/video/texture/parser/texturepacker.d.ts +1 -0
- package/build/video/texture/parser/texturepacker.d.ts.map +1 -0
- package/build/video/utils/autodetect.d.ts +8 -0
- package/build/video/utils/autodetect.d.ts.map +1 -0
- package/{dist/types → build}/video/video.d.ts +4 -3
- package/build/video/video.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/buffer/vertex.d.ts +5 -6
- package/build/video/webgl/buffer/vertex.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/compositors/compositor.d.ts +9 -2
- package/build/video/webgl/compositors/compositor.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/compositors/primitive_compositor.d.ts +7 -3
- package/build/video/webgl/compositors/primitive_compositor.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/compositors/quad_compositor.d.ts +5 -5
- package/build/video/webgl/compositors/quad_compositor.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/glshader.d.ts +2 -2
- package/build/video/webgl/glshader.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/utils/attributes.d.ts +1 -0
- package/build/video/webgl/utils/attributes.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/utils/precision.d.ts +1 -0
- package/build/video/webgl/utils/precision.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/utils/program.d.ts +1 -0
- package/build/video/webgl/utils/program.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/utils/string.d.ts +1 -0
- package/build/video/webgl/utils/string.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/utils/uniforms.d.ts +1 -0
- package/build/video/webgl/utils/uniforms.d.ts.map +1 -0
- package/{dist/types → build}/video/webgl/webgl_renderer.d.ts +55 -43
- package/build/video/webgl/webgl_renderer.d.ts.map +1 -0
- package/package.json +83 -105
- package/LICENSE.md +0 -21
- package/README.md +0 -223
- package/dist/melonjs.mjs/_virtual/_commonjsHelpers.js +0 -14
- package/dist/melonjs.mjs/_virtual/earcut.js +0 -10
- package/dist/melonjs.mjs/_virtual/howler.js +0 -10
- package/dist/melonjs.mjs/_virtual/index.js +0 -10
- package/dist/melonjs.mjs/_virtual/re.js +0 -10
- package/dist/melonjs.mjs/application/application.js +0 -437
- package/dist/melonjs.mjs/application/header.js +0 -35
- package/dist/melonjs.mjs/application/resize.js +0 -123
- package/dist/melonjs.mjs/application/settings.js +0 -65
- package/dist/melonjs.mjs/audio/audio.js +0 -618
- package/dist/melonjs.mjs/camera/camera2d.js +0 -729
- package/dist/melonjs.mjs/const.js +0 -32
- package/dist/melonjs.mjs/geometries/ellipse.js +0 -245
- package/dist/melonjs.mjs/geometries/line.js +0 -108
- package/dist/melonjs.mjs/geometries/path2d.js +0 -474
- package/dist/melonjs.mjs/geometries/point.js +0 -80
- package/dist/melonjs.mjs/geometries/poly.js +0 -433
- package/dist/melonjs.mjs/geometries/rectangle.js +0 -330
- package/dist/melonjs.mjs/geometries/roundrect.js +0 -165
- package/dist/melonjs.mjs/geometries/toarccanvas.js +0 -103
- package/dist/melonjs.mjs/index.js +0 -239
- package/dist/melonjs.mjs/input/gamepad.js +0 -495
- package/dist/melonjs.mjs/input/input.js +0 -26
- package/dist/melonjs.mjs/input/keyboard.js +0 -470
- package/dist/melonjs.mjs/input/pointer.js +0 -393
- package/dist/melonjs.mjs/input/pointerevent.js +0 -803
- package/dist/melonjs.mjs/lang/console.js +0 -44
- package/dist/melonjs.mjs/lang/deprecated.js +0 -200
- package/dist/melonjs.mjs/level/level.js +0 -298
- package/dist/melonjs.mjs/level/tiled/TMXGroup.js +0 -120
- package/dist/melonjs.mjs/level/tiled/TMXLayer.js +0 -432
- package/dist/melonjs.mjs/level/tiled/TMXObject.js +0 -295
- package/dist/melonjs.mjs/level/tiled/TMXTile.js +0 -177
- package/dist/melonjs.mjs/level/tiled/TMXTileMap.js +0 -574
- package/dist/melonjs.mjs/level/tiled/TMXTileset.js +0 -292
- package/dist/melonjs.mjs/level/tiled/TMXTilesetGroup.js +0 -74
- package/dist/melonjs.mjs/level/tiled/TMXUtils.js +0 -417
- package/dist/melonjs.mjs/level/tiled/constants.js +0 -17
- package/dist/melonjs.mjs/level/tiled/renderer/TMXHexagonalRenderer.js +0 -503
- package/dist/melonjs.mjs/level/tiled/renderer/TMXIsometricRenderer.js +0 -215
- package/dist/melonjs.mjs/level/tiled/renderer/TMXOrthogonalRenderer.js +0 -155
- package/dist/melonjs.mjs/level/tiled/renderer/TMXRenderer.js +0 -113
- package/dist/melonjs.mjs/level/tiled/renderer/TMXStaggeredRenderer.js +0 -107
- package/dist/melonjs.mjs/level/tiled/renderer/autodetect.js +0 -38
- package/dist/melonjs.mjs/loader/cache.js +0 -30
- package/dist/melonjs.mjs/loader/loader.js +0 -728
- package/dist/melonjs.mjs/loader/loadingscreen.js +0 -118
- package/dist/melonjs.mjs/loader/melonjs_logo.png.js +0 -10
- package/dist/melonjs.mjs/loader/parsers/binary.js +0 -42
- package/dist/melonjs.mjs/loader/parsers/compressed_textures/compressed_image.js +0 -58
- package/dist/melonjs.mjs/loader/parsers/compressed_textures/parseDDS.js +0 -13
- package/dist/melonjs.mjs/loader/parsers/compressed_textures/parseKTX.js +0 -13
- package/dist/melonjs.mjs/loader/parsers/compressed_textures/parseKTX2.js +0 -13
- package/dist/melonjs.mjs/loader/parsers/compressed_textures/parsePKM.js +0 -13
- package/dist/melonjs.mjs/loader/parsers/compressed_textures/parsePVR.js +0 -136
- package/dist/melonjs.mjs/loader/parsers/fetchdata.js +0 -62
- package/dist/melonjs.mjs/loader/parsers/fontface.js +0 -62
- package/dist/melonjs.mjs/loader/parsers/image.js +0 -129
- package/dist/melonjs.mjs/loader/parsers/json.js +0 -43
- package/dist/melonjs.mjs/loader/parsers/script.js +0 -46
- package/dist/melonjs.mjs/loader/parsers/tmx.js +0 -103
- package/dist/melonjs.mjs/loader/parsers/video.js +0 -99
- package/dist/melonjs.mjs/math/color.js +0 -635
- package/dist/melonjs.mjs/math/math.js +0 -221
- package/dist/melonjs.mjs/math/matrix2.js +0 -487
- package/dist/melonjs.mjs/math/matrix3.js +0 -621
- package/dist/melonjs.mjs/math/observable_vector2.js +0 -468
- package/dist/melonjs.mjs/math/observable_vector3.js +0 -558
- package/dist/melonjs.mjs/math/vector2.js +0 -431
- package/dist/melonjs.mjs/math/vector3.js +0 -468
- package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/esm/arraymultimap.js +0 -45
- package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/esm/multimap.js +0 -130
- package/dist/melonjs.mjs/node_modules/earcut/src/earcut.js +0 -694
- package/dist/melonjs.mjs/node_modules/eventemitter3/index.js +0 -352
- package/dist/melonjs.mjs/node_modules/eventemitter3/index2.js +0 -12
- package/dist/melonjs.mjs/node_modules/howler/dist/howler.js +0 -3246
- package/dist/melonjs.mjs/node_modules/semver/classes/comparator.js +0 -165
- package/dist/melonjs.mjs/node_modules/semver/classes/range.js +0 -565
- package/dist/melonjs.mjs/node_modules/semver/classes/semver.js +0 -317
- package/dist/melonjs.mjs/node_modules/semver/functions/clean.js +0 -17
- package/dist/melonjs.mjs/node_modules/semver/functions/cmp.js +0 -68
- package/dist/melonjs.mjs/node_modules/semver/functions/coerce.js +0 -73
- package/dist/melonjs.mjs/node_modules/semver/functions/compare-build.js +0 -18
- package/dist/melonjs.mjs/node_modules/semver/functions/compare-loose.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/compare.js +0 -16
- package/dist/melonjs.mjs/node_modules/semver/functions/diff.js +0 -76
- package/dist/melonjs.mjs/node_modules/semver/functions/eq.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/gt.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/gte.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/inc.js +0 -30
- package/dist/melonjs.mjs/node_modules/semver/functions/lt.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/lte.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/major.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/minor.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/neq.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/parse.js +0 -27
- package/dist/melonjs.mjs/node_modules/semver/functions/patch.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/prerelease.js +0 -17
- package/dist/melonjs.mjs/node_modules/semver/functions/rcompare.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/rsort.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/satisfies.js +0 -21
- package/dist/melonjs.mjs/node_modules/semver/functions/sort.js +0 -14
- package/dist/melonjs.mjs/node_modules/semver/functions/valid.js +0 -17
- package/dist/melonjs.mjs/node_modules/semver/index.js +0 -140
- package/dist/melonjs.mjs/node_modules/semver/internal/constants.js +0 -44
- package/dist/melonjs.mjs/node_modules/semver/internal/debug.js +0 -18
- package/dist/melonjs.mjs/node_modules/semver/internal/identifiers.js +0 -32
- package/dist/melonjs.mjs/node_modules/semver/internal/lrucache.js +0 -49
- package/dist/melonjs.mjs/node_modules/semver/internal/parse-options.js +0 -24
- package/dist/melonjs.mjs/node_modules/semver/internal/re.js +0 -234
- package/dist/melonjs.mjs/node_modules/semver/ranges/gtr.js +0 -15
- package/dist/melonjs.mjs/node_modules/semver/ranges/intersects.js +0 -18
- package/dist/melonjs.mjs/node_modules/semver/ranges/ltr.js +0 -15
- package/dist/melonjs.mjs/node_modules/semver/ranges/max-satisfying.js +0 -37
- package/dist/melonjs.mjs/node_modules/semver/ranges/min-satisfying.js +0 -36
- package/dist/melonjs.mjs/node_modules/semver/ranges/min-version.js +0 -74
- package/dist/melonjs.mjs/node_modules/semver/ranges/outside.js +0 -98
- package/dist/melonjs.mjs/node_modules/semver/ranges/simplify.js +0 -59
- package/dist/melonjs.mjs/node_modules/semver/ranges/subset.js +0 -261
- package/dist/melonjs.mjs/node_modules/semver/ranges/to-comparators.js +0 -19
- package/dist/melonjs.mjs/node_modules/semver/ranges/valid.js +0 -22
- package/dist/melonjs.mjs/particles/emitter.js +0 -265
- package/dist/melonjs.mjs/particles/particle.js +0 -186
- package/dist/melonjs.mjs/particles/settings.js +0 -317
- package/dist/melonjs.mjs/physics/body.js +0 -706
- package/dist/melonjs.mjs/physics/bounds.js +0 -409
- package/dist/melonjs.mjs/physics/collision.js +0 -130
- package/dist/melonjs.mjs/physics/detector.js +0 -218
- package/dist/melonjs.mjs/physics/quadtree.js +0 -396
- package/dist/melonjs.mjs/physics/response.js +0 -57
- package/dist/melonjs.mjs/physics/sat.js +0 -483
- package/dist/melonjs.mjs/physics/world.js +0 -224
- package/dist/melonjs.mjs/plugin/plugin.js +0 -168
- package/dist/melonjs.mjs/renderable/collectable.js +0 -60
- package/dist/melonjs.mjs/renderable/colorlayer.js +0 -78
- package/dist/melonjs.mjs/renderable/container.js +0 -994
- package/dist/melonjs.mjs/renderable/draggable.js +0 -121
- package/dist/melonjs.mjs/renderable/dragndrop.js +0 -114
- package/dist/melonjs.mjs/renderable/entity/entity.js +0 -254
- package/dist/melonjs.mjs/renderable/imagelayer.js +0 -288
- package/dist/melonjs.mjs/renderable/light2d.js +0 -164
- package/dist/melonjs.mjs/renderable/nineslicesprite.js +0 -242
- package/dist/melonjs.mjs/renderable/renderable.js +0 -860
- package/dist/melonjs.mjs/renderable/sprite.js +0 -694
- package/dist/melonjs.mjs/renderable/text/bitmaptext.js +0 -421
- package/dist/melonjs.mjs/renderable/text/bitmaptextdata.js +0 -195
- package/dist/melonjs.mjs/renderable/text/glyph.js +0 -65
- package/dist/melonjs.mjs/renderable/text/text.js +0 -424
- package/dist/melonjs.mjs/renderable/text/textmetrics.js +0 -176
- package/dist/melonjs.mjs/renderable/text/textstyle.js +0 -21
- package/dist/melonjs.mjs/renderable/trigger.js +0 -158
- package/dist/melonjs.mjs/renderable/ui/uibaseelement.js +0 -285
- package/dist/melonjs.mjs/renderable/ui/uispriteelement.js +0 -231
- package/dist/melonjs.mjs/renderable/ui/uitextbutton.js +0 -146
- package/dist/melonjs.mjs/state/stage.js +0 -235
- package/dist/melonjs.mjs/state/state.js +0 -548
- package/dist/melonjs.mjs/system/device.js +0 -872
- package/dist/melonjs.mjs/system/dom.js +0 -79
- package/dist/melonjs.mjs/system/event.js +0 -606
- package/dist/melonjs.mjs/system/platform.js +0 -43
- package/dist/melonjs.mjs/system/pooling.js +0 -182
- package/dist/melonjs.mjs/system/save.js +0 -157
- package/dist/melonjs.mjs/system/timer.js +0 -274
- package/dist/melonjs.mjs/tweens/easing.js +0 -334
- package/dist/melonjs.mjs/tweens/interpolation.js +0 -112
- package/dist/melonjs.mjs/tweens/tween.js +0 -479
- package/dist/melonjs.mjs/utils/agent.js +0 -77
- package/dist/melonjs.mjs/utils/array.js +0 -63
- package/dist/melonjs.mjs/utils/file.js +0 -54
- package/dist/melonjs.mjs/utils/function.js +0 -69
- package/dist/melonjs.mjs/utils/string.js +0 -82
- package/dist/melonjs.mjs/utils/utils.js +0 -139
- package/dist/melonjs.mjs/video/canvas/canvas_renderer.js +0 -883
- package/dist/melonjs.mjs/video/renderer.js +0 -393
- package/dist/melonjs.mjs/video/rendertarget/canvasrendertarget.js +0 -310
- package/dist/melonjs.mjs/video/texture/atlas.js +0 -460
- package/dist/melonjs.mjs/video/texture/cache.js +0 -186
- package/dist/melonjs.mjs/video/texture/parser/aseprite.js +0 -78
- package/dist/melonjs.mjs/video/texture/parser/spritesheet.js +0 -77
- package/dist/melonjs.mjs/video/texture/parser/texturepacker.js +0 -64
- package/dist/melonjs.mjs/video/utils/autodetect.js +0 -27
- package/dist/melonjs.mjs/video/video.js +0 -142
- package/dist/melonjs.mjs/video/webgl/buffer/vertex.js +0 -146
- package/dist/melonjs.mjs/video/webgl/compositors/compositor.js +0 -234
- package/dist/melonjs.mjs/video/webgl/compositors/primitive_compositor.js +0 -77
- package/dist/melonjs.mjs/video/webgl/compositors/quad_compositor.js +0 -254
- package/dist/melonjs.mjs/video/webgl/glshader.js +0 -166
- package/dist/melonjs.mjs/video/webgl/shaders/primitive.frag.js +0 -10
- package/dist/melonjs.mjs/video/webgl/shaders/primitive.vert.js +0 -10
- package/dist/melonjs.mjs/video/webgl/shaders/quad.frag.js +0 -10
- package/dist/melonjs.mjs/video/webgl/shaders/quad.vert.js +0 -10
- package/dist/melonjs.mjs/video/webgl/utils/attributes.js +0 -25
- package/dist/melonjs.mjs/video/webgl/utils/precision.js +0 -38
- package/dist/melonjs.mjs/video/webgl/utils/program.js +0 -67
- package/dist/melonjs.mjs/video/webgl/utils/string.js +0 -25
- package/dist/melonjs.mjs/video/webgl/utils/uniforms.js +0 -92
- package/dist/melonjs.mjs/video/webgl/webgl_renderer.js +0 -1199
- package/dist/melonjs.module.js +0 -42838
- package/dist/types/application/header.d.ts +0 -5
- package/dist/types/application/settings.d.ts +0 -105
- package/dist/types/const.d.ts +0 -21
- package/dist/types/geometries/ellipse.d.ts +0 -127
- package/dist/types/geometries/line.d.ts +0 -11
- package/dist/types/geometries/point.d.ts +0 -46
- package/dist/types/geometries/poly.d.ts +0 -175
- package/dist/types/geometries/rectangle.d.ts +0 -130
- package/dist/types/geometries/roundrect.d.ts +0 -43
- package/dist/types/geometries/toarccanvas.d.ts +0 -10
- package/dist/types/input/keyboard.d.ts +0 -205
- package/dist/types/input/pointer.d.ts +0 -261
- package/dist/types/lang/deprecated.d.ts +0 -68
- package/dist/types/loader/cache.d.ts +0 -9
- package/dist/types/loader/parsers/compressed_textures/parseDDS.d.ts +0 -1
- package/dist/types/loader/parsers/compressed_textures/parseKTX.d.ts +0 -1
- package/dist/types/loader/parsers/compressed_textures/parseKTX2.d.ts +0 -1
- package/dist/types/loader/parsers/compressed_textures/parsePKM.d.ts +0 -1
- package/dist/types/loader/parsers/compressed_textures/parsePVR.d.ts +0 -1
- package/dist/types/math/color.d.ts +0 -179
- package/dist/types/math/math.d.ts +0 -149
- package/dist/types/math/matrix2.d.ts +0 -165
- package/dist/types/math/matrix3.d.ts +0 -177
- package/dist/types/math/observable_vector2.d.ts +0 -278
- package/dist/types/math/observable_vector3.d.ts +0 -277
- package/dist/types/math/vector2.d.ts +0 -255
- package/dist/types/math/vector3.d.ts +0 -266
- package/dist/types/particles/particle.d.ts +0 -32
- package/dist/types/physics/bounds.d.ts +0 -195
- package/dist/types/polyfill/console.d.ts +0 -1
- package/dist/types/polyfill/index.d.ts +0 -1
- package/dist/types/polyfill/roundrect.d.ts +0 -1
- package/dist/types/renderable/colorlayer.d.ts +0 -28
- package/dist/types/renderable/light2d.d.ts +0 -58
- package/dist/types/renderable/text/bitmaptextdata.d.ts +0 -35
- package/dist/types/system/dom.d.ts +0 -1
- package/dist/types/system/platform.d.ts +0 -33
- package/dist/types/system/save.d.ts +0 -25
- package/dist/types/system/timer.d.ts +0 -126
- package/dist/types/tweens/easing.d.ts +0 -46
- package/dist/types/tweens/interpolation.d.ts +0 -18
- package/dist/types/tweens/tween.d.ts +0 -195
- package/dist/types/utils/agent.d.ts +0 -21
- package/dist/types/utils/array.d.ts +0 -39
- package/dist/types/utils/file.d.ts +0 -27
- package/dist/types/utils/function.d.ts +0 -31
- package/dist/types/utils/string.d.ts +0 -50
- package/dist/types/utils/utils.d.ts +0 -54
- package/dist/types/video/utils/autodetect.d.ts +0 -5
- package/src/application/application.js +0 -429
- package/src/application/header.js +0 -26
- package/src/application/resize.js +0 -114
- package/src/application/settings.js +0 -56
- package/src/audio/audio.js +0 -617
- package/src/camera/camera2d.js +0 -724
- package/src/const.js +0 -23
- package/src/geometries/ellipse.js +0 -236
- package/src/geometries/line.js +0 -99
- package/src/geometries/path2d.js +0 -464
- package/src/geometries/point.js +0 -71
- package/src/geometries/poly.js +0 -424
- package/src/geometries/rectangle.js +0 -321
- package/src/geometries/roundrect.js +0 -156
- package/src/geometries/toarccanvas.js +0 -94
- package/src/index.js +0 -315
- package/src/input/gamepad.js +0 -487
- package/src/input/input.js +0 -17
- package/src/input/keyboard.js +0 -461
- package/src/input/pointer.js +0 -386
- package/src/input/pointerevent.js +0 -794
- package/src/lang/console.js +0 -36
- package/src/lang/deprecated.js +0 -192
- package/src/level/level.js +0 -290
- package/src/level/tiled/TMXGroup.js +0 -111
- package/src/level/tiled/TMXLayer.js +0 -424
- package/src/level/tiled/TMXObject.js +0 -286
- package/src/level/tiled/TMXTile.js +0 -168
- package/src/level/tiled/TMXTileMap.js +0 -569
- package/src/level/tiled/TMXTileset.js +0 -284
- package/src/level/tiled/TMXTilesetGroup.js +0 -66
- package/src/level/tiled/TMXUtils.js +0 -408
- package/src/level/tiled/constants.js +0 -8
- package/src/level/tiled/renderer/TMXHexagonalRenderer.js +0 -497
- package/src/level/tiled/renderer/TMXIsometricRenderer.js +0 -208
- package/src/level/tiled/renderer/TMXOrthogonalRenderer.js +0 -149
- package/src/level/tiled/renderer/TMXRenderer.js +0 -103
- package/src/level/tiled/renderer/TMXStaggeredRenderer.js +0 -100
- package/src/level/tiled/renderer/autodetect.js +0 -29
- package/src/loader/cache.js +0 -22
- package/src/loader/loader.js +0 -727
- package/src/loader/loadingscreen.js +0 -112
- package/src/loader/melonjs_logo.png +0 -0
- package/src/loader/parsers/binary.js +0 -33
- package/src/loader/parsers/compressed_textures/compressed_image.js +0 -49
- package/src/loader/parsers/compressed_textures/parseDDS.js +0 -5
- package/src/loader/parsers/compressed_textures/parseKTX.js +0 -5
- package/src/loader/parsers/compressed_textures/parseKTX2.js +0 -5
- package/src/loader/parsers/compressed_textures/parsePKM.js +0 -5
- package/src/loader/parsers/compressed_textures/parsePVR.js +0 -127
- package/src/loader/parsers/fetchdata.js +0 -53
- package/src/loader/parsers/fontface.js +0 -54
- package/src/loader/parsers/image.js +0 -120
- package/src/loader/parsers/json.js +0 -35
- package/src/loader/parsers/script.js +0 -37
- package/src/loader/parsers/tmx.js +0 -95
- package/src/loader/parsers/video.js +0 -90
- package/src/math/color.js +0 -627
- package/src/math/math.js +0 -212
- package/src/math/matrix2.js +0 -479
- package/src/math/matrix3.js +0 -613
- package/src/math/observable_vector2.js +0 -460
- package/src/math/observable_vector3.js +0 -550
- package/src/math/vector2.js +0 -423
- package/src/math/vector3.js +0 -460
- package/src/particles/emitter.js +0 -258
- package/src/particles/particle.js +0 -178
- package/src/particles/settings.js +0 -310
- package/src/physics/body.js +0 -698
- package/src/physics/bounds.js +0 -401
- package/src/physics/collision.js +0 -123
- package/src/physics/detector.js +0 -209
- package/src/physics/quadtree.js +0 -387
- package/src/physics/response.js +0 -48
- package/src/physics/sat.js +0 -473
- package/src/physics/world.js +0 -216
- package/src/plugin/plugin.js +0 -159
- package/src/polyfill/console.js +0 -11
- package/src/polyfill/index.js +0 -13
- package/src/polyfill/roundrect.js +0 -237
- package/src/renderable/collectable.js +0 -51
- package/src/renderable/colorlayer.js +0 -70
- package/src/renderable/container.js +0 -985
- package/src/renderable/draggable.js +0 -114
- package/src/renderable/dragndrop.js +0 -106
- package/src/renderable/entity/entity.js +0 -246
- package/src/renderable/imagelayer.js +0 -280
- package/src/renderable/light2d.js +0 -155
- package/src/renderable/nineslicesprite.js +0 -233
- package/src/renderable/renderable.js +0 -852
- package/src/renderable/sprite.js +0 -685
- package/src/renderable/text/bitmaptext.js +0 -418
- package/src/renderable/text/bitmaptextdata.js +0 -186
- package/src/renderable/text/glyph.js +0 -57
- package/src/renderable/text/text.js +0 -415
- package/src/renderable/text/textmetrics.js +0 -167
- package/src/renderable/text/textstyle.js +0 -12
- package/src/renderable/trigger.js +0 -149
- package/src/renderable/ui/uibaseelement.js +0 -276
- package/src/renderable/ui/uispriteelement.js +0 -223
- package/src/renderable/ui/uitextbutton.js +0 -140
- package/src/state/stage.js +0 -226
- package/src/state/state.js +0 -541
- package/src/system/device.js +0 -863
- package/src/system/dom.js +0 -70
- package/src/system/event.js +0 -597
- package/src/system/platform.js +0 -34
- package/src/system/pooling.js +0 -190
- package/src/system/save.js +0 -148
- package/src/system/timer.js +0 -281
- package/src/tweens/easing.js +0 -325
- package/src/tweens/interpolation.js +0 -103
- package/src/tweens/tween.js +0 -470
- package/src/utils/agent.js +0 -68
- package/src/utils/array.js +0 -54
- package/src/utils/file.js +0 -46
- package/src/utils/function.js +0 -60
- package/src/utils/string.js +0 -73
- package/src/utils/utils.js +0 -127
- package/src/video/canvas/canvas_renderer.js +0 -874
- package/src/video/renderer.js +0 -384
- package/src/video/rendertarget/canvasrendertarget.js +0 -303
- package/src/video/texture/atlas.js +0 -451
- package/src/video/texture/cache.js +0 -178
- package/src/video/texture/parser/aseprite.js +0 -69
- package/src/video/texture/parser/spritesheet.js +0 -68
- package/src/video/texture/parser/texturepacker.js +0 -55
- package/src/video/utils/autodetect.js +0 -18
- package/src/video/video.js +0 -160
- package/src/video/webgl/buffer/vertex.js +0 -137
- package/src/video/webgl/compositors/compositor.js +0 -225
- package/src/video/webgl/compositors/primitive_compositor.js +0 -68
- package/src/video/webgl/compositors/quad_compositor.js +0 -245
- package/src/video/webgl/glshader.js +0 -158
- package/src/video/webgl/shaders/primitive.frag +0 -5
- package/src/video/webgl/shaders/primitive.vert +0 -15
- package/src/video/webgl/shaders/quad.frag +0 -7
- package/src/video/webgl/shaders/quad.vert +0 -18
- package/src/video/webgl/utils/attributes.js +0 -16
- package/src/video/webgl/utils/precision.js +0 -29
- package/src/video/webgl/utils/program.js +0 -58
- package/src/video/webgl/utils/string.js +0 -16
- package/src/video/webgl/utils/uniforms.js +0 -84
- package/src/video/webgl/webgl_renderer.js +0 -1190
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { Point } from "../geometries/point.ts";
|
|
2
|
+
import { Matrix2d } from "../math/matrix2d.ts";
|
|
3
|
+
import { Vector2d } from "../math/vector2d.ts";
|
|
4
|
+
import { XYPoint } from "../utils/types.ts";
|
|
5
|
+
/**
|
|
6
|
+
* a bound object contains methods for creating and manipulating axis-aligned bounding boxes (AABB).
|
|
7
|
+
*/
|
|
8
|
+
export declare class Bounds {
|
|
9
|
+
_center: Vector2d;
|
|
10
|
+
type: "Bounds";
|
|
11
|
+
min: XYPoint;
|
|
12
|
+
max: XYPoint;
|
|
13
|
+
/**
|
|
14
|
+
* Constructs a Bounds object with optional vertices.
|
|
15
|
+
* @param [vertices] - An array of Vector2d or Point to initialize the bounds.
|
|
16
|
+
*/
|
|
17
|
+
constructor(vertices?: Vector2d[] | Point[] | XYPoint[]);
|
|
18
|
+
/**
|
|
19
|
+
* Resets the bounds to its initial state.
|
|
20
|
+
*/
|
|
21
|
+
clear(): void;
|
|
22
|
+
/**
|
|
23
|
+
* Sets the bounds to the given minimum and maximum values.
|
|
24
|
+
* @param minX - The minimum x value.
|
|
25
|
+
* @param minY - The minimum y value.
|
|
26
|
+
* @param maxX - The maximum x value.
|
|
27
|
+
* @param maxY - The maximum y value.
|
|
28
|
+
*/
|
|
29
|
+
setMinMax(minX: number, minY: number, maxX: number, maxY: number): void;
|
|
30
|
+
/**
|
|
31
|
+
* Gets the x position of the bounds.
|
|
32
|
+
* @returns The x position.
|
|
33
|
+
*/
|
|
34
|
+
get x(): number;
|
|
35
|
+
/**
|
|
36
|
+
* Sets the x position of the bounds.
|
|
37
|
+
* @param value - The new x position.
|
|
38
|
+
*/
|
|
39
|
+
set x(value: number);
|
|
40
|
+
/**
|
|
41
|
+
* Gets the y position of the bounds.
|
|
42
|
+
* @returns The y position.
|
|
43
|
+
*/
|
|
44
|
+
get y(): number;
|
|
45
|
+
/**
|
|
46
|
+
* Sets the y position of the bounds.
|
|
47
|
+
* @param value - The new y position.
|
|
48
|
+
*/
|
|
49
|
+
set y(value: number);
|
|
50
|
+
/**
|
|
51
|
+
* Gets the width of the bounds.
|
|
52
|
+
* @returns The width.
|
|
53
|
+
*/
|
|
54
|
+
get width(): number;
|
|
55
|
+
/**
|
|
56
|
+
* Sets the width of the bounds.
|
|
57
|
+
* @param value - The new width.
|
|
58
|
+
*/
|
|
59
|
+
set width(value: number);
|
|
60
|
+
/**
|
|
61
|
+
* Gets the height of the bounds.
|
|
62
|
+
* @returns The height.
|
|
63
|
+
*/
|
|
64
|
+
get height(): number;
|
|
65
|
+
/**
|
|
66
|
+
* Sets the height of the bounds.
|
|
67
|
+
* @param value - The new height.
|
|
68
|
+
*/
|
|
69
|
+
set height(value: number);
|
|
70
|
+
/**
|
|
71
|
+
* Gets the left coordinate of the bounds.
|
|
72
|
+
* @returns The left coordinate.
|
|
73
|
+
*/
|
|
74
|
+
get left(): number;
|
|
75
|
+
/**
|
|
76
|
+
* Gets the right coordinate of the bounds.
|
|
77
|
+
* @returns The right coordinate.
|
|
78
|
+
*/
|
|
79
|
+
get right(): number;
|
|
80
|
+
/**
|
|
81
|
+
* Gets the top coordinate of the bounds.
|
|
82
|
+
* @returns The top coordinate.
|
|
83
|
+
*/
|
|
84
|
+
get top(): number;
|
|
85
|
+
/**
|
|
86
|
+
* Gets the bottom coordinate of the bounds.
|
|
87
|
+
* @returns The bottom coordinate.
|
|
88
|
+
*/
|
|
89
|
+
get bottom(): number;
|
|
90
|
+
/**
|
|
91
|
+
* Gets the center position of the bounds on the x axis.
|
|
92
|
+
* @returns The center x coordinate.
|
|
93
|
+
*/
|
|
94
|
+
get centerX(): number;
|
|
95
|
+
/**
|
|
96
|
+
* Gets the center position of the bounds on the y axis.
|
|
97
|
+
* @returns The center y coordinate.
|
|
98
|
+
*/
|
|
99
|
+
get centerY(): number;
|
|
100
|
+
/**
|
|
101
|
+
* Gets the center position of the bounds.
|
|
102
|
+
* @returns The center position as a Vector2d.
|
|
103
|
+
*/
|
|
104
|
+
get center(): Vector2d;
|
|
105
|
+
/**
|
|
106
|
+
* Centers the bounds position around the given coordinates.
|
|
107
|
+
* @param x - The x coordinate to center around.
|
|
108
|
+
* @param y - The y coordinate to center around.
|
|
109
|
+
* @returns The current Bounds instance for method chaining.
|
|
110
|
+
*/
|
|
111
|
+
centerOn(x: number, y: number): this;
|
|
112
|
+
/**
|
|
113
|
+
* Updates the bounds using the given vertices.
|
|
114
|
+
* @param vertices - An array of Vector2d or Point to update the bounds.
|
|
115
|
+
*/
|
|
116
|
+
update(vertices: Vector2d[] | Point[] | XYPoint[]): void;
|
|
117
|
+
/**
|
|
118
|
+
* Adds the given vertices to the bounds definition.
|
|
119
|
+
* @param vertices - An array of Vector2d or Point to add to the bounds.
|
|
120
|
+
* @param [clear] - Whether to reset the bounds before adding the new vertices. Defaults to false.
|
|
121
|
+
*/
|
|
122
|
+
add(vertices: Vector2d[] | Point[] | XYPoint[], clear?: boolean): void;
|
|
123
|
+
/**
|
|
124
|
+
* Adds the given bounds to the bounds definition.
|
|
125
|
+
* @param bounds - The bounds to add.
|
|
126
|
+
* @param [clear] - Whether to reset the bounds before adding the new bounds.
|
|
127
|
+
*/
|
|
128
|
+
addBounds(bounds: Bounds, clear?: boolean): void;
|
|
129
|
+
/**
|
|
130
|
+
* Adds the given point to the bounds definition.
|
|
131
|
+
* @param point - The point to add to the bounds.
|
|
132
|
+
* @param [m] - An optional transform to apply to the given point.
|
|
133
|
+
*/
|
|
134
|
+
addPoint(point: Vector2d | Point, m?: Matrix2d): void;
|
|
135
|
+
/**
|
|
136
|
+
* Adds the given quad coordinates to this bounds definition, multiplied by the given matrix.
|
|
137
|
+
* @param x0 - The left x coordinate of the quad.
|
|
138
|
+
* @param y0 - The top y coordinate of the quad.
|
|
139
|
+
* @param x1 - The right x coordinate of the quad.
|
|
140
|
+
* @param y1 - The bottom y coordinate of the quad.
|
|
141
|
+
* @param [m] - An optional transform to apply to the given coordinates.
|
|
142
|
+
*/
|
|
143
|
+
addFrame(x0: number, y0: number, x1: number, y1: number, m?: Matrix2d): void;
|
|
144
|
+
/**
|
|
145
|
+
* Returns true if the bounds contain the given point or vector.
|
|
146
|
+
* @param xOrVectorOrBounds - The x coordinate, vector, or bounds to check.
|
|
147
|
+
* @param [y] - The y coordinate if the first parameter is a number.
|
|
148
|
+
* @returns True if the bounds contain the point or vector, otherwise false.
|
|
149
|
+
*/
|
|
150
|
+
contains(x: number, y: number): boolean;
|
|
151
|
+
contains(vector: Vector2d | Bounds): boolean;
|
|
152
|
+
/**
|
|
153
|
+
* Returns true if the two bounds intersect.
|
|
154
|
+
* @param bounds - The bounds to check for intersection.
|
|
155
|
+
* @returns True if the bounds overlap, otherwise false.
|
|
156
|
+
*/
|
|
157
|
+
overlaps(bounds: Bounds): boolean;
|
|
158
|
+
/**
|
|
159
|
+
* Determines whether all coordinates of this bounds are finite numbers.
|
|
160
|
+
* @returns False if any coordinates are positive or negative Infinity or NaN; otherwise, true.
|
|
161
|
+
*/
|
|
162
|
+
isFinite(): boolean;
|
|
163
|
+
/**
|
|
164
|
+
* Translates the bounds by the given point or vector.
|
|
165
|
+
* @param xOrVector - The x coordinate or vector to translate by.
|
|
166
|
+
* @param [y] - The y coordinate if the first parameter is a number.
|
|
167
|
+
*/
|
|
168
|
+
translate(x: number, y: number): void;
|
|
169
|
+
translate(vector: Vector2d): void;
|
|
170
|
+
/**
|
|
171
|
+
* Shifts the bounds to the given x, y position or vector.
|
|
172
|
+
* @param xOrVector - The x coordinate or vector to shift to.
|
|
173
|
+
* @param [y] - The y coordinate if the first parameter is a number.
|
|
174
|
+
*/
|
|
175
|
+
shift(x: number, y: number): void;
|
|
176
|
+
shift(vector: Vector2d): void;
|
|
177
|
+
/**
|
|
178
|
+
* Creates a clone of this bounds.
|
|
179
|
+
* @returns A new Bounds object that is a copy of this bounds.
|
|
180
|
+
*/
|
|
181
|
+
clone(): Bounds;
|
|
182
|
+
/**
|
|
183
|
+
* Returns a polygon whose edges are the same as this bounds.
|
|
184
|
+
* @returns A new Polygon that represents this bounds.
|
|
185
|
+
*/
|
|
186
|
+
toPolygon(): import("../index.js").Polygon;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* A pool for creating and reusing Bounds objects.
|
|
190
|
+
*/
|
|
191
|
+
export declare const boundsPool: import("../system/pool.ts").Pool<Bounds, [vertices?: Vector2d[] | Point[] | undefined]>;
|
|
192
|
+
//# sourceMappingURL=bounds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bounds.d.ts","sourceRoot":"","sources":["../../src/physics/bounds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAa,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C;;GAEG;AACH,qBAAa,MAAM;IAClB,OAAO,EAAE,QAAQ,CAAC;IAClB,IAAI,EAAE,QAAQ,CAAC;IACf,GAAG,EAAE,OAAO,CAAC;IACb,GAAG,EAAE,OAAO,CAAC;IAEb;;;OAGG;gBACS,QAAQ,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,GAAG,OAAO,EAAE;IAUvD;;OAEG;IACH,KAAK;IAIL;;;;;;OAMG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAQhE;;;OAGG;IACH,IAAI,CAAC,WAEJ;IAED;;;OAGG;IACH,IAAI,CAAC,CAAC,KAAK,QAAA,EAIV;IAED;;;OAGG;IACH,IAAI,CAAC,WAEJ;IAED;;;OAGG;IACH,IAAI,CAAC,CAAC,KAAK,QAAA,EAKV;IAED;;;OAGG;IACH,IAAI,KAAK,WAER;IAED;;;OAGG;IACH,IAAI,KAAK,CAAC,KAAK,QAAA,EAEd;IAED;;;OAGG;IACH,IAAI,MAAM,WAET;IAED;;;OAGG;IACH,IAAI,MAAM,CAAC,KAAK,QAAA,EAEf;IAED;;;OAGG;IACH,IAAI,IAAI,WAEP;IAED;;;OAGG;IACH,IAAI,KAAK,WAER;IAED;;;OAGG;IACH,IAAI,GAAG,WAEN;IAED;;;OAGG;IACH,IAAI,MAAM,WAET;IAED;;;OAGG;IACH,IAAI,OAAO,WAEV;IAED;;;OAGG;IACH,IAAI,OAAO,WAEV;IAED;;;OAGG;IACH,IAAI,MAAM,aAET;IAED;;;;;OAKG;IACH,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;IAK7B;;;OAGG;IACH,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,GAAG,OAAO,EAAE;IAIjD;;;;OAIG;IACH,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,GAAG,OAAO,EAAE,EAAE,KAAK,UAAQ;IAoB7D;;;;OAIG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,UAAQ;IAsBvC;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,KAAK,EAAE,CAAC,CAAC,EAAE,QAAQ;IAQ9C;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,QAAQ;IAWrE;;;;;OAKG;IACH,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO;IACvC,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO;IA2B5C;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM;IASvB;;;OAGG;IACH,QAAQ;IASR;;;;OAIG;IACH,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI;IACrC,SAAS,CAAC,MAAM,EAAE,QAAQ,GAAG,IAAI;IAiBjC;;;;OAIG;IACH,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI;IACjC,KAAK,CAAC,MAAM,EAAE,QAAQ,GAAG,IAAI;IAsB7B;;;OAGG;IACH,KAAK;IAML;;;OAGG;IACH,SAAS;CAQT;AAED;;GAEG;AACH,eAAO,MAAM,UAAU,yFAcrB,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
declare namespace collision {
|
|
1
|
+
export namespace collision {
|
|
3
2
|
let maxChildren: number;
|
|
4
3
|
let maxDepth: number;
|
|
5
4
|
namespace types {
|
|
@@ -24,7 +23,7 @@ declare namespace collision {
|
|
|
24
23
|
* @returns {Array.<Renderable>} an array of intersecting physic objects
|
|
25
24
|
* @example
|
|
26
25
|
* // define a line accross the viewport
|
|
27
|
-
* let ray = new
|
|
26
|
+
* let ray = new Line(
|
|
28
27
|
* // absolute position of the line
|
|
29
28
|
* 0, 0, [
|
|
30
29
|
* // starting point relative to the initial position
|
|
@@ -40,5 +39,8 @@ declare namespace collision {
|
|
|
40
39
|
* // ...
|
|
41
40
|
* }
|
|
42
41
|
*/
|
|
43
|
-
function rayCast(line: Line, result?: Renderable
|
|
42
|
+
function rayCast(line: Line, result?: Array<Renderable>): Array<Renderable>;
|
|
44
43
|
}
|
|
44
|
+
import type { Line } from "./../geometries/line.ts";
|
|
45
|
+
import type Renderable from "./../renderable/renderable.js";
|
|
46
|
+
//# sourceMappingURL=collision.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collision.d.ts","sourceRoot":"","sources":["../../src/physics/collision.js"],"names":[],"mappings":";qBAmBW,MAAM;kBAWN,MAAM;;;;;;;;;;;;;IAmEhB;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,uBArBW,IAAI,WACJ,KAAK,CAAE,UAAU,CAAC,GAChB,KAAK,CAAE,UAAU,CAAC,CAqB9B;;0BA1HqB,yBAAyB;4BACrB,+BAA+B"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
export default Detector;
|
|
1
2
|
/**
|
|
2
3
|
* the Detector class contains methods for detecting collisions between bodies using a broadphase algorithm.
|
|
3
4
|
*/
|
|
4
|
-
|
|
5
|
+
declare class Detector {
|
|
5
6
|
/**
|
|
6
7
|
* @param {Container} world - the physic world this detector is bind to
|
|
7
8
|
*/
|
|
@@ -43,13 +44,13 @@ export default class Detector {
|
|
|
43
44
|
* @returns {Array.<Renderable>} an array of intersecting physic objects
|
|
44
45
|
* @example
|
|
45
46
|
* // define a line accross the viewport
|
|
46
|
-
* let ray = new
|
|
47
|
+
* let ray = new Line(
|
|
47
48
|
* // absolute position of the line
|
|
48
49
|
* 0, 0, [
|
|
49
50
|
* // starting point relative to the initial position
|
|
50
|
-
* new
|
|
51
|
+
* new Vector2d(0, 0),
|
|
51
52
|
* // ending point
|
|
52
|
-
* new
|
|
53
|
+
* new Vector2d(me.game.viewport.width, me.game.viewport.height)
|
|
53
54
|
* ]);
|
|
54
55
|
*
|
|
55
56
|
* // check for collition
|
|
@@ -59,6 +60,13 @@ export default class Detector {
|
|
|
59
60
|
* // ...
|
|
60
61
|
* }
|
|
61
62
|
*/
|
|
62
|
-
rayCast(line: Line, result?: Renderable
|
|
63
|
+
rayCast(line: Line, result?: Array<Renderable>): Array<Renderable>;
|
|
63
64
|
}
|
|
65
|
+
import type Container from "./../renderable/container.js";
|
|
64
66
|
import ResponseObject from "./response.js";
|
|
67
|
+
import type Renderable from "./../renderable/renderable.js";
|
|
68
|
+
import type Entity from "./../renderable/entity/entity.js";
|
|
69
|
+
import type Sprite from "./../renderable/sprite.js";
|
|
70
|
+
import type NineSliceSprite from "./../renderable/nineslicesprite.js";
|
|
71
|
+
import type { Line } from "./../geometries/line.ts";
|
|
72
|
+
//# sourceMappingURL=detector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detector.d.ts","sourceRoot":"","sources":["../../src/physics/detector.js"],"names":[],"mappings":";AA0CA;;GAEG;AACH;IACC;;OAEG;IACH,mBAFW,SAAS,EAYnB;IARA,iBAAkB;IAElB;;;;OAIG;IACH,UAFU,cAAc,CAEY;IAGrC;;;;;;OAMG;IACH,iBAJW,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,KAClD,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,GAChD,OAAO,CAiBnB;IAED;;;;;OAKG;IACH,gBAJW,IAAI,SACJ,IAAI,8BACF,OAAO,CAkCnB;IAED;;;;;OAKG;IACH,iBAHW,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,GAChD,OAAO,CA8EnB;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,cArBW,IAAI,WACJ,KAAK,CAAE,UAAU,CAAC,GAChB,KAAK,CAAE,UAAU,CAAC,CAiE9B;CACD;2BApQyB,8BAA8B;2BAlB7B,eAAe;4BAmBf,+BAA+B;wBAFnC,kCAAkC;wBAGlC,2BAA2B;iCAClB,oCAAoC;0BAC7C,yBAAyB"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @classdesc
|
|
3
2
|
* a QuadTree implementation in JavaScript, a 2d spatial subdivision algorithm.
|
|
4
3
|
* @see game.world.broadphase
|
|
5
4
|
*/
|
|
@@ -11,7 +10,7 @@ export default class QuadTree {
|
|
|
11
10
|
* @param {number} [max_levels=4] - total max levels inside root Quadtree
|
|
12
11
|
* @param {number} [level] - deepth level, required for subnodes
|
|
13
12
|
*/
|
|
14
|
-
constructor(world: World, bounds: Bounds, max_objects?: number
|
|
13
|
+
constructor(world: World, bounds: Bounds, max_objects?: number, max_levels?: number, level?: number);
|
|
15
14
|
world: World;
|
|
16
15
|
bounds: Bounds;
|
|
17
16
|
max_objects: number;
|
|
@@ -23,8 +22,6 @@ export default class QuadTree {
|
|
|
23
22
|
getIndex(item: any): number;
|
|
24
23
|
/**
|
|
25
24
|
* Insert the given object container into the node.
|
|
26
|
-
* @name insertContainer
|
|
27
|
-
* @memberof QuadTree
|
|
28
25
|
* @param {Container} container - group of objects to be added
|
|
29
26
|
*/
|
|
30
27
|
insertContainer(container: Container): void;
|
|
@@ -32,48 +29,40 @@ export default class QuadTree {
|
|
|
32
29
|
* Insert the given object into the node. If the node
|
|
33
30
|
* exceeds the capacity, it will split and add all
|
|
34
31
|
* objects to their corresponding subnodes.
|
|
35
|
-
* @name insert
|
|
36
|
-
* @memberof QuadTree
|
|
37
32
|
* @param {object} item - object to be added
|
|
38
33
|
*/
|
|
39
34
|
insert(item: object): void;
|
|
40
35
|
/**
|
|
41
36
|
* Return all objects that could collide with the given object
|
|
42
|
-
* @name retrieve
|
|
43
|
-
* @memberof QuadTree
|
|
44
37
|
* @param {object} item - object to be checked against
|
|
45
38
|
* @param {object} [fn] - a sorting function for the returned array
|
|
46
39
|
* @returns {object[]} array with all detected objects
|
|
47
40
|
*/
|
|
48
|
-
retrieve(item: object, fn?: object
|
|
41
|
+
retrieve(item: object, fn?: object, result: any): object[];
|
|
49
42
|
/**
|
|
50
43
|
* Remove the given item from the quadtree.
|
|
51
44
|
* (this function won't recalculate the impacted node)
|
|
52
|
-
* @name remove
|
|
53
|
-
* @memberof QuadTree
|
|
54
45
|
* @param {object} item - object to be removed
|
|
55
46
|
* @returns {boolean} true if the item was found and removed.
|
|
56
47
|
*/
|
|
57
48
|
remove(item: object): boolean;
|
|
58
49
|
/**
|
|
59
50
|
* return true if the node is prunable
|
|
60
|
-
* @name isPrunable
|
|
61
|
-
* @memberof QuadTree
|
|
62
51
|
* @returns {boolean} true if the node is prunable
|
|
63
52
|
*/
|
|
64
53
|
isPrunable(): boolean;
|
|
65
54
|
/**
|
|
66
55
|
* return true if the node has any children
|
|
67
|
-
* @name hasChildren
|
|
68
|
-
* @memberof QuadTree
|
|
69
56
|
* @returns {boolean} true if the node has any children
|
|
70
57
|
*/
|
|
71
58
|
hasChildren(): boolean;
|
|
72
59
|
/**
|
|
73
60
|
* clear the quadtree
|
|
74
|
-
* @name clear
|
|
75
|
-
* @memberof QuadTree
|
|
76
61
|
* @param {Bounds} [bounds=this.bounds] - the bounds to be cleared
|
|
77
62
|
*/
|
|
78
|
-
clear(bounds?:
|
|
63
|
+
clear(bounds?: Bounds): void;
|
|
79
64
|
}
|
|
65
|
+
import type World from "./world.js";
|
|
66
|
+
import type { Bounds } from "./bounds.ts";
|
|
67
|
+
import type Container from "./../renderable/container.js";
|
|
68
|
+
//# sourceMappingURL=quadtree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quadtree.d.ts","sourceRoot":"","sources":["../../src/physics/quadtree.js"],"names":[],"mappings":"AA4DA;;;GAGG;AACH;IACC;;;;;;OAMG;IACH,mBANW,KAAK,UACL,MAAM,gBACN,MAAM,eACN,MAAM,UACN,MAAM,EAahB;IAVA,aAAkB;IAClB,eAAoB;IAEpB,oBAA8B;IAC9B,mBAA4B;IAE5B,cAAkB;IAElB,eAAiB;IACjB,aAAe;IAMhB,cA8DC;IAOD,4BA4CC;IAED;;;OAGG;IACH,2BAFW,SAAS,QAsBnB;IAED;;;;;OAKG;IACH,aAFW,MAAM,QAsChB;IAED;;;;;OAKG;IACH,eAJW,MAAM,OACN,MAAM,gBACJ,MAAM,EAAE,CAmCpB;IAED;;;;;OAKG;IACH,aAHW,MAAM,GACJ,OAAO,CAiCnB;IAED;;;OAGG;IACH,cAFa,OAAO,CAInB;IAED;;;OAGG;IACH,eAFa,OAAO,CAUnB;IAED;;;OAGG;IACH,eAFW,MAAM,QAsBhB;CACD;uBA5YqB,YAAY;4BAET,aAAa;2BADZ,8BAA8B"}
|
|
@@ -1,6 +1,48 @@
|
|
|
1
|
+
export default ResponseObject;
|
|
1
2
|
/**
|
|
2
|
-
* @classdesc
|
|
3
3
|
* An object representing the result of an intersection.
|
|
4
|
+
*/
|
|
5
|
+
export type ResponseObject = {
|
|
6
|
+
/**
|
|
7
|
+
* The first object participating in the intersection
|
|
8
|
+
*/
|
|
9
|
+
a: Renderable;
|
|
10
|
+
/**
|
|
11
|
+
* The second object participating in the intersection
|
|
12
|
+
*/
|
|
13
|
+
b: Renderable;
|
|
14
|
+
/**
|
|
15
|
+
* Magnitude of the overlap on the shortest colliding axis
|
|
16
|
+
*/
|
|
17
|
+
overlap: number;
|
|
18
|
+
/**
|
|
19
|
+
* The overlap vector (i.e. `overlapN.scale(overlap, overlap)`). If this vector is subtracted from the position of a, a and b will no longer be colliding
|
|
20
|
+
*/
|
|
21
|
+
overlapV: Vector2d;
|
|
22
|
+
/**
|
|
23
|
+
* The shortest colliding axis (unit-vector)
|
|
24
|
+
*/
|
|
25
|
+
overlapN: Vector2d;
|
|
26
|
+
/**
|
|
27
|
+
* Whether the first object is entirely inside the second
|
|
28
|
+
*/
|
|
29
|
+
aInB: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the second object is entirely inside the first
|
|
32
|
+
*/
|
|
33
|
+
bInA: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* The index of the colliding shape for the object a body
|
|
36
|
+
*/
|
|
37
|
+
indexShapeA: number;
|
|
38
|
+
/**
|
|
39
|
+
* The index of the colliding shape for the object b body
|
|
40
|
+
*/
|
|
41
|
+
indexShapeB: number;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* An object representing the result of an intersection.
|
|
45
|
+
* @typedef {object} ResponseObject
|
|
4
46
|
* @property {Renderable} a The first object participating in the intersection
|
|
5
47
|
* @property {Renderable} b The second object participating in the intersection
|
|
6
48
|
* @property {number} overlap Magnitude of the overlap on the shortest colliding axis
|
|
@@ -10,10 +52,8 @@
|
|
|
10
52
|
* @property {boolean} bInA Whether the second object is entirely inside the first
|
|
11
53
|
* @property {number} indexShapeA The index of the colliding shape for the object a body
|
|
12
54
|
* @property {number} indexShapeB The index of the colliding shape for the object b body
|
|
13
|
-
* @name ResponseObject
|
|
14
|
-
* @public
|
|
15
55
|
*/
|
|
16
|
-
|
|
56
|
+
declare class ResponseObject {
|
|
17
57
|
a: any;
|
|
18
58
|
b: any;
|
|
19
59
|
overlapN: Vector2d;
|
|
@@ -34,4 +74,5 @@ export default class ResponseObject {
|
|
|
34
74
|
*/
|
|
35
75
|
public clear(): object;
|
|
36
76
|
}
|
|
37
|
-
import Vector2d from "
|
|
77
|
+
import { Vector2d } from "../math/vector2d.ts";
|
|
78
|
+
//# sourceMappingURL=response.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../src/physics/response.js"],"names":[],"mappings":";;;;;;;;OAKc,UAAU;;;;OACV,UAAU;;;;aACV,MAAM;;;;cACN,QAAQ;;;;cACR,QAAQ;;;;UACR,OAAO;;;;UACP,OAAO;;;;iBACP,MAAM;;;;iBACN,MAAM;;AAXpB;;;;;;;;;;;;GAYG;AACH;IAEE,OAAa;IACb,OAAa;IACb,mBAA8B;IAC9B,mBAA8B;IAC9B,cAAgB;IAChB,cAAgB;IAChB,oBAAqB;IACrB,oBAAqB;IACrB,gBAA+B;IAGhC;;;;;;;;OAQG;IACH,gBAFa,MAAM,CASlB;CACD;yBA7CwB,qBAAqB"}
|
|
@@ -46,3 +46,11 @@ export function testPolygonEllipse(a: Renderable | Container | Entity | Sprite |
|
|
|
46
46
|
* @returns {boolean} true if they intersect, false if they don't.
|
|
47
47
|
*/
|
|
48
48
|
export function testEllipsePolygon(a: Renderable | Container | Entity | Sprite | NineSliceSprite, ellipseA: Ellipse, b: Renderable | Container | Entity | Sprite | NineSliceSprite, polyB: Polygon, response?: Response | undefined): boolean;
|
|
49
|
+
import type Renderable from "./../renderable/renderable.js";
|
|
50
|
+
import type Container from "./../renderable/container.js";
|
|
51
|
+
import type Entity from "./../renderable/entity/entity.js";
|
|
52
|
+
import type Sprite from "./../renderable/sprite.js";
|
|
53
|
+
import type NineSliceSprite from "./../renderable/nineslicesprite.js";
|
|
54
|
+
import type { Polygon } from "../geometries/polygon.ts";
|
|
55
|
+
import type { Ellipse } from "./../geometries/ellipse.ts";
|
|
56
|
+
//# sourceMappingURL=sat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sat.d.ts","sourceRoot":"","sources":["../../src/physics/sat.js"],"names":[],"mappings":"AAyMA;;;;;;;;;GASG;AACH,sCAPW,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,SAClD,OAAO,KACP,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,SAClD,OAAO,aACP,QAAQ,YAAC,GACP,OAAO,CAiDnB;AAED;;;;;;;;;;GAUG;AACH,sCARW,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,YAClD,OAAO,KACP,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,YAClD,OAAO,aACP,QAAQ,YAAC,GAEP,OAAO,CAmCnB;AAED;;;;;;;;;GASG;AACH,sCAPW,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,SAClD,OAAO,KACP,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,YAClD,OAAO,aACP,QAAQ,YAAC,GACP,OAAO,CAmKnB;AAED;;;;;;;;;;;;GAYG;AACH,sCARW,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,YAClD,OAAO,KACP,UAAU,GAAC,SAAS,GAAC,MAAM,GAAC,MAAM,GAAC,eAAe,SAClD,OAAO,aACP,QAAQ,YAAC,GAEP,OAAO,CAiBnB;4BAjf0B,+BAA+B;2BADhC,8BAA8B;wBADjC,kCAAkC;wBAGlC,2BAA2B;iCAClB,oCAAoC;6BAC1C,0BAA0B;6BAC1B,4BAA4B"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @
|
|
2
|
+
* @import Application from "./../application/application.js";
|
|
3
|
+
* @import Body from "./body.js";
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
3
6
|
* an object representing the physic world, and responsible for managing and updating all childs and physics
|
|
4
|
-
* @augments Container
|
|
5
7
|
*/
|
|
6
8
|
export default class World extends Container {
|
|
7
9
|
/**
|
|
@@ -10,7 +12,7 @@ export default class World extends Container {
|
|
|
10
12
|
* @param {number} [width=game.viewport.width] - width of the container
|
|
11
13
|
* @param {number} [height=game.viewport.height] - height of the container
|
|
12
14
|
*/
|
|
13
|
-
constructor(x?: number
|
|
15
|
+
constructor(x?: number, y?: number, width?: number, height?: number);
|
|
14
16
|
/**
|
|
15
17
|
* the application (game) this physic world belong to
|
|
16
18
|
* @type {Application}
|
|
@@ -90,6 +92,9 @@ export default class World extends Container {
|
|
|
90
92
|
step(dt: number): void;
|
|
91
93
|
}
|
|
92
94
|
import Container from "../renderable/container.js";
|
|
93
|
-
import
|
|
95
|
+
import type Application from "./../application/application.js";
|
|
96
|
+
import { Vector2d } from "../math/vector2d.ts";
|
|
97
|
+
import type Body from "./body.js";
|
|
94
98
|
import QuadTree from "./quadtree.js";
|
|
95
99
|
import Detector from "./detector.js";
|
|
100
|
+
//# sourceMappingURL=world.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"world.d.ts","sourceRoot":"","sources":["../../src/physics/world.js"],"names":[],"mappings":"AAcA;;;GAGG;AAEH;;GAEG;AACH;IACC;;;;;OAKG;IACH,gBALW,MAAM,MACN,MAAM,UACN,MAAM,WACN,MAAM,EAqFhB;IAzEA;;;OAGG;IACH,KAFU,WAAW,CAED;IAEpB;;;;;;;;OAQG;IACH,QANU,MAAM,CAMO;IAEvB;;;;;OAKG;IACH,YAAa;IAEb;;;;OAIG;IACH,SAHU,QAAQ,CAGkB;IAEpC;;;;;;;OAOG;IACH,WAHU,OAAO,CAGK;IAEtB;;;OAGG;IACH,QAFU,GAAG,CAAC,IAAI,CAAC,CAEI;IAEvB;;;OAGG;IACH,YAFU,QAAQ,CAOjB;IAED;;;OAGG;IACH,UAFU,QAAQ,CAEgB;IA6CnC;;;;;OAKG;IACH,cAHW,IAAI,GACF,KAAK,CAQjB;IAED;;;;;OAKG;IACH,iBAHW,IAAI,GACF,KAAK,CAQjB;IAED;;;;OAIG;IACH,yBASC;IAuBD;;;OAGG;IACH,SAFW,MAAM,QAiChB;CACD;sBAtPqB,4BAA4B;6BAatB,iCAAiC;yBAdpC,qBAAqB;sBAezB,WAAW;qBAJX,eAAe;qBADf,eAAe"}
|
|
@@ -28,41 +28,41 @@ export function patch(proto: object, name: string, fn: Function): void;
|
|
|
28
28
|
* // the `testPlugin` class instance can also be accessed through me.plugin.cache
|
|
29
29
|
* me.plugin.cache.testPlugin.myfunction ();
|
|
30
30
|
*/
|
|
31
|
-
export function register(plugin: plugin.BasePlugin, name?: string
|
|
31
|
+
export function register(plugin: plugin.BasePlugin, name?: string, ...args: any[]): void;
|
|
32
32
|
/**
|
|
33
33
|
* returns the the plugin instance with the specified class type or registered name
|
|
34
34
|
* @name get
|
|
35
35
|
* @memberof plugin
|
|
36
36
|
* @param {object|string} classType - the Class Object or registered name of the plugin to retreive
|
|
37
|
-
* @returns {BasePlugin} a plugin instance or undefined
|
|
37
|
+
* @returns {plugin.BasePlugin} a plugin instance or undefined
|
|
38
|
+
*/
|
|
39
|
+
export function get(classType: object | string): plugin.BasePlugin;
|
|
40
|
+
/**
|
|
41
|
+
* @import Application from "./../application/application.js";
|
|
38
42
|
*/
|
|
39
|
-
export function get(classType: object | string): BasePlugin;
|
|
40
43
|
/**
|
|
41
44
|
* Contains all registered plugins.
|
|
42
45
|
* @name cache
|
|
43
46
|
* @memberof plugin
|
|
47
|
+
* @type {Object.<plugin.BasePlugin>}
|
|
44
48
|
*/
|
|
45
|
-
export
|
|
49
|
+
export const cache: Object<plugin.BasePlugin>;
|
|
46
50
|
/**
|
|
47
51
|
* @namespace plugin
|
|
48
52
|
*/
|
|
49
53
|
/**
|
|
50
54
|
* a base Object class for plugin
|
|
51
55
|
* (plugin must be installed using the register function)
|
|
52
|
-
* @class
|
|
53
|
-
* @name BasePlugin
|
|
54
56
|
* @memberof plugin
|
|
55
57
|
*/
|
|
56
58
|
export class BasePlugin {
|
|
57
59
|
/**
|
|
58
60
|
* @param {Application} [app] - a reference to the app/game that registered this plugin
|
|
59
61
|
*/
|
|
60
|
-
constructor(app?:
|
|
62
|
+
constructor(app?: Application);
|
|
61
63
|
/**
|
|
62
64
|
* define the minimum required version of melonJS<br>
|
|
63
65
|
* this can be overridden by the plugin
|
|
64
|
-
* @type {string}
|
|
65
|
-
* @default "__VERSION__"
|
|
66
66
|
*/
|
|
67
67
|
version: string;
|
|
68
68
|
/**
|
|
@@ -71,12 +71,5 @@ export class BasePlugin {
|
|
|
71
71
|
*/
|
|
72
72
|
app: Application;
|
|
73
73
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
* @name Base
|
|
77
|
-
* @memberof plugin
|
|
78
|
-
* @deprecated since 15.1.6, see {@link plugin.BasePlugin}
|
|
79
|
-
*/
|
|
80
|
-
export class Base extends BasePlugin {
|
|
81
|
-
constructor();
|
|
82
|
-
}
|
|
74
|
+
import type Application from "./../application/application.js";
|
|
75
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/plugin/plugin.js"],"names":[],"mappings":"AA4CA;;;;;;;;;;;;;;;GAeG;AACH,6BAZW,MAAM,QACN,MAAM,sBAmChB;AAED;;;;;;;;;;;;GAYG;AACH,iCATW,MAAM,CAAC,UAAU,SACjB,MAAM,wBA0ChB;AAED;;;;;;GAMG;AACH,+BAHW,MAAM,GAAC,MAAM,GACX,MAAM,CAAC,UAAU,CAW7B;AAnJD;;GAEG;AAEH;;;;;GAKG;AACH,oBAFU,MAAM,CAAE,MAAM,CAAC,UAAU,CAAC,CAEZ;AAExB;;GAEG;AAEH;;;;GAIG;AACH;IACC;;OAEG;IACH,kBAFW,WAAW,EAcrB;IAXA;;;OAGG;IACH,gBAAsB;IAEtB;;;OAGG;IACH,KAFU,WAAW,CAEP;CAEf;6BArC2B,iCAAiC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../src/polyfill/console.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/polyfill/index.ts"],"names":[],"mappings":"AACA,OAAO,+BAA+B,CAAC;AAGvC,OAAO,8BAA8B,CAAC;AACtC,OAAO,4BAA4B,CAAC;AAGpC,OAAO,cAAc,CAAC;AACtB,OAAO,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roundrect.d.ts","sourceRoot":"","sources":["../../src/polyfill/roundrect.ts"],"names":[],"mappings":""}
|
package/build/pool.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ellipsePool } from "./geometries/ellipse";
|
|
2
|
+
import { linePool } from "./geometries/line";
|
|
3
|
+
import { pointPool } from "./geometries/point";
|
|
4
|
+
import { polygonPool } from "./geometries/polygon";
|
|
5
|
+
import { rectPool } from "./geometries/rectangle";
|
|
6
|
+
import { roundedRectanglePool } from "./geometries/roundrect";
|
|
7
|
+
import { colorPool } from "./math/color";
|
|
8
|
+
import { matrix2dPool } from "./math/matrix2d";
|
|
9
|
+
import { matrix3dPool } from "./math/matrix3d";
|
|
10
|
+
import { vector2dPool } from "./math/vector2d";
|
|
11
|
+
import { vector3dPool } from "./math/vector3d";
|
|
12
|
+
import type ParticleEmitter from "./particles/emitter";
|
|
13
|
+
import type Particle from "./particles/particle";
|
|
14
|
+
import { boundsPool } from "./physics/bounds";
|
|
15
|
+
import { bitmapTextDataPool } from "./renderable/text/bitmaptextdata";
|
|
16
|
+
import type { Pool } from "./system/pool";
|
|
17
|
+
import { tweenPool } from "./tweens/tween";
|
|
18
|
+
interface PoolMap {
|
|
19
|
+
vector2d: typeof vector2dPool;
|
|
20
|
+
vector3d: typeof vector3dPool;
|
|
21
|
+
point: typeof pointPool;
|
|
22
|
+
matrix2d: typeof matrix2dPool;
|
|
23
|
+
matrix3d: typeof matrix3dPool;
|
|
24
|
+
bounds: typeof boundsPool;
|
|
25
|
+
color: typeof colorPool;
|
|
26
|
+
polygon: typeof polygonPool;
|
|
27
|
+
line: typeof linePool;
|
|
28
|
+
rectangle: typeof rectPool;
|
|
29
|
+
roundedRectangle: typeof roundedRectanglePool;
|
|
30
|
+
ellipse: typeof ellipsePool;
|
|
31
|
+
tween: typeof tweenPool;
|
|
32
|
+
particle: Pool<Particle, [emitter: ParticleEmitter]>;
|
|
33
|
+
bitmapTextData: typeof bitmapTextDataPool;
|
|
34
|
+
}
|
|
35
|
+
type PoolKey = keyof PoolMap;
|
|
36
|
+
export declare const getPool: <K extends PoolKey>(key: K) => PoolMap[K];
|
|
37
|
+
export declare const getTotalPoolSize: () => number;
|
|
38
|
+
export { createPool, registerPool } from "./system/pool";
|
|
39
|
+
//# sourceMappingURL=pool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pool.d.ts","sourceRoot":"","sources":["../src/pool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,eAAe,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,QAAQ,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAqB3C,UAAU,OAAO;IAChB,QAAQ,EAAE,OAAO,YAAY,CAAC;IAC9B,QAAQ,EAAE,OAAO,YAAY,CAAC;IAC9B,KAAK,EAAE,OAAO,SAAS,CAAC;IACxB,QAAQ,EAAE,OAAO,YAAY,CAAC;IAC9B,QAAQ,EAAE,OAAO,YAAY,CAAC;IAC9B,MAAM,EAAE,OAAO,UAAU,CAAC;IAC1B,KAAK,EAAE,OAAO,SAAS,CAAC;IACxB,OAAO,EAAE,OAAO,WAAW,CAAC;IAC5B,IAAI,EAAE,OAAO,QAAQ,CAAC;IACtB,SAAS,EAAE,OAAO,QAAQ,CAAC;IAC3B,gBAAgB,EAAE,OAAO,oBAAoB,CAAC;IAC9C,OAAO,EAAE,OAAO,WAAW,CAAC;IAC5B,KAAK,EAAE,OAAO,SAAS,CAAC;IACxB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC;IACrD,cAAc,EAAE,OAAO,kBAAkB,CAAC;CAC1C;AAED,KAAK,OAAO,GAAG,MAAM,OAAO,CAAC;AAE7B,eAAO,MAAM,OAAO,GAAI,CAAC,SAAS,OAAO,EAAE,KAAK,CAAC,KAAG,OAAO,CAAC,CAAC,CAE5D,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAAO,MAOnC,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @classdesc
|
|
3
2
|
* a basic collectable helper class for immovable object (e.g. a coin)
|
|
4
|
-
* @augments Sprite
|
|
5
3
|
*/
|
|
6
4
|
export default class Collectable extends Sprite {
|
|
7
5
|
/**
|
|
@@ -13,5 +11,7 @@ export default class Collectable extends Sprite {
|
|
|
13
11
|
name: any;
|
|
14
12
|
type: any;
|
|
15
13
|
id: any;
|
|
14
|
+
body: any;
|
|
16
15
|
}
|
|
17
16
|
import Sprite from "./sprite.js";
|
|
17
|
+
//# sourceMappingURL=collectable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collectable.d.ts","sourceRoot":"","sources":["../../src/renderable/collectable.js"],"names":[],"mappings":"AAMA;;GAEG;AACH;IACC;;;;OAIG;IACH,eAJW,MAAM,KACN,MAAM,YACN,MAAM,EAgChB;IA1BA,UAAyB;IACzB,UAAyB;IACzB,QAAqB;IAWrB,UAAiC;CAclC;mBA1CkB,aAAa"}
|