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,126 @@
1
+ export default timer;
2
+ declare const timer: Timer;
3
+ /**
4
+ * @classdesc
5
+ * a Timer class to manage timing related function (FPS, Game Tick, Time...)
6
+ * @see {@link timer} the default global timer instance
7
+ */
8
+ declare class Timer {
9
+ /**
10
+ * Last game tick value. <br>
11
+ * Use this value to scale velocities during frame drops due to slow hardware or when setting an FPS limit.
12
+ * This feature is disabled by default (Enable interpolation to use it).
13
+ * @public
14
+ * @see interpolation
15
+ * @See maxfps
16
+ * @type {number}
17
+ * @name tick
18
+ */
19
+ public tick: number;
20
+ /**
21
+ * Last measured fps rate.<br>
22
+ * This feature is disabled by default, unless the debugPanel is enabled/visible.
23
+ * @public
24
+ * @type {number}
25
+ * @name fps
26
+ */
27
+ public fps: number;
28
+ /**
29
+ * Set the maximum target display frame per second
30
+ * @public
31
+ * @see tick
32
+ * @type {number}
33
+ * @default 60
34
+ */
35
+ public maxfps: number;
36
+ /**
37
+ * Enable/disable frame interpolation
38
+ * @see tick
39
+ * @type {boolean}
40
+ * @default false
41
+ */
42
+ interpolation: boolean;
43
+ framecount: number;
44
+ framedelta: number;
45
+ last: number;
46
+ now: number;
47
+ delta: number;
48
+ step: number;
49
+ minstep: number;
50
+ timers: any[];
51
+ timerId: number;
52
+ /**
53
+ * reset time (e.g. usefull in case of pause)
54
+ * @ignore
55
+ */
56
+ reset(): void;
57
+ /**
58
+ * Calls a function once after a specified delay. See me.timer.setInterval to repeativly call a function.
59
+ * @param {Function} fn - the function you want to execute after delay milliseconds.
60
+ * @param {number} delay - the number of milliseconds (thousandths of a second) that the function call should be delayed by.
61
+ * @param {boolean} [pauseable=true] - respects the pause state of the engine.
62
+ * @param {...*} args - optional parameters which are passed through to the function specified by fn once the timer expires.
63
+ * @returns {number} The numerical ID of the timer, which can be used later with me.timer.clearTimeout().
64
+ * @example
65
+ * // set a timer to call "myFunction" after 1000ms
66
+ * me.timer.setTimeout(myFunction, 1000);
67
+ * // set a timer to call "myFunction" after 1000ms (respecting the pause state) and passing param1 and param2
68
+ * me.timer.setTimeout(myFunction, 1000, true, param1, param2);
69
+ */
70
+ setTimeout(fn: Function, delay: number, pauseable?: boolean | undefined, ...args: any[]): number;
71
+ /**
72
+ * Calls a function continously at the specified interval. See setTimeout to call function a single time.
73
+ * @param {Function} fn - the function to execute
74
+ * @param {number} delay - the number of milliseconds (thousandths of a second) on how often to execute the function
75
+ * @param {boolean} [pauseable=true] - respects the pause state of the engine.
76
+ * @param {...*} args - optional parameters which are passed through to the function specified by fn once the timer expires.
77
+ * @returns {number} The numerical ID of the timer, which can be used later with me.timer.clearInterval().
78
+ * @example
79
+ * // set a timer to call "myFunction" every 1000ms
80
+ * me.timer.setInterval(myFunction, 1000);
81
+ * // set a timer to call "myFunction" every 1000ms (respecting the pause state) and passing param1 and param2
82
+ * me.timer.setInterval(myFunction, 1000, true, param1, param2);
83
+ */
84
+ setInterval(fn: Function, delay: number, pauseable?: boolean | undefined, ...args: any[]): number;
85
+ /**
86
+ * Clears the delay set by me.timer.setTimeout().
87
+ * @param {number} timeoutID - ID of the timeout to be cleared
88
+ */
89
+ clearTimeout(timeoutID: number): void;
90
+ /**
91
+ * Clears the Interval set by me.timer.setInterval().
92
+ * @param {number} intervalID - ID of the interval to be cleared
93
+ */
94
+ clearInterval(intervalID: number): void;
95
+ /**
96
+ * Return the current timestamp in milliseconds <br>
97
+ * since the game has started or since linux epoch (based on browser support for High Resolution Timer)
98
+ * @returns {number}
99
+ */
100
+ getTime(): number;
101
+ /**
102
+ * Return elapsed time in milliseconds since the last update
103
+ * @returns {number}
104
+ */
105
+ getDelta(): number;
106
+ /**
107
+ * compute the actual frame time and fps rate
108
+ * @ignore
109
+ */
110
+ countFPS(): void;
111
+ /**
112
+ * update
113
+ * @ignore
114
+ */
115
+ update(time: any): void;
116
+ /**
117
+ * clear Timers
118
+ * @ignore
119
+ */
120
+ clearTimer(timerId: any): void;
121
+ /**
122
+ * update timers
123
+ * @ignore
124
+ */
125
+ updateTimers(): void;
126
+ }
@@ -0,0 +1,151 @@
1
+ /**
2
+ * @classdesc
3
+ * a bitmap font object
4
+ * @augments Renderable
5
+ */
6
+ export default class BitmapText extends Renderable {
7
+ /**
8
+ * @param {number} x - position of the text object
9
+ * @param {number} y - position of the text object
10
+ * @param {object} settings - the text configuration
11
+ * @param {string|Image} settings.font - a font name to identify the corresponing source image
12
+ * @param {string} [settings.fontData=settings.font] - the bitmap font data corresponding name, or the bitmap font data itself
13
+ * @param {number} [settings.size] - size a scaling ratio
14
+ * @param {Color|string} [settings.fillStyle] - a CSS color value used to tint the bitmapText (@see BitmapText.tint)
15
+ * @param {number} [settings.lineWidth=1] - line width, in pixels, when drawing stroke
16
+ * @param {string} [settings.textAlign="left"] - horizontal text alignment
17
+ * @param {string} [settings.textBaseline="top"] - the text baseline
18
+ * @param {number} [settings.lineHeight=1.0] - line spacing height
19
+ * @param {Vector2d} [settings.anchorPoint={x:0.0, y:0.0}] - anchor point to draw the text at
20
+ * @param {number} [settings.wordWrapWidth] - the maximum length in CSS pixel for a single segment of text
21
+ * @param {(string|string[])} [settings.text] - a string, or an array of strings
22
+ * @example
23
+ * // Use me.loader.preload or me.loader.load to load assets
24
+ * me.loader.preload([
25
+ * { name: "arial", type: "binary" src: "data/font/arial.fnt" },
26
+ * { name: "arial", type: "image" src: "data/font/arial.png" },
27
+ * ])
28
+ * // Then create an instance of your bitmap font:
29
+ * var myFont = new me.BitmapText(x, y, {font:"arial", text:"Hello"});
30
+ * // two possibilities for using "myFont"
31
+ * // either call the draw function from your Renderable draw function
32
+ * myFont.draw(renderer, "Hello!", 0, 0);
33
+ * // or just add it to the word container
34
+ * me.game.world.addChild(myFont);
35
+ */
36
+ constructor(x: number, y: number, settings: {
37
+ font: string | (new (width?: number | undefined, height?: number | undefined) => HTMLImageElement);
38
+ fontData?: string | undefined;
39
+ size?: number | undefined;
40
+ fillStyle?: string | Color | undefined;
41
+ lineWidth?: number | undefined;
42
+ textAlign?: string | undefined;
43
+ textBaseline?: string | undefined;
44
+ lineHeight?: number | undefined;
45
+ anchorPoint?: any;
46
+ wordWrapWidth?: number | undefined;
47
+ text?: string | string[] | undefined;
48
+ });
49
+ /**
50
+ * Set the default text alignment (or justification),<br>
51
+ * possible values are "left", "right", and "center".
52
+ * @public
53
+ * @type {string}
54
+ * @default "left"
55
+ */
56
+ public textAlign: string;
57
+ /**
58
+ * Set the text baseline (e.g. the Y-coordinate for the draw operation), <br>
59
+ * possible values are "top", "hanging, "middle, "alphabetic, "ideographic, "bottom"<br>
60
+ * @public
61
+ * @type {string}
62
+ * @default "top"
63
+ */
64
+ public textBaseline: string;
65
+ /**
66
+ * Set the line spacing height (when displaying multi-line strings). <br>
67
+ * Current font height will be multiplied with this value to set the line height.
68
+ * @public
69
+ * @type {number}
70
+ * @default 1.0
71
+ */
72
+ public lineHeight: number;
73
+ /**
74
+ * the maximum length in CSS pixel for a single segment of text.
75
+ * (use -1 to disable word wrapping)
76
+ * @public
77
+ * @type {number}
78
+ * @default -1
79
+ */
80
+ public wordWrapWidth: number;
81
+ /**
82
+ * the text to be displayed
83
+ * @private
84
+ */
85
+ private _text;
86
+ /**
87
+ * scaled font size
88
+ * @private
89
+ */
90
+ private fontScale;
91
+ /**
92
+ * font image
93
+ * @private
94
+ */
95
+ private fontImage;
96
+ /**
97
+ * font data
98
+ * @private
99
+ */
100
+ private fontData;
101
+ public set fillStyle(arg: Color);
102
+ /**
103
+ * defines the color used to tint the bitmap text
104
+ * @public
105
+ * @type {Color}
106
+ * @see Renderable#tint
107
+ */
108
+ public get fillStyle(): Color;
109
+ metrics: TextMetrics;
110
+ /**
111
+ * change the font settings
112
+ * @param {string} textAlign - ("left", "center", "right")
113
+ * @param {number} [scale]
114
+ * @returns {BitmapText} this object for chaining
115
+ */
116
+ set(textAlign: string, scale?: number | undefined): BitmapText;
117
+ /**
118
+ * change the text to be displayed
119
+ * @param {number|string|string[]} value - a string, or an array of strings
120
+ * @returns {BitmapText} this object for chaining
121
+ */
122
+ setText(value?: number | string | string[]): BitmapText;
123
+ /**
124
+ * change the font display size
125
+ * @param {number} scale - ratio
126
+ * @returns {BitmapText} this object for chaining
127
+ */
128
+ resize(scale: number): BitmapText;
129
+ /**
130
+ * measure the given text size in pixels
131
+ * @param {string} [text]
132
+ * @returns {TextMetrics} a TextMetrics object with two properties: `width` and `height`, defining the output dimensions
133
+ */
134
+ measureText(text?: string | undefined): TextMetrics;
135
+ /**
136
+ * draw the bitmap font
137
+ * @param {CanvasRenderer|WebGLRenderer} renderer - Reference to the destination renderer instance
138
+ * @param {string} [text]
139
+ * @param {number} [x]
140
+ * @param {number} [y]
141
+ */
142
+ draw(renderer: CanvasRenderer | WebGLRenderer, text?: string | undefined, x?: number | undefined, y?: number | undefined): void;
143
+ /**
144
+ * Destroy function
145
+ * @ignore
146
+ */
147
+ destroy(): void;
148
+ }
149
+ import Renderable from "./../renderable/renderable.js";
150
+ import Color from "./../math/color.js";
151
+ import TextMetrics from "./textmetrics.js";
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Class for storing relevant data from the font file.
3
+ * @ignore
4
+ */
5
+ export default class BitmapTextData {
6
+ /**
7
+ * @param {string} data - The bitmap font data pulled from the resource loader using me.loader.getBinary()
8
+ */
9
+ constructor(data: string);
10
+ /**
11
+ * @ignore
12
+ */
13
+ onResetEvent(data: any): void;
14
+ padTop: number | undefined;
15
+ padRight: number | undefined;
16
+ padBottom: number | undefined;
17
+ padLeft: number | undefined;
18
+ lineHeight: number | undefined;
19
+ capHeight: any;
20
+ descent: any;
21
+ /**
22
+ * The map of glyphs, each key is a char code.
23
+ * @name glyphs
24
+ * @type {object}
25
+ * @memberof BitmapTextData
26
+ */
27
+ glyphs: object | undefined;
28
+ /**
29
+ * This parses the font data text and builds a map of glyphs containing the data for each character
30
+ * @name parse
31
+ * @memberof BitmapTextData
32
+ * @param {string} fontData
33
+ */
34
+ parse(fontData: string): void;
35
+ }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * a glyph representing a single character in a font
3
+ * @ignore
4
+ */
5
+ export default class Glyph {
6
+ id: number;
7
+ x: number;
8
+ y: number;
9
+ width: number;
10
+ height: number;
11
+ u: number;
12
+ v: number;
13
+ u2: number;
14
+ v2: number;
15
+ xoffset: number;
16
+ yoffset: number;
17
+ xadvance: number;
18
+ fixedWidth: boolean;
19
+ /**
20
+ * @ignore
21
+ */
22
+ getKerning(ch: any): any;
23
+ /**
24
+ * @ignore
25
+ */
26
+ setKerning(ch: any, value: any): void;
27
+ kerning: {} | undefined;
28
+ }
@@ -0,0 +1,173 @@
1
+ /**
2
+ * @classdesc
3
+ * a generic system font object.
4
+ * @augments Renderable
5
+ */
6
+ export default class Text extends Renderable {
7
+ /**
8
+ * @param {number} x - position of the text object
9
+ * @param {number} y - position of the text object
10
+ * @param {object} settings - the text configuration
11
+ * @param {string} settings.font - a CSS family font name
12
+ * @param {number|string} settings.size - size, or size + suffix (px, em, pt)
13
+ * @param {Color|string} [settings.fillStyle="#000000"] - a CSS color value
14
+ * @param {Color|string} [settings.strokeStyle="#000000"] - a CSS color value
15
+ * @param {number} [settings.lineWidth=1] - line width, in pixels, when drawing stroke
16
+ * @param {string} [settings.textAlign="left"] - horizontal text alignment
17
+ * @param {string} [settings.textBaseline="top"] - the text baseline
18
+ * @param {number} [settings.lineHeight=1.0] - line spacing height
19
+ * @param {Vector2d} [settings.anchorPoint={x:0.0, y:0.0}] - anchor point to draw the text at
20
+ * @param {boolean} [settings.offScreenCanvas=false] - whether to draw the font to an individual "cache" texture first
21
+ * @param {number} [settings.wordWrapWidth] - the maximum length in CSS pixel for a single segment of text
22
+ * @param {(string|string[])} [settings.text=""] - a string, or an array of strings
23
+ * @example
24
+ * var font = new me.Text(0, 0, {font: "Arial", size: 8, fillStyle: this.color});
25
+ */
26
+ constructor(x: number, y: number, settings: {
27
+ font: string;
28
+ size: number | string;
29
+ fillStyle?: string | Color | undefined;
30
+ strokeStyle?: string | Color | undefined;
31
+ lineWidth?: number | undefined;
32
+ textAlign?: string | undefined;
33
+ textBaseline?: string | undefined;
34
+ lineHeight?: number | undefined;
35
+ anchorPoint?: any;
36
+ offScreenCanvas?: boolean | undefined;
37
+ wordWrapWidth?: number | undefined;
38
+ text?: string | string[] | undefined;
39
+ });
40
+ /** @ignore */
41
+ onResetEvent(x: any, y: any, settings: any): void;
42
+ fillStyle: any;
43
+ strokeStyle: any;
44
+ /**
45
+ * sets the current line width, in pixels, when drawing stroke
46
+ * @public
47
+ * @type {number}
48
+ * @default 1
49
+ */
50
+ public lineWidth: number | undefined;
51
+ /**
52
+ * Set the default text alignment (or justification),<br>
53
+ * possible values are "left", "right", and "center".<br>
54
+ * @public
55
+ * @type {string}
56
+ * @default "left"
57
+ */
58
+ public textAlign: string | undefined;
59
+ /**
60
+ * Set the text baseline (e.g. the Y-coordinate for the draw operation), <br>
61
+ * possible values are "top", "hanging, "middle, "alphabetic, "ideographic, "bottom"<br>
62
+ * @public
63
+ * @type {string}
64
+ * @default "top"
65
+ */
66
+ public textBaseline: string | undefined;
67
+ /**
68
+ * Set the line spacing height (when displaying multi-line strings). <br>
69
+ * Current font height will be multiplied with this value to set the line height.
70
+ * @public
71
+ * @type {number}
72
+ * @default 1.0
73
+ */
74
+ public lineHeight: number | undefined;
75
+ /**
76
+ * whether to draw the font to a indidividual offscreen canvas texture first <br>
77
+ * Note: this will improve performances when using WebGL, but will impact
78
+ * memory consumption as every text element will have its own canvas texture
79
+ * @public
80
+ * @type {boolean}
81
+ * @default false
82
+ */
83
+ public offScreenCanvas: boolean | undefined;
84
+ /**
85
+ * the maximum length in CSS pixel for a single segment of text.
86
+ * (use -1 to disable word wrapping)
87
+ * @public
88
+ * @type {number}
89
+ * @default -1
90
+ */
91
+ public wordWrapWidth: number | undefined;
92
+ /**
93
+ * the text to be displayed
94
+ * @private
95
+ */
96
+ private _text;
97
+ /**
98
+ * the font size (in px)
99
+ * @public
100
+ * @type {number}
101
+ * @default 10
102
+ */
103
+ public fontSize: number | undefined;
104
+ canvasTexture: object | undefined;
105
+ metrics: TextMetrics | undefined;
106
+ /**
107
+ * make the font bold
108
+ * @returns {Text} this object for chaining
109
+ */
110
+ bold(): Text;
111
+ font: any;
112
+ /**
113
+ * make the font italic
114
+ * @returns {Text} this object for chaining
115
+ */
116
+ italic(): Text;
117
+ /**
118
+ * set the font family and size
119
+ * @param {string} font - a CSS font name
120
+ * @param {number|string} [size=10] - size in px, or size + suffix (px, em, pt)
121
+ * @returns {Text} this object for chaining
122
+ * @example
123
+ * font.setFont("Arial", 20);
124
+ * font.setFont("Arial", "1.5em");
125
+ */
126
+ setFont(font: string, size?: string | number | undefined): Text;
127
+ /**
128
+ * change the text to be displayed
129
+ * @param {number|string|string[]} value - a string, or an array of strings
130
+ * @returns {Text} this object for chaining
131
+ */
132
+ setText(value?: number | string | string[]): Text;
133
+ glTextureUnit: any;
134
+ /**
135
+ * measure the given text size in pixels
136
+ * @param {CanvasRenderer|WebGLRenderer} renderer - reference to the active renderer
137
+ * @param {string} [text] - the text to be measured
138
+ * @returns {TextMetrics} a TextMetrics object defining the dimensions of the given piece of text
139
+ */
140
+ measureText(renderer: CanvasRenderer | WebGLRenderer, text?: string | undefined): TextMetrics;
141
+ /**
142
+ * draw a text at the specified coord
143
+ * @param {CanvasRenderer|WebGLRenderer} renderer - Reference to the destination renderer instance
144
+ * @param {string} [text]
145
+ * @param {number} [x]
146
+ * @param {number} [y]
147
+ * @param {boolean} [stroke=false] - draw stroke the the text if true
148
+ */
149
+ draw(renderer: CanvasRenderer | WebGLRenderer, text?: string | undefined, x?: number | undefined, y?: number | undefined, stroke?: boolean | undefined): void;
150
+ /**
151
+ * draw a stroke text at the specified coord, as defined <br>
152
+ * by the `lineWidth` and `fillStroke` properties. <br>
153
+ * Note : using drawStroke is not recommended for performance reasons
154
+ * @param {CanvasRenderer|WebGLRenderer} renderer - Reference to the destination renderer instance
155
+ * @param {string} text
156
+ * @param {number} x
157
+ * @param {number} y
158
+ */
159
+ drawStroke(renderer: CanvasRenderer | WebGLRenderer, text: string, x: number, y: number): void;
160
+ /**
161
+ * @ignore
162
+ */
163
+ _drawFont(context: any, text: any, x: any, y: any, stroke?: boolean): TextMetrics | undefined;
164
+ /**
165
+ * Destroy function
166
+ * @ignore
167
+ */
168
+ destroy(): void;
169
+ }
170
+ import Renderable from "./../renderable/renderable.js";
171
+ import TextMetrics from "./textmetrics.js";
172
+ import WebGLRenderer from "./../video/webgl/webgl_renderer.js";
173
+ import Color from "./../math/color.js";
@@ -0,0 +1,47 @@
1
+ /**
2
+ * @classdesc
3
+ * a Text Metrics object that contains helper for text manipulation
4
+ * @augments Bounds
5
+ */
6
+ export default class TextMetrics extends Bounds {
7
+ /**
8
+ * @param {Text|BitmapText} ancestor - the parent object that contains this TextMetrics object
9
+ */
10
+ constructor(ancestor: Text | BitmapText);
11
+ /**
12
+ * a reference to the parent object that contains this TextMetrics object
13
+ * @public
14
+ * @type {Renderable}
15
+ * @default undefined
16
+ */
17
+ public ancestor: Renderable;
18
+ /**
19
+ * Returns the height of a segment of inline text in CSS pixels.
20
+ * @returns {number} the height of a segment of inline text in CSS pixels.
21
+ */
22
+ lineHeight(): number;
23
+ /**
24
+ * Returns the width of the given segment of inline text in CSS pixels.
25
+ * @param {string} text - the text to be measured
26
+ * @param {CanvasRenderingContext2D} [context] - reference to an active 2d context for canvas rendering
27
+ * @returns {number} the width of the given segment of inline text in CSS pixels.
28
+ */
29
+ lineWidth(text: string, context?: CanvasRenderingContext2D | undefined): number;
30
+ /**
31
+ * measure the given text size in CSS pixels
32
+ * @param {string} text - the text to be measured
33
+ * @param {CanvasRenderingContext2D} [context] - reference to an active 2d context for canvas rendering
34
+ * @returns {TextMetrics} this
35
+ */
36
+ measureText(text: string, context?: CanvasRenderingContext2D | undefined): TextMetrics;
37
+ /**
38
+ * wrap the given text based on the given width
39
+ * @param {string|string[]} text - the text to be wrapped
40
+ * @param {number} width - maximum width of one segment of text in css pixel
41
+ * @param {CanvasRenderingContext2D} [context] - reference to an active 2d context for canvas rendering
42
+ * @returns {string[]} an array of string representing wrapped text
43
+ */
44
+ wordWrap(text: string | string[], width: number, context?: CanvasRenderingContext2D | undefined): string[];
45
+ }
46
+ import Bounds from "./../physics/bounds.js";
47
+ import Text from "./text.js";
@@ -0,0 +1,5 @@
1
+ /**
2
+ * apply the current text style to the given context
3
+ * @ignore
4
+ */
5
+ export default function setContextStyle(context: any, style: any, stroke?: boolean): void;
@@ -0,0 +1,46 @@
1
+ /**
2
+ * *
3
+ */
4
+ export type Easing = Function;
5
+ /**
6
+ * Easing Function :<br>
7
+ * <p>
8
+ * Easing.Linear.None<br>
9
+ * Easing.Quadratic.In<br>
10
+ * Easing.Quadratic.Out<br>
11
+ * Easing.Quadratic.InOut<br>
12
+ * Easing.Cubic.In<br>
13
+ * Easing.Cubic.Out<br>
14
+ * Easing.Cubic.InOut<br>
15
+ * Easing.Quartic.In<br>
16
+ * Easing.Quartic.Out<br>
17
+ * Easing.Quartic.InOut<br>
18
+ * Easing.Quintic.In<br>
19
+ * Easing.Quintic.Out<br>
20
+ * Easing.Quintic.InOut<br>
21
+ * Easing.Sinusoidal.In<br>
22
+ * Easing.Sinusoidal.Out<br>
23
+ * Easing.Sinusoidal.InOut<br>
24
+ * Easing.Exponential.In<br>
25
+ * Easing.Exponential.Out<br>
26
+ * Easing.Exponential.InOut<br>
27
+ * Easing.Circular.In<br>
28
+ * Easing.Circular.Out<br>
29
+ * Easing.Circular.InOut<br>
30
+ * Easing.Elastic.In<br>
31
+ * Easing.Elastic.Out<br>
32
+ * Easing.Elastic.InOut<br>
33
+ * Easing.Back.In<br>
34
+ * Easing.Back.Out<br>
35
+ * Easing.Back.InOut<br>
36
+ * Easing.Bounce.In<br>
37
+ * Easing.Bounce.Out<br>
38
+ * Easing.Bounce.InOut
39
+ * </p>
40
+ * @public
41
+ * @constant
42
+ * @enum {Function}
43
+ * @name Easing
44
+ * @memberof Tween
45
+ */
46
+ export let Easing: any;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * *
3
+ */
4
+ export type Interpolation = Function;
5
+ /**
6
+ * Interpolation Function :<br>
7
+ * <p>
8
+ * Interpolation.Linear<br>
9
+ * Interpolation.Bezier<br>
10
+ * Interpolation.CatmullRom
11
+ * </p>
12
+ * @public
13
+ * @constant
14
+ * @enum {Function}
15
+ * @name Interpolation
16
+ * @memberof Tween
17
+ */
18
+ export let Interpolation: any;