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
@@ -15,6 +15,7 @@ export interface PointerComponentOptions {
15
15
  * are intersecting the pointer.
16
16
  */
17
17
  export declare class PointerComponent extends Component {
18
+ private static _NAME;
18
19
  /**
19
20
  * Use any existing Collider component geometry for pointer events. This is useful if you want
20
21
  * user pointer events only to trigger on the same collision geometry used in the collider component
@@ -34,6 +34,8 @@ export declare class PointerEventReceiver {
34
34
  events: EventEmitter<PointerEvents>;
35
35
  primary: PointerAbstraction;
36
36
  private _activeNativePointerIdsToNormalized;
37
+ private _freedNormalizedIds;
38
+ private _nextNormalizedId;
37
39
  lastFramePointerCoords: Map<number, GlobalCoordinates>;
38
40
  currentFramePointerCoords: Map<number, GlobalCoordinates>;
39
41
  currentFramePointerDown: Map<number, boolean>;
@@ -44,6 +46,16 @@ export declare class PointerEventReceiver {
44
46
  currentFrameCancel: PointerEvent[];
45
47
  currentFrameWheel: WheelEvent[];
46
48
  private _enabled;
49
+ /**
50
+ * Tracks whether the {@apilink PointerSystem} has already processed (updated and cleared) this
51
+ * receiver during the current frame.
52
+ *
53
+ * This is used by the {@apilink InputHost} to guarantee the receiver's per-frame events are always
54
+ * flushed, even when no {@apilink PointerSystem} is active in the current scene. Without this, removing
55
+ * the PointerSystem would cause the `currentFrame*` arrays to grow unbounded on every native pointer event.
56
+ * @internal
57
+ */
58
+ _processedThisFrame: boolean;
47
59
  constructor(target: GlobalEventHandlers & EventTarget, engine: Engine);
48
60
  toggleEnabled(enabled: boolean): void;
49
61
  /**
@@ -103,6 +115,7 @@ export declare class PointerEventReceiver {
103
115
  * @internal
104
116
  */
105
117
  update(): void;
118
+ private _releaseEndedPointer;
106
119
  /**
107
120
  * Clears the current frame event and pointer data
108
121
  */
@@ -31,11 +31,11 @@ export declare class PointerSystem extends System {
31
31
  */
32
32
  overrideUseGraphicsBounds: boolean;
33
33
  private _scene;
34
- initialize(world: World, scene: Scene): void;
34
+ onInitialize(world: World, scene: Scene): void;
35
35
  private _sortedTransforms;
36
36
  private _sortedEntities;
37
37
  private _zHasChanged;
38
38
  private _zIndexUpdate;
39
- preupdate(): void;
40
- update(): void;
39
+ onPreUpdate(): void;
40
+ onUpdate(): void;
41
41
  }
@@ -1,6 +1,4 @@
1
1
  export type * from './clonable';
2
- export type * from './audio';
3
- export * from './audio-implementation';
4
2
  export type * from './evented';
5
3
  export type * from './loadable';
6
4
  export * from './lifecycle-events';
@@ -4,7 +4,7 @@ import { Vector } from './math/vector';
4
4
  import type { SpriteFont } from './graphics';
5
5
  import { Font } from './graphics/font';
6
6
  import { Actor } from './actor';
7
- import type { ActorArgs } from './actor';
7
+ import type { ActorOptions } from './actor';
8
8
  /**
9
9
  * Option for creating a label
10
10
  */
@@ -65,7 +65,7 @@ export declare class Label extends Actor {
65
65
  * Build a new label
66
66
  * @param options
67
67
  */
68
- constructor(options?: LabelOptions & ActorArgs);
68
+ constructor(options?: LabelOptions & ActorOptions);
69
69
  _initialize(engine: Engine): void;
70
70
  /**
71
71
  * Returns the width of the text in the label (in pixels);
@@ -0,0 +1,47 @@
1
+ import { Component } from '../entity-component-system/component';
2
+ import { Color } from '../color';
3
+ import type { FlickerOptions } from './flicker-options';
4
+ import type { PointLightComponentOptions } from './point-light-component';
5
+ export interface ConeLightComponentOptions extends PointLightComponentOptions {
6
+ /**
7
+ * Radius of the light in world pixels. Default 200
8
+ */
9
+ radius?: number;
10
+ /**
11
+ * Total angle arc of the wedge in radians. Default Math.PI / 3
12
+ */
13
+ angle?: number;
14
+ /**
15
+ * Heading angle in radians relative to the owning entity's world rotation
16
+ * (0 = Right when the entity is unrotated). Default 0
17
+ */
18
+ direction?: number;
19
+ /**
20
+ * Edge smoothing ratio. 0.0 represents hard cuts, 1.0 represents full dissipation. Default 0.25
21
+ */
22
+ softness?: number;
23
+ }
24
+ /**
25
+ * Emits light restricted to a directional angular wedge,
26
+ * cutting through any {@apilink DarknessComponent} veil.
27
+ */
28
+ export declare class ConeLightComponent extends Component {
29
+ private static _NAME;
30
+ color: Color;
31
+ intensity: number;
32
+ radius: number;
33
+ angle: number;
34
+ direction: number;
35
+ softness: number;
36
+ flicker?: FlickerOptions;
37
+ enabled: boolean;
38
+ private _currentIntensity;
39
+ /**
40
+ * Runtime intensity after flicker calculations are applied, written by the {@apilink FlickerSystem}.
41
+ * Until a {@apilink FlickerSystem} writes a value (e.g. a {@apilink LightingSystem} added manually
42
+ * without one), reads track the live {@apilink ConeLightComponent.intensity} value.
43
+ */
44
+ get currentIntensity(): number;
45
+ set currentIntensity(value: number);
46
+ constructor(options?: ConeLightComponentOptions);
47
+ }
@@ -0,0 +1,34 @@
1
+ import { Component } from '../entity-component-system/component';
2
+ import { Color } from '../color';
3
+ export interface DarknessComponentOptions {
4
+ /**
5
+ * Color of the darkness veil. Default rgb(0, 0, 10)
6
+ */
7
+ color?: Color;
8
+ /**
9
+ * Opacity of the darkness veil (0.0 to 1.0). Default 0.85
10
+ */
11
+ intensity?: number;
12
+ /**
13
+ * Width of the darkness boundary in world pixels. Set to Infinity for global coverage. Default Infinity
14
+ */
15
+ width?: number;
16
+ /**
17
+ * Height of the darkness boundary in world pixels. Set to Infinity for global coverage. Default Infinity
18
+ */
19
+ height?: number;
20
+ }
21
+ /**
22
+ * Controls the darkness veil drawn over a scene or room by the {@apilink LightingSystem}.
23
+ *
24
+ * With `width`/`height` of `Infinity` (the default) the veil covers the whole screen. With finite
25
+ * dimensions the veil is a "room" rectangle in world pixels centered on the owning entity's position.
26
+ */
27
+ export declare class DarknessComponent extends Component {
28
+ private static _NAME;
29
+ color: Color;
30
+ intensity: number;
31
+ width: number;
32
+ height: number;
33
+ constructor(options?: DarknessComponentOptions);
34
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Options for light flicker driven by the {@apilink FlickerSystem} using deterministic layered sine waves.
3
+ */
4
+ export interface FlickerOptions {
5
+ /**
6
+ * Frequency of the flicker oscillation in Hz.
7
+ */
8
+ frequency: number;
9
+ /**
10
+ * Maximum deviation from base intensity (0.0 to 1.0).
11
+ */
12
+ amplitude: number;
13
+ /**
14
+ * Optional secondary wave frequency for asymmetrical, organic modulation.
15
+ */
16
+ secondaryFrequency?: number;
17
+ }
@@ -0,0 +1,19 @@
1
+ import { System, SystemType } from '../entity-component-system/system';
2
+ import type { World } from '../entity-component-system/world';
3
+ /**
4
+ * Modulates active light intensities ahead of the lighting render pass
5
+ * utilizing deterministic layered sine waves.
6
+ *
7
+ * Writes {@apilink PointLightComponent.currentIntensity} and {@apilink ConeLightComponent.currentIntensity},
8
+ * so it must run before the {@apilink LightingSystem} rasterizes the frame.
9
+ */
10
+ export declare class FlickerSystem extends System {
11
+ static priority: 0;
12
+ readonly systemType = SystemType.Update;
13
+ private _pointQuery;
14
+ private _coneQuery;
15
+ private _elapsed;
16
+ onInitialize(world: World): void;
17
+ onUpdate(elapsed: number): void;
18
+ private _applyFlicker;
19
+ }
@@ -0,0 +1,8 @@
1
+ export * from './lighting-config';
2
+ export type * from './flicker-options';
3
+ export * from './darkness-component';
4
+ export * from './point-light-component';
5
+ export * from './cone-light-component';
6
+ export * from './light-occluder-component';
7
+ export * from './flicker-system';
8
+ export * from './lighting-system';
@@ -0,0 +1,66 @@
1
+ import { Component } from '../entity-component-system/component';
2
+ import { Vector } from '../math/vector';
3
+ export type OccluderShape = {
4
+ kind: 'box';
5
+ width: number;
6
+ height: number;
7
+ anchor?: Vector;
8
+ } | {
9
+ kind: 'polygon';
10
+ vertices: Vector[];
11
+ } | {
12
+ kind: 'circle';
13
+ radius: number;
14
+ };
15
+ /** A shadow volume silhouette approximated by a closed polygon in screen space */
16
+ export type PolyOccluder = {
17
+ kind: 'poly';
18
+ verts: Vector[];
19
+ };
20
+ /** A shadow volume silhouette approximated by a circle in screen space */
21
+ export type CircleOccluder = {
22
+ kind: 'circle';
23
+ center: Vector;
24
+ radius: number;
25
+ };
26
+ /** World/screen-space occluder geometry consumed by {@apilink LightingSystem} to cast shadows */
27
+ export type Occluder = PolyOccluder | CircleOccluder;
28
+ export interface LightOccluderComponentOptions {
29
+ /**
30
+ * Shape of the occluder, independent of any collider geometry on the entity
31
+ */
32
+ shape: OccluderShape;
33
+ /**
34
+ * When false, skips shadow volume geometry generation for this occluder. Default true
35
+ */
36
+ castShadows?: boolean;
37
+ /**
38
+ * Local space coordinate offset shifting the occluder geometry away from the transform origin. Default Vector.Zero
39
+ */
40
+ offset?: Vector;
41
+ }
42
+ /**
43
+ * Marks an entity as a light-blocking obstacle that projects dynamic shadows in the {@apilink LightingSystem}.
44
+ *
45
+ * Box shapes are centered on the transform origin by default (`anchor: Vector.Half`, matching {@apilink Shape.Box}).
46
+ * Polygon and circle shapes are positioned by their own vertex/center coordinates, same as {@apilink Shape.Polygon}
47
+ * and {@apilink Shape.Circle} — `offset` shifts any shape further from the transform origin in local space.
48
+ */
49
+ export declare class LightOccluderComponent extends Component {
50
+ private static _NAME;
51
+ castShadows: boolean;
52
+ private _shape;
53
+ private _offset;
54
+ private _localVertices;
55
+ constructor(options: LightOccluderComponentOptions);
56
+ get shape(): OccluderShape;
57
+ set shape(shape: OccluderShape);
58
+ get offset(): Vector;
59
+ set offset(offset: Vector);
60
+ clone(): LightOccluderComponent;
61
+ /**
62
+ * Evaluates the bounding shape vertices in local space, factoring in local offsets.
63
+ * Returns an empty array for circular primitives. Cached until `shape` or `offset` are reassigned.
64
+ */
65
+ localVertices(): Vector[];
66
+ }
@@ -0,0 +1,47 @@
1
+ import type { DeepRequired } from '../util/required';
2
+ import type { Color } from '../color';
3
+ /**
4
+ * Lighting simulation configuration, normalized from {@apilink EngineOptions.lighting}
5
+ */
6
+ export interface LightingConfig {
7
+ /**
8
+ * Enables the scene {@apilink LightingSystem} and {@apilink FlickerSystem}. Default false.
9
+ *
10
+ * The lighting overlay is rendered with the 2D Canvas API and re-uploaded to the GPU every frame,
11
+ * which carries a performance penalty — this is why lighting is opt-in.
12
+ */
13
+ enabled: boolean;
14
+ /**
15
+ * The z-index of the provisioned lighting overlay. Default 100.
16
+ *
17
+ * Overridden per-instance by {@apilink LightingSystemOptions.zIndex}.
18
+ */
19
+ zIndex?: number;
20
+ /**
21
+ * World-pixel padding added around the camera frustum when culling lights/occluders. Default 64.
22
+ */
23
+ cullPadding?: number;
24
+ /**
25
+ * Ambient brightness floor (0.0 to 1.0) subtracted from darkness intensity. Default 0.05.
26
+ */
27
+ ambientIntensity?: number;
28
+ /**
29
+ * Ambient light color, blended into any {@apilink DarknessComponent} veil proportional to
30
+ * `ambientIntensity` (e.g. a blue ambient at low intensity produces a moonlit veil). Default `null`,
31
+ * meaning no color tint is applied.
32
+ */
33
+ ambientColor?: Color | null;
34
+ /**
35
+ * Fraction of a light's intensity used when painting its colored tint (0.0 to 1.0). Default 0.35.
36
+ */
37
+ tintAlphaFactor?: number;
38
+ /**
39
+ * Occluder shadow radial gradient opacity at the occluder (near) edge (0.0 to 1.0). Default 0.92.
40
+ */
41
+ shadowNearOpacity?: number;
42
+ /**
43
+ * Occluder shadow radial gradient opacity at 40% of the shadow's reach (0.0 to 1.0). Default 0.6.
44
+ */
45
+ shadowMidOpacity?: number;
46
+ }
47
+ export declare const getDefaultLightingConfig: () => DeepRequired<LightingConfig>;
@@ -0,0 +1,153 @@
1
+ import { System, SystemType } from '../entity-component-system/system';
2
+ import type { World } from '../entity-component-system/world';
3
+ import type { Scene } from '../scene';
4
+ import { Vector } from '../math/vector';
5
+ import { Color } from '../color';
6
+ import { ScreenElement } from '../screen-element';
7
+ export interface LightingSystemOptions {
8
+ /**
9
+ * The z-index of the provisioned lighting overlay. Defaults to 100.
10
+ */
11
+ zIndex?: number;
12
+ /**
13
+ * Fixed anchor screen positioning coordinate. When omitted the overlay is anchored to the
14
+ * top left of the full visible canvas ({@apilink Screen.unsafeArea}) every frame.
15
+ */
16
+ pos?: Vector;
17
+ /**
18
+ * Fixed resolution dimensions. Defaults to tracking the screen {@apilink Screen.resolution} when omitted.
19
+ */
20
+ size?: {
21
+ width: number;
22
+ height: number;
23
+ };
24
+ /**
25
+ * Hook an external ScreenElement host rather than provisioning an independent one.
26
+ * The caller becomes responsible for its position and size.
27
+ */
28
+ screenElement?: ScreenElement;
29
+ /**
30
+ * Overrides {@apilink EngineOptions.lighting}'s `ambientIntensity` for this scene's instance.
31
+ */
32
+ ambientIntensity?: number;
33
+ /**
34
+ * Overrides {@apilink EngineOptions.lighting}'s `ambientColor` for this scene's instance.
35
+ */
36
+ ambientColor?: Color | null;
37
+ }
38
+ /**
39
+ * Composite canvas-driven visibility system tracking ambient, darkness,
40
+ * light masks, and ray projected shadow volumes.
41
+ *
42
+ * Renders via a {@apilink Canvas} graphic on a screen-space {@apilink ScreenElement} named 'lighting'.
43
+ * The raster pipeline per frame: ambient-blended darkness veil → room rect fills/clips → camera frustum
44
+ * cull → per-light destination-out punch (with occluder shadows subtracted) → colored tint passes.
45
+ *
46
+ * Enabled scene-wide via {@apilink EngineOptions.lighting}, or add an instance manually to a scene's world.
47
+ *
48
+ * **Potentially performance impacting** — the overlay is rasterized with the 2D Canvas API and re-uploaded
49
+ * to the GPU every frame.
50
+ *
51
+ * Known limitations: circle occluder radii scale uniformly with `Math.min(scale.x, scale.y)` so a
52
+ * non-uniformly scaled occluder won't cast an elliptical shadow, darkness room rects have no independent
53
+ * rotation of their own (though they do rotate along with the camera), and polygon shadow volumes can
54
+ * split at corners when the silhouette edge is not face on to the light.
55
+ */
56
+ export declare class LightingSystem extends System {
57
+ static priority: number;
58
+ readonly systemType = SystemType.Draw;
59
+ private _options;
60
+ private _engine;
61
+ private _scene;
62
+ private _lightingEntity;
63
+ private _lightingCanvas;
64
+ private _offscreen;
65
+ private _offscreenCtx;
66
+ private _darknessEntries;
67
+ private _pointLights;
68
+ private _coneLights;
69
+ private _occluderEntries;
70
+ private _ambientScratch;
71
+ private _subscriptions;
72
+ constructor(options?: LightingSystemOptions);
73
+ onInitialize(world: World, scene: Scene): void;
74
+ /**
75
+ * Releases everything `initialize` provisioned: unsubscribes the component tracking queries,
76
+ * removes the lighting overlay ScreenElement (when this system created it), and drops the
77
+ * offscreen scratch canvas. Called by the {@apilink SystemManager} when the system is removed,
78
+ * e.g. when `engine.lighting.enabled` is turned off at runtime.
79
+ */
80
+ dispose(_world: World, scene: Scene): void;
81
+ /**
82
+ * Queries `world` for entities with `ctor` + a TransformComponent, seeds `entries` from the
83
+ * initial matches, and wires the query's entityAdded$/entityRemoved$ to keep `entries` in sync
84
+ * as matching entities are added/removed. Shared by all four light-like component trackers below.
85
+ */
86
+ private _wireQuery;
87
+ private _initDarkness;
88
+ private _initPointLights;
89
+ private _initConeLights;
90
+ private _initOccluders;
91
+ private _initCanvas;
92
+ onUpdate(elapsed: number): void;
93
+ /**
94
+ * Writes the scene's effective ambient intensity/color into `dest` (avoids allocating a fresh
95
+ * object every frame).
96
+ */
97
+ private _computeAmbient;
98
+ private _darknessFill;
99
+ private _drawDarknessVeil;
100
+ /**
101
+ * Computes (and caches) a room darkness rect's world bounds and camera-rotated screen quad. Only
102
+ * rebuilds when the room's world position/dimensions or the camera's finalized transform changed
103
+ * since last frame - the screen quad depends on the camera's full transform (which also moves with
104
+ * camera shake and fixed-update interpolation, not just pos/zoom/rotation), so the transform's
105
+ * matrix components are the cache key.
106
+ */
107
+ private _computeRoomClip;
108
+ private _inCameraView;
109
+ /**
110
+ * Computes (once per frame, shared by the erase and tint passes) whether each light in `entries` is
111
+ * enabled and within `cullBounds`, and its screen-space position/radius. Writes into each entry's
112
+ * persistent `screenPos` in place rather than allocating a new Vector.
113
+ */
114
+ private _updateLightVisibility;
115
+ /**
116
+ * Computes (and caches) an occluder's world-space shadow geometry. Only re-projects through the
117
+ * entity's transform when its position/rotation/scale or the component's shape/offset changed
118
+ * since last frame — avoids rebuilding shadow geometry for static occluders every frame.
119
+ */
120
+ private _computeOccluderGeometry;
121
+ /**
122
+ * True when the occluder's world geometry overlaps `bounds` expanded by `expand` on every side.
123
+ * Shadows only matter for occluders within a light's radius, and visible light centers lie within
124
+ * the cull bounds expanded by their own radius - so `expand` of twice the largest visible light
125
+ * radius is conservative.
126
+ */
127
+ private _occluderInRange;
128
+ private _collectOccluders;
129
+ /**
130
+ * Transforms every occluder's (cached, world-space) geometry to screen space once for this frame,
131
+ * so `_drawOccluderShadows` can reuse the same screen-space geometry for every light instead of
132
+ * re-transforming it once per (light, occluder) pair. Also computes a screen-space bounding circle
133
+ * per occluder so the shadow pass can cheaply skip (light, occluder) pairs that are out of range.
134
+ */
135
+ private _collectScreenOccluders;
136
+ private _drawOccluderShadows;
137
+ private _paintPointGradient;
138
+ private _paintConeGradient;
139
+ /**
140
+ * Draws a single light's shape into the offscreen scratch canvas, punches its occluder shadows
141
+ * out of it (destination-out), then punches the scratch out of the darkness veil (lights erase
142
+ * darkness).
143
+ */
144
+ private _drawLight;
145
+ /**
146
+ * Paints the additive colored tint for a non-white light, clipped to its containing room rect
147
+ */
148
+ private _drawColorTint;
149
+ private _drawPointLights;
150
+ private _drawConeLights;
151
+ private _drawColorTints;
152
+ private _renderLightingCanvas;
153
+ }
@@ -0,0 +1,46 @@
1
+ import { Component } from '../entity-component-system/component';
2
+ import { Color } from '../color';
3
+ import type { FlickerOptions } from './flicker-options';
4
+ export interface PointLightComponentOptions {
5
+ /**
6
+ * Color of the light. Non-white colors are painted as an additive tint. Default Color.White
7
+ */
8
+ color?: Color;
9
+ /**
10
+ * Base intensity of the light (0.0 to 1.0). Default 1.0
11
+ */
12
+ intensity?: number;
13
+ /**
14
+ * Radius of the light in world pixels. Default 150
15
+ */
16
+ radius?: number;
17
+ /**
18
+ * Optional flicker animation applied by the {@apilink FlickerSystem}
19
+ */
20
+ flicker?: FlickerOptions;
21
+ /**
22
+ * Default true
23
+ */
24
+ enabled?: boolean;
25
+ }
26
+ /**
27
+ * Emits light uniformly in all directions from the owning entity's position,
28
+ * cutting through any {@apilink DarknessComponent} veil.
29
+ */
30
+ export declare class PointLightComponent extends Component {
31
+ private static _NAME;
32
+ color: Color;
33
+ intensity: number;
34
+ radius: number;
35
+ flicker?: FlickerOptions;
36
+ enabled: boolean;
37
+ private _currentIntensity;
38
+ /**
39
+ * Runtime intensity after flicker calculations are applied, written by the {@apilink FlickerSystem}.
40
+ * Until a {@apilink FlickerSystem} writes a value (e.g. a {@apilink LightingSystem} added manually
41
+ * without one), reads track the live {@apilink PointLightComponent.intensity} value.
42
+ */
43
+ get currentIntensity(): number;
44
+ set currentIntensity(value: number);
45
+ constructor(options?: PointLightComponentOptions);
46
+ }
@@ -1,5 +1,6 @@
1
1
  import { Matrix } from './matrix';
2
2
  import { Vector } from './vector';
3
+ import { Vector3 } from './vector3';
3
4
  export declare class AffineMatrix {
4
5
  /**
5
6
  * | | | |
@@ -8,7 +9,7 @@ export declare class AffineMatrix {
8
9
  * | data[1] | data[3] | data[5] |
9
10
  * | 0 | 0 | 1 |
10
11
  */
11
- data: Float64Array;
12
+ data: Float64Array<ArrayBuffer>;
12
13
  /**
13
14
  * Converts the current matrix into a DOMMatrix
14
15
  *
@@ -61,6 +62,12 @@ export declare class AffineMatrix {
61
62
  * @param target
62
63
  */
63
64
  inverse(target?: AffineMatrix): AffineMatrix;
65
+ /**
66
+ * Multiply the current matrix by a vector producing a new vector
67
+ * @param vector
68
+ * @param dest
69
+ */
70
+ multiply(vector: Vector3, dest?: Vector3): Vector3;
64
71
  /**
65
72
  * Multiply the current matrix by a vector producing a new vector
66
73
  * @param vector
@@ -0,0 +1,52 @@
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 space is rooted at the top-left of the safe {@apilink Screen.contentArea} (the
15
+ * "C-frame"): a `CoordPlane.Screen` entity with `pos = (0, 0)` is drawn at
16
+ * `contentArea.topLeft`, not at the raw canvas corner (the "R-frame"). The engine applies this
17
+ * shift automatically before drawing — see {@apilink Screen.contentAreaOffset}.
18
+ *
19
+ * Under display modes that don't clip ({@apilink DisplayMode.Fixed}, {@apilink DisplayMode.FitScreen},
20
+ * {@apilink DisplayMode.FillScreen}, {@apilink DisplayMode.FitContainer}, {@apilink DisplayMode.FillContainer})
21
+ * `contentAreaOffset = (0, 0)` so the C and R frames coincide. Under
22
+ * {@apilink DisplayMode.FitScreenAndFill} / {@apilink DisplayMode.FitContainerAndFill} /
23
+ * {@apilink DisplayMode.FitScreenAndZoom} / {@apilink DisplayMode.FitContainerAndZoom}, the
24
+ * C-frame is shifted into the safe area.
25
+ *
26
+ * ```
27
+ * World (infinite, camera) Screen (CoordPlane.Screen, C) Canvas / resolution (R)
28
+ *
29
+ * + + +
30
+ * | camera moves this | (0,0) = contentArea.topLeft | (0,0) = canvas top-left
31
+ * | | shifts into the safe area | raw canvas corner
32
+ * | | on *AndFill / *AndZoom |
33
+ * v v v
34
+ * +----------- contentW -----------+ +----------- resolutionW -------------------+
35
+ * worldToScreen(): | | | | | |
36
+ * camera.transform | contentArea | | unsafe | contentArea | unsafe |
37
+ * - contentAreaOffset ========> | (CoordPlane.Screen) | <== | (clip) | (R span) | (clip) |
38
+ * | | | | | |
39
+ * screenToWorld(): +-------------------------------_+ +-------------------------------------------+
40
+ * camera.inverse
41
+ * + contentAreaOffset
42
+ *
43
+ * contentAreaOffset = (clip|0, clip|0) on the *AndFill / *AndZoom horizontal-clip axis;
44
+ * (0, 0) under Fixed/FitScreen/FillScreen/FitContainer/FillContainer.
45
+ * ```
46
+ *
47
+ * Use {@apilink Screen.worldToScreenCoordinates}, {@apilink Screen.screenToWorldCoordinates},
48
+ * {@apilink Screen.pageToScreenCoordinates} and {@apilink Screen.screenToPageCoordinates}
49
+ * to convert between frames — they perform the offset and camera math for you.
50
+ */
51
+ Screen = "screen"
52
+ }
@@ -178,8 +178,7 @@ export declare class Graph<T> {
178
178
  * This method calculates the shortest path from the specified start node to the
179
179
  * specified end node in the graph. It returns an object containing the path and
180
180
  * the total distance of the path.
181
- * @param startNode - The node from which the search for the shortest path begins.
182
- * @param endNode - The node where the search for the shortest path ends.
181
+ * @param sourcenode - The node from which the search for the shortest path begins.
183
182
  * @returns An object containing:
184
183
  * - `path`: An array of nodes representing the shortest path from startNode to endNode.
185
184
  * If no path is found, this will be `null`.
@@ -249,7 +248,7 @@ export declare class Edge<T> {
249
248
  get source(): Node<T>;
250
249
  get target(): Node<T>;
251
250
  get weight(): number;
252
- get partnerEdge(): Edge<T>;
251
+ get partnerEdge(): Edge<T> | null;
253
252
  }
254
253
  /**
255
254
  * Represents a node in a graph, with a unique identifier and optional data.
@@ -15,3 +15,5 @@ export * from './util';
15
15
  export * from './rotation-type';
16
16
  export * from './graph';
17
17
  export * from './easings';
18
+ export * from './vector3';
19
+ export * from './vector4';
@@ -60,7 +60,7 @@ export declare class LineSegment {
60
60
  * @param sideVector Vector that traces the line
61
61
  * @param length Length to clip along side
62
62
  */
63
- clip(sideVector: Vector, length: number, normalize?: boolean): LineSegment;
63
+ clip(sideVector: Vector, length: number, normalize?: boolean): LineSegment | null;
64
64
  /**
65
65
  * Find the perpendicular distance from the line to a point
66
66
  * https://en.wikipedia.org/wiki/Distance_from_a_point_to_a_line