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.
Files changed (381) hide show
  1. package/README.md +3 -4
  2. package/dist/melonjs.mjs/_virtual/_commonjsHelpers.js +1 -1
  3. package/dist/melonjs.mjs/_virtual/arraymultimap.js +1 -1
  4. package/dist/melonjs.mjs/_virtual/earcut.js +7 -3
  5. package/dist/melonjs.mjs/_virtual/howler.js +1 -1
  6. package/dist/melonjs.mjs/_virtual/index.js +1 -1
  7. package/dist/melonjs.mjs/_virtual/index2.js +7 -3
  8. package/dist/melonjs.mjs/_virtual/make-built-in.js +10 -0
  9. package/dist/melonjs.mjs/_virtual/multimap.js +1 -1
  10. package/dist/melonjs.mjs/_virtual/object-define-property.js +10 -0
  11. package/dist/melonjs.mjs/_virtual/object-get-own-property-descriptor.js +10 -0
  12. package/dist/melonjs.mjs/_virtual/object-get-own-property-names.js +10 -0
  13. package/dist/melonjs.mjs/_virtual/object-get-own-property-symbols.js +10 -0
  14. package/dist/melonjs.mjs/_virtual/object-property-is-enumerable.js +10 -0
  15. package/dist/melonjs.mjs/_virtual/setmultimap.js +1 -1
  16. package/dist/melonjs.mjs/_virtual/shared.js +10 -0
  17. package/dist/melonjs.mjs/application/application.js +173 -22
  18. package/dist/melonjs.mjs/application/header.js +34 -0
  19. package/dist/melonjs.mjs/application/resize.js +119 -0
  20. package/dist/melonjs.mjs/application/settings.js +28 -0
  21. package/dist/melonjs.mjs/audio/audio.js +1 -1
  22. package/dist/melonjs.mjs/camera/camera2d.js +2 -2
  23. package/dist/melonjs.mjs/entity/entity.js +1 -1
  24. package/dist/melonjs.mjs/game.js +1 -1
  25. package/dist/melonjs.mjs/geometries/ellipse.js +1 -1
  26. package/dist/melonjs.mjs/geometries/line.js +1 -1
  27. package/dist/melonjs.mjs/geometries/path2d.js +3 -3
  28. package/dist/melonjs.mjs/geometries/point.js +1 -1
  29. package/dist/melonjs.mjs/geometries/poly.js +3 -3
  30. package/dist/melonjs.mjs/geometries/rectangle.js +1 -1
  31. package/dist/melonjs.mjs/geometries/roundrect.js +1 -1
  32. package/dist/melonjs.mjs/index.js +41 -61
  33. package/dist/melonjs.mjs/input/gamepad.js +1 -1
  34. package/dist/melonjs.mjs/input/input.js +1 -1
  35. package/dist/melonjs.mjs/input/keyboard.js +1 -1
  36. package/dist/melonjs.mjs/input/pointer.js +2 -2
  37. package/dist/melonjs.mjs/input/pointerevent.js +7 -8
  38. package/dist/melonjs.mjs/lang/deprecated.js +1 -1
  39. package/dist/melonjs.mjs/level/level.js +2 -2
  40. package/dist/melonjs.mjs/level/tiled/TMXGroup.js +1 -1
  41. package/dist/melonjs.mjs/level/tiled/TMXLayer.js +2 -2
  42. package/dist/melonjs.mjs/level/tiled/TMXObject.js +1 -1
  43. package/dist/melonjs.mjs/level/tiled/TMXTile.js +1 -1
  44. package/dist/melonjs.mjs/level/tiled/TMXTileMap.js +2 -2
  45. package/dist/melonjs.mjs/level/tiled/TMXTileset.js +1 -1
  46. package/dist/melonjs.mjs/level/tiled/TMXTilesetGroup.js +1 -1
  47. package/dist/melonjs.mjs/level/tiled/TMXUtils.js +1 -1
  48. package/dist/melonjs.mjs/level/tiled/renderer/TMXHexagonalRenderer.js +1 -1
  49. package/dist/melonjs.mjs/level/tiled/renderer/TMXIsometricRenderer.js +1 -1
  50. package/dist/melonjs.mjs/level/tiled/renderer/TMXOrthogonalRenderer.js +1 -1
  51. package/dist/melonjs.mjs/level/tiled/renderer/TMXRenderer.js +1 -1
  52. package/dist/melonjs.mjs/level/tiled/renderer/TMXStaggeredRenderer.js +1 -1
  53. package/dist/melonjs.mjs/loader/loader.js +1 -1
  54. package/dist/melonjs.mjs/loader/loadingscreen.js +2 -2
  55. package/dist/melonjs.mjs/loader/melonjs_logo.png.js +1 -1
  56. package/dist/melonjs.mjs/math/color.js +1 -1
  57. package/dist/melonjs.mjs/math/math.js +1 -1
  58. package/dist/melonjs.mjs/math/matrix2.js +1 -1
  59. package/dist/melonjs.mjs/math/matrix3.js +1 -1
  60. package/dist/melonjs.mjs/math/observable_vector2.js +1 -1
  61. package/dist/melonjs.mjs/math/observable_vector3.js +1 -1
  62. package/dist/melonjs.mjs/math/vector2.js +1 -1
  63. package/dist/melonjs.mjs/math/vector3.js +1 -1
  64. package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/arraymultimap.js +3 -2
  65. package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/index.js +1 -1
  66. package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/multimap.js +3 -2
  67. package/dist/melonjs.mjs/node_modules/@teppeis/multimaps/dist/src/setmultimap.js +3 -2
  68. package/dist/melonjs.mjs/node_modules/core-js/es/string/trim-end.js +13 -0
  69. package/dist/melonjs.mjs/node_modules/core-js/es/string/trim-start.js +13 -0
  70. package/dist/melonjs.mjs/node_modules/core-js/internals/a-callable.js +22 -0
  71. package/dist/melonjs.mjs/node_modules/core-js/internals/an-object.js +21 -0
  72. package/dist/melonjs.mjs/node_modules/core-js/internals/array-includes.js +45 -0
  73. package/dist/melonjs.mjs/node_modules/core-js/internals/classof-raw.js +19 -0
  74. package/dist/melonjs.mjs/node_modules/core-js/internals/classof.js +43 -0
  75. package/dist/melonjs.mjs/node_modules/core-js/internals/copy-constructor-properties.js +32 -0
  76. package/dist/melonjs.mjs/node_modules/core-js/internals/create-non-enumerable-property.js +24 -0
  77. package/dist/melonjs.mjs/node_modules/core-js/internals/create-property-descriptor.js +17 -0
  78. package/dist/melonjs.mjs/node_modules/core-js/internals/define-built-in.js +43 -0
  79. package/dist/melonjs.mjs/node_modules/core-js/internals/define-global-property.js +23 -0
  80. package/dist/melonjs.mjs/node_modules/core-js/internals/descriptors.js +18 -0
  81. package/dist/melonjs.mjs/node_modules/core-js/internals/document-all.js +18 -0
  82. package/dist/melonjs.mjs/node_modules/core-js/internals/document-create-element.js +22 -0
  83. package/dist/melonjs.mjs/node_modules/core-js/internals/engine-user-agent.js +14 -0
  84. package/dist/melonjs.mjs/node_modules/core-js/internals/engine-v8-version.js +39 -0
  85. package/dist/melonjs.mjs/node_modules/core-js/internals/entry-unbind.js +18 -0
  86. package/dist/melonjs.mjs/node_modules/core-js/internals/enum-bug-keys.js +19 -0
  87. package/dist/melonjs.mjs/node_modules/core-js/internals/export.js +72 -0
  88. package/dist/melonjs.mjs/node_modules/core-js/internals/fails.js +16 -0
  89. package/dist/melonjs.mjs/node_modules/core-js/internals/function-bind-native.js +19 -0
  90. package/dist/melonjs.mjs/node_modules/core-js/internals/function-call.js +18 -0
  91. package/dist/melonjs.mjs/node_modules/core-js/internals/function-name.js +29 -0
  92. package/dist/melonjs.mjs/node_modules/core-js/internals/function-uncurry-this.js +22 -0
  93. package/dist/melonjs.mjs/node_modules/core-js/internals/get-built-in.js +22 -0
  94. package/dist/melonjs.mjs/node_modules/core-js/internals/get-method.js +21 -0
  95. package/dist/melonjs.mjs/node_modules/core-js/internals/global.js +25 -0
  96. package/dist/melonjs.mjs/node_modules/core-js/internals/has-own-property.js +23 -0
  97. package/dist/melonjs.mjs/node_modules/core-js/internals/hidden-keys.js +10 -0
  98. package/dist/melonjs.mjs/node_modules/core-js/internals/ie8-dom-define.js +24 -0
  99. package/dist/melonjs.mjs/node_modules/core-js/internals/indexed-object.js +28 -0
  100. package/dist/melonjs.mjs/node_modules/core-js/internals/inspect-source.js +27 -0
  101. package/dist/melonjs.mjs/node_modules/core-js/internals/internal-state.js +88 -0
  102. package/dist/melonjs.mjs/node_modules/core-js/internals/is-callable.js +22 -0
  103. package/dist/melonjs.mjs/node_modules/core-js/internals/is-forced.js +34 -0
  104. package/dist/melonjs.mjs/node_modules/core-js/internals/is-null-or-undefined.js +14 -0
  105. package/dist/melonjs.mjs/node_modules/core-js/internals/is-object.js +22 -0
  106. package/dist/melonjs.mjs/node_modules/core-js/internals/is-symbol.js +27 -0
  107. package/dist/melonjs.mjs/node_modules/core-js/internals/length-of-array-like.js +18 -0
  108. package/dist/melonjs.mjs/node_modules/core-js/internals/make-built-in.js +68 -0
  109. package/dist/melonjs.mjs/node_modules/core-js/internals/math-trunc.js +19 -0
  110. package/dist/melonjs.mjs/node_modules/core-js/internals/object-define-property.js +58 -0
  111. package/dist/melonjs.mjs/node_modules/core-js/internals/object-get-own-property-descriptor.js +41 -0
  112. package/dist/melonjs.mjs/node_modules/core-js/internals/object-get-own-property-names.js +23 -0
  113. package/dist/melonjs.mjs/node_modules/core-js/internals/object-get-own-property-symbols.js +12 -0
  114. package/dist/melonjs.mjs/node_modules/core-js/internals/object-is-prototype-of.js +14 -0
  115. package/dist/melonjs.mjs/node_modules/core-js/internals/object-keys-internal.js +35 -0
  116. package/dist/melonjs.mjs/node_modules/core-js/internals/object-property-is-enumerable.js +23 -0
  117. package/dist/melonjs.mjs/node_modules/core-js/internals/ordinary-to-primitive.js +28 -0
  118. package/dist/melonjs.mjs/node_modules/core-js/internals/own-keys.js +31 -0
  119. package/dist/melonjs.mjs/node_modules/core-js/internals/require-object-coercible.js +21 -0
  120. package/dist/melonjs.mjs/node_modules/core-js/internals/shared-key.js +21 -0
  121. package/dist/melonjs.mjs/node_modules/core-js/internals/shared-store.js +19 -0
  122. package/dist/melonjs.mjs/node_modules/core-js/internals/shared.js +24 -0
  123. package/dist/melonjs.mjs/node_modules/core-js/internals/string-trim-end.js +22 -0
  124. package/dist/melonjs.mjs/node_modules/core-js/internals/string-trim-forced.js +28 -0
  125. package/dist/melonjs.mjs/node_modules/core-js/internals/string-trim-start.js +22 -0
  126. package/dist/melonjs.mjs/node_modules/core-js/internals/string-trim.js +45 -0
  127. package/dist/melonjs.mjs/node_modules/core-js/internals/symbol-constructor-detection.js +26 -0
  128. package/dist/melonjs.mjs/node_modules/core-js/internals/to-absolute-index.js +23 -0
  129. package/dist/melonjs.mjs/node_modules/core-js/internals/to-indexed-object.js +19 -0
  130. package/dist/melonjs.mjs/node_modules/core-js/internals/to-integer-or-infinity.js +20 -0
  131. package/dist/melonjs.mjs/node_modules/core-js/internals/to-length.js +20 -0
  132. package/dist/melonjs.mjs/node_modules/core-js/internals/to-object.js +20 -0
  133. package/dist/melonjs.mjs/node_modules/core-js/internals/to-primitive.js +41 -0
  134. package/dist/melonjs.mjs/node_modules/core-js/internals/to-property-key.js +21 -0
  135. package/dist/melonjs.mjs/node_modules/core-js/internals/to-string-tag-support.js +19 -0
  136. package/dist/melonjs.mjs/node_modules/core-js/internals/to-string.js +19 -0
  137. package/dist/melonjs.mjs/node_modules/core-js/internals/try-to-string.js +18 -0
  138. package/dist/melonjs.mjs/node_modules/core-js/internals/uid.js +20 -0
  139. package/dist/melonjs.mjs/node_modules/core-js/internals/use-symbol-as-uid.js +18 -0
  140. package/dist/melonjs.mjs/node_modules/core-js/internals/v8-prototype-define-bug.js +24 -0
  141. package/dist/melonjs.mjs/node_modules/core-js/internals/weak-map-basic-detection.js +18 -0
  142. package/dist/melonjs.mjs/node_modules/core-js/internals/well-known-symbol.js +41 -0
  143. package/dist/melonjs.mjs/node_modules/core-js/internals/whitespaces.js +12 -0
  144. package/dist/melonjs.mjs/node_modules/core-js/modules/es.global-this.js +18 -0
  145. package/dist/melonjs.mjs/node_modules/core-js/modules/es.string.trim-end.js +22 -0
  146. package/dist/melonjs.mjs/node_modules/core-js/modules/es.string.trim-left.js +19 -0
  147. package/dist/melonjs.mjs/node_modules/core-js/modules/es.string.trim-right.js +19 -0
  148. package/dist/melonjs.mjs/node_modules/core-js/modules/es.string.trim-start.js +22 -0
  149. package/dist/melonjs.mjs/node_modules/earcut/src/earcut.js +4 -5
  150. package/dist/melonjs.mjs/node_modules/eventemitter3/index.js +3 -3
  151. package/dist/melonjs.mjs/node_modules/eventemitter3/index.mjs.js +9 -0
  152. package/dist/melonjs.mjs/node_modules/eventemitter3/index2.js +5 -2
  153. package/dist/melonjs.mjs/node_modules/howler/dist/howler.js +3 -2
  154. package/dist/melonjs.mjs/particles/emitter.js +1 -1
  155. package/dist/melonjs.mjs/particles/particle.js +1 -1
  156. package/dist/melonjs.mjs/particles/settings.js +1 -1
  157. package/dist/melonjs.mjs/physics/body.js +1 -1
  158. package/dist/melonjs.mjs/physics/bounds.js +1 -1
  159. package/dist/melonjs.mjs/physics/collision.js +3 -3
  160. package/dist/melonjs.mjs/physics/detector.js +174 -146
  161. package/dist/melonjs.mjs/physics/quadtree.js +1 -1
  162. package/dist/melonjs.mjs/physics/response.js +1 -1
  163. package/dist/melonjs.mjs/physics/sat.js +1 -1
  164. package/dist/melonjs.mjs/physics/world.js +10 -30
  165. package/dist/melonjs.mjs/plugin/plugin.js +4 -4
  166. package/dist/melonjs.mjs/polyfill/console.js +18 -0
  167. package/dist/melonjs.mjs/polyfill/performance.js +27 -0
  168. package/dist/melonjs.mjs/polyfill/requestAnimationFrame.js +46 -0
  169. package/dist/melonjs.mjs/polyfill/roundrect.js +242 -0
  170. package/dist/melonjs.mjs/renderable/collectable.js +1 -1
  171. package/dist/melonjs.mjs/renderable/colorlayer.js +1 -1
  172. package/dist/melonjs.mjs/renderable/container.js +3 -87
  173. package/dist/melonjs.mjs/renderable/dragndrop.js +1 -1
  174. package/dist/melonjs.mjs/renderable/imagelayer.js +2 -2
  175. package/dist/melonjs.mjs/renderable/light2d.js +1 -1
  176. package/dist/melonjs.mjs/renderable/nineslicesprite.js +1 -1
  177. package/dist/melonjs.mjs/renderable/re_container.js +1016 -0
  178. package/dist/melonjs.mjs/renderable/renderable.js +1 -1
  179. package/dist/melonjs.mjs/renderable/sprite.js +1 -1
  180. package/dist/melonjs.mjs/renderable/trigger.js +2 -2
  181. package/dist/melonjs.mjs/renderable/ui/uibaseelement.js +1 -1
  182. package/dist/melonjs.mjs/renderable/ui/uispriteelement.js +1 -1
  183. package/dist/melonjs.mjs/renderable/ui/uitextbutton.js +1 -1
  184. package/dist/melonjs.mjs/state/stage.js +2 -2
  185. package/dist/melonjs.mjs/state/state.js +2 -2
  186. package/dist/melonjs.mjs/system/device.js +9 -29
  187. package/dist/melonjs.mjs/system/dom.js +3 -2
  188. package/dist/melonjs.mjs/system/event.js +1 -1
  189. package/dist/melonjs.mjs/system/platform.js +1 -1
  190. package/dist/melonjs.mjs/system/pooling.js +1 -1
  191. package/dist/melonjs.mjs/system/save.js +1 -1
  192. package/dist/melonjs.mjs/system/timer.js +1 -1
  193. package/dist/melonjs.mjs/text/bitmaptext.js +1 -1
  194. package/dist/melonjs.mjs/text/bitmaptextdata.js +1 -1
  195. package/dist/melonjs.mjs/text/glyph.js +1 -1
  196. package/dist/melonjs.mjs/text/text.js +1 -1
  197. package/dist/melonjs.mjs/text/textmetrics.js +1 -1
  198. package/dist/melonjs.mjs/text/textstyle.js +1 -1
  199. package/dist/melonjs.mjs/tweens/easing.js +1 -1
  200. package/dist/melonjs.mjs/tweens/interpolation.js +1 -1
  201. package/dist/melonjs.mjs/tweens/tween.js +2 -2
  202. package/dist/melonjs.mjs/utils/agent.js +1 -1
  203. package/dist/melonjs.mjs/utils/array.js +1 -1
  204. package/dist/melonjs.mjs/utils/file.js +1 -1
  205. package/dist/melonjs.mjs/utils/function.js +1 -1
  206. package/dist/melonjs.mjs/utils/string.js +1 -1
  207. package/dist/melonjs.mjs/utils/utils.js +4 -29
  208. package/dist/melonjs.mjs/video/canvas/canvas_renderer.js +4 -1
  209. package/dist/melonjs.mjs/video/renderer.js +26 -6
  210. package/dist/melonjs.mjs/video/texture/atlas.js +1 -1
  211. package/dist/melonjs.mjs/video/texture/cache.js +1 -1
  212. package/dist/melonjs.mjs/video/texture/canvas_texture.js +21 -1
  213. package/dist/melonjs.mjs/video/utils/autodetect.js +27 -0
  214. package/dist/melonjs.mjs/video/utils/resize.js +116 -0
  215. package/dist/melonjs.mjs/video/video.js +20 -294
  216. package/dist/melonjs.mjs/video/webgl/buffer/vertex.js +1 -1
  217. package/dist/melonjs.mjs/video/webgl/glshader.js +2 -3
  218. package/dist/melonjs.mjs/video/webgl/shaders/primitive.frag.js +1 -1
  219. package/dist/melonjs.mjs/video/webgl/shaders/primitive.vert.js +1 -1
  220. package/dist/melonjs.mjs/video/webgl/shaders/quad.frag.js +1 -1
  221. package/dist/melonjs.mjs/video/webgl/shaders/quad.vert.js +1 -1
  222. package/dist/melonjs.mjs/video/webgl/utils/attributes.js +1 -1
  223. package/dist/melonjs.mjs/video/webgl/utils/precision.js +20 -2
  224. package/dist/melonjs.mjs/video/webgl/utils/program.js +1 -1
  225. package/dist/melonjs.mjs/video/webgl/utils/string.js +1 -1
  226. package/dist/melonjs.mjs/video/webgl/utils/uniforms.js +1 -1
  227. package/dist/melonjs.mjs/video/webgl/webgl_compositor.js +1 -1
  228. package/dist/melonjs.mjs/video/webgl/webgl_renderer.js +4 -1
  229. package/dist/melonjs.module.js +28551 -26959
  230. package/dist/types/application/application.d.ts +144 -0
  231. package/dist/types/application/header.d.ts +5 -0
  232. package/dist/types/application/resize.d.ts +5 -0
  233. package/dist/types/application/settings.d.ts +18 -0
  234. package/dist/types/audio/audio.d.ts +267 -0
  235. package/dist/types/camera/camera2d.d.ts +289 -0
  236. package/dist/types/entity/entity.d.ts +98 -0
  237. package/{src/game.js → dist/types/game.d.ts} +3 -14
  238. package/dist/types/geometries/ellipse.d.ts +154 -0
  239. package/dist/types/geometries/line.d.ts +11 -0
  240. package/dist/types/geometries/path2d.d.ts +121 -0
  241. package/dist/types/geometries/point.d.ts +53 -0
  242. package/dist/types/geometries/poly.d.ts +222 -0
  243. package/dist/types/geometries/rectangle.d.ts +176 -0
  244. package/dist/types/geometries/roundrect.d.ts +52 -0
  245. package/dist/types/index.d.ts +3 -2
  246. package/dist/types/input/gamepad.d.ts +95 -0
  247. package/dist/types/input/input.d.ts +15 -0
  248. package/dist/types/input/keyboard.d.ts +205 -0
  249. package/dist/types/input/pointer.d.ts +270 -0
  250. package/dist/types/input/pointerevent.d.ts +181 -0
  251. package/dist/types/lang/deprecated.d.ts +53 -0
  252. package/dist/types/level/level.d.ts +134 -0
  253. package/dist/types/level/tiled/TMXGroup.d.ts +82 -0
  254. package/dist/types/level/tiled/TMXLayer.d.ts +180 -0
  255. package/dist/types/level/tiled/TMXObject.d.ts +195 -0
  256. package/dist/types/level/tiled/TMXTile.d.ts +78 -0
  257. package/dist/types/level/tiled/TMXTileMap.d.ts +180 -0
  258. package/dist/types/level/tiled/TMXTileset.d.ts +94 -0
  259. package/dist/types/level/tiled/TMXTilesetGroup.d.ts +32 -0
  260. package/dist/types/level/tiled/TMXUtils.d.ts +47 -0
  261. package/dist/types/level/tiled/renderer/TMXHexagonalRenderer.d.ts +87 -0
  262. package/dist/types/level/tiled/renderer/TMXIsometricRenderer.d.ts +55 -0
  263. package/dist/types/level/tiled/renderer/TMXOrthogonalRenderer.d.ts +43 -0
  264. package/dist/types/level/tiled/renderer/TMXRenderer.d.ts +75 -0
  265. package/dist/types/level/tiled/renderer/TMXStaggeredRenderer.d.ts +8 -0
  266. package/dist/types/loader/loader.d.ts +181 -0
  267. package/dist/types/loader/loadingscreen.d.ts +18 -0
  268. package/dist/types/math/color.d.ts +170 -0
  269. package/dist/types/math/math.d.ts +165 -0
  270. package/dist/types/math/matrix2.d.ts +209 -0
  271. package/dist/types/math/matrix3.d.ts +236 -0
  272. package/dist/types/math/observable_vector2.d.ts +278 -0
  273. package/dist/types/math/observable_vector3.d.ts +277 -0
  274. package/dist/types/math/vector2.d.ts +327 -0
  275. package/dist/types/math/vector3.d.ts +332 -0
  276. package/dist/types/particles/emitter.d.ts +188 -0
  277. package/dist/types/particles/particle.d.ts +32 -0
  278. package/dist/types/particles/settings.d.ts +32 -0
  279. package/dist/types/physics/body.d.ts +330 -0
  280. package/dist/types/physics/bounds.d.ts +250 -0
  281. package/dist/types/physics/collision.d.ts +44 -0
  282. package/dist/types/physics/detector.d.ts +64 -0
  283. package/dist/types/physics/quadtree.d.ts +79 -0
  284. package/dist/types/physics/response.d.ts +37 -0
  285. package/dist/types/physics/sat.d.ts +48 -0
  286. package/dist/types/physics/world.d.ts +83 -0
  287. package/dist/types/plugin/plugin.d.ts +10 -0
  288. package/dist/types/polyfill/console.d.ts +0 -0
  289. package/dist/types/polyfill/index.d.ts +1 -0
  290. package/dist/types/polyfill/performance.d.ts +0 -0
  291. package/dist/types/polyfill/requestAnimationFrame.d.ts +1 -0
  292. package/dist/types/polyfill/roundrect.d.ts +0 -0
  293. package/dist/types/renderable/collectable.d.ts +19 -0
  294. package/dist/types/renderable/colorlayer.d.ts +28 -0
  295. package/dist/types/renderable/container.d.ts +302 -0
  296. package/dist/types/renderable/dragndrop.d.ts +118 -0
  297. package/dist/types/renderable/imagelayer.d.ts +106 -0
  298. package/dist/types/renderable/light2d.d.ts +58 -0
  299. package/dist/types/renderable/nineslicesprite.d.ts +59 -0
  300. package/dist/types/renderable/renderable.d.ts +402 -0
  301. package/dist/types/renderable/sprite.d.ts +268 -0
  302. package/dist/types/renderable/trigger.d.ts +61 -0
  303. package/dist/types/renderable/ui/uibaseelement.d.ts +95 -0
  304. package/dist/types/renderable/ui/uispriteelement.d.ts +127 -0
  305. package/dist/types/renderable/ui/uitextbutton.d.ts +54 -0
  306. package/dist/types/state/stage.d.ts +116 -0
  307. package/dist/types/state/state.d.ts +170 -0
  308. package/dist/types/system/device.d.ts +579 -0
  309. package/dist/types/system/dom.d.ts +1 -0
  310. package/dist/types/system/event.d.ts +473 -0
  311. package/dist/types/system/platform.d.ts +31 -0
  312. package/dist/types/system/pooling.d.ts +101 -0
  313. package/dist/types/system/save.d.ts +25 -0
  314. package/dist/types/system/timer.d.ts +126 -0
  315. package/dist/types/text/bitmaptext.d.ts +151 -0
  316. package/dist/types/text/bitmaptextdata.d.ts +35 -0
  317. package/dist/types/text/glyph.d.ts +28 -0
  318. package/dist/types/text/text.d.ts +173 -0
  319. package/dist/types/text/textmetrics.d.ts +47 -0
  320. package/dist/types/text/textstyle.d.ts +5 -0
  321. package/dist/types/tweens/easing.d.ts +46 -0
  322. package/dist/types/tweens/interpolation.d.ts +18 -0
  323. package/dist/types/tweens/tween.d.ts +195 -0
  324. package/dist/types/utils/agent.d.ts +21 -0
  325. package/dist/types/utils/array.d.ts +39 -0
  326. package/dist/types/utils/file.d.ts +18 -0
  327. package/dist/types/utils/function.d.ts +32 -0
  328. package/dist/types/utils/string.d.ts +50 -0
  329. package/dist/types/utils/utils.d.ts +17 -0
  330. package/dist/types/video/canvas/canvas_renderer.d.ts +380 -0
  331. package/dist/types/video/renderer.d.ts +222 -0
  332. package/dist/types/video/texture/atlas.d.ts +201 -0
  333. package/dist/types/video/texture/cache.d.ts +45 -0
  334. package/dist/types/video/texture/canvas_texture.d.ts +78 -0
  335. package/dist/types/video/utils/autodetect.d.ts +7 -0
  336. package/dist/types/video/utils/resize.d.ts +4 -0
  337. package/dist/types/video/video.d.ts +92 -0
  338. package/dist/types/video/webgl/buffer/vertex.d.ts +56 -0
  339. package/dist/types/video/webgl/glshader.d.ts +93 -0
  340. package/dist/types/video/webgl/utils/attributes.d.ts +4 -0
  341. package/dist/types/video/webgl/utils/precision.d.ts +13 -0
  342. package/dist/types/video/webgl/utils/program.d.ts +5 -0
  343. package/dist/types/video/webgl/utils/string.d.ts +5 -0
  344. package/dist/types/video/webgl/utils/uniforms.d.ts +4 -0
  345. package/dist/types/video/webgl/webgl_compositor.d.ts +174 -0
  346. package/dist/types/video/webgl/webgl_renderer.d.ts +429 -0
  347. package/package.json +14 -14
  348. package/src/application/application.js +171 -20
  349. package/src/application/header.js +25 -0
  350. package/src/application/resize.js +110 -0
  351. package/src/application/settings.js +19 -0
  352. package/src/camera/camera2d.js +1 -1
  353. package/src/index.js +34 -23
  354. package/src/input/pointer.js +1 -1
  355. package/src/input/pointerevent.js +6 -7
  356. package/src/level/level.js +1 -1
  357. package/src/level/tiled/TMXLayer.js +1 -1
  358. package/src/level/tiled/TMXTileMap.js +2 -2
  359. package/src/loader/loadingscreen.js +1 -1
  360. package/src/physics/collision.js +2 -2
  361. package/src/physics/detector.js +172 -145
  362. package/src/physics/world.js +10 -30
  363. package/src/plugin/plugin.js +1 -1
  364. package/src/renderable/container.js +7 -91
  365. package/src/renderable/imagelayer.js +1 -1
  366. package/src/renderable/trigger.js +1 -1
  367. package/src/renderable/ui/uibaseelement.js +1 -1
  368. package/src/state/stage.js +1 -1
  369. package/src/state/state.js +1 -1
  370. package/src/system/device.js +7 -27
  371. package/src/system/dom.js +2 -1
  372. package/src/tweens/tween.js +1 -1
  373. package/src/utils/utils.js +3 -28
  374. package/src/video/canvas/canvas_renderer.js +3 -0
  375. package/src/video/renderer.js +27 -7
  376. package/src/video/texture/canvas_texture.js +20 -0
  377. package/src/video/utils/autodetect.js +18 -0
  378. package/src/video/video.js +17 -291
  379. package/src/video/webgl/glshader.js +3 -4
  380. package/src/video/webgl/utils/precision.js +18 -0
  381. package/src/video/webgl/webgl_renderer.js +3 -0
