melonjs 14.1.2 → 14.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -4
- package/dist/melonjs.mjs/_virtual/_commonjsHelpers.js +1 -1
- package/dist/melonjs.mjs/_virtual/arraymultimap.js +1 -1
- package/dist/melonjs.mjs/_virtual/earcut.js +7 -3
- package/dist/melonjs.mjs/_virtual/howler.js +1 -1
- package/dist/melonjs.mjs/_virtual/index.js +1 -1
- package/dist/melonjs.mjs/_virtual/index2.js +7 -3
- package/dist/melonjs.mjs/_virtual/make-built-in.js +10 -0
- package/dist/melonjs.mjs/_virtual/multimap.js +1 -1
- package/dist/melonjs.mjs/_virtual/object-define-property.js +10 -0
- package/dist/melonjs.mjs/_virtual/object-get-own-property-descriptor.js +10 -0
- package/dist/melonjs.mjs/_virtual/object-get-own-property-names.js +10 -0
- package/dist/melonjs.mjs/_virtual/object-get-own-property-symbols.js +10 -0
- package/dist/melonjs.mjs/_virtual/object-property-is-enumerable.js +10 -0
- package/dist/melonjs.mjs/_virtual/setmultimap.js +1 -1
- package/dist/melonjs.mjs/_virtual/shared.js +10 -0
- package/dist/melonjs.mjs/application/application.js +173 -22
- package/dist/melonjs.mjs/application/header.js +34 -0
- package/dist/melonjs.mjs/application/resize.js +119 -0
- package/dist/melonjs.mjs/application/settings.js +28 -0
- package/dist/melonjs.mjs/audio/audio.js +1 -1
- package/dist/melonjs.mjs/camera/camera2d.js +2 -2
- package/dist/melonjs.mjs/entity/entity.js +1 -1
- package/dist/melonjs.mjs/game.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 +3 -3
- package/dist/melonjs.mjs/geometries/point.js +1 -1
- package/dist/melonjs.mjs/geometries/poly.js +3 -3
- package/dist/melonjs.mjs/geometries/rectangle.js +1 -1
- package/dist/melonjs.mjs/geometries/roundrect.js +1 -1
- package/dist/melonjs.mjs/index.js +41 -61
- 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 +2 -2
- package/dist/melonjs.mjs/input/pointerevent.js +7 -8
- package/dist/melonjs.mjs/lang/deprecated.js +1 -1
- package/dist/melonjs.mjs/level/level.js +2 -2
- package/dist/melonjs.mjs/level/tiled/TMXGroup.js +1 -1
- package/dist/melonjs.mjs/level/tiled/TMXLayer.js +2 -2
- 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 +2 -2
- 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/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/loader/loader.js +1 -1
- package/dist/melonjs.mjs/loader/loadingscreen.js +2 -2
- package/dist/melonjs.mjs/loader/melonjs_logo.png.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/src/arraymultimap.js +3 -2
- package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/index.js +1 -1
- package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/multimap.js +3 -2
- package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/setmultimap.js +3 -2
- package/dist/melonjs.mjs/node_modules/core-js/es/string/trim-end.js +13 -0
- package/dist/melonjs.mjs/node_modules/core-js/es/string/trim-start.js +13 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/a-callable.js +22 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/an-object.js +21 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/array-includes.js +45 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/classof-raw.js +19 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/classof.js +43 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/copy-constructor-properties.js +32 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/create-non-enumerable-property.js +24 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/create-property-descriptor.js +17 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/define-built-in.js +43 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/define-global-property.js +23 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/descriptors.js +18 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/document-all.js +18 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/document-create-element.js +22 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/engine-user-agent.js +14 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/engine-v8-version.js +39 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/entry-unbind.js +18 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/enum-bug-keys.js +19 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/export.js +72 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/fails.js +16 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/function-bind-native.js +19 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/function-call.js +18 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/function-name.js +29 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/function-uncurry-this.js +22 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/get-built-in.js +22 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/get-method.js +21 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/global.js +25 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/has-own-property.js +23 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/hidden-keys.js +10 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/ie8-dom-define.js +24 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/indexed-object.js +28 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/inspect-source.js +27 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/internal-state.js +88 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/is-callable.js +22 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/is-forced.js +34 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/is-null-or-undefined.js +14 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/is-object.js +22 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/is-symbol.js +27 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/length-of-array-like.js +18 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/make-built-in.js +68 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/math-trunc.js +19 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/object-define-property.js +58 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/object-get-own-property-descriptor.js +41 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/object-get-own-property-names.js +23 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/object-get-own-property-symbols.js +12 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/object-is-prototype-of.js +14 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/object-keys-internal.js +35 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/object-property-is-enumerable.js +23 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/ordinary-to-primitive.js +28 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/own-keys.js +31 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/require-object-coercible.js +21 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/shared-key.js +21 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/shared-store.js +19 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/shared.js +24 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/string-trim-end.js +22 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/string-trim-forced.js +28 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/string-trim-start.js +22 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/string-trim.js +45 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/symbol-constructor-detection.js +26 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/to-absolute-index.js +23 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/to-indexed-object.js +19 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/to-integer-or-infinity.js +20 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/to-length.js +20 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/to-object.js +20 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/to-primitive.js +41 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/to-property-key.js +21 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/to-string-tag-support.js +19 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/to-string.js +19 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/try-to-string.js +18 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/uid.js +20 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/use-symbol-as-uid.js +18 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/v8-prototype-define-bug.js +24 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/weak-map-basic-detection.js +18 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/well-known-symbol.js +41 -0
- package/dist/melonjs.mjs/node_modules/core-js/internals/whitespaces.js +12 -0
- package/dist/melonjs.mjs/node_modules/core-js/modules/es.global-this.js +18 -0
- package/dist/melonjs.mjs/node_modules/core-js/modules/es.string.trim-end.js +22 -0
- package/dist/melonjs.mjs/node_modules/core-js/modules/es.string.trim-left.js +19 -0
- package/dist/melonjs.mjs/node_modules/core-js/modules/es.string.trim-right.js +19 -0
- package/dist/melonjs.mjs/node_modules/core-js/modules/es.string.trim-start.js +22 -0
- package/dist/melonjs.mjs/node_modules/earcut/src/earcut.js +4 -5
- package/dist/melonjs.mjs/node_modules/eventemitter3/index.js +3 -3
- package/dist/melonjs.mjs/node_modules/eventemitter3/index.mjs.js +9 -0
- package/dist/melonjs.mjs/node_modules/eventemitter3/index2.js +5 -2
- package/dist/melonjs.mjs/node_modules/howler/dist/howler.js +3 -2
- 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 +1 -1
- package/dist/melonjs.mjs/physics/bounds.js +1 -1
- package/dist/melonjs.mjs/physics/collision.js +3 -3
- package/dist/melonjs.mjs/physics/detector.js +174 -146
- 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 +1 -1
- package/dist/melonjs.mjs/physics/world.js +10 -30
- package/dist/melonjs.mjs/plugin/plugin.js +4 -4
- package/dist/melonjs.mjs/polyfill/console.js +18 -0
- package/dist/melonjs.mjs/polyfill/performance.js +27 -0
- package/dist/melonjs.mjs/polyfill/requestAnimationFrame.js +46 -0
- package/dist/melonjs.mjs/polyfill/roundrect.js +242 -0
- 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 +3 -87
- package/dist/melonjs.mjs/renderable/dragndrop.js +1 -1
- package/dist/melonjs.mjs/renderable/imagelayer.js +2 -2
- package/dist/melonjs.mjs/renderable/light2d.js +1 -1
- package/dist/melonjs.mjs/renderable/nineslicesprite.js +1 -1
- package/dist/melonjs.mjs/renderable/re_container.js +1016 -0
- package/dist/melonjs.mjs/renderable/renderable.js +1 -1
- 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 +2 -2
- package/dist/melonjs.mjs/state/state.js +2 -2
- package/dist/melonjs.mjs/system/device.js +9 -29
- package/dist/melonjs.mjs/system/dom.js +3 -2
- 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 +2 -2
- 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 +4 -29
- package/dist/melonjs.mjs/video/canvas/canvas_renderer.js +4 -1
- package/dist/melonjs.mjs/video/renderer.js +26 -6
- 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 +21 -1
- package/dist/melonjs.mjs/video/utils/autodetect.js +27 -0
- package/dist/melonjs.mjs/video/utils/resize.js +116 -0
- package/dist/melonjs.mjs/video/video.js +20 -294
- package/dist/melonjs.mjs/video/webgl/buffer/vertex.js +1 -1
- package/dist/melonjs.mjs/video/webgl/glshader.js +2 -3
- 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 +20 -2
- 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_compositor.js +1 -1
- package/dist/melonjs.mjs/video/webgl/webgl_renderer.js +4 -1
- package/dist/melonjs.module.js +28551 -26959
- package/dist/types/application/application.d.ts +144 -0
- package/dist/types/application/header.d.ts +5 -0
- package/dist/types/application/resize.d.ts +5 -0
- package/dist/types/application/settings.d.ts +18 -0
- package/dist/types/audio/audio.d.ts +267 -0
- package/dist/types/camera/camera2d.d.ts +289 -0
- package/dist/types/entity/entity.d.ts +98 -0
- package/{src/game.js → dist/types/game.d.ts} +3 -14
- package/dist/types/geometries/ellipse.d.ts +154 -0
- package/dist/types/geometries/line.d.ts +11 -0
- package/dist/types/geometries/path2d.d.ts +121 -0
- package/dist/types/geometries/point.d.ts +53 -0
- package/dist/types/geometries/poly.d.ts +222 -0
- package/dist/types/geometries/rectangle.d.ts +176 -0
- package/dist/types/geometries/roundrect.d.ts +52 -0
- package/dist/types/index.d.ts +3 -2
- package/dist/types/input/gamepad.d.ts +95 -0
- package/dist/types/input/input.d.ts +15 -0
- package/dist/types/input/keyboard.d.ts +205 -0
- package/dist/types/input/pointer.d.ts +270 -0
- package/dist/types/input/pointerevent.d.ts +181 -0
- package/dist/types/lang/deprecated.d.ts +53 -0
- package/dist/types/level/level.d.ts +134 -0
- package/dist/types/level/tiled/TMXGroup.d.ts +82 -0
- package/dist/types/level/tiled/TMXLayer.d.ts +180 -0
- package/dist/types/level/tiled/TMXObject.d.ts +195 -0
- package/dist/types/level/tiled/TMXTile.d.ts +78 -0
- package/dist/types/level/tiled/TMXTileMap.d.ts +180 -0
- package/dist/types/level/tiled/TMXTileset.d.ts +94 -0
- package/dist/types/level/tiled/TMXTilesetGroup.d.ts +32 -0
- package/dist/types/level/tiled/TMXUtils.d.ts +47 -0
- package/dist/types/level/tiled/renderer/TMXHexagonalRenderer.d.ts +87 -0
- package/dist/types/level/tiled/renderer/TMXIsometricRenderer.d.ts +55 -0
- package/dist/types/level/tiled/renderer/TMXOrthogonalRenderer.d.ts +43 -0
- package/dist/types/level/tiled/renderer/TMXRenderer.d.ts +75 -0
- package/dist/types/level/tiled/renderer/TMXStaggeredRenderer.d.ts +8 -0
- package/dist/types/loader/loader.d.ts +181 -0
- package/dist/types/loader/loadingscreen.d.ts +18 -0
- package/dist/types/math/color.d.ts +170 -0
- package/dist/types/math/math.d.ts +165 -0
- package/dist/types/math/matrix2.d.ts +209 -0
- package/dist/types/math/matrix3.d.ts +236 -0
- package/dist/types/math/observable_vector2.d.ts +278 -0
- package/dist/types/math/observable_vector3.d.ts +277 -0
- package/dist/types/math/vector2.d.ts +327 -0
- package/dist/types/math/vector3.d.ts +332 -0
- package/dist/types/particles/emitter.d.ts +188 -0
- package/dist/types/particles/particle.d.ts +32 -0
- package/dist/types/particles/settings.d.ts +32 -0
- package/dist/types/physics/body.d.ts +330 -0
- package/dist/types/physics/bounds.d.ts +250 -0
- package/dist/types/physics/collision.d.ts +44 -0
- package/dist/types/physics/detector.d.ts +64 -0
- package/dist/types/physics/quadtree.d.ts +79 -0
- package/dist/types/physics/response.d.ts +37 -0
- package/dist/types/physics/sat.d.ts +48 -0
- package/dist/types/physics/world.d.ts +83 -0
- package/dist/types/plugin/plugin.d.ts +10 -0
- package/dist/types/polyfill/console.d.ts +0 -0
- package/dist/types/polyfill/index.d.ts +1 -0
- package/dist/types/polyfill/performance.d.ts +0 -0
- package/dist/types/polyfill/requestAnimationFrame.d.ts +1 -0
- package/dist/types/polyfill/roundrect.d.ts +0 -0
- package/dist/types/renderable/collectable.d.ts +19 -0
- package/dist/types/renderable/colorlayer.d.ts +28 -0
- package/dist/types/renderable/container.d.ts +302 -0
- package/dist/types/renderable/dragndrop.d.ts +118 -0
- package/dist/types/renderable/imagelayer.d.ts +106 -0
- package/dist/types/renderable/light2d.d.ts +58 -0
- package/dist/types/renderable/nineslicesprite.d.ts +59 -0
- package/dist/types/renderable/renderable.d.ts +402 -0
- package/dist/types/renderable/sprite.d.ts +268 -0
- package/dist/types/renderable/trigger.d.ts +61 -0
- package/dist/types/renderable/ui/uibaseelement.d.ts +95 -0
- package/dist/types/renderable/ui/uispriteelement.d.ts +127 -0
- package/dist/types/renderable/ui/uitextbutton.d.ts +54 -0
- package/dist/types/state/stage.d.ts +116 -0
- package/dist/types/state/state.d.ts +170 -0
- package/dist/types/system/device.d.ts +579 -0
- package/dist/types/system/dom.d.ts +1 -0
- package/dist/types/system/event.d.ts +473 -0
- package/dist/types/system/platform.d.ts +31 -0
- package/dist/types/system/pooling.d.ts +101 -0
- package/dist/types/system/save.d.ts +25 -0
- package/dist/types/system/timer.d.ts +126 -0
- package/dist/types/text/bitmaptext.d.ts +151 -0
- package/dist/types/text/bitmaptextdata.d.ts +35 -0
- package/dist/types/text/glyph.d.ts +28 -0
- package/dist/types/text/text.d.ts +173 -0
- package/dist/types/text/textmetrics.d.ts +47 -0
- package/dist/types/text/textstyle.d.ts +5 -0
- package/dist/types/tweens/easing.d.ts +46 -0
- package/dist/types/tweens/interpolation.d.ts +18 -0
- package/dist/types/tweens/tween.d.ts +195 -0
- package/dist/types/utils/agent.d.ts +21 -0
- package/dist/types/utils/array.d.ts +39 -0
- package/dist/types/utils/file.d.ts +18 -0
- package/dist/types/utils/function.d.ts +32 -0
- package/dist/types/utils/string.d.ts +50 -0
- package/dist/types/utils/utils.d.ts +17 -0
- package/dist/types/video/canvas/canvas_renderer.d.ts +380 -0
- package/dist/types/video/renderer.d.ts +222 -0
- package/dist/types/video/texture/atlas.d.ts +201 -0
- package/dist/types/video/texture/cache.d.ts +45 -0
- package/dist/types/video/texture/canvas_texture.d.ts +78 -0
- package/dist/types/video/utils/autodetect.d.ts +7 -0
- package/dist/types/video/utils/resize.d.ts +4 -0
- package/dist/types/video/video.d.ts +92 -0
- package/dist/types/video/webgl/buffer/vertex.d.ts +56 -0
- package/dist/types/video/webgl/glshader.d.ts +93 -0
- package/dist/types/video/webgl/utils/attributes.d.ts +4 -0
- package/dist/types/video/webgl/utils/precision.d.ts +13 -0
- package/dist/types/video/webgl/utils/program.d.ts +5 -0
- package/dist/types/video/webgl/utils/string.d.ts +5 -0
- package/dist/types/video/webgl/utils/uniforms.d.ts +4 -0
- package/dist/types/video/webgl/webgl_compositor.d.ts +174 -0
- package/dist/types/video/webgl/webgl_renderer.d.ts +429 -0
- package/package.json +14 -14
- package/src/application/application.js +171 -20
- package/src/application/header.js +25 -0
- package/src/application/resize.js +110 -0
- package/src/application/settings.js +19 -0
- package/src/camera/camera2d.js +1 -1
- package/src/index.js +34 -23
- package/src/input/pointer.js +1 -1
- package/src/input/pointerevent.js +6 -7
- package/src/level/level.js +1 -1
- package/src/level/tiled/TMXLayer.js +1 -1
- package/src/level/tiled/TMXTileMap.js +2 -2
- package/src/loader/loadingscreen.js +1 -1
- package/src/physics/collision.js +2 -2
- package/src/physics/detector.js +172 -145
- package/src/physics/world.js +10 -30
- package/src/plugin/plugin.js +1 -1
- package/src/renderable/container.js +7 -91
- package/src/renderable/imagelayer.js +1 -1
- package/src/renderable/trigger.js +1 -1
- package/src/renderable/ui/uibaseelement.js +1 -1
- package/src/state/stage.js +1 -1
- package/src/state/state.js +1 -1
- package/src/system/device.js +7 -27
- package/src/system/dom.js +2 -1
- package/src/tweens/tween.js +1 -1
- package/src/utils/utils.js +3 -28
- package/src/video/canvas/canvas_renderer.js +3 -0
- package/src/video/renderer.js +27 -7
- package/src/video/texture/canvas_texture.js +20 -0
- package/src/video/utils/autodetect.js +18 -0
- package/src/video/video.js +17 -291
- package/src/video/webgl/glshader.js +3 -4
- package/src/video/webgl/utils/precision.js +18 -0
- package/src/video/webgl/webgl_renderer.js +3 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @classdesc
|
|
3
|
+
* An Application represents a single melonJS game.
|
|
4
|
+
* An Application is responsible for updating (each frame) all the related object status and draw them.
|
|
5
|
+
* @see game
|
|
6
|
+
*/
|
|
7
|
+
export default class Application {
|
|
8
|
+
/**
|
|
9
|
+
* @param {number} width - The width of the canvas viewport
|
|
10
|
+
* @param {number} height - The height of the canvas viewport
|
|
11
|
+
* @param {object} [options] - The optional video/renderer parameters.<br> (see Renderer(s) documentation for further specific options)
|
|
12
|
+
* @param {string|HTMLElement} [options.parent=document.body] - the DOM parent element to hold the canvas in the HTML file
|
|
13
|
+
* @param {number|Renderer} [options.renderer=video.AUTO] - renderer to use (me.video.CANVAS, me.video.WEBGL, me.video.AUTO), or a custom renderer class
|
|
14
|
+
* @param {number|string} [options.scale=1.0] - enable scaling of the canvas ('auto' for automatic scaling)
|
|
15
|
+
* @param {string} [options.scaleMethod="fit"] - screen scaling modes ('fit','fill-min','fill-max','flex','flex-width','flex-height','stretch')
|
|
16
|
+
* @param {boolean} [options.preferWebGL1=false] - if true the renderer will only use WebGL 1
|
|
17
|
+
* @param {string} [options.powerPreference="default"] - a hint to the user agent indicating what configuration of GPU is suitable for the WebGL context ("default", "high-performance", "low-power"). To be noted that Safari and Chrome (since version 80) both default to "low-power" to save battery life and improve the user experience on these dual-GPU machines.
|
|
18
|
+
* @param {boolean} [options.transparent=false] - whether to allow transparent pixels in the front buffer (screen).
|
|
19
|
+
* @param {boolean} [options.antiAlias=false] - whether to enable or not video scaling interpolation
|
|
20
|
+
* @param {boolean} [options.consoleHeader=true] - whether to display melonJS version and basic device information in the console
|
|
21
|
+
* @throws Will throw an exception if it fails to instantiate a renderer
|
|
22
|
+
*/
|
|
23
|
+
constructor(width: number, height: number, options?: {
|
|
24
|
+
parent?: string | HTMLElement | undefined;
|
|
25
|
+
renderer?: number | Renderer;
|
|
26
|
+
scale?: string | number | undefined;
|
|
27
|
+
scaleMethod?: string | undefined;
|
|
28
|
+
preferWebGL1?: boolean | undefined;
|
|
29
|
+
powerPreference?: string | undefined;
|
|
30
|
+
transparent?: boolean | undefined;
|
|
31
|
+
antiAlias?: boolean | undefined;
|
|
32
|
+
consoleHeader?: boolean | undefined;
|
|
33
|
+
} | undefined);
|
|
34
|
+
/**
|
|
35
|
+
* the parent HTML element holding the main canvas of this application
|
|
36
|
+
* @type {HTMLElement}
|
|
37
|
+
*/
|
|
38
|
+
parentElement: HTMLElement;
|
|
39
|
+
/**
|
|
40
|
+
* a reference to the active Canvas or WebGL active renderer renderer
|
|
41
|
+
* @type {CanvasRenderer|WebGLRenderer}
|
|
42
|
+
*/
|
|
43
|
+
renderer: CanvasRenderer | WebGLRenderer;
|
|
44
|
+
/**
|
|
45
|
+
* the active stage "default" camera
|
|
46
|
+
* @type {Camera2d}
|
|
47
|
+
*/
|
|
48
|
+
viewport: Camera2d;
|
|
49
|
+
/**
|
|
50
|
+
* a reference to the game world, <br>
|
|
51
|
+
* a world is a virtual environment containing all the game objects
|
|
52
|
+
* @type {World}
|
|
53
|
+
*/
|
|
54
|
+
world: World;
|
|
55
|
+
/**
|
|
56
|
+
* when true, all objects will be added under the root world container.<br>
|
|
57
|
+
* When false, a `me.Container` object will be created for each corresponding groups
|
|
58
|
+
* @type {boolean}
|
|
59
|
+
* @default true
|
|
60
|
+
*/
|
|
61
|
+
mergeGroup: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Specify the property to be used when sorting renderables.
|
|
64
|
+
* Accepted values : "x", "y", "z"
|
|
65
|
+
* @type {string}
|
|
66
|
+
* @default "z"
|
|
67
|
+
*/
|
|
68
|
+
sortOn: string;
|
|
69
|
+
/**
|
|
70
|
+
* Last time the game update loop was executed. <br>
|
|
71
|
+
* Use this value to implement frame prediction in drawing events,
|
|
72
|
+
* for creating smooth motion while running game update logic at
|
|
73
|
+
* a lower fps.
|
|
74
|
+
* @type {DOMHighResTimeStamp}
|
|
75
|
+
*/
|
|
76
|
+
lastUpdate: DOMHighResTimeStamp;
|
|
77
|
+
/**
|
|
78
|
+
* true when this app instance has been initialized
|
|
79
|
+
* @type {boolean}
|
|
80
|
+
* @default false
|
|
81
|
+
*/
|
|
82
|
+
isInitialized: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* the given settings used when creating this application
|
|
85
|
+
* @type {Object}
|
|
86
|
+
*/
|
|
87
|
+
settings: Object;
|
|
88
|
+
isDirty: boolean;
|
|
89
|
+
isAlwaysDirty: boolean;
|
|
90
|
+
frameCounter: number;
|
|
91
|
+
frameRate: number;
|
|
92
|
+
accumulator: number;
|
|
93
|
+
accumulatorMax: number;
|
|
94
|
+
accumulatorUpdateDelta: number;
|
|
95
|
+
stepSize: number;
|
|
96
|
+
updateDelta: number;
|
|
97
|
+
lastUpdateStart: number | null;
|
|
98
|
+
updateAverageDelta: number;
|
|
99
|
+
/**
|
|
100
|
+
* init the game instance (create a physic world, update starting time, etc..)
|
|
101
|
+
*/
|
|
102
|
+
init(width: any, height: any, options: any): void;
|
|
103
|
+
/**
|
|
104
|
+
* reset the game Object manager
|
|
105
|
+
* destroy all current objects
|
|
106
|
+
*/
|
|
107
|
+
reset(): void;
|
|
108
|
+
/**
|
|
109
|
+
* Fired when a level is fully loaded and all renderable instantiated. <br>
|
|
110
|
+
* Additionnaly the level id will also be passed to the called function.
|
|
111
|
+
* @example
|
|
112
|
+
* // call myFunction () everytime a level is loaded
|
|
113
|
+
* me.game.onLevelLoaded = this.myFunction.bind(this);
|
|
114
|
+
*/
|
|
115
|
+
onLevelLoaded(): void;
|
|
116
|
+
/**
|
|
117
|
+
* Update the renderer framerate using the system config variables.
|
|
118
|
+
* @see timer.maxfps
|
|
119
|
+
* @see World.fps
|
|
120
|
+
*/
|
|
121
|
+
updateFrameRate(): void;
|
|
122
|
+
/**
|
|
123
|
+
* Returns the parent HTML Element holding the main canvas of this application
|
|
124
|
+
* @returns {HTMLElement}
|
|
125
|
+
*/
|
|
126
|
+
getParentElement(): HTMLElement;
|
|
127
|
+
/**
|
|
128
|
+
* force the redraw (not update) of all objects
|
|
129
|
+
*/
|
|
130
|
+
repaint(): void;
|
|
131
|
+
/**
|
|
132
|
+
* update all objects related to this game active scene/stage
|
|
133
|
+
* @param {number} time - current timestamp as provided by the RAF callback
|
|
134
|
+
* @param {Stage} stage - the current stage
|
|
135
|
+
*/
|
|
136
|
+
update(time: number, stage: Stage): void;
|
|
137
|
+
/**
|
|
138
|
+
* draw the active scene/stage associated to this game
|
|
139
|
+
* @param {Stage} stage - the current stage
|
|
140
|
+
*/
|
|
141
|
+
draw(stage: Stage): void;
|
|
142
|
+
}
|
|
143
|
+
import CanvasRenderer from "./../video/canvas/canvas_renderer.js";
|
|
144
|
+
import World from "./../physics/world.js";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export namespace defaultSettings {
|
|
2
|
+
const parent: undefined;
|
|
3
|
+
const renderer: number;
|
|
4
|
+
const autoScale: boolean;
|
|
5
|
+
const scale: number;
|
|
6
|
+
const scaleMethod: string;
|
|
7
|
+
const transparent: boolean;
|
|
8
|
+
const premultipliedAlpha: boolean;
|
|
9
|
+
const blendMode: string;
|
|
10
|
+
const antiAlias: boolean;
|
|
11
|
+
const failIfMajorPerformanceCaveat: boolean;
|
|
12
|
+
const subPixel: boolean;
|
|
13
|
+
const preferWebGL1: boolean;
|
|
14
|
+
const powerPreference: string;
|
|
15
|
+
const verbose: boolean;
|
|
16
|
+
const consoleHeader: boolean;
|
|
17
|
+
const legacy: boolean;
|
|
18
|
+
}
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Initialize and configure the audio support.<br>
|
|
3
|
+
* melonJS supports a wide array of audio codecs that have varying browser support :
|
|
4
|
+
* <i> ("mp3", "mpeg", opus", "ogg", "oga", "wav", "aac", "caf", "m4a", "m4b", "mp4", "weba", "webm", "dolby", "flac")</i>.<br>
|
|
5
|
+
* For a maximum browser coverage the recommendation is to use at least two of them,
|
|
6
|
+
* typically default to webm and then fallback to mp3 for the best balance of small filesize and high quality,
|
|
7
|
+
* webm has nearly full browser coverage with a great combination of compression and quality, and mp3 will fallback gracefully for other browsers.
|
|
8
|
+
* It is important to remember that melonJS selects the first compatible sound based on the list of extensions and given order passed here.
|
|
9
|
+
* So if you want webm to be used before mp3, you need to put the audio format in that order.
|
|
10
|
+
* @function audio.init
|
|
11
|
+
* @param {string} [format="mp3"] - audio format to prioritize
|
|
12
|
+
* @returns {boolean} Indicates whether audio initialization was successful
|
|
13
|
+
* @example
|
|
14
|
+
* // initialize the "sound engine", giving "webm" as default desired audio format, and "mp3" as a fallback
|
|
15
|
+
* if (!me.audio.init("webm,mp3")) {
|
|
16
|
+
* alert("Sorry but your browser does not support html 5 audio !");
|
|
17
|
+
* return;
|
|
18
|
+
* }
|
|
19
|
+
*/
|
|
20
|
+
export function init(format?: string | undefined): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* check if the given audio format is supported
|
|
23
|
+
* @function audio.hasFormat
|
|
24
|
+
* @param {string} codec - audio format : "mp3", "mpeg", opus", "ogg", "oga", "wav", "aac", "caf", "m4a", "m4b", "mp4", "weba", "webm", "dolby", "flac"
|
|
25
|
+
* @returns {boolean} return true if the given audio format is supported
|
|
26
|
+
*/
|
|
27
|
+
export function hasFormat(codec: string): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* check if audio (HTML5 or WebAudio) is supported
|
|
30
|
+
* @function audio.hasAudio
|
|
31
|
+
* @returns {boolean} return true if audio (HTML5 or WebAudio) is supported
|
|
32
|
+
*/
|
|
33
|
+
export function hasAudio(): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* enable audio output <br>
|
|
36
|
+
* only useful if audio supported and previously disabled through
|
|
37
|
+
* @function audio.enable
|
|
38
|
+
* @see audio#disable
|
|
39
|
+
*/
|
|
40
|
+
export function enable(): void;
|
|
41
|
+
/**
|
|
42
|
+
* disable audio output
|
|
43
|
+
* @function audio.disable
|
|
44
|
+
*/
|
|
45
|
+
export function disable(): void;
|
|
46
|
+
/**
|
|
47
|
+
* Load an audio file.<br>
|
|
48
|
+
* <br>
|
|
49
|
+
* sound item must contain the following fields :<br>
|
|
50
|
+
* - name : name of the sound<br>
|
|
51
|
+
* - src : source path<br>
|
|
52
|
+
* @ignore
|
|
53
|
+
*/
|
|
54
|
+
export function load(sound: any, html5: any, onload_cb: any, onerror_cb: any): number;
|
|
55
|
+
/**
|
|
56
|
+
* play the specified sound
|
|
57
|
+
* @function audio.play
|
|
58
|
+
* @param {string} sound_name - audio clip name - case sensitive
|
|
59
|
+
* @param {boolean} [loop=false] - loop audio
|
|
60
|
+
* @param {Function} [onend] - Function to call when sound instance ends playing.
|
|
61
|
+
* @param {number} [volume=default] - Float specifying volume (0.0 - 1.0 values accepted).
|
|
62
|
+
* @returns {number} the sound instance ID.
|
|
63
|
+
* @example
|
|
64
|
+
* // play the "cling" audio clip
|
|
65
|
+
* me.audio.play("cling");
|
|
66
|
+
* // play & repeat the "engine" audio clip
|
|
67
|
+
* me.audio.play("engine", true);
|
|
68
|
+
* // play the "gameover_sfx" audio clip and call myFunc when finished
|
|
69
|
+
* me.audio.play("gameover_sfx", false, myFunc);
|
|
70
|
+
* // play the "gameover_sfx" audio clip with a lower volume level
|
|
71
|
+
* me.audio.play("gameover_sfx", false, null, 0.5);
|
|
72
|
+
*/
|
|
73
|
+
export function play(sound_name: string, loop?: boolean | undefined, onend?: Function | undefined, volume?: number | undefined): number;
|
|
74
|
+
/**
|
|
75
|
+
* Fade a currently playing sound between two volumee.
|
|
76
|
+
* @function audio.fade
|
|
77
|
+
* @param {string} sound_name - audio clip name - case sensitive
|
|
78
|
+
* @param {number} from - Volume to fade from (0.0 to 1.0).
|
|
79
|
+
* @param {number} to - Volume to fade to (0.0 to 1.0).
|
|
80
|
+
* @param {number} duration - Time in milliseconds to fade.
|
|
81
|
+
* @param {number} [id] - the sound instance ID. If none is passed, all sounds in group will fade.
|
|
82
|
+
*/
|
|
83
|
+
export function fade(sound_name: string, from: number, to: number, duration: number, id?: number | undefined): void;
|
|
84
|
+
/**
|
|
85
|
+
* get/set the position of playback for a sound.
|
|
86
|
+
* @function audio.seek
|
|
87
|
+
* @param {string} sound_name - audio clip name - case sensitive
|
|
88
|
+
* @param {number} [seek] - the position to move current playback to (in seconds).
|
|
89
|
+
* @param {number} [id] - the sound instance ID. If none is passed, all sounds in group will changed.
|
|
90
|
+
* @returns {number} return the current seek position (if no extra parameters were given)
|
|
91
|
+
* @example
|
|
92
|
+
* // return the current position of the background music
|
|
93
|
+
* var current_pos = me.audio.seek("dst-gameforest");
|
|
94
|
+
* // set back the position of the background music to the beginning
|
|
95
|
+
* me.audio.seek("dst-gameforest", 0);
|
|
96
|
+
*/
|
|
97
|
+
export function seek(sound_name: string, ...args: any[]): number;
|
|
98
|
+
/**
|
|
99
|
+
* get or set the rate of playback for a sound.
|
|
100
|
+
* @function audio.rate
|
|
101
|
+
* @param {string} sound_name - audio clip name - case sensitive
|
|
102
|
+
* @param {number} [rate] - playback rate : 0.5 to 4.0, with 1.0 being normal speed.
|
|
103
|
+
* @param {number} [id] - the sound instance ID. If none is passed, all sounds in group will be changed.
|
|
104
|
+
* @returns {number} return the current playback rate (if no extra parameters were given)
|
|
105
|
+
* @example
|
|
106
|
+
* // get the playback rate of the background music
|
|
107
|
+
* var rate = me.audio.rate("dst-gameforest");
|
|
108
|
+
* // speed up the playback of the background music
|
|
109
|
+
* me.audio.rate("dst-gameforest", 2.0);
|
|
110
|
+
*/
|
|
111
|
+
export function rate(sound_name: string, ...args: any[]): number;
|
|
112
|
+
/**
|
|
113
|
+
* stop the specified sound on all channels
|
|
114
|
+
* @function audio.stop
|
|
115
|
+
* @param {string} [sound_name] - audio clip name (case sensitive). If none is passed, all sounds are stopped.
|
|
116
|
+
* @param {number} [id] - the sound instance ID. If none is passed, all sounds in group will stop.
|
|
117
|
+
* @example
|
|
118
|
+
* me.audio.stop("cling");
|
|
119
|
+
*/
|
|
120
|
+
export function stop(sound_name?: string | undefined, id?: number | undefined): void;
|
|
121
|
+
/**
|
|
122
|
+
* pause the specified sound on all channels<br>
|
|
123
|
+
* this function does not reset the currentTime property
|
|
124
|
+
* @function audio.pause
|
|
125
|
+
* @param {string} sound_name - audio clip name - case sensitive
|
|
126
|
+
* @param {number} [id] - the sound instance ID. If none is passed, all sounds in group will pause.
|
|
127
|
+
* @example
|
|
128
|
+
* me.audio.pause("cling");
|
|
129
|
+
*/
|
|
130
|
+
export function pause(sound_name: string, id?: number | undefined): void;
|
|
131
|
+
/**
|
|
132
|
+
* resume the specified sound on all channels<br>
|
|
133
|
+
* @function audio.resume
|
|
134
|
+
* @param {string} sound_name - audio clip name - case sensitive
|
|
135
|
+
* @param {number} [id] - the sound instance ID. If none is passed, all sounds in group will resume.
|
|
136
|
+
* @example
|
|
137
|
+
* // play a audio clip
|
|
138
|
+
* var id = me.audio.play("myClip");
|
|
139
|
+
* ...
|
|
140
|
+
* // pause it
|
|
141
|
+
* me.audio.pause("myClip", id);
|
|
142
|
+
* ...
|
|
143
|
+
* // resume
|
|
144
|
+
* me.audio.resume("myClip", id);
|
|
145
|
+
*/
|
|
146
|
+
export function resume(sound_name: string, id?: number | undefined): void;
|
|
147
|
+
/**
|
|
148
|
+
* play the specified audio track<br>
|
|
149
|
+
* this function automatically set the loop property to true<br>
|
|
150
|
+
* and keep track of the current sound being played.
|
|
151
|
+
* @function audio.playTrack
|
|
152
|
+
* @param {string} sound_name - audio track name - case sensitive
|
|
153
|
+
* @param {number} [volume=default] - Float specifying volume (0.0 - 1.0 values accepted).
|
|
154
|
+
* @returns {number} the sound instance ID.
|
|
155
|
+
* @example
|
|
156
|
+
* me.audio.playTrack("awesome_music");
|
|
157
|
+
*/
|
|
158
|
+
export function playTrack(sound_name: string, volume?: number | undefined): number;
|
|
159
|
+
/**
|
|
160
|
+
* stop the current audio track
|
|
161
|
+
* @function audio.stopTrack
|
|
162
|
+
* @see audio#playTrack
|
|
163
|
+
* @example
|
|
164
|
+
* // play a awesome music
|
|
165
|
+
* me.audio.playTrack("awesome_music");
|
|
166
|
+
* // stop the current music
|
|
167
|
+
* me.audio.stopTrack();
|
|
168
|
+
*/
|
|
169
|
+
export function stopTrack(): void;
|
|
170
|
+
/**
|
|
171
|
+
* pause the current audio track
|
|
172
|
+
* @function audio.pauseTrack
|
|
173
|
+
* @example
|
|
174
|
+
* me.audio.pauseTrack();
|
|
175
|
+
*/
|
|
176
|
+
export function pauseTrack(): void;
|
|
177
|
+
/**
|
|
178
|
+
* resume the previously paused audio track
|
|
179
|
+
* @function audio.resumeTrack
|
|
180
|
+
* @example
|
|
181
|
+
* // play an awesome music
|
|
182
|
+
* me.audio.playTrack("awesome_music");
|
|
183
|
+
* // pause the audio track
|
|
184
|
+
* me.audio.pauseTrack();
|
|
185
|
+
* // resume the music
|
|
186
|
+
* me.audio.resumeTrack();
|
|
187
|
+
*/
|
|
188
|
+
export function resumeTrack(): void;
|
|
189
|
+
/**
|
|
190
|
+
* returns the current track Id
|
|
191
|
+
* @function audio.getCurrentTrack
|
|
192
|
+
* @returns {string} audio track name
|
|
193
|
+
*/
|
|
194
|
+
export function getCurrentTrack(): string;
|
|
195
|
+
/**
|
|
196
|
+
* set the default global volume
|
|
197
|
+
* @function audio.setVolume
|
|
198
|
+
* @param {number} volume - Float specifying volume (0.0 - 1.0 values accepted).
|
|
199
|
+
*/
|
|
200
|
+
export function setVolume(volume: number): void;
|
|
201
|
+
/**
|
|
202
|
+
* get the default global volume
|
|
203
|
+
* @function audio.getVolume
|
|
204
|
+
* @returns {number} current volume value in Float [0.0 - 1.0] .
|
|
205
|
+
*/
|
|
206
|
+
export function getVolume(): number;
|
|
207
|
+
/**
|
|
208
|
+
* mute or unmute the specified sound, but does not pause the playback.
|
|
209
|
+
* @function audio.mute
|
|
210
|
+
* @param {string} sound_name - audio clip name - case sensitive
|
|
211
|
+
* @param {number} [id] - the sound instance ID. If none is passed, all sounds in group will mute.
|
|
212
|
+
* @param {boolean} [mute=true] - True to mute and false to unmute
|
|
213
|
+
* @example
|
|
214
|
+
* // mute the background music
|
|
215
|
+
* me.audio.mute("awesome_music");
|
|
216
|
+
*/
|
|
217
|
+
export function mute(sound_name: string, id?: number | undefined, mute?: boolean | undefined): void;
|
|
218
|
+
/**
|
|
219
|
+
* unmute the specified sound
|
|
220
|
+
* @function audio.unmute
|
|
221
|
+
* @param {string} sound_name - audio clip name
|
|
222
|
+
* @param {number} [id] - the sound instance ID. If none is passed, all sounds in group will unmute.
|
|
223
|
+
*/
|
|
224
|
+
export function unmute(sound_name: string, id?: number | undefined): void;
|
|
225
|
+
/**
|
|
226
|
+
* mute all audio
|
|
227
|
+
* @function audio.muteAll
|
|
228
|
+
*/
|
|
229
|
+
export function muteAll(): void;
|
|
230
|
+
/**
|
|
231
|
+
* unmute all audio
|
|
232
|
+
* @function audio.unmuteAll
|
|
233
|
+
*/
|
|
234
|
+
export function unmuteAll(): void;
|
|
235
|
+
/**
|
|
236
|
+
* Returns true if audio is muted globally.
|
|
237
|
+
* @function audio.muted
|
|
238
|
+
* @returns {boolean} true if audio is muted globally
|
|
239
|
+
*/
|
|
240
|
+
export function muted(): boolean;
|
|
241
|
+
/**
|
|
242
|
+
* unload specified audio track to free memory
|
|
243
|
+
* @function audio.unload
|
|
244
|
+
* @param {string} sound_name - audio track name - case sensitive
|
|
245
|
+
* @returns {boolean} true if unloaded
|
|
246
|
+
* @example
|
|
247
|
+
* me.audio.unload("awesome_music");
|
|
248
|
+
*/
|
|
249
|
+
export function unload(sound_name: string): boolean;
|
|
250
|
+
/**
|
|
251
|
+
* unload all audio to free memory
|
|
252
|
+
* @function audio.unloadAll
|
|
253
|
+
* @example
|
|
254
|
+
* me.audio.unloadAll();
|
|
255
|
+
*/
|
|
256
|
+
export function unloadAll(): void;
|
|
257
|
+
/**
|
|
258
|
+
* Specify either to stop on audio loading error or not<br>
|
|
259
|
+
* if true, melonJS will throw an exception and stop loading<br>
|
|
260
|
+
* if false, melonJS will disable sounds and output a warning message
|
|
261
|
+
* in the console<br>
|
|
262
|
+
* @name stopOnAudioError
|
|
263
|
+
* @type {boolean}
|
|
264
|
+
* @default true
|
|
265
|
+
* @memberof audio
|
|
266
|
+
*/
|
|
267
|
+
export let stopOnAudioError: boolean;
|