excalibur 0.33.0-alpha.99 → 1.1.0-alpha.310

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 (345) hide show
  1. package/.nvmrc +1 -1
  2. package/CHANGELOG.md +206 -5
  3. package/build/esm/excalibur.development.js +37363 -35202
  4. package/build/esm/excalibur.js +37363 -35202
  5. package/build/esm/excalibur.min.development.js +18360 -23963
  6. package/build/esm/excalibur.min.js +18360 -23963
  7. package/build/{dist → esm/src/engine}/actions/action/move-by.d.ts +1 -4
  8. package/build/{dist → esm/src/engine}/actions/action/move-to.d.ts +1 -4
  9. package/build/{dist → esm/src/engine}/actions/action/repeat-forever.d.ts +8 -0
  10. package/build/{dist → esm/src/engine}/actions/action/rotate-by.d.ts +9 -3
  11. package/build/{dist → esm/src/engine}/actions/action-context.d.ts +9 -43
  12. package/build/{dist → esm/src/engine}/actions/actions-component.d.ts +3 -41
  13. package/build/{dist → esm/src/engine}/actions/actions-system.d.ts +2 -3
  14. package/build/{dist → esm/src/engine}/actions/index.d.ts +0 -2
  15. package/build/{dist → esm/src/engine}/actor.d.ts +19 -30
  16. package/build/{dist → esm/src/engine}/camera.d.ts +13 -10
  17. package/build/{dist → esm/src/engine}/collision/body-component.d.ts +11 -20
  18. package/build/{dist → esm/src/engine}/collision/bounding-box.d.ts +3 -10
  19. package/build/{dist → esm/src/engine}/collision/collider-component.d.ts +17 -2
  20. package/build/{dist → esm/src/engine}/collision/colliders/circle-collider.d.ts +8 -0
  21. package/build/{dist → esm/src/engine}/collision/colliders/closest-line-jump-table.d.ts +1 -1
  22. package/build/{dist → esm/src/engine}/collision/colliders/collider.d.ts +7 -1
  23. package/build/{dist/collision/colliders/shape.d.ts → esm/src/engine/collision/colliders/colliders.d.ts} +50 -0
  24. package/build/{dist → esm/src/engine}/collision/colliders/collision-jump-table.d.ts +2 -1
  25. package/build/{dist → esm/src/engine}/collision/colliders/edge-collider.d.ts +25 -1
  26. package/build/{dist → esm/src/engine}/collision/colliders/polygon-collider.d.ts +23 -0
  27. package/build/esm/src/engine/collision/colliders/sat-shape.d.ts +27 -0
  28. package/build/{dist → esm/src/engine}/collision/colliders/separating-axis.d.ts +11 -6
  29. package/build/{dist → esm/src/engine}/collision/collision-system.d.ts +9 -5
  30. package/build/{dist → esm/src/engine}/collision/detection/collision-contact.d.ts +6 -0
  31. package/build/{dist → esm/src/engine}/collision/detection/dynamic-tree.d.ts +9 -11
  32. package/build/{dist → esm/src/engine}/collision/detection/pair.d.ts +9 -0
  33. package/build/{dist → esm/src/engine}/collision/detection/quad-tree.d.ts +2 -2
  34. package/build/{dist → esm/src/engine}/collision/detection/sparse-hash-grid-collision-processor.d.ts +7 -2
  35. package/build/{dist → esm/src/engine}/collision/detection/sparse-hash-grid.d.ts +11 -3
  36. package/build/{dist → esm/src/engine}/collision/group/collision-group-manager.d.ts +1 -1
  37. package/build/{dist → esm/src/engine}/collision/index.d.ts +2 -1
  38. package/build/{dist → esm/src/engine}/collision/motion-system.d.ts +2 -3
  39. package/build/{dist → esm/src/engine}/collision/physics-config.d.ts +7 -0
  40. package/build/{dist → esm/src/engine}/collision/physics-world.d.ts +34 -33
  41. package/build/esm/src/engine/collision/solver/realistic-solver.d.ts +50 -0
  42. package/build/{dist → esm/src/engine}/collision/solver/solver.d.ts +4 -2
  43. package/build/{dist → esm/src/engine}/debug/debug-config.d.ts +16 -0
  44. package/build/{dist → esm/src/engine}/debug/debug-system.d.ts +3 -3
  45. package/build/esm/src/engine/deprecated.d.ts +1 -0
  46. package/build/{dist → esm/src/engine}/director/director.d.ts +13 -8
  47. package/build/{dist → esm/src/engine}/director/slide.d.ts +2 -2
  48. package/build/{dist → esm/src/engine}/director/transition.d.ts +1 -4
  49. package/build/{dist → esm/src/engine}/engine.d.ts +58 -8
  50. package/build/{dist → esm/src/engine}/entity-component-system/component.d.ts +1 -1
  51. package/build/{dist → esm/src/engine}/entity-component-system/components/motion-component.d.ts +1 -0
  52. package/build/{dist → esm/src/engine}/entity-component-system/components/pause-component.d.ts +2 -0
  53. package/build/{dist → esm/src/engine}/entity-component-system/components/tags-component.d.ts +1 -0
  54. package/build/{dist → esm/src/engine}/entity-component-system/components/transform-component.d.ts +1 -0
  55. package/build/{dist → esm/src/engine}/entity-component-system/entity.d.ts +0 -10
  56. package/build/{dist → esm/src/engine}/entity-component-system/index.d.ts +0 -1
  57. package/build/{dist → esm/src/engine}/entity-component-system/query.d.ts +1 -1
  58. package/build/{dist → esm/src/engine}/entity-component-system/system.d.ts +11 -4
  59. package/build/{dist → esm/src/engine}/entity-component-system/world.d.ts +1 -5
  60. package/build/{dist → esm/src/engine}/events/media-events.d.ts +3 -3
  61. package/build/{dist → esm/src/engine}/events.d.ts +4 -4
  62. package/build/{dist → esm/src/engine}/graphics/animation.d.ts +15 -5
  63. package/build/{dist → esm/src/engine}/graphics/context/circle-renderer/circle-renderer.d.ts +5 -0
  64. package/build/{dist → esm/src/engine}/graphics/context/debug-text.d.ts +13 -1
  65. package/build/{dist → esm/src/engine}/graphics/context/excalibur-graphics-context-2d-canvas.d.ts +13 -3
  66. package/build/{dist → esm/src/engine}/graphics/context/excalibur-graphics-context-webgl.d.ts +43 -6
  67. package/build/{dist → esm/src/engine}/graphics/context/excalibur-graphics-context.d.ts +108 -4
  68. package/build/esm/src/engine/graphics/context/framebuffer.d.ts +154 -0
  69. package/build/esm/src/engine/graphics/context/glsl.d.ts +47 -0
  70. package/build/{dist → esm/src/engine}/graphics/context/material-renderer/material-renderer.d.ts +1 -0
  71. package/build/esm/src/engine/graphics/context/material.d.ts +208 -0
  72. package/build/esm/src/engine/graphics/context/shader-pipeline/effects/bloom-effect.d.ts +80 -0
  73. package/build/esm/src/engine/graphics/context/shader-pipeline/effects/blur-passes.d.ts +75 -0
  74. package/build/esm/src/engine/graphics/context/shader-pipeline/effects/glow-passes.d.ts +93 -0
  75. package/build/esm/src/engine/graphics/context/shader-pipeline/shader-pass.d.ts +138 -0
  76. package/build/esm/src/engine/graphics/context/shader-pipeline/shader-pipeline.d.ts +91 -0
  77. package/build/{dist → esm/src/engine}/graphics/context/shader.d.ts +43 -6
  78. package/build/{dist → esm/src/engine}/graphics/context/texture-loader.d.ts +1 -1
  79. package/build/{dist → esm/src/engine}/graphics/context/webgl-util.d.ts +2 -2
  80. package/build/{dist → esm/src/engine}/graphics/debug-graphics-component.d.ts +1 -0
  81. package/build/{dist → esm/src/engine}/graphics/filtering.d.ts +1 -1
  82. package/build/{dist → esm/src/engine}/graphics/font-common.d.ts +2 -2
  83. package/build/{dist → esm/src/engine}/graphics/font-text-instance.d.ts +5 -5
  84. package/build/{dist → esm/src/engine}/graphics/font.d.ts +3 -3
  85. package/build/{dist → esm/src/engine}/graphics/graphics-component.d.ts +28 -15
  86. package/build/{dist → esm/src/engine}/graphics/graphics-group.d.ts +6 -0
  87. package/build/{dist → esm/src/engine}/graphics/graphics-system.d.ts +3 -3
  88. package/build/{dist → esm/src/engine}/graphics/image-source.d.ts +1 -1
  89. package/build/{dist → esm/src/engine}/graphics/index.d.ts +8 -0
  90. package/build/{dist → esm/src/engine}/graphics/offscreen-system.d.ts +2 -2
  91. package/build/{dist → esm/src/engine}/graphics/parallax-component.d.ts +1 -0
  92. package/build/{dist → esm/src/engine}/graphics/post-processor/color-blindness-post-processor.d.ts +3 -5
  93. package/build/esm/src/engine/graphics/post-processor/post-processor.d.ts +66 -0
  94. package/build/esm/src/engine/graphics/post-processor/shader-pipeline-post-processor.d.ts +45 -0
  95. package/build/{dist → esm/src/engine}/graphics/sprite-font.d.ts +3 -3
  96. package/build/{dist → esm/src/engine}/index.d.ts +5 -5
  97. package/build/{dist → esm/src/engine}/input/gamepad.d.ts +4 -7
  98. package/build/{dist → esm/src/engine}/input/keyboard.d.ts +3 -3
  99. package/build/{dist → esm/src/engine}/input/pointer-component.d.ts +1 -0
  100. package/build/{dist → esm/src/engine}/input/pointer-event-receiver.d.ts +13 -0
  101. package/build/{dist → esm/src/engine}/input/pointer-system.d.ts +3 -3
  102. package/build/{dist → esm/src/engine}/interfaces/index.d.ts +0 -2
  103. package/build/{dist → esm/src/engine}/label.d.ts +2 -2
  104. package/build/esm/src/engine/lighting/cone-light-component.d.ts +47 -0
  105. package/build/esm/src/engine/lighting/darkness-component.d.ts +34 -0
  106. package/build/esm/src/engine/lighting/flicker-options.d.ts +17 -0
  107. package/build/esm/src/engine/lighting/flicker-system.d.ts +19 -0
  108. package/build/esm/src/engine/lighting/index.d.ts +8 -0
  109. package/build/esm/src/engine/lighting/light-occluder-component.d.ts +66 -0
  110. package/build/esm/src/engine/lighting/lighting-config.d.ts +47 -0
  111. package/build/esm/src/engine/lighting/lighting-system.d.ts +153 -0
  112. package/build/esm/src/engine/lighting/point-light-component.d.ts +46 -0
  113. package/build/{dist → esm/src/engine}/math/affine-matrix.d.ts +8 -1
  114. package/build/esm/src/engine/math/coord-plane.d.ts +52 -0
  115. package/build/{dist → esm/src/engine}/math/graph.d.ts +2 -3
  116. package/build/{dist → esm/src/engine}/math/index.d.ts +2 -0
  117. package/build/{dist → esm/src/engine}/math/line-segment.d.ts +1 -1
  118. package/build/{dist → esm/src/engine}/math/matrix.d.ts +25 -0
  119. package/build/{dist → esm/src/engine}/math/ray.d.ts +1 -1
  120. package/build/{dist → esm/src/engine}/math/transform.d.ts +9 -0
  121. package/build/{dist → esm/src/engine}/math/vector.d.ts +16 -13
  122. package/build/esm/src/engine/math/vector3.d.ts +163 -0
  123. package/build/esm/src/engine/math/vector4.d.ts +157 -0
  124. package/build/{dist → esm/src/engine}/particles/gpu-particle-emitter.d.ts +2 -2
  125. package/build/{dist → esm/src/engine}/particles/particle-emitter.d.ts +2 -2
  126. package/build/{dist → esm/src/engine}/particles/particles.d.ts +6 -1
  127. package/build/esm/src/engine/plugin.d.ts +253 -0
  128. package/build/{dist → esm/src/engine}/resources/resource.d.ts +8 -0
  129. package/build/{dist → esm/src/engine}/resources/sound/index.d.ts +1 -1
  130. package/build/esm/src/engine/resources/sound/sound-manager.d.ts +378 -0
  131. package/build/esm/src/engine/resources/sound/sound-track.d.ts +176 -0
  132. package/build/esm/src/engine/resources/sound/sound.d.ts +351 -0
  133. package/build/{dist → esm/src/engine}/scene.d.ts +13 -7
  134. package/build/{dist → esm/src/engine}/screen-element.d.ts +2 -2
  135. package/build/{dist → esm/src/engine}/screen.d.ts +97 -29
  136. package/build/{dist → esm/src/engine}/tile-map/isometric-entity-component.d.ts +1 -0
  137. package/build/{dist → esm/src/engine}/tile-map/isometric-entity-system.d.ts +2 -3
  138. package/build/{dist → esm/src/engine}/tile-map/isometric-map.d.ts +0 -10
  139. package/build/{dist → esm/src/engine}/tile-map/tile-map.d.ts +2 -0
  140. package/build/{dist → esm/src/engine}/timer.d.ts +5 -8
  141. package/build/{dist/util/pool.d.ts → esm/src/engine/util/arena-pool.d.ts} +15 -4
  142. package/build/{dist → esm/src/engine}/util/browser.d.ts +8 -0
  143. package/build/{dist → esm/src/engine}/util/detector.d.ts +1 -1
  144. package/build/{dist → esm/src/engine}/util/draw-util.d.ts +2 -2
  145. package/build/{dist → esm/src/engine}/util/index.d.ts +0 -1
  146. package/build/{dist → esm/src/engine}/util/pause-system.d.ts +7 -1
  147. package/build/{dist → esm/src/engine}/util/rental-pool.d.ts +1 -0
  148. package/build/{dist → esm/src/engine}/util/serializer.d.ts +1 -1
  149. package/build/{dist → esm/src/engine}/util/state-machine.d.ts +1 -1
  150. package/package.json +38 -44
  151. package/tsconfig.json +38 -1
  152. package/.devcontainer/devcontainer.json +0 -26
  153. package/.git-blame-ignore-revs +0 -3
  154. package/.gitattributes +0 -70
  155. package/.gitmodules +0 -0
  156. package/.husky/pre-commit +0 -1
  157. package/.prettierrc +0 -8
  158. package/build/dist/collision/solver/realistic-solver.d.ts +0 -28
  159. package/build/dist/deprecated.d.ts +0 -0
  160. package/build/dist/entity-component-system/tag-query.d.ts +0 -28
  161. package/build/dist/excalibur.development.js +0 -35408
  162. package/build/dist/excalibur.js +0 -35408
  163. package/build/dist/excalibur.min.development.js +0 -931
  164. package/build/dist/excalibur.min.js +0 -931
  165. package/build/dist/graphics/context/material.d.ts +0 -102
  166. package/build/dist/graphics/context/render-source.d.ts +0 -7
  167. package/build/dist/graphics/context/render-target.d.ts +0 -60
  168. package/build/dist/graphics/post-processor/post-processor.d.ts +0 -36
  169. package/build/dist/interfaces/audio-implementation.d.ts +0 -25
  170. package/build/dist/interfaces/audio.d.ts +0 -55
  171. package/build/dist/math/coord-plane.d.ts +0 -15
  172. package/build/dist/resources/sound/sound-manager.d.ts +0 -102
  173. package/build/dist/resources/sound/sound.d.ts +0 -215
  174. package/build/dist/resources/sound/web-audio-instance.d.ts +0 -49
  175. package/build/dist/util/decorators.d.ts +0 -15
  176. package/build/dist/util/easing-functions.d.ts +0 -89
  177. package/build/dist/util/sound.d.ts +0 -5
  178. package/deno.json +0 -10
  179. package/eslint.config.mjs +0 -210
  180. package/playground/README.md +0 -71
  181. package/playground/index.html +0 -75
  182. package/playground/package-lock.json +0 -1976
  183. package/playground/package.json +0 -27
  184. package/playground/public/favicon.ico +0 -0
  185. package/playground/public/icon.png +0 -0
  186. package/playground/public/logo-white@2x.png +0 -0
  187. package/playground/public/logo@2x.png +0 -0
  188. package/playground/public/player-run.png +0 -0
  189. package/playground/public/rpg-audio/License.txt +0 -21
  190. package/playground/public/rpg-audio/audio/handleCoins.ogg +0 -0
  191. package/playground/public/social.jpg +0 -0
  192. package/playground/public/social.png +0 -0
  193. package/playground/public/tiny-town/License.txt +0 -22
  194. package/playground/public/tiny-town/tilemap/tilemap.png +0 -0
  195. package/playground/tsconfig.json +0 -26
  196. package/playground/tsdown.config.ts +0 -13
  197. package/playground/vite.config.ts +0 -5
  198. package/vite.config.common.js +0 -27
  199. package/vite.config.ts +0 -78
  200. package/vitest.config.ts +0 -41
  201. /package/build/{dist → esm/src/engine}/actions/action/action-sequence.d.ts +0 -0
  202. /package/build/{dist → esm/src/engine}/actions/action/blink.d.ts +0 -0
  203. /package/build/{dist → esm/src/engine}/actions/action/call-method.d.ts +0 -0
  204. /package/build/{dist → esm/src/engine}/actions/action/curve-by.d.ts +0 -0
  205. /package/build/{dist → esm/src/engine}/actions/action/curve-to.d.ts +0 -0
  206. /package/build/{dist → esm/src/engine}/actions/action/delay.d.ts +0 -0
  207. /package/build/{dist → esm/src/engine}/actions/action/die.d.ts +0 -0
  208. /package/build/{dist → esm/src/engine}/actions/action/ease-by.d.ts +0 -0
  209. /package/build/{dist → esm/src/engine}/actions/action/ease-to.d.ts +0 -0
  210. /package/build/{dist → esm/src/engine}/actions/action/fade.d.ts +0 -0
  211. /package/build/{dist → esm/src/engine}/actions/action/flash.d.ts +0 -0
  212. /package/build/{dist → esm/src/engine}/actions/action/follow.d.ts +0 -0
  213. /package/build/{dist → esm/src/engine}/actions/action/meet.d.ts +0 -0
  214. /package/build/{dist → esm/src/engine}/actions/action/parallel-actions.d.ts +0 -0
  215. /package/build/{dist → esm/src/engine}/actions/action/repeat.d.ts +0 -0
  216. /package/build/{dist → esm/src/engine}/actions/action/rotate-to.d.ts +0 -0
  217. /package/build/{dist → esm/src/engine}/actions/action/scale-by.d.ts +0 -0
  218. /package/build/{dist → esm/src/engine}/actions/action/scale-to.d.ts +0 -0
  219. /package/build/{dist → esm/src/engine}/actions/action-queue.d.ts +0 -0
  220. /package/build/{dist → esm/src/engine}/actions/action.d.ts +0 -0
  221. /package/build/{dist → esm/src/engine}/actions/actionable.d.ts +0 -0
  222. /package/build/{dist → esm/src/engine}/collision/colliders/composite-collider.d.ts +0 -0
  223. /package/build/{dist → esm/src/engine}/collision/collision-type.d.ts +0 -0
  224. /package/build/{dist → esm/src/engine}/collision/detection/collision-processor.d.ts +0 -0
  225. /package/build/{dist → esm/src/engine}/collision/detection/dynamic-tree-collision-processor.d.ts +0 -0
  226. /package/build/{dist → esm/src/engine}/collision/detection/ray-cast-hit.d.ts +0 -0
  227. /package/build/{dist → esm/src/engine}/collision/detection/ray-cast-options.d.ts +0 -0
  228. /package/build/{dist → esm/src/engine}/collision/detection/spatial-partition-strategy.d.ts +0 -0
  229. /package/build/{dist → esm/src/engine}/collision/group/collision-group.d.ts +0 -0
  230. /package/build/{dist → esm/src/engine}/collision/integrator.d.ts +0 -0
  231. /package/build/{dist → esm/src/engine}/collision/island.d.ts +0 -0
  232. /package/build/{dist → esm/src/engine}/collision/side.d.ts +0 -0
  233. /package/build/{dist → esm/src/engine}/collision/solver/arcade-solver.d.ts +0 -0
  234. /package/build/{dist → esm/src/engine}/collision/solver/contact-bias.d.ts +0 -0
  235. /package/build/{dist → esm/src/engine}/collision/solver/contact-constraint-point.d.ts +0 -0
  236. /package/build/{dist → esm/src/engine}/collision/solver-strategy.d.ts +0 -0
  237. /package/build/{dist → esm/src/engine}/color.d.ts +0 -0
  238. /package/build/{dist → esm/src/engine}/context.d.ts +0 -0
  239. /package/build/{dist → esm/src/engine}/debug/debug-flags.d.ts +0 -0
  240. /package/build/{dist → esm/src/engine}/debug/index.d.ts +0 -0
  241. /package/build/{dist → esm/src/engine}/director/cross-fade.d.ts +0 -0
  242. /package/build/{dist → esm/src/engine}/director/default-loader.d.ts +0 -0
  243. /package/build/{dist → esm/src/engine}/director/fade-in-out.d.ts +0 -0
  244. /package/build/{dist → esm/src/engine}/director/index.d.ts +0 -0
  245. /package/build/{dist → esm/src/engine}/director/loader.d.ts +0 -0
  246. /package/build/{dist → esm/src/engine}/entity-component-system/entity-manager.d.ts +0 -0
  247. /package/build/{dist → esm/src/engine}/entity-component-system/priority.d.ts +0 -0
  248. /package/build/{dist → esm/src/engine}/entity-component-system/query-manager.d.ts +0 -0
  249. /package/build/{dist → esm/src/engine}/entity-component-system/system-manager.d.ts +0 -0
  250. /package/build/{dist → esm/src/engine}/entity-component-system/types.d.ts +0 -0
  251. /package/build/{dist → esm/src/engine}/event-emitter.d.ts +0 -0
  252. /package/build/{dist → esm/src/engine}/events/ex-event.d.ts +0 -0
  253. /package/build/{dist → esm/src/engine}/events/pointer-events.d.ts +0 -0
  254. /package/build/{dist → esm/src/engine}/excalibur.d.ts +0 -0
  255. /package/build/{dist → esm/src/engine}/flags.d.ts +0 -0
  256. /package/build/{dist → esm/src/engine}/garbage-collector.d.ts +0 -0
  257. /package/build/{dist → esm/src/engine}/graphics/canvas.d.ts +0 -0
  258. /package/build/{dist → esm/src/engine}/graphics/circle.d.ts +0 -0
  259. /package/build/{dist → esm/src/engine}/graphics/context/debug-circle-renderer/debug-circle-renderer.d.ts +0 -0
  260. /package/build/{dist → esm/src/engine}/graphics/context/debug-line-renderer/debug-line-renderer.d.ts +0 -0
  261. /package/build/{dist → esm/src/engine}/graphics/context/debug-point-renderer/debug-point-renderer.d.ts +0 -0
  262. /package/build/{dist → esm/src/engine}/graphics/context/draw-call.d.ts +0 -0
  263. /package/build/{dist → esm/src/engine}/graphics/context/image-renderer/image-renderer.d.ts +0 -0
  264. /package/build/{dist → esm/src/engine}/graphics/context/image-renderer-v2/image-renderer-v2.d.ts +0 -0
  265. /package/build/{dist → esm/src/engine}/graphics/context/particle-renderer/particle-renderer.d.ts +0 -0
  266. /package/build/{dist → esm/src/engine}/graphics/context/quad-index-buffer.d.ts +0 -0
  267. /package/build/{dist → esm/src/engine}/graphics/context/rectangle-renderer/rectangle-renderer.d.ts +0 -0
  268. /package/build/{dist → esm/src/engine}/graphics/context/renderer.d.ts +0 -0
  269. /package/build/{dist → esm/src/engine}/graphics/context/screen-pass-painter/screen-pass-painter.d.ts +0 -0
  270. /package/build/{dist → esm/src/engine}/graphics/context/state-stack.d.ts +0 -0
  271. /package/build/{dist → esm/src/engine}/graphics/context/transform-stack.d.ts +0 -0
  272. /package/build/{dist → esm/src/engine}/graphics/context/uniform-buffer.d.ts +0 -0
  273. /package/build/{dist → esm/src/engine}/graphics/context/vertex-buffer.d.ts +0 -0
  274. /package/build/{dist → esm/src/engine}/graphics/context/vertex-layout.d.ts +0 -0
  275. /package/build/{dist → esm/src/engine}/graphics/debug.d.ts +0 -0
  276. /package/build/{dist → esm/src/engine}/graphics/font-cache.d.ts +0 -0
  277. /package/build/{dist → esm/src/engine}/graphics/graphic.d.ts +0 -0
  278. /package/build/{dist → esm/src/engine}/graphics/graphics-diagnostics.d.ts +0 -0
  279. /package/build/{dist → esm/src/engine}/graphics/line.d.ts +0 -0
  280. /package/build/{dist → esm/src/engine}/graphics/nine-slice.d.ts +0 -0
  281. /package/build/{dist → esm/src/engine}/graphics/polygon.d.ts +0 -0
  282. /package/build/{dist → esm/src/engine}/graphics/post-processor/color-blindness-mode.d.ts +0 -0
  283. /package/build/{dist → esm/src/engine}/graphics/post-processor/screen-shader.d.ts +0 -0
  284. /package/build/{dist → esm/src/engine}/graphics/raster.d.ts +0 -0
  285. /package/build/{dist → esm/src/engine}/graphics/rectangle.d.ts +0 -0
  286. /package/build/{dist → esm/src/engine}/graphics/sprite-sheet.d.ts +0 -0
  287. /package/build/{dist → esm/src/engine}/graphics/sprite.d.ts +0 -0
  288. /package/build/{dist → esm/src/engine}/graphics/text.d.ts +0 -0
  289. /package/build/{dist → esm/src/engine}/graphics/tiled-animation.d.ts +0 -0
  290. /package/build/{dist → esm/src/engine}/graphics/tiled-sprite.d.ts +0 -0
  291. /package/build/{dist → esm/src/engine}/graphics/transform-interpolation.d.ts +0 -0
  292. /package/build/{dist → esm/src/engine}/graphics/wrapping.d.ts +0 -0
  293. /package/build/{dist → esm/src/engine}/id.d.ts +0 -0
  294. /package/build/{dist → esm/src/engine}/input/capture-pointer-config.d.ts +0 -0
  295. /package/build/{dist → esm/src/engine}/input/input-host.d.ts +0 -0
  296. /package/build/{dist → esm/src/engine}/input/input-mapper.d.ts +0 -0
  297. /package/build/{dist → esm/src/engine}/input/native-pointer-button.d.ts +0 -0
  298. /package/build/{dist → esm/src/engine}/input/pointer-abstraction.d.ts +0 -0
  299. /package/build/{dist → esm/src/engine}/input/pointer-button.d.ts +0 -0
  300. /package/build/{dist → esm/src/engine}/input/pointer-event.d.ts +0 -0
  301. /package/build/{dist → esm/src/engine}/input/pointer-events-to-object-dispatcher.d.ts +0 -0
  302. /package/build/{dist → esm/src/engine}/input/pointer-scope.d.ts +0 -0
  303. /package/build/{dist → esm/src/engine}/input/pointer-type.d.ts +0 -0
  304. /package/build/{dist → esm/src/engine}/input/wheel-delta-mode.d.ts +0 -0
  305. /package/build/{dist → esm/src/engine}/input/wheel-event.d.ts +0 -0
  306. /package/build/{dist → esm/src/engine}/interfaces/clonable.d.ts +0 -0
  307. /package/build/{dist → esm/src/engine}/interfaces/evented.d.ts +0 -0
  308. /package/build/{dist → esm/src/engine}/interfaces/lifecycle-events.d.ts +0 -0
  309. /package/build/{dist → esm/src/engine}/interfaces/loadable.d.ts +0 -0
  310. /package/build/{dist → esm/src/engine}/interfaces/pointer-event-handlers.d.ts +0 -0
  311. /package/build/{dist → esm/src/engine}/math/bezier-curve.d.ts +0 -0
  312. /package/build/{dist → esm/src/engine}/math/easings.d.ts +0 -0
  313. /package/build/{dist → esm/src/engine}/math/global-coordinates.d.ts +0 -0
  314. /package/build/{dist → esm/src/engine}/math/lerp.d.ts +0 -0
  315. /package/build/{dist → esm/src/engine}/math/projection.d.ts +0 -0
  316. /package/build/{dist → esm/src/engine}/math/random.d.ts +0 -0
  317. /package/build/{dist → esm/src/engine}/math/rotation-type.d.ts +0 -0
  318. /package/build/{dist → esm/src/engine}/math/util.d.ts +0 -0
  319. /package/build/{dist → esm/src/engine}/math/vector-view.d.ts +0 -0
  320. /package/build/{dist → esm/src/engine}/math/watch-vector.d.ts +0 -0
  321. /package/build/{dist → esm/src/engine}/particles/emitter-type.d.ts +0 -0
  322. /package/build/{dist → esm/src/engine}/particles/gpu-particle-renderer.d.ts +0 -0
  323. /package/build/{dist → esm/src/engine}/particles/index.d.ts +0 -0
  324. /package/build/{dist → esm/src/engine}/polyfill.d.ts +0 -0
  325. /package/build/{dist → esm/src/engine}/resources/font.d.ts +0 -0
  326. /package/build/{dist → esm/src/engine}/resources/gif.d.ts +0 -0
  327. /package/build/{dist → esm/src/engine}/resources/index.d.ts +0 -0
  328. /package/build/{dist → esm/src/engine}/resources/sound/audio-context.d.ts +0 -0
  329. /package/build/{dist → esm/src/engine}/tile-map/index.d.ts +0 -0
  330. /package/build/{dist → esm/src/engine}/trigger.d.ts +0 -0
  331. /package/build/{dist → esm/src/engine}/util/assert.d.ts +0 -0
  332. /package/build/{dist → esm/src/engine}/util/clock.d.ts +0 -0
  333. /package/build/{dist → esm/src/engine}/util/coroutine.d.ts +0 -0
  334. /package/build/{dist → esm/src/engine}/util/fps.d.ts +0 -0
  335. /package/build/{dist → esm/src/engine}/util/future.d.ts +0 -0
  336. /package/build/{dist → esm/src/engine}/util/iframe.d.ts +0 -0
  337. /package/build/{dist → esm/src/engine}/util/log.d.ts +0 -0
  338. /package/build/{dist → esm/src/engine}/util/observable.d.ts +0 -0
  339. /package/build/{dist → esm/src/engine}/util/required.d.ts +0 -0
  340. /package/build/{dist → esm/src/engine}/util/semaphore.d.ts +0 -0
  341. /package/build/{dist → esm/src/engine}/util/string.d.ts +0 -0
  342. /package/build/{dist → esm/src/engine}/util/toaster.d.ts +0 -0
  343. /package/build/{dist → esm/src/engine}/util/util.d.ts +0 -0
  344. /package/build/{dist → esm/src/engine}/util/watch.d.ts +0 -0
  345. /package/build/{dist → esm/src/engine}/util/web-audio.d.ts +0 -0
