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,8 +1,9 @@
1
- import type { ExcaliburGraphicsContext, LineGraphicsOptions, PointGraphicsOptions, ExcaliburGraphicsContextOptions, DebugDraw, HTMLImageSource } from './excalibur-graphics-context';
1
+ import type { ExcaliburGraphicsContext, LineGraphicsOptions, PointGraphicsOptions, ExcaliburGraphicsContextOptions, DebugDraw, DebugTextOptions, HTMLImageSource } from './excalibur-graphics-context';
2
2
  import type { Vector } from '../../math/vector';
3
3
  import { Color } from '../../color';
4
4
  import type { Resolution } from '../../screen';
5
5
  import type { PostProcessor } from '../post-processor/post-processor';
6
+ import type { RendererPlugin } from './renderer';
6
7
  import { AffineMatrix } from '../../math/affine-matrix';
7
8
  import type { Material, MaterialOptions } from './material';
8
9
  declare class ExcaliburGraphicsContext2DCanvasDebug implements DebugDraw {
@@ -20,17 +21,22 @@ declare class ExcaliburGraphicsContext2DCanvasDebug implements DebugDraw {
20
21
  drawLine(start: Vector, end: Vector, lineOptions?: LineGraphicsOptions): void;
21
22
  drawPoint(point: Vector, pointOptions?: PointGraphicsOptions): void;
22
23
  drawCircle(pos: Vector, radius: number, color: Color, stroke?: Color, thickness?: number): void;
23
- drawText(text: string, pos: Vector): void;
24
+ drawText(text: string, pos: Vector, options?: DebugTextOptions): void;
25
+ measureText(text: string, scale?: number): {
26
+ width: number;
27
+ height: number;
28
+ };
24
29
  }
25
30
  export interface ExcaliburGraphicsContext2DOptions extends ExcaliburGraphicsContextOptions {
26
31
  context?: CanvasRenderingContext2D;
27
32
  }
28
33
  export declare class ExcaliburGraphicsContext2DCanvas implements ExcaliburGraphicsContext {
34
+ private _ctx;
29
35
  /**
30
36
  * Meant for internal use only. Access the internal context at your own risk and no guarantees this will exist in the future.
31
37
  * @internal
32
38
  */
33
- __ctx: CanvasRenderingContext2D;
39
+ get __ctx(): CanvasRenderingContext2D;
34
40
  get width(): number;
35
41
  get height(): number;
36
42
  /**
@@ -102,6 +108,10 @@ export declare class ExcaliburGraphicsContext2DCanvas implements ExcaliburGraphi
102
108
  removePostProcessor(_postprocessor: PostProcessor): void;
103
109
  clearPostProcessors(): void;
104
110
  updatePostProcessors(elapsed: number): void;
111
+ register<T extends RendererPlugin>(_renderer: T): void;
112
+ lazyRegister<TRenderer extends RendererPlugin>(_type: TRenderer['type'], _renderer: () => TRenderer): void;
113
+ get(_rendererName: string): RendererPlugin | null;
114
+ draw<TRenderer extends RendererPlugin>(_rendererName: TRenderer['type'], ..._args: Parameters<TRenderer['draw']>): void;
105
115
  beginDrawLifecycle(): void;
106
116
  endDrawLifecycle(): void;
107
117
  set material(material: Material | undefined | null);
@@ -1,15 +1,17 @@
1
- import type { ExcaliburGraphicsContext, LineGraphicsOptions, RectGraphicsOptions, PointGraphicsOptions, ExcaliburGraphicsContextOptions, DebugDraw, HTMLImageSource } from './excalibur-graphics-context';
1
+ import type { ExcaliburGraphicsContext, LineGraphicsOptions, RectGraphicsOptions, PointGraphicsOptions, ExcaliburGraphicsContextOptions, DebugDraw, DebugTextOptions, HTMLImageSource } from './excalibur-graphics-context';
2
2
  import { Matrix } from '../../math/matrix';
3
3
  import { TransformStack } from './transform-stack';
4
4
  import type { Vector } from '../../math/vector';
5
5
  import { Color } from '../../color';
6
6
  import { StateStack } from './state-stack';
7
7
  import type { Resolution } from '../../screen';
8
+ import { Framebuffer } from './framebuffer';
9
+ import { VertexBuffer } from './vertex-buffer';
8
10
  import type { PostProcessor } from '../post-processor/post-processor';
9
11
  import { TextureLoader } from './texture-loader';
10
12
  import type { RendererPlugin } from './renderer';
11
13
  import type { AffineMatrix } from '../../math/affine-matrix';
12
- import type { MaterialOptions } from './material';
14
+ import type { MaterialOptionsWithoutContext } from './material';
13
15
  import { Material } from './material';
14
16
  import type { ShaderOptions } from './shader';
15
17
  import { Shader } from './shader';
@@ -57,7 +59,11 @@ declare class ExcaliburGraphicsContextWebGLDebug implements DebugDraw {
57
59
  *
58
60
  * Debugging draws are independent of scale/zoom
59
61
  */
60
- drawText(text: string, pos: Vector): void;
62
+ drawText(text: string, pos: Vector, options?: DebugTextOptions): void;
63
+ measureText(text: string, scale?: number): {
64
+ width: number;
65
+ height: number;
66
+ };
61
67
  }
62
68
  export interface WebGLGraphicsContextInfo {
63
69
  transform: TransformStack;
@@ -85,8 +91,9 @@ export declare class ExcaliburGraphicsContextWebGL implements ExcaliburGraphicsC
85
91
  private _drawCallIndex;
86
92
  private _drawCalls;
87
93
  private _renderTarget;
88
- private _msaaTarget;
94
+ private _msaaTarget?;
89
95
  private _postProcessTargets;
96
+ private _drawTarget;
90
97
  private _screenRenderer;
91
98
  private _postprocessors;
92
99
  /**
@@ -116,7 +123,10 @@ export declare class ExcaliburGraphicsContextWebGL implements ExcaliburGraphicsC
116
123
  uvPadding: number;
117
124
  backgroundColor: Color;
118
125
  textureLoader: TextureLoader;
126
+ private _materials;
119
127
  materialScreenTexture: WebGLTexture | null;
128
+ private _onGraphicsPreInitialize?;
129
+ private _onGraphicsPostInitialize?;
120
130
  get z(): number;
121
131
  set z(value: number);
122
132
  get opacity(): number;
@@ -126,6 +136,20 @@ export declare class ExcaliburGraphicsContextWebGL implements ExcaliburGraphicsC
126
136
  get width(): number;
127
137
  get height(): number;
128
138
  get ortho(): Matrix;
139
+ /**
140
+ * The {@apilink Framebuffer} the current frame is being drawn into.
141
+ *
142
+ * Useful as an explicit destination when compositing custom shader passes into the frame,
143
+ * for example `pass.draw(myFramebuffer, ctx.drawTarget)`.
144
+ */
145
+ get drawTarget(): Framebuffer;
146
+ private _screenQuadBuffer;
147
+ /**
148
+ * Shared static clip-space quad (interleaved [x, y, u, v] * 6 vertices) used by every
149
+ * {@apilink ShaderPass} on this context, meant for internal use only.
150
+ * @internal
151
+ */
152
+ get __screenQuadBuffer(): VertexBuffer;
129
153
  /**
130
154
  * Checks the underlying webgl implementation if the requested internal resolution is supported
131
155
  * @param dim
@@ -141,7 +165,7 @@ export declare class ExcaliburGraphicsContextWebGL implements ExcaliburGraphicsC
141
165
  private _init;
142
166
  register<T extends RendererPlugin>(renderer: T): void;
143
167
  lazyRegister<TRenderer extends RendererPlugin>(type: TRenderer['type'], renderer: () => TRenderer): void;
144
- get(rendererName: string): RendererPlugin | undefined;
168
+ get(rendererName: string): RendererPlugin | null;
145
169
  private _currentRenderer;
146
170
  private _isCurrentRenderer;
147
171
  beginDrawLifecycle(): void;
@@ -175,12 +199,25 @@ export declare class ExcaliburGraphicsContextWebGL implements ExcaliburGraphicsC
175
199
  updatePostProcessors(elapsed: number): void;
176
200
  set material(material: Material | null | undefined);
177
201
  get material(): Material | null | undefined;
202
+ /**
203
+ * Registers a material with this context so it can be enumerated with {@apilink ExcaliburGraphicsContextWebGL.materials},
204
+ * called automatically by the {@apilink Material} constructor.
205
+ *
206
+ * Materials are held weakly and do not prevent garbage collection.
207
+ */
208
+ registerMaterial(material: Material): void;
209
+ /**
210
+ * Returns all live materials created against this context, useful for debugging and tooling.
211
+ *
212
+ * Materials are held weakly; materials that have been garbage collected are pruned on access.
213
+ */
214
+ get materials(): Material[];
178
215
  /**
179
216
  * Creates and initializes the material which compiles the internal shader
180
217
  * @param options
181
218
  * @returns Material
182
219
  */
183
- createMaterial(options: Omit<MaterialOptions, 'graphicsContext'>): Material;
220
+ createMaterial(options: MaterialOptionsWithoutContext): Material;
184
221
  createShader(options: Omit<ShaderOptions, 'graphicsContext'>): Shader;
185
222
  clear(): void;
186
223
  /**
@@ -4,6 +4,7 @@ import type { Resolution } from '../../screen';
4
4
  import type { PostProcessor } from '../post-processor/post-processor';
5
5
  import type { AffineMatrix } from '../../math/affine-matrix';
6
6
  import type { Material, MaterialOptions } from './material';
7
+ import type { RendererPlugin } from './renderer';
7
8
  import { ImageFiltering } from '../filtering';
8
9
  export type HTMLImageSource = HTMLImageElement | HTMLCanvasElement;
9
10
  export interface AntialiasOptions {
@@ -104,6 +105,43 @@ export interface ExcaliburGraphicsContextOptions {
104
105
  * Feature flag that enables draw sorting will removed in v0.29
105
106
  */
106
107
  useDrawSorting?: boolean;
108
+ /**
109
+ * Hook called before the graphics context is configured. Use to modify options before
110
+ * the WebGL context is created. Called at the start of the constructor.
111
+ *
112
+ * Called internally by Excalibur to forward plugin hooks.
113
+ * @param context The graphics context being constructed
114
+ * @param options The graphics context options (mutable)
115
+ * @internal
116
+ */
117
+ onGraphicsPreConfig?: (context: ExcaliburGraphicsContext, options: ExcaliburGraphicsContextOptions) => void;
118
+ /**
119
+ * Hook called after the graphics context is configured but before initialization.
120
+ * Called after the WebGL context is created and configuration properties are set.
121
+ *
122
+ * Called internally by Excalibur to forward plugin hooks.
123
+ * @param context The graphics context being constructed
124
+ * @param options The graphics context options
125
+ * @internal
126
+ */
127
+ onGraphicsPostConfig?: (context: ExcaliburGraphicsContext, options: ExcaliburGraphicsContextOptions) => void;
128
+ /**
129
+ * Hook called before the graphics context's internal initialization (renderers, render targets).
130
+ *
131
+ * Called internally by Excalibur to forward plugin hooks.
132
+ * @param context The graphics context being initialized
133
+ * @internal
134
+ */
135
+ onGraphicsPreInitialize?: (context: ExcaliburGraphicsContext) => void;
136
+ /**
137
+ * Hook called after the graphics context's internal initialization is complete.
138
+ * This is where plugins typically register custom renderers and post-processors.
139
+ *
140
+ * Called internally by Excalibur to forward plugin hooks.
141
+ * @param context The initialized graphics context
142
+ * @internal
143
+ */
144
+ onGraphicsPostInitialize?: (context: ExcaliburGraphicsContext) => void;
107
145
  }
108
146
  export interface ExcaliburGraphicsContextState {
109
147
  opacity: number;
@@ -158,11 +196,33 @@ export interface DebugDraw {
158
196
  */
159
197
  drawCircle(pos: Vector, radius: number, color: Color, stroke?: Color, thickness?: number): void;
160
198
  /**
161
- * Draw debug text
162
- * @param text
163
- * @param pos
199
+ * Debug text styling options
164
200
  */
165
- drawText(text: string, pos: Vector): void;
201
+ drawText(text: string, pos: Vector, options?: DebugTextOptions): void;
202
+ /**
203
+ * Measure the pixel dimensions of debug text as it would be drawn by {@apilink DebugDraw.drawText},
204
+ * accounting for the optional scale factor. Useful for sizing UI around debug labels.
205
+ * @param text Text to measure
206
+ * @param scale Glyph scale factor, defaults to 1
207
+ */
208
+ measureText(text: string, scale?: number): {
209
+ width: number;
210
+ height: number;
211
+ };
212
+ }
213
+ export interface DebugTextOptions {
214
+ /**
215
+ * Optional foreground color override for the debug text
216
+ */
217
+ foreground?: Color;
218
+ /**
219
+ * Optional background color drawn behind the debug text
220
+ */
221
+ background?: Color;
222
+ /**
223
+ * Optional scale factor applied to the debug text glyphs, defaults to 1
224
+ */
225
+ scale?: number;
166
226
  }
167
227
  export interface ExcaliburGraphicsContext {
168
228
  width: number;
@@ -312,6 +372,50 @@ export interface ExcaliburGraphicsContext {
312
372
  * @internal
313
373
  */
314
374
  updatePostProcessors(elapsed: number): void;
375
+ /**
376
+ * Register a custom renderer plugin with the graphics context.
377
+ *
378
+ * The renderer is immediately initialized with the WebGL context.
379
+ * Use this for renderers that should always be available.
380
+ *
381
+ * In the Canvas 2D fallback context this is a no-op.
382
+ * @param renderer The renderer plugin to register
383
+ */
384
+ register<T extends RendererPlugin>(renderer: T): void;
385
+ /**
386
+ * Lazily register a custom renderer plugin with the graphics context.
387
+ *
388
+ * The renderer factory is stored and only instantiated the first time it is
389
+ * requested via {@apilink ExcaliburGraphicsContext.get}. Use this for renderers
390
+ * that may not be needed in every game to avoid unnecessary initialization cost.
391
+ *
392
+ * In the Canvas 2D fallback context this is a no-op.
393
+ * @param type The unique renderer type name (matches {@apilink RendererPlugin.type})
394
+ * @param renderer A factory function that creates the renderer
395
+ */
396
+ lazyRegister<TRenderer extends RendererPlugin>(type: TRenderer['type'], renderer: () => TRenderer): void;
397
+ /**
398
+ * Look up a registered renderer plugin by its type name.
399
+ *
400
+ * If the renderer was lazily registered, it will be instantiated and initialized
401
+ * on first access.
402
+ *
403
+ * @param rendererName The unique renderer type name
404
+ * @returns The renderer plugin, or `null` if not found
405
+ */
406
+ get(rendererName: string): RendererPlugin | null;
407
+ /**
408
+ * Issue a draw command to a named renderer plugin.
409
+ *
410
+ * The renderer is looked up by name (auto-instantiating lazy renderers) and its
411
+ * `draw()` method is called with the provided arguments. Draw calls are sorted
412
+ * by z-index and renderer priority before flushing.
413
+ *
414
+ * In the Canvas 2D fallback context this is a no-op.
415
+ * @param rendererName The unique renderer type name to draw with
416
+ * @param args Arguments forwarded to the renderer's `draw()` method
417
+ */
418
+ draw<TRenderer extends RendererPlugin>(rendererName: TRenderer['type'], ...args: Parameters<TRenderer['draw']>): void;
315
419
  /**
316
420
  * Gets or sets the material to be used in the current context's drawings
317
421
  *
@@ -0,0 +1,154 @@
1
+ import type { Color } from '../../color';
2
+ import { ImageFiltering } from '../filtering';
3
+ import type { ImageWrapConfiguration } from '../image-source';
4
+ import { ImageWrapping } from '../wrapping';
5
+ import type { ExcaliburGraphicsContextWebGL } from './excalibur-graphics-context-webgl';
6
+ declare global {
7
+ interface WebGL2RenderingContext {
8
+ /**
9
+ * Experimental only in chrome
10
+ */
11
+ drawingBufferFormat?: number;
12
+ }
13
+ }
14
+ export interface FramebufferOptions {
15
+ graphicsContext: ExcaliburGraphicsContextWebGL;
16
+ width: number;
17
+ height: number;
18
+ /**
19
+ * How this framebuffer's texture is sampled when used as a source.
20
+ *
21
+ * Default {@apilink ImageFiltering.Pixel} (nearest), matching the engine's frame targets which are
22
+ * only ever sampled 1:1. Pass {@apilink ImageFiltering.Blended} (linear) for anything that samples
23
+ * at a different resolution, like downsample/upsample blur chains.
24
+ */
25
+ filtering?: ImageFiltering;
26
+ /**
27
+ * How this framebuffer's texture wraps when sampled outside 0-1 UVs, default {@apilink ImageWrapping.Clamp}
28
+ */
29
+ wrapping?: ImageWrapConfiguration | ImageWrapping;
30
+ /**
31
+ * Match the canvas transparency semantics, used to pick a compatible blit format. Default true.
32
+ */
33
+ transparency?: boolean;
34
+ }
35
+ /**
36
+ * A texture-backed WebGL framebuffer that is both a render **destination** and a texture **source**.
37
+ *
38
+ * Draw into it by passing it as the `destination` of a {@apilink ShaderPass.draw} (or any consumer of
39
+ * {@apilink Framebuffer.glFramebuffer}), sample from it by passing it as a `source` (or reading
40
+ * {@apilink Framebuffer.texture}). There is no implicit bind/unbind protocol to sequence.
41
+ *
42
+ * Contents are premultiplied alpha, matching the rest of the Excalibur WebGL pipeline.
43
+ */
44
+ export declare class Framebuffer {
45
+ protected _gl: WebGL2RenderingContext;
46
+ protected _graphicsContext: ExcaliburGraphicsContextWebGL;
47
+ readonly transparency: boolean;
48
+ readonly filtering: ImageFiltering;
49
+ readonly wrapping: ImageWrapConfiguration;
50
+ /**
51
+ * Format compatible with the canvas drawing buffer, needed for {@apilink Framebuffer.blitToScreen}
52
+ */
53
+ readonly bufferFormat: number;
54
+ private _width;
55
+ private _height;
56
+ private _texelSize;
57
+ private _frameBuffer;
58
+ private _frameTexture;
59
+ private _disposed;
60
+ constructor(options: FramebufferOptions);
61
+ get width(): number;
62
+ get height(): number;
63
+ /**
64
+ * `[1 / width, 1 / height]`, useful for passing to shaders that sample neighboring texels (blurs etc.)
65
+ */
66
+ get texelSize(): [texelWidth: number, texelHeight: number];
67
+ /**
68
+ * The color texture backing this framebuffer, for sampling as a source.
69
+ *
70
+ * On a {@apilink MultisampleFramebuffer} reading this resolves the MSAA renderbuffer first.
71
+ */
72
+ get texture(): WebGLTexture;
73
+ /**
74
+ * The framebuffer to bind when drawing **into** this framebuffer.
75
+ *
76
+ * On a {@apilink MultisampleFramebuffer} this is the multisampled renderbuffer framebuffer.
77
+ */
78
+ get glFramebuffer(): WebGLFramebuffer;
79
+ /**
80
+ * The framebuffer with the resolved color texture attached
81
+ * @internal
82
+ */
83
+ protected get _textureFramebuffer(): WebGLFramebuffer;
84
+ private _toGlFiltering;
85
+ private _toGlWrapping;
86
+ private _setupFramebuffer;
87
+ /**
88
+ * Resize the framebuffer, contents are discarded
89
+ */
90
+ resize(width: number, height: number): void;
91
+ /**
92
+ * Clears the framebuffer to the provided color (transparent black by default)
93
+ *
94
+ * Leaves this framebuffer bound
95
+ */
96
+ clear(color?: Color): void;
97
+ /**
98
+ * Copies the current (resolved) contents into the provided texture, which is
99
+ * reallocated at this framebuffer's dimensions
100
+ */
101
+ copyToTexture(texture: WebGLTexture): void;
102
+ /**
103
+ * Blits the (resolved) contents 1:1 to the canvas drawing buffer
104
+ */
105
+ blitToScreen(): void;
106
+ /**
107
+ * Performs any resolve necessary to make {@apilink Framebuffer._textureFramebuffer} current, returns it
108
+ * @internal
109
+ */
110
+ protected _resolve(): WebGLFramebuffer;
111
+ /**
112
+ * Binds this framebuffer for drawing and sets the viewport to its dimensions.
113
+ *
114
+ * Meant for internal use by the context's batched flush, pipeline code passes framebuffers
115
+ * explicitly as destinations instead.
116
+ * @internal
117
+ */
118
+ bind(): void;
119
+ /**
120
+ * Returns drawing to the canvas
121
+ * @internal
122
+ */
123
+ unbind(): void;
124
+ /**
125
+ * Deletes the GL resources owned by this framebuffer, it cannot be used afterwards
126
+ */
127
+ dispose(): void;
128
+ }
129
+ export interface MultisampleFramebufferOptions extends FramebufferOptions {
130
+ /**
131
+ * Optionally specify number of anti-aliasing samples to use, by default the max for the platform
132
+ */
133
+ samples?: number;
134
+ }
135
+ /**
136
+ * A {@apilink Framebuffer} backed by a multisampled renderbuffer.
137
+ *
138
+ * Drawing goes into the MSAA renderbuffer ({@apilink Framebuffer.glFramebuffer}); reading
139
+ * {@apilink Framebuffer.texture} (or blitting/copying) resolves the samples into the backing
140
+ * color texture first, so consumers never need to sequence the resolve themselves.
141
+ */
142
+ export declare class MultisampleFramebuffer extends Framebuffer {
143
+ readonly samples: number;
144
+ private _renderBuffer;
145
+ private _renderFrameBuffer;
146
+ private _msaaDisposed;
147
+ constructor(options: MultisampleFramebufferOptions);
148
+ get glFramebuffer(): WebGLFramebuffer;
149
+ get texture(): WebGLTexture;
150
+ resize(width: number, height: number): void;
151
+ blitToScreen(): void;
152
+ protected _resolve(): WebGLFramebuffer;
153
+ dispose(): void;
154
+ }
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Tagged template literal for authoring Excalibur {@apilink Material} fragment shaders.
3
+ *
4
+ * It handles the boilerplate and, most importantly, the alpha space bookkeeping.
5
+ *
6
+ * ## Automatic alpha premultiplication
7
+ *
8
+ * Excalibur's WebGL pipeline is premultiplied end to end. Textures are uploaded with
9
+ * `UNPACK_PREMULTIPLY_ALPHA_WEBGL`, so a raw `texture(u_graphic, uv)` hands back a premultiplied
10
+ * value, and the blend function is `(ONE, ONE_MINUS_SRC_ALPHA)`, so the fragment output must be
11
+ * premultiplied too. Doing your own alpha math in the middle of that is a reliable source of
12
+ * washed out blending and dark halos on antialiased edges.
13
+ *
14
+ * Shaders written with this tag instead get a **straight (un-premultiplied) alpha authoring
15
+ * space**. Sampling calls are un-premultiplied on the way in and your color output is
16
+ * premultiplied on the way out, so ordinary intuitive alpha math works in between:
17
+ *
18
+ * ```ts
19
+ * const material = game.graphicsContext.createMaterial({
20
+ * name: 'fade',
21
+ * fragmentSource: glsl`
22
+ * in vec2 v_uv;
23
+ * uniform sampler2D u_graphic;
24
+ * out vec4 fragColor;
25
+ * void main() {
26
+ * vec4 color = texture(u_graphic, v_uv);
27
+ * color.a *= 0.5; // just works, no manual premultiply needed
28
+ * fragColor = color;
29
+ * }`
30
+ * });
31
+ * ```
32
+ *
33
+ * Filtering still happens in premultiplied space where it belongs, only the filtered result is
34
+ * converted. See https://www.realtimerendering.com/blog/gpus-prefer-premultiplication/
35
+ *
36
+ * To sample a texture that is not color data (a lookup table, a noise or data texture) use
37
+ * `ex_texture_raw(tex, uv)`, which is passed through untouched. To turn the whole transform off
38
+ * for a shader, add `#pragma excalibur premultiply(off)` to its source.
39
+ *
40
+ * ## Other conveniences
41
+ *
42
+ * * Adds `#version 300 es` and a `precision` declaration if you did not write them
43
+ * * Injects the `pixel_texture(sampler2D, vec2)` pixel art filter if your source references it
44
+ * * Injects `uniform vec2 u_graphic_resolution;` alongside it if you have not declared it
45
+ * * Exposes `ex_premultiply(vec4)` / `ex_unpremultiply(vec4)` if you need to convert by hand
46
+ */
47
+ export declare function glsl(strings: TemplateStringsArray, ...values: any[]): string;
@@ -10,6 +10,7 @@ export declare class MaterialRenderer implements RendererPlugin {
10
10
  private _quads;
11
11
  private _buffer;
12
12
  private _layout;
13
+ private _seedPass;
13
14
  initialize(gl: WebGL2RenderingContext, context: ExcaliburGraphicsContextWebGL): void;
14
15
  dispose(): void;
15
16
  draw(image: HTMLImageSource, sx: number, sy: number, swidth?: number, sheight?: number, dx?: number, dy?: number, dwidth?: number, dheight?: number): void;