@@ -0,0 +1,53 @@
1
+ /**
2
+ * @classdesc
3
+ * represents a point in a 2d space
4
+ */
5
+ export default class Point {
6
+ constructor(x?: number, y?: number);
7
+ /**
8
+ * the position of the point on the horizontal axis
9
+ * @public
10
+ * @type {Number}
11
+ * @default 0
12
+ */
13
+ public x: number;
14
+ /**
15
+ * the position of the point on the vertical axis
16
+ * @public
17
+ * @type {Number}
18
+ * @default 0
19
+ */
20
+ public y: number;
21
+ /** @ignore */
22
+ onResetEvent(x?: number, y?: number): void;
23
+ /**
24
+ * set the Point x and y properties to the given values
25
+ * @param {number} x
26
+ * @param {number} y
27
+ * @returns {Point} Reference to this object for method chaining
28
+ */
29
+ set(x?: number, y?: number): Point;
30
+ /**
31
+ * return true if the two points are the same
32
+ * @name equals
33
+ * @memberof Point
34
+ * @method
35
+ * @param {Point} point
36
+ * @returns {boolean}
37
+ */
38
+ /**
39
+ * return true if this point is equal to the given values
40
+ * @name equals
41
+ * @memberof Point
42
+ * @param {number} x
43
+ * @param {number} y
44
+ * @returns {boolean}
45
+ */
46
+ equals(...args: any[]): boolean;
47
+ /**
48
+ * clone this Point
49
+ * @name clone
50
+ * @returns {Point} new Point
51
+ */
52
+ clone(): Point;
53
+ }
@@ -0,0 +1,222 @@
1
+ /**
2
+ * @classdesc
3
+ * a polygon Object.<br>
4
+ * Please do note that melonJS implements a simple Axis-Aligned Boxes collision algorithm, which requires all polygons used for collision to be convex with all vertices defined with clockwise winding.
5
+ * A polygon is convex when all line segments connecting two points in the interior do not cross any edge of the polygon
6
+ * (which means that all angles are less than 180 degrees), as described here below : <br>
7
+ * <center><img src="images/convex_polygon.png"/></center><br>
8
+ *
9
+ * A polygon's `winding` is clockwise if its vertices (points) are declared turning to the right. The image above shows COUNTERCLOCKWISE winding.
10
+ */
11
+ export default class Polygon {
12
+ /**
13
+ * @param {number} x - origin point of the Polygon
14
+ * @param {number} y - origin point of the Polygon
15
+ * @param {Vector2d[]} points - array of vector defining the Polygon
16
+ */
17
+ constructor(x: number, y: number, points: Vector2d[]);
18
+ /**
19
+ * origin point of the Polygon
20
+ * @public
21
+ * @type {Vector2d}
22
+ * @name pos
23
+ * @memberof Polygon
24
+ */
25
+ public pos: Vector2d;
26
+ /**
27
+ * Array of points defining the Polygon <br>
28
+ * Note: If you manually change `points`, you **must** call `recalc`afterwards so that the changes get applied correctly.
29
+ * @public
30
+ * @type {Vector2d[]}
31
+ * @name points
32
+ * @memberof Polygon
33
+ */
34
+ public points: Vector2d[];
35
+ /**
36
+ * The edges here are the direction of the `n`th edge of the polygon, relative to
37
+ * the `n`th point. If you want to draw a given edge from the edge value, you must
38
+ * first translate to the position of the starting point.
39
+ * @ignore
40
+ */
41
+ edges: any[];
42
+ /**
43
+ * a list of indices for all vertices composing this polygon (@see earcut)
44
+ * @ignore
45
+ */
46
+ indices: any[];
47
+ /**
48
+ * The normals here are the direction of the normal for the `n`th edge of the polygon, relative
49
+ * to the position of the `n`th point. If you want to draw an edge normal, you must first
50
+ * translate to the position of the starting point.
51
+ * @ignore
52
+ */
53
+ normals: any[];
54
+ shapeType: string;
55
+ /** @ignore */
56
+ onResetEvent(x: any, y: any, points: any): void;
57
+ /**
58
+ * set new value to the Polygon
59
+ * @name setShape
60
+ * @memberof Polygon
61
+ * @param {number} x - position of the Polygon
62
+ * @param {number} y - position of the Polygon
63
+ * @param {Vector2d[]|number[]} points - array of vector or vertice defining the Polygon
64
+ * @returns {Polygon} this instance for objecf chaining
65
+ */
66
+ setShape(x: number, y: number, points: Vector2d[] | number[]): Polygon;
67
+ /**
68
+ * set the vertices defining this Polygon
69
+ * @name setVertices
70
+ * @memberof Polygon
71
+ * @param {Vector2d[]} vertices - array of vector or vertice defining the Polygon
72
+ * @returns {Polygon} this instance for objecf chaining
73
+ */
74
+ setVertices(vertices: Vector2d[]): Polygon;
75
+ /**
76
+ * apply the given transformation matrix to this Polygon
77
+ * @name transform
78
+ * @memberof Polygon
79
+ * @param {Matrix2d} m - the transformation matrix
80
+ * @returns {Polygon} Reference to this object for method chaining
81
+ */
82
+ transform(m: Matrix2d): Polygon;
83
+ /**
84
+ * apply an isometric projection to this shape
85
+ * @name toIso
86
+ * @memberof Polygon
87
+ * @returns {Polygon} Reference to this object for method chaining
88
+ */
89
+ toIso(): Polygon;
90
+ /**
91
+ * apply a 2d projection to this shape
92
+ * @name to2d
93
+ * @memberof Polygon
94
+ * @returns {Polygon} Reference to this object for method chaining
95
+ */
96
+ to2d(): Polygon;
97
+ /**
98
+ * Rotate this Polygon (counter-clockwise) by the specified angle (in radians).
99
+ * @name rotate
100
+ * @memberof Polygon
101
+ * @param {number} angle - The angle to rotate (in radians)
102
+ * @param {Vector2d|ObservableVector2d} [v] - an optional point to rotate around
103
+ * @returns {Polygon} Reference to this object for method chaining
104
+ */
105
+ rotate(angle: number, v?: Vector2d | ObservableVector2d): Polygon;
106
+ /**
107
+ * Scale this Polygon by the given scalar.
108
+ * @name scale
109
+ * @memberof Polygon
110
+ * @param {number} x
111
+ * @param {number} [y=x]
112
+ * @returns {Polygon} Reference to this object for method chaining
113
+ */
114
+ scale(x: number, y?: number | undefined): Polygon;
115
+ /**
116
+ * Scale this Polygon by the given vector
117
+ * @name scaleV
118
+ * @memberof Polygon
119
+ * @param {Vector2d} v
120
+ * @returns {Polygon} Reference to this object for method chaining
121
+ */
122
+ scaleV(v: Vector2d): Polygon;
123
+ /**
124
+ * Computes the calculated collision polygon.
125
+ * This **must** be called if the `points` array, `angle`, or `offset` is modified manually.
126
+ * @name recalc
127
+ * @memberof Polygon
128
+ * @returns {Polygon} Reference to this object for method chaining
129
+ */
130
+ recalc(): Polygon;
131
+ /**
132
+ * returns a list of indices for all triangles defined in this polygon
133
+ * @name getIndices
134
+ * @memberof Polygon
135
+ * @returns {Array} an array of vertex indices for all triangles forming this polygon.
136
+ */
137
+ getIndices(): any[];
138
+ /**
139
+ * Returns true if the vertices composing this polygon form a convex shape (vertices must be in clockwise order).
140
+ * @name isConvex
141
+ * @memberof Polygon
142
+ * @returns {boolean} true if the vertices are convex, false if not, null if not computable
143
+ */
144
+ isConvex(): boolean;
145
+ /**
146
+ * translate the Polygon by the specified offset
147
+ * @name translate
148
+ * @memberof Polygon
149
+ * @method
150
+ * @param {number} x - x offset
151
+ * @param {number} y - y offset
152
+ * @returns {Polygon} this Polygon
153
+ */
154
+ /**
155
+ * translate the Polygon by the specified vector
156
+ * @name translate
157
+ * @memberof Polygon
158
+ * @param {Vector2d} v - vector offset
159
+ * @returns {Polygon} Reference to this object for method chaining
160
+ */
161
+ translate(...args: any[]): Polygon;
162
+ /**
163
+ * Shifts the Polygon to the given position vector.
164
+ * @name shift
165
+ * @memberof Polygon
166
+ * @method
167
+ * @param {Vector2d} position
168
+ */
169
+ /**
170
+ * Shifts the Polygon to the given x, y position.
171
+ * @name shift
172
+ * @memberof Polygon
173
+ * @param {number} x
174
+ * @param {number} y
175
+ */
176
+ shift(...args: any[]): void;
177
+ /**
178
+ * Returns true if the polygon contains the given point.
179
+ * (Note: it is highly recommended to first do a hit test on the corresponding <br>
180
+ * bounding rect, as the function can be highly consuming with complex shapes)
181
+ * @name contains
182
+ * @memberof Polygon
183
+ * @method
184
+ * @param {Vector2d} point
185
+ * @returns {boolean} true if contains
186
+ */
187
+ /**
188
+ * Returns true if the polygon contains the given point. <br>
189
+ * (Note: it is highly recommended to first do a hit test on the corresponding <br>
190
+ * bounding rect, as the function can be highly consuming with complex shapes)
191
+ * @name contains
192
+ * @memberof Polygon
193
+ * @param {number} x - x coordinate
194
+ * @param {number} y - y coordinate
195
+ * @returns {boolean} true if contains
196
+ */
197
+ contains(...args: any[]): boolean;
198
+ /**
199
+ * returns the bounding box for this shape, the smallest Rectangle object completely containing this shape.
200
+ * @name getBounds
201
+ * @memberof Polygon
202
+ * @returns {Bounds} this shape bounding box Rectangle object
203
+ */
204
+ getBounds(): Bounds;
205
+ _bounds: object | undefined;
206
+ /**
207
+ * update the bounding box for this shape.
208
+ * @ignore
209
+ * @name updateBounds
210
+ * @memberof Polygon
211
+ * @returns {Bounds} this shape bounding box Rectangle object
212
+ */
213
+ updateBounds(): Bounds;
214
+ /**
215
+ * clone this Polygon
216
+ * @name clone
217
+ * @memberof Polygon
218
+ * @returns {Polygon} new Polygon
219
+ */
220
+ clone(): Polygon;
221
+ }
222
+ import Vector2d from "./../math/vector2.js";
@@ -0,0 +1,176 @@
1
+ /**
2
+ * @classdesc
3
+ * a rectangle Object
4
+ * @augments Polygon
5
+ */
6
+ export default class Rect extends Polygon {
7
+ /**
8
+ * @param {number} x - position of the Rectangle
9
+ * @param {number} y - position of the Rectangle
10
+ * @param {number} w - width of the rectangle
11
+ * @param {number} h - height of the rectangle
12
+ */
13
+ constructor(x: number, y: number, w: number, h: number);
14
+ /** @ignore */
15
+ onResetEvent(x: any, y: any, w: any, h: any): void;
16
+ /**
17
+ * set new value to the rectangle shape
18
+ * @name setShape
19
+ * @memberof Rect
20
+ * @param {number} x - position of the Rectangle
21
+ * @param {number} y - position of the Rectangle
22
+ * @param {number|Vector2d[]} w - width of the rectangle, or an array of vector defining the rectangle
23
+ * @param {number} [h] - height of the rectangle, if a numeral width parameter is specified
24
+ * @returns {Rect} this rectangle
25
+ */
26
+ setShape(x: number, y: number, w: number | Vector2d[], h?: number | undefined, ...args: any[]): Rect;
27
+ /**
28
+ * left coordinate of the Rectangle
29
+ * @public
30
+ * @type {number}
31
+ * @name left
32
+ * @memberof Rect
33
+ */
34
+ public get left(): number;
35
+ /**
36
+ * right coordinate of the Rectangle
37
+ * @public
38
+ * @type {number}
39
+ * @name right
40
+ * @memberof Rect
41
+ */
42
+ public get right(): number;
43
+ /**
44
+ * top coordinate of the Rectangle
45
+ * @public
46
+ * @type {number}
47
+ * @name top
48
+ * @memberof Rect
49
+ */
50
+ public get top(): number;
51
+ /**
52
+ * bottom coordinate of the Rectangle
53
+ * @public
54
+ * @type {number}
55
+ * @name bottom
56
+ * @memberof Rect
57
+ */
58
+ public get bottom(): number;
59
+ public set width(arg: number);
60
+ /**
61
+ * width of the Rectangle
62
+ * @public
63
+ * @type {number}
64
+ * @name width
65
+ * @memberof Rect
66
+ */
67
+ public get width(): number;
68
+ public set height(arg: number);
69
+ /**
70
+ * height of the Rectangle
71
+ * @public
72
+ * @type {number}
73
+ * @name height
74
+ * @memberof Rect
75
+ */
76
+ public get height(): number;
77
+ public set centerX(arg: number);
78
+ /**
79
+ * absolute center of this rectangle on the horizontal axis
80
+ * @public
81
+ * @type {number}
82
+ * @name centerX
83
+ * @memberof Rect
84
+ */
85
+ public get centerX(): number;
86
+ public set centerY(arg: number);
87
+ /**
88
+ * absolute center of this rectangle on the vertical axis
89
+ * @public
90
+ * @type {number}
91
+ * @name centerY
92
+ * @memberof Rect
93
+ */
94
+ public get centerY(): number;
95
+ /**
96
+ * center the rectangle position around the given coordinates
97
+ * @name centerOn
98
+ * @memberof Rect
99
+ * @param {number} x - the x coordinate around which to center this rectangle
100
+ * @param {number} y - the y coordinate around which to center this rectangle
101
+ * @returns {Rect} this rectangle
102
+ */
103
+ centerOn(x: number, y: number): Rect;
104
+ /**
105
+ * resize the rectangle
106
+ * @name resize
107
+ * @memberof Rect
108
+ * @param {number} w - new width of the rectangle
109
+ * @param {number} h - new height of the rectangle
110
+ * @returns {Rect} this rectangle
111
+ */
112
+ resize(w: number, h: number): Rect;
113
+ /**
114
+ * scale the rectangle
115
+ * @name scale
116
+ * @memberof Rect
117
+ * @param {number} x - a number representing the abscissa of the scaling vector.
118
+ * @param {number} [y=x] - a number representing the ordinate of the scaling vector.
119
+ * @returns {Rect} this rectangle
120
+ */
121
+ scale(x: number, y?: number | undefined): Rect;
122
+ /**
123
+ * clone this rectangle
124
+ * @name clone
125
+ * @memberof Rect
126
+ * @returns {Rect} new rectangle
127
+ */
128
+ clone(): Rect;
129
+ /**
130
+ * copy the position and size of the given rectangle into this one
131
+ * @name copy
132
+ * @memberof Rect
133
+ * @param {Rect} rect - Source rectangle
134
+ * @returns {Rect} new rectangle
135
+ */
136
+ copy(rect: Rect): Rect;
137
+ /**
138
+ * merge this rectangle with another one
139
+ * @name union
140
+ * @memberof Rect
141
+ * @param {Rect} rect - other rectangle to union with
142
+ * @returns {Rect} the union(ed) rectangle
143
+ */
144
+ union(rect: Rect): Rect;
145
+ /**
146
+ * check if this rectangle is intersecting with the specified one
147
+ * @name overlaps
148
+ * @memberof Rect
149
+ * @param {Rect} rect
150
+ * @returns {boolean} true if overlaps
151
+ */
152
+ overlaps(rect: Rect): boolean;
153
+ /**
154
+ * check if this rectangle is identical to the specified one
155
+ * @name equals
156
+ * @memberof Rect
157
+ * @param {Rect} rect
158
+ * @returns {boolean} true if equals
159
+ */
160
+ equals(rect: Rect): boolean;
161
+ /**
162
+ * determines whether all coordinates of this rectangle are finite numbers.
163
+ * @name isFinite
164
+ * @memberof Rect
165
+ * @returns {boolean} false if all coordinates are positive or negative Infinity or NaN; otherwise, true.
166
+ */
167
+ isFinite(): boolean;
168
+ /**
169
+ * Returns a polygon whose edges are the same as this box.
170
+ * @name toPolygon
171
+ * @memberof Rect
172
+ * @returns {Polygon} a new Polygon that represents this rectangle.
173
+ */
174
+ toPolygon(): Polygon;
175
+ }
176
+ import Polygon from "./poly.js";
@@ -0,0 +1,52 @@
1
+ /**
2
+ * @classdesc
3
+ * a rectangle object with rounded corners
4
+ * @augments Rect
5
+ */
6
+ export default class RoundRect extends Rect {
7
+ /**
8
+ * @param {number} x - position of the rounded rectangle
9
+ * @param {number} y - position of the rounded rectangle
10
+ * @param {number} width - the rectangle width
11
+ * @param {number} height - the rectangle height
12
+ * @param {number} [radius=20] - the radius of the rounded corner
13
+ */
14
+ constructor(x: number, y: number, width: number, height: number, radius?: number | undefined);
15
+ public set radius(arg: number);
16
+ /**
17
+ * the radius of the rounded corner
18
+ * @public
19
+ * @type {number}
20
+ * @default 20
21
+ * @name radius
22
+ * @memberof RoundRect
23
+ */
24
+ public get radius(): number;
25
+ /** @ignore */
26
+ onResetEvent(x: any, y: any, w: any, h: any, radius: any): void;
27
+ _radius: number | undefined;
28
+ /**
29
+ * copy the position, size and radius of the given rounded rectangle into this one
30
+ * @name copy
31
+ * @memberof RoundRect
32
+ * @param {RoundRect} rrect - source rounded rectangle
33
+ * @returns {RoundRect} new rectangle
34
+ */
35
+ copy(rrect: RoundRect): RoundRect;
36
+ /**
37
+ * check if this RoundRect is identical to the specified one
38
+ * @name equals
39
+ * @memberof RoundRect
40
+ * @param {RoundRect} rrect
41
+ * @returns {boolean} true if equals
42
+ */
43
+ equals(rrect: RoundRect): boolean;
44
+ /**
45
+ * clone this RoundRect
46
+ * @name clone
47
+ * @memberof RoundRect
48
+ * @returns {RoundRect} new RoundRect
49
+ */
50
+ clone(): RoundRect;
51
+ }
52
+ import Rect from "./rectangle.js";
@@ -30,11 +30,11 @@ export const initialized: boolean;
30
30
  * @see boot