@@ -1,102 +0,0 @@
1
- import { Color } from '../../color';
2
- import type { ExcaliburGraphicsContext } from './excalibur-graphics-context';
3
- import type { Shader, UniformDictionary } from './shader';
4
- import type { ImageSource } from '../image-source';
5
- import type { ImageFiltering } from '../filtering';
6
- export interface MaterialOptions {
7
- /**
8
- * Name the material for debugging
9
- */
10
- name?: string;
11
- /**
12
- * Excalibur graphics context to create the material (only WebGL is supported at the moment)
13
- */
14
- graphicsContext?: ExcaliburGraphicsContext;
15
- /**
16
- * Optionally specify a vertex shader
17
- *
18
- * If none supplied the default will be used
19
- *
20
- * ```
21
- * #version 300 es
22
- * // vertex position in local space
23
- * in vec2 a_position;
24
- * in vec2 a_uv;
25
- * out vec2 v_uv;
26
- * // orthographic projection matrix
27
- * uniform mat4 u_matrix;
28
- * // world space transform matrix
29
- * uniform mat4 u_transform;
30
- * void main() {
31
- * // Set the vertex position using the ortho & transform matrix
32
- * gl_Position = u_matrix * u_transform * vec4(a_position, 0.0, 1.0);
33
- * // Pass through the UV coord to the fragment shader
34
- * v_uv = a_uv;
35
- * }
36
- * ```
37
- */
38
- vertexSource?: string;
39
- /**
40
- * Add custom fragment shader
41
- *
42
- * *Note: Excalibur image alpha's are pre-multiplied
43
- *
44
- * Pre-built varyings:
45
- *
46
- * * `in vec2 v_uv` - UV coordinate
47
- * * `in vec2 v_screenuv` - UV coordinate
48
- *
49
- * Pre-built uniforms:
50
- *
51
- * * `uniform sampler2D u_graphic` - The current graphic displayed by the GraphicsComponent
52
- * * `uniform vec2 u_resolution` - The current resolution of the screen
53
- * * `uniform vec2 u_size;` - The current size of the graphic
54
- * * `uniform vec4 u_color` - The current color of the material
55
- * * `uniform float u_opacity` - The current opacity of the graphics context
56
- *
57
- */
58
- fragmentSource: string;
59
- /**
60
- * Add custom color, by default ex.Color.Transparent
61
- */
62
- color?: Color;
63
- /**
64
- * Add additional images to the material, you are limited by the GPU's maximum texture slots
65
- *
66
- * Specify a dictionary of uniform sampler names to ImageSource
67
- */
68
- images?: Record<string, ImageSource>;
69
- /**
70
- * Optionally set starting uniforms on a shader
71
- */
72
- uniforms?: UniformDictionary;
73
- }
74
- export interface MaterialImageOptions {
75
- filtering?: ImageFiltering;
76
- }
77
- export declare class Material {
78
- static BuiltInUniforms: string[];
79
- private _logger;
80
- private _name;
81
- private _shader;
82
- private _color;
83
- private _initialized;
84
- private _fragmentSource;
85
- private _vertexSource;
86
- private _images;
87
- private _uniforms;
88
- constructor(options: MaterialOptions);
89
- private _initialize;
90
- get uniforms(): UniformDictionary;
91
- get images(): Record<string, ImageSource>;
92
- get color(): Color;
93
- set color(c: Color);
94
- get name(): string;
95
- get isUsingScreenTexture(): boolean;
96
- get isOverridingGraphic(): boolean;
97
- update(callback: (shader: Shader) => any): void;
98
- getShader(): Shader | null;
99
- addImageSource(samplerName: string, image: ImageSource): void;
100
- removeImageSource(samplerName: string): void;
101
- use(): void;
102
- }
@@ -1,7 +0,0 @@
1
- export declare class RenderSource {
2
- private _gl;
3
- private _texture;
4
- constructor(_gl: WebGLRenderingContext, _texture: WebGLTexture);
5
- use(): void;
6
- disable(): void;
7
- }
@@ -1,60 +0,0 @@
1
- import { RenderSource } from './render-source';
2
- declare global {
3
- interface WebGL2RenderingContext {
4
- /**
5
- * Experimental only in chrome
6
- */
7
- drawingBufferFormat?: number;
8
- }
9
- }
10
- export interface RenderTargetOptions {
11
- gl: WebGL2RenderingContext;
12
- width: number;
13
- height: number;
14
- transparency: boolean;
15
- /**
16
- * Optionally enable render buffer multisample anti-aliasing
17
- *
18
- * By default false
19
- */
20
- antialias?: boolean;
21
- /**
22
- * Optionally specify number of anti-aliasing samples to use
23
- *
24
- * By default the max for the platform is used if antialias is on.
25
- */
26
- samples?: number;
27
- }
28
- export declare class RenderTarget {
29
- width: number;
30
- height: number;
31
- transparency: boolean;
32
- antialias: boolean;
33
- samples: number;
34
- private _gl;
35
- readonly bufferFormat: number;
36
- constructor(options: RenderTargetOptions);
37
- setResolution(width: number, height: number): void;
38
- private _renderBuffer;
39
- get renderBuffer(): WebGLRenderbuffer;
40
- private _renderFrameBuffer;
41
- get renderFrameBuffer(): WebGLFramebuffer;
42
- private _frameBuffer;
43
- get frameBuffer(): WebGLFramebuffer;
44
- private _frameTexture;
45
- get frameTexture(): WebGLTexture;
46
- private _setupRenderBuffer;
47
- private _setupFramebuffer;
48
- toRenderSource(): RenderSource;
49
- blitToScreen(): void;
50
- blitRenderBufferToFrameBuffer(): void;
51
- copyToTexture(texture: WebGLTexture): void;
52
- /**
53
- * When called, all drawing gets redirected to this render target
54
- */
55
- use(): void;
56
- /**
57
- * When called, all drawing is sent back to the canvas
58
- */
59
- disable(): void;
60
- }
@@ -1,36 +0,0 @@
1
- import type { VertexLayout } from '../context/vertex-layout';
2
- import type { Shader } from '../context/shader';
3
- import type { ExcaliburGraphicsContextWebGL } from '../context/excalibur-graphics-context-webgl';
4
- /**
5
- * PostProcessors can be used to apply a shader to the entire screen. It is recommended
6
- * you use the {@apilink ScreenShader} to build your post processor shader.
7
- *
8
- * The screen texture comes through as this uniform
9
- *
10
- * `uniform sampler2D u_image`
11
- *
12
- * Post processor shaders get some default uniforms passed to them
13
- *
14
- * `uniform float u_time_ms` - total playback time in milliseconds
15
- * `uniform float u_elapsed_ms` - the elapsed time from the last frame in milliseconds
16
- * `uniform vec2 u_resolution` - the resolution of the canvas (in pixels)
17
- *
18
- * Custom uniforms can be updated in the {@apilink PostProcessor.onUpdate}
19
- */
20
- export interface PostProcessor {
21
- initialize(graphicsContext: ExcaliburGraphicsContextWebGL): void;
22
- getShader(): Shader;
23
- getLayout(): VertexLayout;
24
- /**
25
- * Use the onUpdate hook to update any uniforms in the postprocessors shader
26
- *
27
- * The shader has already been bound so there is no need to call shader.use();
28
- * @param elapsed
29
- */
30
- onUpdate?(elapsed: number): void;
31
- /**
32
- * Use the onDraw hook to upload any textures or command that need to run right before draw
33
- * @param elapsed
34
- */
35
- onDraw?(): void;
36
- }
@@ -1,25 +0,0 @@
1
- import type { Audio } from './audio';
2
- export type ExResponseType = '' | 'arraybuffer' | 'blob' | 'document' | 'json' | 'text';
3
- export interface ExResponseTypesLookup {
4
- [name: string]: ExResponseType;
5
- }
6
- export declare class ExResponse {
7
- static type: ExResponseTypesLookup;
8
- }
9
- /**
10
- * Represents an audio implementation like {@apilink WebAudioInstance}
11
- */
12
- export interface AudioImplementation {
13
- /**
14
- * XHR response type
15
- */
16
- responseType: ExResponseType;
17
- /**
18
- * Processes raw data and transforms into sound data
19
- */
20
- processData(data: Blob | ArrayBuffer): Promise<string | AudioBuffer>;
21
- /**
22
- * Factory method that returns an instance of a played audio track
23
- */
24
- createInstance(data: string | AudioBuffer): Audio;
25
- }
@@ -1,55 +0,0 @@
1
- /**
2
- * Represents an audio control implementation
3
- */
4
- export interface Audio {
5
- /**
6
- * Whether the audio should loop (repeat forever)
7
- */
8
- loop: boolean;
9
- /**
10
- * The volume (between 0 and 1)
11
- */
12
- volume: number;
13
- /**
14
- * Set the playbackRate, default is 1.0 at normal speed.
15
- * For example 2.0 is double speed, and 0.5 is half speed.
16
- */
17
- playbackRate: number;
18
- /**
19
- * Whether or not any audio is playing
20
- */
21
- isPlaying(): boolean;
22
- /**
23
- * Returns if the audio is paused
24
- */
25
- isPaused(): boolean;
26
- /**
27
- * Returns if the audio is stopped
28
- */
29
- isStopped(): boolean;
30
- /**
31
- * Will play the sound or resume if paused
32
- */
33
- play(): Promise<any>;
34
- /**
35
- * Seek to a position (in seconds) in the audio
36
- * @param position
37
- */
38
- seek(position: number): void;
39
- /**
40
- * Return the duration of the sound
41
- */
42
- getTotalPlaybackDuration(): number;
43
- /**
44
- * Return the current playback time of the playing track in seconds from the start
45
- */
46
- getPlaybackPosition(): number;
47
- /**
48
- * Pause the sound
49
- */
50
- pause(): void;
51
- /**
52
- * Stop playing the sound and reset
53
- */
54
- stop(): void;
55
- }
@@ -1,15 +0,0 @@
1
- /**
2
- * Enum representing the coordinate plane for the position 2D vector in the {@apilink TransformComponent}
3
- */
4
- export declare enum CoordPlane {
5
- /**
6
- * The world coordinate plane (default) represents world space, any entities drawn with world
7
- * space move when the camera moves.
8
- */
9
- World = "world",
10
- /**
11
- * The screen coordinate plane represents screen space, entities drawn in screen space are pinned
12
- * to screen coordinates ignoring the camera.
13
- */
14
- Screen = "screen"
15
- }
@@ -1,102 +0,0 @@
1
- import { Sound } from './sound';
2
- export type AnyString = {} & string;
3
- export interface ChannelSoundsConfiguration {
4
- sounds: Sound[];
5
- }
6
- export interface SoundConfig<Channel extends string = string> {
7
- sound: Sound;
8
- /**
9
- * Maximum volume for the sound manager to use, all soundManager.play(.5) calls will
10
- */
11
- volume?: number;
12
- /**
13
- *
14
- * You may also add a list of string `channels` to do group operations to sounds at once. For example mute all 'background' sounds.
15
- */
16
- channels?: Channel[];
17
- }
18
- export interface SoundManagerOptions<Channel extends string = string, SoundName extends string = string> {
19
- /**
20
- * Optionally specify the possible channels to avoid typo's
21
- */
22
- channels?: readonly Channel[];
23
- /**
24
- * Optionally set the default maximum volume for all sounds
25
- *
26
- * Default is 1 (100%)
27
- */
28
- volume?: number;
29
- /**
30
- * Optionally set the max `volume` for a `sound` to be when played. All other volume operations will be a fraction of the mix.
31
- *
32
- * You may also add a list of string `channels` to do group operations to sounds at once. For example mute all 'background' sounds.
33
- *
34
- */
35
- sounds: Record<SoundName, Sound | SoundConfig<NoInfer<Channel>>>;
36
- }
37
- export type PossibleChannels<TSoundManagerOptions> = TSoundManagerOptions extends SoundManagerOptions<infer Channels> ? Channels : never;
38
- export type PossibleSounds<TSoundMangerOptions> = TSoundMangerOptions extends SoundManagerOptions ? Extract<keyof TSoundMangerOptions['sounds'], string> : never;
39
- export interface SoundManagerApi {
40
- setVolume(name: string, volume?: number): void;
41
- play(name: string, volume?: number): Promise<void>;
42
- stop(name?: string): void;
43
- mute(name?: string): void;
44
- unmute(name?: string): void;
45
- toggle(name?: string): void;
46
- }
47
- export declare class ChannelCollection<Channel extends string> implements SoundManagerApi {
48
- soundManager: SoundManager<Channel, string>;
49
- constructor(options: SoundManagerOptions<Channel, string>, soundManager: SoundManager<Channel, string>);
50
- stop(name: string): void;
51
- setVolume(name: Channel, volume?: number): void;
52
- play(name: Channel, volume?: number): Promise<void>;
53
- mute(name: Channel): void;
54
- unmute(name: Channel): void;
55
- toggle(name: Channel): void;
56
- }
57
- /**
58
- * Manage Sound volume levels without mutating the original Sound objects
59
- */
60
- export declare class SoundManager<Channel extends string, SoundName extends string> implements SoundManagerApi {
61
- private _channelToConfig;
62
- private _nameToConfig;
63
- private _mix;
64
- _muted: Set<Sound>;
65
- private _all;
66
- private _defaultVolume;
67
- set defaultVolume(volume: number);
68
- get defaultVolume(): number;
69
- channel: ChannelCollection<Channel>;
70
- constructor(options: SoundManagerOptions<Channel, SoundName>);
71
- getSounds(): readonly Sound[];
72
- getSoundsForChannel(channel: Channel | AnyString): readonly Sound[];
73
- _isMuted(sound: Sound): boolean;
74
- _getEffectiveVolume(sound: Sound): number;
75
- play(soundName: SoundName, volume?: number): Promise<void>;
76
- getSound(soundName: SoundName | AnyString): Sound | undefined;
77
- setVolume(soundname: SoundName, volume?: number): void;
78
- /**
79
- * Gets the volumn for a sound
80
- */
81
- getVolume(soundName: SoundName): number;
82
- /**
83
- * Set the maximum volume a sound, if not set assumed to be 1.0 (100% of the source volume)
84
- */
85
- private _setMix;
86
- track(name: SoundName | AnyString, soundOrConfig: Sound | SoundConfig): void;
87
- /**
88
- * Remove the maximum volume for a sound, will be 100% of the source volume
89
- *
90
- * Untracks the Sound in the sound manager
91
- */
92
- untrack(soundName: SoundName): void;
93
- stop(name?: SoundName): void;
94
- mute(name?: SoundName): void;
95
- unmute(name?: SoundName): void;
96
- toggle(name?: SoundName): void;
97
- /**
98
- * Apply a list of channels to a sound instance
99
- */
100
- addChannel(soundName: SoundName | AnyString, channels: Channel[] | AnyString[]): void;
101
- removeChannel(soundName: SoundName | AnyString, channels: Channel[] | AnyString[]): void;
102
- }
@@ -1,215 +0,0 @@
1
- import type { Audio } from '../../interfaces/audio';
2
- import type { Engine } from '../../engine';
3
- import { WebAudioInstance } from './web-audio-instance';
4
- import { NativeSoundEvent, NativeSoundProcessedEvent } from '../../events/media-events';
5
- import type { Loadable } from '../../interfaces/index';
6
- import { Logger } from '../../util/log';
7
- import type { EventKey, Handler, Subscription } from '../../event-emitter';
8
- import { EventEmitter } from '../../event-emitter';
9
- export interface SoundEvents {
10
- volumechange: NativeSoundEvent;
11
- processed: NativeSoundProcessedEvent;
12
- pause: NativeSoundEvent;
13
- stop: NativeSoundEvent;
14
- playbackend: NativeSoundEvent;
15
- resume: NativeSoundEvent;
16
- playbackstart: NativeSoundEvent;
17
- }
18
- export declare const SoundEvents: {
19
- VolumeChange: string;
20
- Processed: string;
21
- Pause: string;
22
- Stop: string;
23
- PlaybackEnd: string;
24
- Resume: string;
25
- PlaybackStart: string;
26
- };
27
- export interface SoundOptions {
28
- /**
29
- * @param paths A list of audio sources (clip.wav, clip.mp3, clip.ogg) for this audio clip. This is done for browser compatibility.
30
- */
31
- paths: string[];
32
- /**
33
- * Optionally bust the cache on load
34
- *
35
- * Default is false
36
- */
37
- bustCache?: boolean;
38
- /**
39
- * [0-1] 0% to 100%
40
- *
41
- * By default 1 (100%)
42
- */
43
- volume?: number;
44
- /**
45
- * Loop infinitely
46
- */
47
- loop?: boolean;
48
- /**
49
- * Multiplyer
50
- *
51
- * By default 1
52
- */
53
- playbackRate?: number;
54
- /**
55
- * Seconds?
56
- *
57
- * By default unset, will play the natural length of the clip
58
- */
59
- duration?: number;
60
- /**
61
- * Advance to a position in the audio clip
62
- */
63
- position?: number;
64
- }
65
- export interface PlayOptions {
66
- /**
67
- * Volume to play between [0, 1]
68
- */
69
- volume?: number;
70
- /**
71
- * Schedule time to play in milliseconds from the audio context origin
72
- *
73
- * Compute using the audio context
74
- *
75
- * ```typescript
76
- * const sound: Sound = ...;
77
- * const oneThousandMillisecondsFromNow = AudioContextFactory.currentTime + 1000;
78
- *
79
- * sound.play({ scheduledStartTime: oneThousandMillisecondsFromNow });
80
- *
81
- * ```
82
- */
83
- scheduledStartTime?: number;
84
- }
85
- /**
86
- * The {@apilink Sound} object allows games built in Excalibur to load audio
87
- * components, from soundtracks to sound effects. {@apilink Sound} is an {@apilink Loadable}
88
- * which means it can be passed to a {@apilink Loader} to pre-load before a game or level.
89
- */
90
- export declare class Sound implements Audio, Loadable<AudioBuffer> {
91
- events: EventEmitter<SoundEvents>;
92
- logger: Logger;
93
- data: AudioBuffer;
94
- private _resource;
95
- position: number | undefined;
96
- /**
97
- * Indicates whether the clip should loop when complete
98
- * @param value Set the looping flag
99
- */
100
- set loop(value: boolean);
101
- get loop(): boolean;
102
- set volume(value: number);
103
- get volume(): number;
104
- private _duration;
105
- /**
106
- * Get the duration that this audio should play. If unset the total natural playback duration will be used.
107
- */
108
- get duration(): number | undefined;
109
- /**
110
- * Set the duration that this audio should play. If unset the total natural playback duration will be used.
111
- *
112
- * Note: if you seek to a specific point the duration will start from that point, for example
113
- *
114
- * If you have a 10 second clip, seek to 5 seconds, then set the duration to 2, it will play the clip from 5-7 seconds.
115
- */
116
- set duration(duration: number | undefined);
117
- /**
118
- * Return array of Current AudioInstances playing or being paused
119
- */
120
- get instances(): Audio[];
121
- get path(): string;
122
- set path(val: string);
123
- /**
124
- * Should excalibur add a cache busting querystring? By default false.
125
- * Must be set before loading
126
- */
127
- get bustCache(): boolean;
128
- set bustCache(val: boolean);
129
- /**
130
- * Schedule time to play in milliseconds from the audio context origin
131
- *
132
- * Compute using the audio context
133
- *
134
- * ```typescript
135
- * const sound: Sound = ...;
136
- * const oneThousandMillisecondsFromNow = AudioContextFactory.currentTime + 1000;
137
- *
138
- * sound.scheduledStartTime = oneThousandMillisecondsFromNow;
139
- *
140
- * ```
141
- */
142
- scheduledStartTime: number;
143
- private _loop;
144
- private _volume;
145
- private _isStopped;
146
- private _tracks;
147
- private _engine?;
148
- private _wasPlayingOnHidden;
149
- private _playbackRate;
150
- private _audioContext;
151
- /**
152
- * @param paths A list of audio sources (clip.wav, clip.mp3, clip.ogg) for this audio clip. This is done for browser compatibility.
153
- */
154
- constructor(options: SoundOptions);
155
- constructor(...paths: string[]);
156
- isLoaded(): boolean;
157
- load(): Promise<AudioBuffer>;
158
- decodeAudio(data: ArrayBuffer): Promise<AudioBuffer>;
159
- wireEngine(engine: Engine): void;
160
- /**
161
- * Returns how many instances of the sound are currently playing
162
- */
163
- instanceCount(): number;
164
- /**
165
- * Whether or not the sound is playing right now
166
- */
167
- isPlaying(): boolean;
168
- isPaused(): boolean;
169
- isStopped(): boolean;
170
- /**
171
- * Play the sound, returns a promise that resolves when the sound is done playing
172
- * An optional volume argument can be passed in to play the sound. Max volume is 1.0
173
- */
174
- play(volumeOrConfig?: number | PlayOptions): Promise<boolean>;
175
- /**
176
- * Stop the sound, and do not rewind
177
- */
178
- pause(): void;
179
- /**
180
- * Stop the sound if it is currently playing and rewind the track. If the sound is not playing, rewinds the track.
181
- */
182
- stop(): void;
183
- get playbackRate(): number;
184
- set playbackRate(playbackRate: number);
185
- seek(position: number, trackId?: number): void;
186
- getTotalPlaybackDuration(): number;
187
- /**
188
- * Return the current playback time of the playing track in seconds from the start.
189
- *
190
- * Optionally specify the track to query if multiple are playing at once.
191
- * @param trackId
192
- */
193
- getPlaybackPosition(trackId?: number): number;
194
- /**
195
- * Get Id of provided AudioInstance in current trackList
196
- * @param track {@apilink Audio} which Id is to be given
197
- */
198
- getTrackId(track: WebAudioInstance): number;
199
- private _resumePlayback;
200
- /**
201
- * Starts playback, returns a promise that resolves when playback is complete
202
- */
203
- private _startPlayback;
204
- private _getTrackInstance;
205
- emit<TEventName extends EventKey<SoundEvents>>(eventName: TEventName, event: SoundEvents[TEventName]): void;
206
- emit(eventName: string, event?: any): void;
207
- on<TEventName extends EventKey<SoundEvents>>(eventName: TEventName, handler: Handler<SoundEvents[TEventName]>): Subscription;
208
- on(eventName: string, handler: Handler<unknown>): Subscription;
209
- once<TEventName extends EventKey<SoundEvents>>(eventName: TEventName, handler: Handler<SoundEvents[TEventName]>): Subscription;
210
- once(eventName: string, handler: Handler<unknown>): Subscription;
211
- off<TEventName extends EventKey<SoundEvents>>(eventName: TEventName, handler: Handler<SoundEvents[TEventName]>): void;
212
- off(eventName: string, handler: Handler<unknown>): void;
213
- off(eventName: string): void;
214
- static fromBlob(blob: Blob): Promise<Sound>;
215
- }
@@ -1,49 +0,0 @@
1
- import type { Audio } from '../../interfaces/audio';
2
- /**
3
- * Internal class representing a Web Audio AudioBufferSourceNode instance
4
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API
5
- */
6
- export declare class WebAudioInstance implements Audio {
7
- private _src;
8
- private _instance;
9
- private _audioContext;
10
- private _volumeNode;
11
- private _playingFuture;
12
- private _stateMachine;
13
- private _createNewBufferSource;
14
- private _handleEnd;
15
- private _volume;
16
- private _loop;
17
- private _playStarted;
18
- set loop(value: boolean);
19
- get loop(): boolean;
20
- set volume(value: number);
21
- get volume(): number;
22
- private _duration;
23
- /**
24
- * Returns the set duration to play, otherwise returns the total duration if unset
25
- */
26
- get duration(): number;
27
- /**
28
- * Set the duration that this audio should play.
29
- *
30
- * Note: if you seek to a specific point the duration will start from that point, for example
31
- *
32
- * If you have a 10 second clip, seek to 5 seconds, then set the duration to 2, it will play the clip from 5-7 seconds.
33
- */
34
- set duration(duration: number);
35
- constructor(_src: AudioBuffer);
36
- isPlaying(): boolean;
37
- isPaused(): boolean;
38
- isStopped(): boolean;
39
- play(playStarted?: () => any): Promise<boolean>;
40
- pause(): void;
41
- stop(): void;
42
- seek(position: number): void;
43
- getTotalPlaybackDuration(): number;
44
- getPlaybackPosition(): number;
45
- private _playbackRate;
46
- set playbackRate(playbackRate: number);
47
- get playbackRate(): number;
48
- scheduledStartTime: number;
49
- }
@@ -1,15 +0,0 @@
1
- /**
2
- * Obsolete decorator options
3
- */
4
- export interface ObsoleteOptions {
5
- message?: string;
6
- alternateMethod?: string;
7
- showStackTrace?: boolean;
8
- }
9
- export declare const maxMessages = 5;
10
- export declare const resetObsoleteCounter: () => void;
11
- /**
12
- * Obsolete decorator for marking Excalibur methods obsolete, you can optionally specify a custom message and/or alternate replacement
13
- * method do the deprecated one. Inspired by https://github.com/jayphelps/core-decorators.js
14
- */
15
- export declare function obsolete(options?: ObsoleteOptions): any;