31
31
  */
32
32
  export const skipAutoInit: boolean;
33
+ export const game: Application;
33
34
  import * as audio from "./audio/audio.js";
34
35
  import collision from "./physics/collision.js";
35
36
  import * as device from "./system/device.js";
36
37
  import * as event from "./system/event.js";
37
- import game from "./game.js";
38
38
  import loader from "./loader/loader.js";
39
39
  import level from "./level/level.js";
40
40
  import * as input from "./input/input.js";
@@ -105,4 +105,5 @@ import ParticleEmitter from "./particles/emitter.js";
105
105
  import ParticleEmitterSettings from "./particles/settings.js";
106
106
  import Particle from "./particles/particle.js";
107
107
  import Entity from "./entity/entity.js";
108
- export { audio, collision, device, event, game, loader, level, input, Math, plugin, plugins, utils, save, timer, pool, state, video, Color, Vector2d, Vector3d, ObservableVector2d, ObservableVector3d, Matrix2d, Matrix3d, Polygon, Line, Ellipse, Point, Rect, RoundRect, Tween, QuadTree, GLShader, WebGLCompositor, Renderer, WebGLRenderer, CanvasRenderer, TextureAtlas, Renderable, Body, Bounds, Text, BitmapText, BitmapTextData, ColorLayer, ImageLayer, Sprite, NineSliceSprite, UIBaseElement, UITextButton, UISpriteElement, Collectable, Trigger, Light2d, Draggable, DropTarget, TMXRenderer, TMXOrthogonalRenderer, TMXIsometricRenderer, TMXHexagonalRenderer, TMXStaggeredRenderer, Tile, TMXTileset, TMXTilesetGroup, TMXTileMap, TMXLayer, Pointer, Stage, Camera2d, Container, World, ParticleEmitter, ParticleEmitterSettings, Particle, Entity };
108
+ import Application from "./application/application.js";
109
+ export { audio, collision, device, event, loader, level, input, Math, plugin, plugins, utils, save, timer, pool, state, video, Color, Vector2d, Vector3d, ObservableVector2d, ObservableVector3d, Matrix2d, Matrix3d, Polygon, Line, Ellipse, Point, Rect, RoundRect, Tween, QuadTree, GLShader, WebGLCompositor, Renderer, WebGLRenderer, CanvasRenderer, TextureAtlas, Renderable, Body, Bounds, Text, BitmapText, BitmapTextData, ColorLayer, ImageLayer, Sprite, NineSliceSprite, UIBaseElement, UITextButton, UISpriteElement, Collectable, Trigger, Light2d, Draggable, DropTarget, TMXRenderer, TMXOrthogonalRenderer, TMXIsometricRenderer, TMXHexagonalRenderer, TMXStaggeredRenderer, Tile, TMXTileset, TMXTilesetGroup, TMXTileMap, TMXLayer, Pointer, Stage, Camera2d, Container, World, ParticleEmitter, ParticleEmitterSettings, Particle, Entity, Application };
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Associate a gamepad event to a keycode
3
+ * @name bindGamepad
4
+ * @memberof input
5
+ * @public
6
+ * @param {number} index - Gamepad index
7
+ * @param {object} button - Button/Axis definition
8
+ * @param {string} button.type - "buttons" or "axes"
9
+ * @param {number} button.code - button or axis code id (See {@link input.GAMEPAD.BUTTONS}, {@link input.GAMEPAD.AXES})
10
+ * @param {number} [button.threshold=1] - value indicating when the axis should trigger the keycode (e.g. -0.5 or 0.5)
11
+ * @param {number} keyCode - (See {@link input.KEY})
12
+ * @example
13
+ * // enable the keyboard
14
+ * me.input.bindKey(me.input.KEY.X, "shoot");
15
+ * ...
16
+ * // map the lower face button on the first gamepad to the X key
17
+ * me.input.bindGamepad(0, {type:"buttons", code: me.input.GAMEPAD.BUTTONS.FACE_1}, me.input.KEY.X);
18
+ * // map the left axis value on the first gamepad to the LEFT key
19
+ * me.input.bindGamepad(0, {type:"axes", code: me.input.GAMEPAD.AXES.LX, threshold: -0.5}, me.input.KEY.LEFT);
20
+ */
21
+ export function bindGamepad(index: number, button: {
22
+ type: string;
23
+ code: number;
24
+ threshold?: number | undefined;
25
+ }, keyCode: number): void;
26
+ /**
27
+ * unbind the defined keycode
28
+ * @name unbindGamepad
29
+ * @memberof input
30
+ * @public
31
+ * @param {number} index - Gamepad index
32
+ * @param {number} button - (See {@link input.GAMEPAD.BUTTONS})
33
+ * @example
34
+ * me.input.unbindGamepad(0, me.input.GAMEPAD.BUTTONS.FACE_1);
35
+ */
36
+ export function unbindGamepad(index: number, button: number): void;
37
+ /**
38
+ * Set deadzone for analog gamepad inputs<br>
39
+ * The default deadzone is 0.1 (10%) Analog values less than this will be ignored
40
+ * @name setGamepadDeadzone
41
+ * @memberof input
42
+ * @public
43
+ * @param {number} value - Deadzone value
44
+ */
45
+ export function setGamepadDeadzone(value: number): void;
46
+ export namespace GAMEPAD {
47
+ namespace AXES {
48
+ const LX: number;
49
+ const LY: number;
50
+ const RX: number;
51
+ const RY: number;
52
+ const EXTRA_1: number;
53
+ const EXTRA_2: number;
54
+ const EXTRA_3: number;
55
+ const EXTRA_4: number;
56
+ }
57
+ namespace BUTTONS {
58
+ export const FACE_1: number;
59
+ export const FACE_2: number;
60
+ export const FACE_3: number;
61
+ export const FACE_4: number;
62
+ export const L1: number;
63
+ export const R1: number;
64
+ export const L2: number;
65
+ export const R2: number;
66
+ export const SELECT: number;
67
+ export const BACK: number;
68
+ export const START: number;
69
+ export const FORWARD: number;
70
+ export const L3: number;
71
+ export const R3: number;
72
+ export const UP: number;
73
+ export const DOWN: number;
74
+ export const LEFT: number;
75
+ export const RIGHT: number;
76
+ export const HOME: number;
77
+ const EXTRA_1_1: number;
78
+ export { EXTRA_1_1 as EXTRA_1 };
79
+ const EXTRA_2_1: number;
80
+ export { EXTRA_2_1 as EXTRA_2 };
81
+ const EXTRA_3_1: number;
82
+ export { EXTRA_3_1 as EXTRA_3 };
83
+ const EXTRA_4_1: number;
84
+ export { EXTRA_4_1 as EXTRA_4 };
85
+ }
86
+ }
87
+ /**
88
+ * Firefox reports different ids for gamepads depending on the platform:
89
+ * - Windows: vendor and product codes contain leading zeroes
90
+ * - Mac: vendor and product codes are sparse (no leading zeroes)
91
+ *
92
+ * This function normalizes the id to support both formats
93
+ * @ignore
94
+ */
95
+ export function setGamepadMapping(id: any, mapping: any): void;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @namespace input
3
+ */
4
+ /**
5
+ * specify if melonJS should prevent all default browser action on registered events.
6
+ * @public
7
+ * @type {boolean}
8
+ * @default true
9
+ * @name preventDefault
10
+ * @memberof input
11
+ */
12
+ export const preventDefault: boolean;
13
+ export * from "./pointerevent.js";
14
+ export * from "./keyboard.js";
15
+ export * from "./gamepad.js";