melonjs 20.2.0 → 20.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (515) hide show
  1. package/README.md +86 -8
  2. package/build/application/application.d.ts +0 -17
  3. package/build/application/application.d.ts.map +1 -1
  4. package/build/application/settings.d.ts +6 -2
  5. package/build/application/settings.d.ts.map +1 -1
  6. package/build/audio/audio.d.ts +2 -2
  7. package/build/audio/audio.d.ts.map +1 -1
  8. package/build/audio/backend/buffer.d.ts +26 -0
  9. package/build/audio/backend/buffer.d.ts.map +1 -0
  10. package/build/audio/backend/cache.d.ts +2 -0
  11. package/build/audio/backend/cache.d.ts.map +1 -0
  12. package/build/audio/backend/core.d.ts +24 -0
  13. package/build/audio/backend/core.d.ts.map +1 -0
  14. package/build/audio/backend/engine.d.ts +35 -0
  15. package/build/audio/backend/engine.d.ts.map +1 -0
  16. package/build/audio/backend/sound.d.ts +29 -0
  17. package/build/audio/backend/sound.d.ts.map +1 -0
  18. package/build/audio/backend/spatial.d.ts +191 -0
  19. package/build/audio/backend/spatial.d.ts.map +1 -0
  20. package/build/audio/backend/types.d.ts +107 -0
  21. package/build/audio/backend/types.d.ts.map +1 -0
  22. package/build/audio/backend/voice.d.ts +8 -0
  23. package/build/audio/backend/voice.d.ts.map +1 -0
  24. package/build/audio/playback.d.ts +49 -4
  25. package/build/audio/playback.d.ts.map +1 -1
  26. package/build/audio/procedural.d.ts.map +1 -1
  27. package/build/audio/state.d.ts +69 -0
  28. package/build/audio/state.d.ts.map +1 -0
  29. package/build/audio/types.d.ts +93 -1
  30. package/build/audio/types.d.ts.map +1 -1
  31. package/build/camera/camera2d.d.ts +0 -68
  32. package/build/camera/camera2d.d.ts.map +1 -1
  33. package/build/camera/camera3d.d.ts +91 -84
  34. package/build/camera/camera3d.d.ts.map +1 -1
  35. package/build/camera/effects/fade_effect.d.ts +0 -5
  36. package/build/camera/effects/fade_effect.d.ts.map +1 -1
  37. package/build/camera/effects/mask_effect.d.ts +0 -5
  38. package/build/camera/effects/mask_effect.d.ts.map +1 -1
  39. package/build/camera/fog.d.ts +118 -0
  40. package/build/camera/fog.d.ts.map +1 -0
  41. package/build/const.d.ts +2 -2
  42. package/build/geometries/box3d.d.ts +0 -28
  43. package/build/geometries/box3d.d.ts.map +1 -1
  44. package/build/geometries/ellipse.d.ts +0 -20
  45. package/build/geometries/ellipse.d.ts.map +1 -1
  46. package/build/geometries/observablePoint.d.ts +0 -3
  47. package/build/geometries/observablePoint.d.ts.map +1 -1
  48. package/build/geometries/path2d.d.ts +0 -19
  49. package/build/geometries/path2d.d.ts.map +1 -1
  50. package/build/geometries/polygon.d.ts +0 -12
  51. package/build/geometries/polygon.d.ts.map +1 -1
  52. package/build/geometries/roundrect.d.ts +0 -18
  53. package/build/geometries/roundrect.d.ts.map +1 -1
  54. package/build/geometries/sphere.d.ts +0 -9
  55. package/build/geometries/sphere.d.ts.map +1 -1
  56. package/build/geometries/toarccanvas.d.ts.map +1 -1
  57. package/build/index.d.ts +1 -0
  58. package/build/index.d.ts.map +1 -1
  59. package/build/index.js +12150 -11289
  60. package/build/index.js.map +4 -4
  61. package/build/input/gamepad.d.ts.map +1 -1
  62. package/build/input/input.d.ts +19 -0
  63. package/build/input/input.d.ts.map +1 -1
  64. package/build/input/pointer.d.ts +0 -4
  65. package/build/input/pointer.d.ts.map +1 -1
  66. package/build/input/pointerevent.d.ts +0 -6
  67. package/build/input/pointerevent.d.ts.map +1 -1
  68. package/build/lang/deprecated.d.ts +4 -2
  69. package/build/lang/deprecated.d.ts.map +1 -1
  70. package/build/level/gltf/GLTFModel.d.ts +0 -81
  71. package/build/level/gltf/GLTFModel.d.ts.map +1 -1
  72. package/build/level/gltf/GLTFScene.d.ts +13 -44
  73. package/build/level/gltf/GLTFScene.d.ts.map +1 -1
  74. package/build/level/gltf/gltf_sampler.d.ts +1 -48
  75. package/build/level/gltf/gltf_sampler.d.ts.map +1 -1
  76. package/build/level/level.d.ts +195 -113
  77. package/build/level/level.d.ts.map +1 -1
  78. package/build/level/tiled/TMXGroup.d.ts +1 -65
  79. package/build/level/tiled/TMXGroup.d.ts.map +1 -1
  80. package/build/level/tiled/TMXLayer.d.ts +0 -44
  81. package/build/level/tiled/TMXLayer.d.ts.map +1 -1
  82. package/build/level/tiled/TMXObject.d.ts +1 -136
  83. package/build/level/tiled/TMXObject.d.ts.map +1 -1
  84. package/build/level/tiled/TMXObjectFactory.d.ts +1 -40
  85. package/build/level/tiled/TMXObjectFactory.d.ts.map +1 -1
  86. package/build/level/tiled/TMXTile.d.ts +1 -30
  87. package/build/level/tiled/TMXTile.d.ts.map +1 -1
  88. package/build/level/tiled/TMXTileMap.d.ts +0 -10
  89. package/build/level/tiled/TMXTileMap.d.ts.map +1 -1
  90. package/build/level/tiled/TMXTileset.d.ts +0 -113
  91. package/build/level/tiled/TMXTileset.d.ts.map +1 -1
  92. package/build/level/tiled/TMXTilesetGroup.d.ts +0 -1
  93. package/build/level/tiled/TMXTilesetGroup.d.ts.map +1 -1
  94. package/build/level/tiled/TMXUtils.d.ts +1 -43
  95. package/build/level/tiled/TMXUtils.d.ts.map +1 -1
  96. package/build/level/tiled/factories/shape.d.ts +1 -7
  97. package/build/level/tiled/factories/shape.d.ts.map +1 -1
  98. package/build/level/tiled/factories/text.d.ts +1 -7
  99. package/build/level/tiled/factories/text.d.ts.map +1 -1
  100. package/build/level/tiled/factories/tile.d.ts +1 -7
  101. package/build/level/tiled/factories/tile.d.ts.map +1 -1
  102. package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts +0 -60
  103. package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts.map +1 -1
  104. package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts +0 -42
  105. package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts.map +1 -1
  106. package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts +0 -5
  107. package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts.map +1 -1
  108. package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts +0 -31
  109. package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts.map +1 -1
  110. package/build/level/tiled/renderer/TMXRenderer.d.ts +2 -2
  111. package/build/level/tiled/renderer/TMXRenderer.d.ts.map +1 -1
  112. package/build/level/tiled/renderer/TMXStaggeredRenderer.d.ts.map +1 -1
  113. package/build/level/tiled/renderer/autodetect.d.ts +1 -6
  114. package/build/level/tiled/renderer/autodetect.d.ts.map +1 -1
  115. package/build/lighting/light2d.d.ts +0 -25
  116. package/build/lighting/light2d.d.ts.map +1 -1
  117. package/build/lighting/light3d.d.ts +0 -16
  118. package/build/lighting/light3d.d.ts.map +1 -1
  119. package/build/loader/loader.d.ts +46 -73
  120. package/build/loader/loader.d.ts.map +1 -1
  121. package/build/loader/loadingscreen.d.ts +0 -33
  122. package/build/loader/loadingscreen.d.ts.map +1 -1
  123. package/build/loader/parsers/aseprite.d.ts +0 -13
  124. package/build/loader/parsers/aseprite.d.ts.map +1 -1
  125. package/build/loader/parsers/audio.d.ts +2 -0
  126. package/build/loader/parsers/audio.d.ts.map +1 -0
  127. package/build/loader/parsers/binary.d.ts +1 -10
  128. package/build/loader/parsers/binary.d.ts.map +1 -1
  129. package/build/loader/parsers/compressed_textures/compressed_image.d.ts.map +1 -1
  130. package/build/loader/parsers/compressed_textures/parseDDS.d.ts +1 -7
  131. package/build/loader/parsers/compressed_textures/parseDDS.d.ts.map +1 -1
  132. package/build/loader/parsers/compressed_textures/parseKTX.d.ts +1 -7
  133. package/build/loader/parsers/compressed_textures/parseKTX.d.ts.map +1 -1
  134. package/build/loader/parsers/compressed_textures/parseKTX2.d.ts +1 -7
  135. package/build/loader/parsers/compressed_textures/parseKTX2.d.ts.map +1 -1
  136. package/build/loader/parsers/compressed_textures/parsePKM.d.ts +1 -7
  137. package/build/loader/parsers/compressed_textures/parsePKM.d.ts.map +1 -1
  138. package/build/loader/parsers/compressed_textures/parsePVR.d.ts +1 -7
  139. package/build/loader/parsers/compressed_textures/parsePVR.d.ts.map +1 -1
  140. package/build/loader/parsers/fontface.d.ts +1 -13
  141. package/build/loader/parsers/fontface.d.ts.map +1 -1
  142. package/build/loader/parsers/gltf.d.ts +1 -70
  143. package/build/loader/parsers/gltf.d.ts.map +1 -1
  144. package/build/loader/parsers/image.d.ts +1 -22
  145. package/build/loader/parsers/image.d.ts.map +1 -1
  146. package/build/loader/parsers/json.d.ts +1 -10
  147. package/build/loader/parsers/json.d.ts.map +1 -1
  148. package/build/loader/parsers/mtl.d.ts +1 -28
  149. package/build/loader/parsers/mtl.d.ts.map +1 -1
  150. package/build/loader/parsers/obj.d.ts +1 -59
  151. package/build/loader/parsers/obj.d.ts.map +1 -1
  152. package/build/loader/parsers/pbr.d.ts +1 -62
  153. package/build/loader/parsers/pbr.d.ts.map +1 -1
  154. package/build/loader/parsers/script.d.ts +1 -10
  155. package/build/loader/parsers/script.d.ts.map +1 -1
  156. package/build/loader/parsers/shader.d.ts +1 -52
  157. package/build/loader/parsers/shader.d.ts.map +1 -1
  158. package/build/loader/parsers/tmx.d.ts +1 -10
  159. package/build/loader/parsers/tmx.d.ts.map +1 -1
  160. package/build/loader/parsers/video.d.ts +1 -10
  161. package/build/loader/parsers/video.d.ts.map +1 -1
  162. package/build/math/color.d.ts.map +1 -1
  163. package/build/math/noise.d.ts +0 -40
  164. package/build/math/noise.d.ts.map +1 -1
  165. package/build/math/observableVector2d.d.ts +0 -3
  166. package/build/math/observableVector2d.d.ts.map +1 -1
  167. package/build/math/observableVector3d.d.ts +0 -3
  168. package/build/math/observableVector3d.d.ts.map +1 -1
  169. package/build/math/vector2d.d.ts +0 -6
  170. package/build/math/vector2d.d.ts.map +1 -1
  171. package/build/math/vertex.d.ts +25 -0
  172. package/build/math/vertex.d.ts.map +1 -1
  173. package/build/particles/emitter.d.ts +0 -65
  174. package/build/particles/emitter.d.ts.map +1 -1
  175. package/build/particles/particle.d.ts +0 -81
  176. package/build/particles/particle.d.ts.map +1 -1
  177. package/build/physics/adapter.d.ts +3 -3
  178. package/build/physics/bounds.d.ts +0 -1
  179. package/build/physics/bounds.d.ts.map +1 -1
  180. package/build/physics/broadphase/broadphase.d.ts +0 -7
  181. package/build/physics/broadphase/broadphase.d.ts.map +1 -1
  182. package/build/physics/broadphase/octree.d.ts +0 -91
  183. package/build/physics/broadphase/octree.d.ts.map +1 -1
  184. package/build/physics/broadphase/quadtree.d.ts +0 -47
  185. package/build/physics/broadphase/quadtree.d.ts.map +1 -1
  186. package/build/physics/builtin/body.d.ts +5 -69
  187. package/build/physics/builtin/body.d.ts.map +1 -1
  188. package/build/physics/builtin/detector.d.ts +0 -312
  189. package/build/physics/builtin/detector.d.ts.map +1 -1
  190. package/build/physics/builtin/sat.d.ts +1 -48
  191. package/build/physics/builtin/sat.d.ts.map +1 -1
  192. package/build/physics/builtin/sat3d.d.ts +1 -56
  193. package/build/physics/builtin/sat3d.d.ts.map +1 -1
  194. package/build/physics/collision.d.ts +0 -2
  195. package/build/physics/collision.d.ts.map +1 -1
  196. package/build/physics/response.d.ts +0 -1
  197. package/build/physics/response.d.ts.map +1 -1
  198. package/build/physics/world.d.ts.map +1 -1
  199. package/build/plugin/plugin.d.ts +9 -1
  200. package/build/plugin/plugin.d.ts.map +1 -1
  201. package/build/polyfill/index.d.ts +1 -4
  202. package/build/polyfill/index.d.ts.map +1 -1
  203. package/build/renderable/anchorPoint.d.ts +1 -73
  204. package/build/renderable/anchorPoint.d.ts.map +1 -1
  205. package/build/renderable/animation.d.ts +0 -7
  206. package/build/renderable/animation.d.ts.map +1 -1
  207. package/build/renderable/colorlayer.d.ts +0 -5
  208. package/build/renderable/colorlayer.d.ts.map +1 -1
  209. package/build/renderable/container.d.ts +0 -55
  210. package/build/renderable/container.d.ts.map +1 -1
  211. package/build/renderable/draggable.d.ts +0 -5
  212. package/build/renderable/draggable.d.ts.map +1 -1
  213. package/build/renderable/dragndrop.d.ts +1 -12
  214. package/build/renderable/dragndrop.d.ts.map +1 -1
  215. package/build/renderable/entity/entity.d.ts +0 -8
  216. package/build/renderable/entity/entity.d.ts.map +1 -1
  217. package/build/renderable/frameAnimation.d.ts +0 -41
  218. package/build/renderable/frameAnimation.d.ts.map +1 -1
  219. package/build/renderable/groundshadow.d.ts +1 -91
  220. package/build/renderable/groundshadow.d.ts.map +1 -1
  221. package/build/renderable/imagelayer.d.ts +0 -29
  222. package/build/renderable/imagelayer.d.ts.map +1 -1
  223. package/build/renderable/instanced_mesh.d.ts +26 -104
  224. package/build/renderable/instanced_mesh.d.ts.map +1 -1
  225. package/build/renderable/mesh.d.ts +145 -140
  226. package/build/renderable/mesh.d.ts.map +1 -1
  227. package/build/renderable/nineslicesprite.d.ts +0 -4
  228. package/build/renderable/nineslicesprite.d.ts.map +1 -1
  229. package/build/renderable/renderable.d.ts +17 -54
  230. package/build/renderable/renderable.d.ts.map +1 -1
  231. package/build/renderable/sprite.d.ts +7 -52
  232. package/build/renderable/sprite.d.ts.map +1 -1
  233. package/build/renderable/sprite3d.d.ts +0 -95
  234. package/build/renderable/sprite3d.d.ts.map +1 -1
  235. package/build/renderable/text/bitmaptext.d.ts +0 -14
  236. package/build/renderable/text/bitmaptext.d.ts.map +1 -1
  237. package/build/renderable/text/bitmaptextdata.d.ts +0 -22
  238. package/build/renderable/text/bitmaptextdata.d.ts.map +1 -1
  239. package/build/renderable/text/glyph.d.ts +1 -39
  240. package/build/renderable/text/glyph.d.ts.map +1 -1
  241. package/build/renderable/text/text.d.ts +0 -20
  242. package/build/renderable/text/text.d.ts.map +1 -1
  243. package/build/renderable/text/textstyle.d.ts +1 -5
  244. package/build/renderable/text/textstyle.d.ts.map +1 -1
  245. package/build/renderable/trail.d.ts +0 -29
  246. package/build/renderable/trail.d.ts.map +1 -1
  247. package/build/renderable/trigger.d.ts +0 -6
  248. package/build/renderable/trigger.d.ts.map +1 -1
  249. package/build/renderable/ui/uibaseelement.d.ts +0 -40
  250. package/build/renderable/ui/uibaseelement.d.ts.map +1 -1
  251. package/build/renderable/ui/uispriteelement.d.ts +0 -35
  252. package/build/renderable/ui/uispriteelement.d.ts.map +1 -1
  253. package/build/state/stage.d.ts +4 -68
  254. package/build/state/stage.d.ts.map +1 -1
  255. package/build/state/state.d.ts.map +1 -1
  256. package/build/system/device.d.ts +0 -12
  257. package/build/system/device.d.ts.map +1 -1
  258. package/build/system/dom.d.ts +1 -8
  259. package/build/system/dom.d.ts.map +1 -1
  260. package/build/system/event.d.ts +1 -1
  261. package/build/system/legacy_pool.d.ts +1 -6
  262. package/build/system/legacy_pool.d.ts.map +1 -1
  263. package/build/system/platform.d.ts +21 -2
  264. package/build/system/platform.d.ts.map +1 -1
  265. package/build/system/pool.d.ts +0 -9
  266. package/build/system/pool.d.ts.map +1 -1
  267. package/build/system/save.d.ts.map +1 -1
  268. package/build/system/timer.d.ts +0 -20
  269. package/build/system/timer.d.ts.map +1 -1
  270. package/build/tweens/tween.d.ts +0 -62
  271. package/build/tweens/tween.d.ts.map +1 -1
  272. package/build/utils/array-multimap.d.ts +1 -13
  273. package/build/utils/array-multimap.d.ts.map +1 -1
  274. package/build/utils/decode.d.ts.map +1 -1
  275. package/build/utils/fetchdata.d.ts +2 -0
  276. package/build/utils/fetchdata.d.ts.map +1 -0
  277. package/build/utils/utils.d.ts +0 -13
  278. package/build/utils/utils.d.ts.map +1 -1
  279. package/build/video/blendmodes.d.ts +1 -106
  280. package/build/video/blendmodes.d.ts.map +1 -1
  281. package/build/video/buffer/index.d.ts +1 -39
  282. package/build/video/buffer/index.d.ts.map +1 -1
  283. package/build/video/buffer/vertex.d.ts +1 -82
  284. package/build/video/buffer/vertex.d.ts.map +1 -1
  285. package/build/video/canvas/canvas_renderer.d.ts +7 -25
  286. package/build/video/canvas/canvas_renderer.d.ts.map +1 -1
  287. package/build/video/canvas_factory.d.ts +1 -24
  288. package/build/video/canvas_factory.d.ts.map +1 -1
  289. package/build/video/effects/blendEffect.d.ts +0 -54
  290. package/build/video/effects/blendEffect.d.ts.map +1 -1
  291. package/build/video/effects/blur.d.ts +4 -4
  292. package/build/video/effects/blur.d.ts.map +1 -1
  293. package/build/video/effects/chromaticAberration.d.ts +5 -5
  294. package/build/video/effects/chromaticAberration.d.ts.map +1 -1
  295. package/build/video/effects/colorMatrix.d.ts +5 -15
  296. package/build/video/effects/colorMatrix.d.ts.map +1 -1
  297. package/build/video/effects/desaturate.d.ts +5 -5
  298. package/build/video/effects/desaturate.d.ts.map +1 -1
  299. package/build/video/effects/dissolve.d.ts +4 -4
  300. package/build/video/effects/dissolve.d.ts.map +1 -1
  301. package/build/video/effects/dropShadow.d.ts +5 -5
  302. package/build/video/effects/dropShadow.d.ts.map +1 -1
  303. package/build/video/effects/flash.d.ts +4 -4
  304. package/build/video/effects/flash.d.ts.map +1 -1
  305. package/build/video/effects/glow.d.ts +5 -5
  306. package/build/video/effects/glow.d.ts.map +1 -1
  307. package/build/video/effects/glsl_realization.d.ts +1 -17
  308. package/build/video/effects/glsl_realization.d.ts.map +1 -1
  309. package/build/video/effects/hologram.d.ts +4 -4
  310. package/build/video/effects/hologram.d.ts.map +1 -1
  311. package/build/video/effects/invert.d.ts +5 -5
  312. package/build/video/effects/invert.d.ts.map +1 -1
  313. package/build/video/effects/outline.d.ts +6 -6
  314. package/build/video/effects/outline.d.ts.map +1 -1
  315. package/build/video/effects/pixelate.d.ts +4 -4
  316. package/build/video/effects/pixelate.d.ts.map +1 -1
  317. package/build/video/effects/radialGradient.d.ts +2 -3
  318. package/build/video/effects/radialGradient.d.ts.map +1 -1
  319. package/build/video/effects/scanline.d.ts +6 -6
  320. package/build/video/effects/scanline.d.ts.map +1 -1
  321. package/build/video/effects/sepia.d.ts +5 -5
  322. package/build/video/effects/sepia.d.ts.map +1 -1
  323. package/build/video/effects/shadereffect.d.ts +12 -123
  324. package/build/video/effects/shadereffect.d.ts.map +1 -1
  325. package/build/video/effects/shine.d.ts +3 -3
  326. package/build/video/effects/shine.d.ts.map +1 -1
  327. package/build/video/effects/tintPulse.d.ts +4 -4
  328. package/build/video/effects/tintPulse.d.ts.map +1 -1
  329. package/build/video/effects/vignette.d.ts +6 -6
  330. package/build/video/effects/vignette.d.ts.map +1 -1
  331. package/build/video/effects/wave.d.ts +4 -4
  332. package/build/video/effects/wave.d.ts.map +1 -1
  333. package/build/video/effects/wgsl/layout.d.ts +1 -27
  334. package/build/video/effects/wgsl/layout.d.ts.map +1 -1
  335. package/build/video/effects/wgsl/parse.d.ts +1 -8
  336. package/build/video/effects/wgsl/parse.d.ts.map +1 -1
  337. package/build/video/effects/wgsl/scaffold.d.ts +1 -42
  338. package/build/video/effects/wgsl/scaffold.d.ts.map +1 -1
  339. package/build/video/effects/wgsl_realization.d.ts +1 -82
  340. package/build/video/effects/wgsl_realization.d.ts.map +1 -1
  341. package/build/video/gpu/batcher.d.ts +1 -13
  342. package/build/video/gpu/batcher.d.ts.map +1 -1
  343. package/build/video/gpu/instancerecord.d.ts +1 -163
  344. package/build/video/gpu/instancerecord.d.ts.map +1 -1
  345. package/build/video/gpu/meshchunk.d.ts +1 -48
  346. package/build/video/gpu/meshchunk.d.ts.map +1 -1
  347. package/build/video/gpu/meshvertex.d.ts +1 -53
  348. package/build/video/gpu/meshvertex.d.ts.map +1 -1
  349. package/build/video/gpu/primitives.d.ts +1 -59
  350. package/build/video/gpu/primitives.d.ts.map +1 -1
  351. package/build/video/gpu/quadcorners.d.ts +1 -10
  352. package/build/video/gpu/quadcorners.d.ts.map +1 -1
  353. package/build/video/gpu/textureslots.d.ts +1 -121
  354. package/build/video/gpu/textureslots.d.ts.map +1 -1
  355. package/build/video/gpu/texturestore.d.ts +1 -138
  356. package/build/video/gpu/texturestore.d.ts.map +1 -1
  357. package/build/video/gpu/topology.d.ts.map +1 -1
  358. package/build/video/gpu/vertexformat.d.ts +0 -28
  359. package/build/video/gpu/vertexformat.d.ts.map +1 -1
  360. package/build/video/gradient.d.ts +0 -81
  361. package/build/video/gradient.d.ts.map +1 -1
  362. package/build/video/renderer.d.ts +21 -102
  363. package/build/video/renderer.d.ts.map +1 -1
  364. package/build/video/renderstate.d.ts +0 -51
  365. package/build/video/renderstate.d.ts.map +1 -1
  366. package/build/video/rendertarget/canvasrendertarget.d.ts +0 -10
  367. package/build/video/rendertarget/canvasrendertarget.d.ts.map +1 -1
  368. package/build/video/rendertarget/render_target_pool.d.ts +1 -82
  369. package/build/video/rendertarget/render_target_pool.d.ts.map +1 -1
  370. package/build/video/rendertarget/webglrendertarget.d.ts +1 -64
  371. package/build/video/rendertarget/webglrendertarget.d.ts.map +1 -1
  372. package/build/video/rendertarget/webgpurendertarget.d.ts +0 -8
  373. package/build/video/rendertarget/webgpurendertarget.d.ts.map +1 -1
  374. package/build/video/texture/atlas.d.ts +2 -76
  375. package/build/video/texture/atlas.d.ts.map +1 -1
  376. package/build/video/texture/cache.d.ts +0 -136
  377. package/build/video/texture/cache.d.ts.map +1 -1
  378. package/build/video/texture/frametexture.d.ts +1 -71
  379. package/build/video/texture/frametexture.d.ts.map +1 -1
  380. package/build/video/texture/noise_texture2d.d.ts +0 -43
  381. package/build/video/texture/noise_texture2d.d.ts.map +1 -1
  382. package/build/video/texture/parser/aseprite.d.ts +1 -8
  383. package/build/video/texture/parser/aseprite.d.ts.map +1 -1
  384. package/build/video/texture/parser/spritesheet.d.ts +1 -8
  385. package/build/video/texture/parser/spritesheet.d.ts.map +1 -1
  386. package/build/video/texture/parser/texturepacker.d.ts +1 -8
  387. package/build/video/texture/parser/texturepacker.d.ts.map +1 -1
  388. package/build/video/texture/resource.d.ts +0 -9
  389. package/build/video/texture/resource.d.ts.map +1 -1
  390. package/build/video/texture/texture2d.d.ts +0 -11
  391. package/build/video/texture/texture2d.d.ts.map +1 -1
  392. package/build/video/utils/autodetect.d.ts +1 -5
  393. package/build/video/utils/autodetect.d.ts.map +1 -1
  394. package/build/video/webgl/batchers/batcher.d.ts +0 -55
  395. package/build/video/webgl/batchers/batcher.d.ts.map +1 -1
  396. package/build/video/webgl/batchers/lit_mesh_batcher.d.ts +0 -14
  397. package/build/video/webgl/batchers/lit_mesh_batcher.d.ts.map +1 -1
  398. package/build/video/webgl/batchers/lit_quad_batcher.d.ts +0 -72
  399. package/build/video/webgl/batchers/lit_quad_batcher.d.ts.map +1 -1
  400. package/build/video/webgl/batchers/material_batcher.d.ts +0 -89
  401. package/build/video/webgl/batchers/material_batcher.d.ts.map +1 -1
  402. package/build/video/webgl/batchers/mesh_batcher.d.ts +14 -343
  403. package/build/video/webgl/batchers/mesh_batcher.d.ts.map +1 -1
  404. package/build/video/webgl/batchers/primitive_batcher.d.ts +0 -10
  405. package/build/video/webgl/batchers/primitive_batcher.d.ts.map +1 -1
  406. package/build/video/webgl/batchers/quad_batcher.d.ts +0 -30
  407. package/build/video/webgl/batchers/quad_batcher.d.ts.map +1 -1
  408. package/build/video/webgl/buffer/index.d.ts +1 -36
  409. package/build/video/webgl/buffer/index.d.ts.map +1 -1
  410. package/build/video/webgl/buffer/instance_buffer.d.ts +1 -53
  411. package/build/video/webgl/buffer/instance_buffer.d.ts.map +1 -1
  412. package/build/video/webgl/buffer/retained_geometry.d.ts +1 -81
  413. package/build/video/webgl/buffer/retained_geometry.d.ts.map +1 -1
  414. package/build/video/webgl/buffer/uniformblock.d.ts +1 -80
  415. package/build/video/webgl/buffer/uniformblock.d.ts.map +1 -1
  416. package/build/video/webgl/buffer/vertexstate.d.ts +1 -100
  417. package/build/video/webgl/buffer/vertexstate.d.ts.map +1 -1
  418. package/build/video/webgl/glshader.d.ts +2 -51
  419. package/build/video/webgl/glshader.d.ts.map +1 -1
  420. package/build/video/webgl/lighting/pack3d.d.ts +1 -47
  421. package/build/video/webgl/lighting/pack3d.d.ts.map +1 -1
  422. package/build/video/webgl/lighting/std140.d.ts +1 -109
  423. package/build/video/webgl/lighting/std140.d.ts.map +1 -1
  424. package/build/video/webgl/renderers/tmxlayer/orthogonal.d.ts +1 -103
  425. package/build/video/webgl/renderers/tmxlayer/orthogonal.d.ts.map +1 -1
  426. package/build/video/webgl/shaders/multitexture-lit.d.ts +1 -26
  427. package/build/video/webgl/shaders/multitexture-lit.d.ts.map +1 -1
  428. package/build/video/webgl/shaders/multitexture.d.ts +1 -9
  429. package/build/video/webgl/shaders/multitexture.d.ts.map +1 -1
  430. package/build/video/webgl/texture/store.d.ts +1 -50
  431. package/build/video/webgl/texture/store.d.ts.map +1 -1
  432. package/build/video/webgl/utils/attributes.d.ts +1 -11
  433. package/build/video/webgl/utils/attributes.d.ts.map +1 -1
  434. package/build/video/webgl/utils/maxtextures.d.ts +1 -36
  435. package/build/video/webgl/utils/maxtextures.d.ts.map +1 -1
  436. package/build/video/webgl/utils/precision.d.ts +1 -14
  437. package/build/video/webgl/utils/precision.d.ts.map +1 -1
  438. package/build/video/webgl/utils/program.d.ts +1 -5
  439. package/build/video/webgl/utils/program.d.ts.map +1 -1
  440. package/build/video/webgl/utils/samplercache.d.ts +1 -68
  441. package/build/video/webgl/utils/samplercache.d.ts.map +1 -1
  442. package/build/video/webgl/utils/string.d.ts +1 -21
  443. package/build/video/webgl/utils/string.d.ts.map +1 -1
  444. package/build/video/webgl/utils/topology.d.ts +1 -23
  445. package/build/video/webgl/utils/topology.d.ts.map +1 -1
  446. package/build/video/webgl/utils/uniforms.d.ts +1 -25
  447. package/build/video/webgl/utils/uniforms.d.ts.map +1 -1
  448. package/build/video/webgl/utils/vertexformat.d.ts +1 -26
  449. package/build/video/webgl/utils/vertexformat.d.ts.map +1 -1
  450. package/build/video/webgl/webgl_renderer.d.ts +24 -286
  451. package/build/video/webgl/webgl_renderer.d.ts.map +1 -1
  452. package/build/video/webgpu/batchers/lit_mesh_batcher.d.ts +0 -6
  453. package/build/video/webgpu/batchers/lit_mesh_batcher.d.ts.map +1 -1
  454. package/build/video/webgpu/batchers/lit_quad_batcher.d.ts +0 -8
  455. package/build/video/webgpu/batchers/lit_quad_batcher.d.ts.map +1 -1
  456. package/build/video/webgpu/batchers/mesh_batcher.d.ts +1 -230
  457. package/build/video/webgpu/batchers/mesh_batcher.d.ts.map +1 -1
  458. package/build/video/webgpu/batchers/primitive_batcher.d.ts.map +1 -1
  459. package/build/video/webgpu/batchers/quad_batcher.d.ts +0 -82
  460. package/build/video/webgpu/batchers/quad_batcher.d.ts.map +1 -1
  461. package/build/video/webgpu/buffer/arena.d.ts +1 -63
  462. package/build/video/webgpu/buffer/arena.d.ts.map +1 -1
  463. package/build/video/webgpu/buffer/instance_buffer.d.ts +1 -64
  464. package/build/video/webgpu/buffer/instance_buffer.d.ts.map +1 -1
  465. package/build/video/webgpu/buffer/retained_geometry.d.ts +1 -54
  466. package/build/video/webgpu/buffer/retained_geometry.d.ts.map +1 -1
  467. package/build/video/webgpu/buffer/uniformring.d.ts +1 -67
  468. package/build/video/webgpu/buffer/uniformring.d.ts.map +1 -1
  469. package/build/video/webgpu/effect_binding.d.ts +1 -16
  470. package/build/video/webgpu/effect_binding.d.ts.map +1 -1
  471. package/build/video/webgpu/pipeline/bindgroups.d.ts +1 -32
  472. package/build/video/webgpu/pipeline/bindgroups.d.ts.map +1 -1
  473. package/build/video/webgpu/pipeline/cache.d.ts +1 -163
  474. package/build/video/webgpu/pipeline/cache.d.ts.map +1 -1
  475. package/build/video/webgpu/renderers/tmxlayer/orthogonal.d.ts +1 -87
  476. package/build/video/webgpu/renderers/tmxlayer/orthogonal.d.ts.map +1 -1
  477. package/build/video/webgpu/shaders/mesh-instanced.d.ts +1 -43
  478. package/build/video/webgpu/shaders/mesh-instanced.d.ts.map +1 -1
  479. package/build/video/webgpu/texture/compressed.d.ts +1 -32
  480. package/build/video/webgpu/texture/compressed.d.ts.map +1 -1
  481. package/build/video/webgpu/texture/frametexture.d.ts +1 -62
  482. package/build/video/webgpu/texture/frametexture.d.ts.map +1 -1
  483. package/build/video/webgpu/texture/store.d.ts +1 -147
  484. package/build/video/webgpu/texture/store.d.ts.map +1 -1
  485. package/build/video/webgpu/webgpu_renderer.d.ts +2 -89
  486. package/build/video/webgpu/webgpu_renderer.d.ts.map +1 -1
  487. package/package.json +8 -11
  488. package/skills/AGENTS.md +67 -0
  489. package/skills/melonjs/SKILL.md +156 -0
  490. package/skills/melonjs-20-migration/SKILL.md +160 -0
  491. package/skills/melonjs-3d/SKILL.md +525 -0
  492. package/skills/melonjs-3d-assets/SKILL.md +258 -0
  493. package/skills/melonjs-audio/SKILL.md +236 -0
  494. package/skills/melonjs-camera-and-drawing/SKILL.md +175 -0
  495. package/skills/melonjs-deployment/SKILL.md +113 -0
  496. package/skills/melonjs-effects-and-shaders/SKILL.md +178 -0
  497. package/skills/melonjs-events/SKILL.md +159 -0
  498. package/skills/melonjs-getting-started/SKILL.md +183 -0
  499. package/skills/melonjs-input/SKILL.md +166 -0
  500. package/skills/melonjs-lighting/SKILL.md +139 -0
  501. package/skills/melonjs-loading-assets/SKILL.md +186 -0
  502. package/skills/melonjs-particles-and-trails/SKILL.md +136 -0
  503. package/skills/melonjs-performance/SKILL.md +183 -0
  504. package/skills/melonjs-physics/SKILL.md +321 -0
  505. package/skills/melonjs-plugins/SKILL.md +191 -0
  506. package/skills/melonjs-renderables/SKILL.md +214 -0
  507. package/skills/melonjs-renderer-backends/SKILL.md +173 -0
  508. package/skills/melonjs-scenes-and-state/SKILL.md +180 -0
  509. package/skills/melonjs-sprites-and-animation/SKILL.md +173 -0
  510. package/skills/melonjs-tilemaps/SKILL.md +213 -0
  511. package/skills/melonjs-ui-and-text/SKILL.md +65 -0
  512. package/build/audio/backend.d.ts +0 -140
  513. package/build/audio/backend.d.ts.map +0 -1
  514. package/build/loader/parsers/fetchdata.d.ts +0 -32
  515. package/build/loader/parsers/fetchdata.d.ts.map +0 -1
@@ -1,107 +1,2 @@
1
- /**
2
- * Whether a blend mode needs the shader path rather than fixed-function state.
3
- * @param {string} mode - the blend mode to test
4
- * @returns {boolean} true when the mode needs the shader path
5
- * @ignore
6
- */
7
- export function isAdvancedBlendMode(mode: string): boolean;
8
- /**
9
- * The `uBlendMode` uniform value for an advanced blend mode.
10
- * @param {string} mode - the blend mode
11
- * @returns {number} the shader's mode index, or -1 when not an advanced mode
12
- * @ignore
13
- */
14
- export function advancedBlendModeIndex(mode: string): number;
15
- /**
16
- * Normalize a user-facing blend-mode string to its canonical token: `add` and
17
- * `lighter` are spellings of `additive`, and anything unrecognized collapses
18
- * to `normal`.
19
- *
20
- * The six advanced modes normalize to `"normal"` on purpose — that is their
21
- * PIPELINE state, since the geometry really does rasterize under ordinary
22
- * source-over before the shader composites it. Use {@link isAdvancedBlendMode}
23
- * to ask the other question, and {@link reportedBlendMode} for what
24
- * `setBlendMode` should tell the caller.
25
- * @param {string} mode - blend mode as set through `setBlendMode`
26
- * @returns {string} the canonical token
27
- * @ignore
28
- */
29
- export function normalizeBlendMode(mode: string): string;
30
- /**
31
- * Whether the engine can honour this blend mode at all, by either route.
32
- * @param {string} mode - the blend mode to test
33
- * @returns {boolean} false only for a mode no backend implements
34
- * @ignore
35
- */
36
- export function isSupportedBlendMode(mode: string): boolean;
37
- /**
38
- * What `setBlendMode` reports back as applied.
39
- *
40
- * The return value is a capability probe: callers compare it against their
41
- * request, and a mismatch means the renderer could not honour the mode. So a
42
- * mode that WAS honoured must report itself verbatim — including an alias
43
- * like `add`, which shares a pipeline with `additive` but must not come back
44
- * under that name — while anything unimplemented reports `"normal"`.
45
- * @param {string} mode - the requested blend mode
46
- * @returns {string} the mode actually applied
47
- * @ignore
48
- */
49
- export function reportedBlendMode(mode: string): string;
50
- /**
51
- * The blend state for a mode, in WebGPU's vocabulary — the neutral form each
52
- * backend translates from.
53
- *
54
- * `srcFactor` depends on whether sources carry premultiplied alpha: a
55
- * premultiplied source has already been scaled, so it takes `one` where a
56
- * straight one takes `src-alpha`.
57
- *
58
- * Every mode here is EXACT for a translucent source as well as an opaque one
59
- * — `multiply`, `screen` and `exclusion` were long commented as
60
- * "approximate", but the algebra works out and measurement agrees. The two
61
- * that genuinely could not be expressed this way, `darken` and `lighten`,
62
- * moved to the shader path instead of staying approximate.
63
- * @param {string} mode - a canonical mode from {@link normalizeBlendMode}
64
- * @param {boolean} premultipliedAlpha - whether sources are premultiplied
65
- * @returns {{operation: string, srcFactor: string, dstFactor: string}|undefined} the
66
- * blend state, or `undefined` for `"none"`, which means replace (no blending)
67
- * @ignore
68
- */
69
- export function blendStateFor(mode: string, premultipliedAlpha: boolean): {
70
- operation: string;
71
- srcFactor: string;
72
- dstFactor: string;
73
- } | undefined;
74
- /**
75
- * The engine's blend-mode registry — one definition of every mode, shared by
76
- * all three renderers.
77
- *
78
- * Blending is described here in **backend-neutral** terms and translated by
79
- * each backend: WebGPU consumes these tokens directly (they are its own
80
- * vocabulary), WebGL maps them onto `gl.*` enums, and Canvas ignores them
81
- * entirely in favour of `globalCompositeOperation`.
82
- *
83
- * Keeping the table in one place is not tidiness. The two GPU backends
84
- * previously each carried their own copy — a `switch` of `blendEquation` /
85
- * `blendFunc` calls on one side and a `GPUBlendState` table on the other —
86
- * which meant a mode added, removed or corrected on one backend could
87
- * silently disagree with the other, and `video.AUTO` would then render the
88
- * same scene differently depending on which backend it happened to pick.
89
- */
90
- /**
91
- * The CSS blend modes that cannot be expressed as `src * sfactor + dst * dfactor`.
92
- *
93
- * Fixed-function blending computes one multiply-add per channel, which covers
94
- * `multiply`, `screen`, `additive` and `exclusion` — exactly, translucent
95
- * sources included. The modes below cannot be reached that way: most need a
96
- * per-pixel branch, a division or a `sqrt` on the DESTINATION, and `darken` /
97
- * `lighten` need a term the `min` / `max` operations leave no room for.
98
- * Neither GPU backend can read the destination in a fragment shader, so all of
99
- * them are implemented by capturing the destination to a texture and
100
- * compositing in `BlendEffect`.
101
- *
102
- * The array ORDER is the wire format: the index is the `uBlendMode` uniform
103
- * value the shader branches on, so reordering it silently remaps every mode.
104
- * @ignore
105
- */
106
- export const ADVANCED_BLEND_MODES: string[];
1
+
107
2
  //# sourceMappingURL=blendmodes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"blendmodes.d.ts","sourceRoot":"","sources":["../../src/video/blendmodes.js"],"names":[],"mappings":"AAkDA;;;;;GAKG;AACH,0CAJW,MAAM,GACJ,OAAO,CAKnB;AAED;;;;;GAKG;AACH,6CAJW,MAAM,GACJ,MAAM,CAKlB;AAED;;;;;;;;;;;;;GAaG;AACH,yCAJW,MAAM,GACJ,MAAM,CAkBlB;AAED;;;;;GAKG;AACH,2CAJW,MAAM,GACJ,OAAO,CASnB;AAED;;;;;;;;;;;GAWG;AACH,wCAJW,MAAM,GACJ,MAAM,CAKlB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,oCANW,MAAM,sBACN,OAAO,GACL;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAC,GAAC,SAAS,CAwC/E;AA1LD;;;;;;;;;;;;;;;GAeG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,4CAeE"}
1
+ {"version":3,"file":"blendmodes.d.ts","sourceRoot":"","sources":["../../src/video/blendmodes.js"],"names":[],"mappings":"AAmDA;;;;;;GAMG;AACH,0CALW,MAAM,GACJ,OAAO,CAMnB;AAED;;;;;;GAMG;AACH,6CALW,MAAM,GACJ,MAAM,CAMlB;AAED;;;;;;;;;;;;;;GAcG;AACH,yCALW,MAAM,GACJ,MAAM,CAmBlB;AAED;;;;;;GAMG;AACH,2CALW,MAAM,GACJ,OAAO,CAUnB;AAED;;;;;;;;;;;;GAYG;AACH,wCALW,MAAM,GACJ,MAAM,CAMlB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,oCAPW,MAAM,sBACN,OAAO,GACL;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAC,GAAC,SAAS,CAyC/E;AAjMD;;;;;;;;;;;;;;;GAeG;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,4CAeE"}
@@ -1,40 +1,2 @@
1
- /**
2
- * A renderer-agnostic index buffer.
3
- * Manages a typed array of vertex indices for indexed drawing.
4
- * {@link WebGLIndexBuffer} extends this with GL-specific bind/upload operations.
5
- * @ignore
6
- */
7
- export default class IndexBuffer {
8
- /**
9
- * @param {number} maxIndices - maximum number of indices this buffer can hold
10
- * @param {boolean} [useUint32=false] - use Uint32 indices instead of Uint16
11
- */
12
- constructor(maxIndices: number, useUint32?: boolean);
13
- data: Uint16Array<ArrayBuffer> | Uint32Array<ArrayBuffer>;
14
- /**
15
- * the current number of indices in the buffer
16
- * @type {number}
17
- */
18
- length: number;
19
- /**
20
- * Fill the buffer with a repeating quad index pattern [0,1,2, 2,1,3, 4,5,6, ...]
21
- * @param {number} maxQuads - number of quads to generate indices for
22
- */
23
- fillQuadPattern(maxQuads: number): void;
24
- /**
25
- * Reset the index count
26
- */
27
- clear(): void;
28
- /**
29
- * Add indices to the buffer, rebased by the given vertex offset
30
- * @param {number[]} indices - source indices to add
31
- * @param {number} vertexOffset - value to add to each index
32
- */
33
- add(indices: number[], vertexOffset: number): void;
34
- /**
35
- * Add pre-computed absolute indices to the buffer (no rebasing)
36
- * @param {number[]} indices - absolute index values to add
37
- */
38
- addRaw(indices: number[]): void;
39
- }
1
+
40
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/video/buffer/index.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;IACC;;;OAGG;IACH,wBAHW,MAAM,cACN,OAAO,EAYjB;IATA,0DAE8B;IAE9B;;;OAGG;IACH,QAFU,MAAM,CAED;IAGhB;;;OAGG;IACH,0BAFW,MAAM,QAYhB;IAED;;OAEG;IACH,cAEC;IAED;;;;OAIG;IACH,aAHW,MAAM,EAAE,gBACR,MAAM,QAOhB;IAED;;;OAGG;IACH,gBAFW,MAAM,EAAE,QAOlB;CACD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/video/buffer/index.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;IACC;;;OAGG;IACH,wBAHW,MAAM,cACN,OAAO,EAYjB;IATA,0DAE8B;IAE9B;;;OAGG;IACH,QAFU,MAAM,CAED;IAGhB;;;OAGG;IACH,0BAFW,MAAM,QAYhB;IAED;;OAEG;IACH,cAEC;IAED;;;;OAIG;IACH,aAHW,MAAM,EAAE,gBACR,MAAM,QAOhB;IAED;;;OAGG;IACH,gBAFW,MAAM,EAAE,QAOlB;CACD"}
@@ -1,83 +1,2 @@
1
- /**
2
- * A fixed-size vertex array buffer for batching vertex data.
3
- * Renderer-agnostic — stores vertex data in typed arrays (Float32/Uint32).
4
- * Batchers must check isFull() and flush before the buffer overflows.
5
- * @ignore
6
- */
7
- export default class VertexArrayBuffer {
8
- constructor(vertexSize: any, maxVertex: any);
9
- vertexSize: any;
10
- maxVertex: any;
11
- vertexCount: number;
12
- buffer: ArrayBuffer;
13
- bufferF32: Float32Array<ArrayBuffer>;
14
- bufferU32: Uint32Array<ArrayBuffer>;
15
- bufferU8: Uint8Array<ArrayBuffer>;
16
- /**
17
- * clear the vertex array buffer
18
- * @ignore
19
- */
20
- clear(): void;
21
- /**
22
- * return true if full
23
- * @ignore
24
- */
25
- isFull(vertex: any): boolean;
26
- /**
27
- * push a new vertex to the buffer
28
- * @param {number} x - x position
29
- * @param {number} y - y position
30
- * @param {number} z - z position (per-renderable depth; 0 under ortho)
31
- * @param {number} u - texture U coordinate (or aNormal.x for primitives)
32
- * @param {number} v - texture V coordinate (or aNormal.y for primitives)
33
- * @param {number} tint - tint color in UINT32 (argb) format
34
- * @param {number} [textureId] - texture unit index for multi-texture batching
35
- * @param {number} [normalTextureId] - paired normal-map texture unit index, or `-1` for unlit quads
36
- * @ignore
37
- */
38
- push(x: number, y: number, z: number, u: number, v: number, tint: number, textureId?: number, normalTextureId?: number): this;
39
- /**
40
- * push a new vertex with all-float data to the buffer
41
- * @param {ArrayLike<number>} data - float values for one vertex
42
- * @param {number} srcOffset - start index in the source data
43
- * @param {number} count - number of floats to copy (should equal vertexSize)
44
- * @ignore
45
- */
46
- pushFloats(data: ArrayLike<number>, srcOffset: number, count: number): this;
47
- /**
48
- * push a new vertex to the buffer (mesh format: x, y, z, u, v, tint).
49
- * Color is unpacked from the ARGB Uint32 input into 4 normalized
50
- * `[0, 1]` floats — the mesh batcher's `aColor` attribute is
51
- * `FLOAT × 4` rather than `UNSIGNED_BYTE × 4` to avoid NaN-pattern
52
- * bit values getting canonicalized on Metal-backed WebGL drivers.
53
- * See `mesh_batcher.init` for the rationale.
54
- * @ignore
55
- */
56
- pushMesh(x: any, y: any, z: any, u: any, v: any, tint: any): this;
57
- /**
58
- * push a new lit-mesh vertex (mesh format + a world-space normal):
59
- * x, y, z, u, v, tint, nx, ny, nz. Used by the lit mesh batcher, whose
60
- * vertex layout is 12 floats (the 9 of {@link pushMesh} plus `aNormal`).
61
- * @ignore
62
- */
63
- pushMeshLit(x: any, y: any, z: any, u: any, v: any, tint: any, nx: any, ny: any, nz: any): this;
64
- /**
65
- * return a reference to the data in Float32 format
66
- * @ignore
67
- */
68
- toFloat32(begin: any, end: any): Float32Array<ArrayBuffer>;
69
- /**
70
- * return a reference to the data in Uint32 format
71
- * @ignore
72
- */
73
- toUint32(begin: any, end: any): Uint32Array<ArrayBuffer>;
74
- /**
75
- * return a byte-view reference to the data — use this for `gl.bufferData`
76
- * uploads to avoid the NaN-canonicalization that some drivers perform
77
- * on Float32 uploads of the same backing buffer (see the constructor's
78
- * `bufferU8` comment).
79
- * @ignore
80
- */
81
- toUint8(byteBegin: any, byteEnd: any): Uint8Array<ArrayBuffer>;
82
- }
1
+
83
2
  //# sourceMappingURL=vertex.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"vertex.d.ts","sourceRoot":"","sources":["../../../src/video/buffer/vertex.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;IACC,6CAyBC;IAvBA,gBAA4B;IAE5B,eAA0B;IAE1B,oBAAoB;IAGpB,oBAEC;IAED,qCAA8C;IAC9C,oCAA6C;IAU7C,kCAA2C;IAG5C;;;OAGG;IACH,cAEC;IAED;;;OAGG;IACH,6BAEC;IAED;;;;;;;;;;;OAWG;IACH,QAVW,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,QACN,MAAM,cACN,MAAM,oBACN,MAAM,QA6BhB;IAED;;;;;;OAMG;IACH,iBALW,SAAS,CAAC,MAAM,CAAC,aACjB,MAAM,SACN,MAAM,QAahB;IAED;;;;;;;;OAQG;IACH,kEAgBC;IAED;;;;;OAKG;IACH,gGAoBC;IAED;;;OAGG;IACH,2DAMC;IAED;;;OAGG;IACH,yDAMC;IAED;;;;;;OAMG;IACH,+DAMC;CACD"}
1
+ {"version":3,"file":"vertex.d.ts","sourceRoot":"","sources":["../../../src/video/buffer/vertex.js"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;IACC,6CAyBC;IAvBA,gBAA4B;IAE5B,eAA0B;IAE1B,oBAAoB;IAGpB,oBAEC;IAED,qCAA8C;IAC9C,oCAA6C;IAU7C,kCAA2C;IAG5C;;;;OAIG;IACH,cAEC;IAED;;;;OAIG;IACH,6BAEC;IAED;;;;;;;;;;;;OAYG;IACH,QAXW,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,QACN,MAAM,cACN,MAAM,oBACN,MAAM,QA8BhB;IAED;;;;;;;OAOG;IACH,iBANW,SAAS,CAAC,MAAM,CAAC,aACjB,MAAM,SACN,MAAM,QAchB;IAED;;;;;;;;;OASG;IACH,kEAgBC;IAED;;;;;;OAMG;IACH,gGAoBC;IAED;;;;OAIG;IACH,2DAMC;IAED;;;;OAIG;IACH,yDAMC;IAED;;;;;;;OAOG;IACH,+DAMC;CACD"}
@@ -16,8 +16,6 @@
16
16
  export default class CanvasRenderer extends Renderer {
17
17
  cache: TextureCache;
18
18
  onGameReset: () => void;
19
- _lightCache: WeakMap<object, any> | undefined;
20
- _frameTexture: any;
21
19
  /**
22
20
  * set/change the current projection matrix.
23
21
  * In Canvas mode, this applies the ortho projection as a canvas 2D transform
@@ -27,7 +25,7 @@ export default class CanvasRenderer extends Renderer {
27
25
  setProjection(matrix: Matrix3d): void;
28
26
  /**
29
27
  * set the current blend mode for this renderer. <br>
30
- * Every renderer supports the full set: <br>
28
+ * This renderer supports every mode below except `"none"`: <br>
31
29
  * - "normal" : draws new content on top of the existing content <br>
32
30
  * <img src="../images/normal-blendmode.png" width="180"/> <br>
33
31
  * - "add", "additive", or "lighter" : color values are added together <br>
@@ -55,7 +53,10 @@ export default class CanvasRenderer extends Renderer {
55
53
  * - "exclusion" : like difference, but lower in contrast <br>
56
54
  * <img src="../images/exclusion-blendmode.png" width="180"/> <br>
57
55
  * - "none" : blending disabled — the source replaces the destination
58
- * outright, alpha included <br>
56
+ * outright, alpha included. **GPU backends only**: there is no
57
+ * `globalCompositeOperation` that disables blending for the drawn area
58
+ * alone (`"copy"` clears the rest of the surface), so this renderer falls
59
+ * back to "normal" and reports it <br>
59
60
  * A few draw types cannot honour every mode — 3D meshes, and fills using
60
61
  * a {@link Gradient} — and fall back to "normal" with a one-time console
61
62
  * warning. `setBlendMode` returns what it actually applied, so comparing
@@ -123,9 +124,6 @@ export default class CanvasRenderer extends Renderer {
123
124
  * @param {Mesh} mesh - a Mesh renderable or compatible object
124
125
  */
125
126
  drawMesh(mesh: Mesh): void;
126
- _meshColorCanvas: HTMLCanvasElement | OffscreenCanvas | undefined;
127
- _meshColorCtx: RenderingContext | OffscreenCanvasRenderingContext2D | null | undefined;
128
- _meshSortBuf: Float64Array<ArrayBuffer> | undefined;
129
127
  /**
130
128
  * starts a new path by emptying the list of sub-paths. Call this method when you want to create a new path
131
129
  * @example
@@ -194,9 +192,9 @@ export default class CanvasRenderer extends Renderer {
194
192
  * @param {number} y - The y axis of the coordinate for the rectangle starting point.
195
193
  * @param {number} width - The rectangle's width.
196
194
  * @param {number} height - The rectangle's height.
197
- * @param {number} radius - The corner radius.
195
+ * @param {number} radii - The corner radius.
198
196
  */
199
- roundRect(x: number, y: number, width: number, height: number, radii: any): void;
197
+ roundRect(x: number, y: number, width: number, height: number, radii: number): void;
200
198
  /**
201
199
  * stroke the given shape or the current defined path
202
200
  * @param {Rect|RoundRect|Polygon|Line|Ellipse|Bounds} [shape] - a shape object to stroke
@@ -281,8 +279,6 @@ export default class CanvasRenderer extends Renderer {
281
279
  * Draw a point at the specified coordinates
282
280
  * @param {number} x
283
281
  * @param {number} y
284
- * @param {number} width
285
- * @param {number} height
286
282
  */
287
283
  fillPoint(x: number, y: number): void;
288
284
  /**
@@ -290,10 +286,6 @@ export default class CanvasRenderer extends Renderer {
290
286
  * @returns {number} global alpha value
291
287
  */
292
288
  getGlobalAlpha(): number;
293
- /**
294
- * @ignore
295
- */
296
- set lineJoin(value: string);
297
289
  /**
298
290
  * sets or returns the shape used to join two line segments where they meet.
299
291
  * There are three possible values for this property: "round", "bevel", and "miter"
@@ -323,16 +315,6 @@ export default class CanvasRenderer extends Renderer {
323
315
  * @param {number} [f] - the f component to multiply the current matrix by; omitted when `a` is a matrix
324
316
  */
325
317
  transform(a: Matrix2d | Matrix3d | number, b?: number, c?: number, d?: number, e?: number, f?: number): void;
326
- /**
327
- * A mask limits rendering elements to the shape and position of the given mask object.
328
- * If the drawing or rendering area is larger than the mask, only the intersecting part of the renderable will be visible.
329
- * (Note Mask are not preserved through renderer context save and restore and need so be manually cleared)
330
- * @see CanvasRenderer#clearMask
331
- * @param {Rect|RoundRect|Polygon|Line|Ellipse} [mask] - the shape defining the mask to be applied
332
- * @param {boolean} [invert=false] - either the given shape should define what is visible (default) or the opposite
333
- */
334
- setMask(mask?: Rect | RoundRect | Polygon | Line | Ellipse, invert?: boolean): void;
335
- _maskInvertOuterAdded: boolean | undefined;
336
318
  }
337
319
  import Renderer from "./../renderer.js";
338
320
  import TextureCache from "./../texture/cache.js";
@@ -1 +1 @@
1
- {"version":3,"file":"canvas_renderer.d.ts","sourceRoot":"","sources":["../../../src/video/canvas/canvas_renderer.js"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"canvas_renderer.d.ts","sourceRoot":"","sources":["../../../src/video/canvas/canvas_renderer.js"],"names":[],"mappings":"AAcA;;;;;;;;;;GAUG;AAEH;;;GAGG;AACH;IAiBE,oBAAmC;IAiCnC,wBAEC;IAyBD;;;OAGG;IACH,8CAA4B;IAyE1B;;;OAGG;IACH,mBAA0B;IA6B7B;;;;;OAKG;IACH,sBAFW,QAAQ,QAclB;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;IACH,oBAHW,MAAM,GACJ,MAAM,CA2ClB;IAWD;;;;OAIG;IACH,mBAHW,KAAK,GAAC,MAAM,WACZ,OAAO,QAajB;IAED;;;;;;OAMG;IACH,aALW,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,QAIhB;IAED;;;;;;;;;;;OAWG;IACH,qBAVW,gBAAgB,GAAC,eAAe,GAAC,gBAAgB,GAAC,iBAAiB,GAAC,WAAW,GAAC,eAAe,GAAC,UAAU,WAC1G,MAAM,GACJ,aAAa,CAezB;IAiID;;;;;;;;OAQG;IACH,qBAPW,aAAa,KACb,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,QAiBhB;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,eAFW,IAAI,QAwOd;IA1LE;;;OAGG;IACH,kEAAyD;IACzD;;;OAGG;IACH,uFAA2D;IAa5D;;;OAGG;IACH,oDAAkD;IAkKpD;;;;;;;;;;;;;;;OAeG;IACH,kBAEC;IAED;;;;OAIG;IACH,UAHW,MAAM,KACN,MAAM,QAIhB;IAED;;OAEG;IACH,6BAEC;IAED;;;;;;OAMG;IACH,sBALW,MAAM,OACN,MAAM,KACN,MAAM,KACN,MAAM,QAIhB;IAED;;;;;;;;OAQG;IACH,oBAPW,MAAM,QACN,MAAM,QACN,MAAM,QACN,MAAM,KACN,MAAM,KACN,MAAM,QAIhB;IAED;;;;;;;OAOG;IACH,UANW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,UACN,MAAM,QAIhB;IAED;;;;;;OAMG;IACH,QALW,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,QAIhB;IAED;;;;;;;OAOG;IACH,aANW,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,SACN,MAAM,QAIhB;IAED;;;;OAIG;IACH,eAHW,IAAI,GAAC,SAAS,GAAC,OAAO,GAAC,IAAI,GAAC,OAAO,GAAC,MAAM,SAC1C,OAAO,QAoCjB;IAED;;;OAGG;IACH,aAFW,IAAI,GAAC,SAAS,GAAC,OAAO,GAAC,IAAI,GAAC,OAAO,GAAC,MAAM,QAIpD;IAED;;OAEG;IACH,kBAEC;IAED;;;;;;;;;OASG;IACH,aARW,MAAM,KACN,MAAM,UACN,MAAM,SACN,MAAM,OACN,MAAM,kBACN,OAAO,SACP,OAAO,QAcjB;IAED;;;;;;;;OAQG;IACH,WAPW,MAAM,KACN,MAAM,UACN,MAAM,SACN,MAAM,OACN,MAAM,kBACN,OAAO,QAIjB;IAsDD;;;;;;OAMG;IACH,iBALW,MAAM,UACN,MAAM,QACN,MAAM,QACN,MAAM,QAIhB;IAmBD;;;;OAIG;IACH,oBAHW,OAAO,SACP,OAAO,QAyBjB;IAED;;;OAGG;IACH,kBAFW,OAAO,QAIjB;IA+BD;;;;;;;;OAQG;IACH,mBAPW,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,UACN,MAAM,SACN,OAAO,QAYjB;IAED;;;;;;;OAOG;IACH,iBANW,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,UACN,MAAM,QAIhB;IAED;;;;OAIG;IACH,eAHW,MAAM,KACN,MAAM,QAIhB;IAED;;;;OAIG;IACH,aAHW,MAAM,KACN,MAAM,QAIhB;IA+GD;;;OAGG;IACH,kBAFa,MAAM,CAIlB;IA6BD;;;OAGG;IACH,oBAXU,MAAM,EAcf;IAjBD;;;;;OAKG;IACH,gBAHU,MAAM,CAKf;IAWD;;;;;;;;;OASG;IACH,gBAPW,QAAQ,GAAC,QAAQ,GAAC,MAAM,MACxB,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QAKhB;IAED;;;;;;;;;OASG;IACH,aAPW,QAAQ,GAAC,QAAQ,GAAC,MAAM,MACxB,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QA+BhB;IA8GC;;;OAGG;IACH,2CAAkC;CAgGpC;qBA1iDoB,kBAAkB;yBACd,uBAAuB;sBAX1B,uBAAuB;0BAgBtB,iCAAiC;+BAC5B,iCAAiC;6BACnC,6BAA6B;0BAChC,4BAA4B;6BACzB,+BAA+B;4BAEhC,yBAAyB;8BADvB,wBAAwB"}
@@ -1,25 +1,2 @@
1
- /**
2
- * Create and return a new Canvas element (or `OffscreenCanvas` when
3
- * supported and `returnOffscreenCanvas` is true). The single low-level
4
- * allocator used by every renderer-side scratch / fallback / render-
5
- * target canvas in the engine.
6
- *
7
- * Lives in its own module (not on `Renderer` directly) to break the
8
- * circular dependency between `Renderer` and `CanvasRenderTarget` —
9
- * both can import this helper without referencing each other.
10
- * `Renderer.createCanvas` re-exposes it as a static method for the
11
- * public-facing API; internal callers can import it directly.
12
- *
13
- * Gates the OffscreenCanvas path on `device.offscreenCanvas` (the
14
- * vetted capability check — actually instantiates + verifies
15
- * `getContext("2d")` works inside a try/catch, covering historical
16
- * Safari quirks).
17
- * @param {number} width - canvas width in pixels
18
- * @param {number} height - canvas height in pixels
19
- * @param {boolean} [returnOffscreenCanvas=false] - return an
20
- * `OffscreenCanvas` if the platform supports it
21
- * @returns {HTMLCanvasElement|OffscreenCanvas} a new canvas of the given size
22
- * @ignore
23
- */
24
- export function createCanvas(width: number, height: number, returnOffscreenCanvas?: boolean): HTMLCanvasElement | OffscreenCanvas;
1
+
25
2
  //# sourceMappingURL=canvas_factory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"canvas_factory.d.ts","sourceRoot":"","sources":["../../src/video/canvas_factory.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,oCAPW,MAAM,UACN,MAAM,0BACN,OAAO,GAEL,iBAAiB,GAAC,eAAe,CAsB7C"}
1
+ {"version":3,"file":"canvas_factory.d.ts","sourceRoot":"","sources":["../../src/video/canvas_factory.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,oCARW,MAAM,UACN,MAAM,0BACN,OAAO,GAEL,iBAAiB,GAAC,eAAe,CAuB7C"}
@@ -1,57 +1,3 @@
1
1
  export const wgslFragment: "\nstruct BlendUniforms {\n\tuBlendMode : f32,\n};\n@group(3) @binding(0) var<uniform> fx : BlendUniforms;\n@group(3) @binding(1) var backdrop : texture_2d<f32>;\n@group(3) @binding(2) var backdrop_sampler : sampler;\n\n// HardLight(Cb, Cs) \u2014 also the kernel for Overlay, which the W3C spec\n// defines as HardLight with the arguments swapped\nfn ME_hardLight(b : vec3f, s : vec3f) -> vec3f {\n\tlet lo = 2.0 * b * s;\n\tlet hi = 1.0 - 2.0 * (1.0 - b) * (1.0 - s);\n\treturn mix(lo, hi, step(vec3f(0.5), s));\n}\n\nfn ME_softLight(b : vec3f, s : vec3f) -> vec3f {\n\tlet d = mix(((16.0 * b - 12.0) * b + 4.0) * b, sqrt(b), step(vec3f(0.25), b));\n\tlet lo = b - (1.0 - 2.0 * s) * b * (1.0 - b);\n\tlet hi = b + (2.0 * s - 1.0) * (d - b);\n\treturn mix(lo, hi, step(vec3f(0.5), s));\n}\n\n// Cb == 0 wins over Cs == 1, so it is applied last\nfn ME_colorDodge(b : vec3f, s : vec3f) -> vec3f {\n\tvar r = min(vec3f(1.0), b / max(1.0 - s, vec3f(1e-4)));\n\tr = mix(r, vec3f(1.0), step(vec3f(1.0), s));\n\treturn mix(r, vec3f(0.0), step(b, vec3f(0.0)));\n}\n\n// Cb == 1 wins over Cs == 0, so it is applied last\nfn ME_colorBurn(b : vec3f, s : vec3f) -> vec3f {\n\tvar r = 1.0 - min(vec3f(1.0), (1.0 - b) / max(s, vec3f(1e-4)));\n\tr = mix(r, vec3f(0.0), step(s, vec3f(0.0)));\n\treturn mix(r, vec3f(1.0), step(vec3f(1.0), b));\n}\n\nfn ME_blend(b : vec3f, s : vec3f) -> vec3f {\n\tif (fx.uBlendMode < 0.5) { return abs(b - s); }\n\tif (fx.uBlendMode < 1.5) { return ME_hardLight(s, b); }\n\tif (fx.uBlendMode < 2.5) { return ME_hardLight(b, s); }\n\tif (fx.uBlendMode < 3.5) { return ME_colorDodge(b, s); }\n\tif (fx.uBlendMode < 4.5) { return ME_colorBurn(b, s); }\n\tif (fx.uBlendMode < 5.5) { return ME_softLight(b, s); }\n\tif (fx.uBlendMode < 6.5) { return min(b, s); }\n\treturn max(b, s);\n}\n\nfn apply(color : vec4f, uv : vec2f) -> vec4f {\n\t// sampled BEFORE any branch, so plain textureSampleLevel is safe here\n\tlet Cb = textureSampleLevel(backdrop, backdrop_sampler, screen_uv, 0.0).rgb;\n\tlet a = color.a;\n\tlet Cs = color.rgb / max(a, 1e-4);\n\tlet B = clamp(ME_blend(Cb, Cs), vec3f(0.0), vec3f(1.0));\n\treturn vec4f(a * B, a);\n}\n";
2
- /**
3
- * The compositing shader behind the six CSS blend modes that fixed-function
4
- * blending cannot express: `overlay`, `hard-light`, `color-dodge`,
5
- * `color-burn`, `soft-light` and `difference`.
6
- *
7
- * Internal — owned by the renderer, one instance per renderer, never
8
- * constructed or configured by user code. A game selects a mode the ordinary
9
- * way (`sprite.blendMode = "overlay"`, or `renderer.setBlendMode("overlay")`)
10
- * and the renderer drives this effect from there.
11
- *
12
- * ### How it composites
13
- *
14
- * The renderer captures the destination, renders the draw to an offscreen
15
- * target, then blits that target through this effect. Everything arriving in
16
- * `color` is PREMULTIPLIED (the offscreen was drawn source-over into a
17
- * transparent clear), while the W3C formulas are defined on straight colour —
18
- * so the body un-premultiplies, blends, and re-premultiplies.
19
- *
20
- * Emitting premultiplied and letting ordinary source-over run the composite
21
- * yields `as*B + (1-as)*Cb` and a correct output alpha for free. It also keeps
22
- * the premultiplied invariant `rgb <= a` — a texel with `rgb > a` is undefined
23
- * and diverges across browsers — which is why `B` is clamped even though all
24
- * six formulas land in `[0,1]` analytically.
25
- *
26
- * The backdrop is treated as opaque (`ab = 1`). The GL capture is an RGB
27
- * texture so that is true by construction there; the WebGPU capture preserves
28
- * alpha and is deliberately ignored, so the two backends agree.
29
- *
30
- * ### Why not the `: screen_texture` builtin
31
- *
32
- * That annotation wires the sampler to the renderer's SHARED capture slot,
33
- * which `drawImage` already refreshes on behalf of any custom shader that
34
- * samples the screen. A renderable carrying an advanced blend mode AND a
35
- * screen-sampling {@link ShaderEffect} would then have the two fighting over
36
- * one texture. This declares a plain sampler instead and the renderer binds
37
- * its own capture, so the two are independent. Referencing `screen_uv` still
38
- * activates that varying on its own.
39
- * @see {@link https://www.w3.org/TR/compositing-1/#blending}
40
- * @ignore
41
- */
42
- export default class BlendEffect extends ShaderEffect {
43
- /**
44
- * @param {import("../webgl/webgl_renderer.js").default|import("../webgpu/webgpu_renderer.js").default} renderer - the renderer that owns this effect
45
- */
46
- constructor(renderer: import("../webgl/webgl_renderer.js").default | import("../webgpu/webgpu_renderer.js").default);
47
- /**
48
- * Select which of the six formulas the shader evaluates.
49
- * @param {string} mode - one of the modes in {@link ADVANCED_BLEND_MODES}
50
- * @returns {boolean} false when the mode is not an advanced blend mode, in
51
- * which case the uniform is left untouched
52
- * @ignore
53
- */
54
- setBlendMode(mode: string): boolean;
55
- }
56
2
  import ShaderEffect from "./shadereffect.js";
57
3
  //# sourceMappingURL=blendEffect.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"blendEffect.d.ts","sourceRoot":"","sources":["../../../src/video/effects/blendEffect.js"],"names":[],"mappings":"AAgBA,soEAwDE;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH;IACC;;OAEG;IACH,sBAFW,OAAO,4BAA4B,EAAE,OAAO,GAAC,OAAO,8BAA8B,EAAE,OAAO,EA4DrG;IAED;;;;;;OAMG;IACH,mBALW,MAAM,GACJ,OAAO,CAWnB;CACD;yBAhMwB,mBAAmB"}
1
+ {"version":3,"file":"blendEffect.d.ts","sourceRoot":"","sources":["../../../src/video/effects/blendEffect.js"],"names":[],"mappings":"AAgBA,soEAwDE;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH;IACC;;OAEG;IACH,sBAFW,OAAO,4BAA4B,EAAE,OAAO,GAAC,OAAO,8BAA8B,EAAE,OAAO,EA4DrG;IAED;;;;;;;OAOG;IACH,mBANW,MAAM,GACJ,OAAO,CAYnB;CACD;yBAlMwB,mBAAmB"}
@@ -3,19 +3,19 @@
3
3
  * Commonly used for background defocus, depth-of-field simulation,
4
4
  * or UI backdrop blur.
5
5
  * @category Effects
6
- * @see {@link Renderable.shader} for usage
6
+ * @see {@link Renderable#addPostEffect} for usage
7
7
  * @example
8
8
  * // moderate blur
9
- * mySprite.shader = new BlurEffect(renderer, { strength: 2.0 });
9
+ * mySprite.addPostEffect(new BlurEffect(renderer, { strength: 2.0 }));
10
10
  */
11
11
  export default class BlurEffect extends ShaderEffect {
12
12
  /**
13
- * @param {import("../webgl_renderer.js").default} renderer - the current renderer instance
13
+ * @param {WebGLRenderer|WebGPURenderer|CanvasRenderer} renderer - the current renderer instance
14
14
  * @param {object} [options] - effect options
15
15
  * @param {number} [options.strength=1.0] - blur strength in texels
16
16
  * @param {number[]} [options.textureSize=[256, 256]] - texture dimensions [width, height]
17
17
  */
18
- constructor(renderer: any, options?: {
18
+ constructor(renderer: WebGLRenderer | WebGPURenderer | CanvasRenderer, options?: {
19
19
  strength?: number | undefined;
20
20
  textureSize?: number[] | undefined;
21
21
  });
@@ -1 +1 @@
1
- {"version":3,"file":"blur.d.ts","sourceRoot":"","sources":["../../../src/video/effects/blur.js"],"names":[],"mappings":"AA4BA;;;;;;;;;GASG;AACH;IACC;;;;;OAKG;IACH,qCAHG;QAAyB,QAAQ;QACN,WAAW;KACxC,EA8BA;IALA,iBAAuC;IAOxC;;;OAGG;IACH,sBAFW,MAAM,QAKhB;IAED;;;;OAIG;IACH,sBAHW,MAAM,UACN,MAAM,QAIhB;CACD;yBA7FwB,mBAAmB"}
1
+ {"version":3,"file":"blur.d.ts","sourceRoot":"","sources":["../../../src/video/effects/blur.js"],"names":[],"mappings":"AA4BA;;;;;;;;;GASG;AACH;IACC;;;;;OAKG;IACH,sBALW,aAAa,GAAC,cAAc,GAAC,cAAc,YAEnD;QAAyB,QAAQ;QACN,WAAW;KACxC,EA8BA;IALA,iBAAuC;IAOxC;;;OAGG;IACH,sBAFW,MAAM,QAKhB;IAED;;;;OAIG;IACH,sBAHW,MAAM,UACN,MAAM,QAIhB;CACD;yBA7FwB,mBAAmB"}
@@ -3,22 +3,22 @@
3
3
  * chromatic aberration (color fringe) effect. Commonly used for
4
4
  * impact feedback, glitch effects, or damage indicators.
5
5
  * @category Effects
6
- * @see {@link Renderable.shader} for usage
6
+ * @see {@link Renderable#addPostEffect} for usage
7
7
  * @example
8
8
  * // subtle chromatic aberration
9
- * mySprite.shader = new ChromaticAberrationEffect(renderer, { offset: 2.0 });
9
+ * mySprite.addPostEffect(new ChromaticAberrationEffect(renderer, { offset: 2.0 }));
10
10
  * @example
11
11
  * // strong glitch effect
12
- * mySprite.shader = new ChromaticAberrationEffect(renderer, { offset: 5.0 });
12
+ * mySprite.addPostEffect(new ChromaticAberrationEffect(renderer, { offset: 5.0 }));
13
13
  */
14
14
  export default class ChromaticAberrationEffect extends ShaderEffect {
15
15
  /**
16
- * @param {import("../webgl_renderer.js").default} renderer - the current renderer instance
16
+ * @param {WebGLRenderer|WebGPURenderer|CanvasRenderer} renderer - the current renderer instance
17
17
  * @param {object} [options] - effect options
18
18
  * @param {number} [options.offset=3.0] - channel offset in texels
19
19
  * @param {number[]} [options.textureSize=[256, 256]] - texture dimensions [width, height]
20
20
  */
21
- constructor(renderer: any, options?: {
21
+ constructor(renderer: WebGLRenderer | WebGPURenderer | CanvasRenderer, options?: {
22
22
  offset?: number | undefined;
23
23
  textureSize?: number[] | undefined;
24
24
  });
@@ -1 +1 @@
1
- {"version":3,"file":"chromaticAberration.d.ts","sourceRoot":"","sources":["../../../src/video/effects/chromaticAberration.js"],"names":[],"mappings":"AAqBA;;;;;;;;;;;;GAYG;AACH;IACC;;;;;OAKG;IACH,qCAHG;QAAyB,MAAM;QACJ,WAAW;KACxC,EAuBA;IALA,eAAmC;IAOpC;;;OAGG;IACH,kBAFW,MAAM,QAKhB;IAED;;;;OAIG;IACH,sBAHW,MAAM,UACN,MAAM,QAIhB;CACD;yBAlFwB,mBAAmB"}
1
+ {"version":3,"file":"chromaticAberration.d.ts","sourceRoot":"","sources":["../../../src/video/effects/chromaticAberration.js"],"names":[],"mappings":"AAqBA;;;;;;;;;;;;GAYG;AACH;IACC;;;;;OAKG;IACH,sBALW,aAAa,GAAC,cAAc,GAAC,cAAc,YAEnD;QAAyB,MAAM;QACJ,WAAW;KACxC,EAuBA;IALA,eAAmC;IAOpC;;;OAGG;IACH,kBAFW,MAAM,QAKhB;IAED;;;;OAIG;IACH,sBAHW,MAAM,UACN,MAAM,QAIhB;CACD;yBAlFwB,mBAAmB"}
@@ -2,36 +2,26 @@
2
2
  * A shader effect that applies a 4x4 color transformation matrix.
3
3
  * Provides chainable color adjustment methods that automatically update the GPU uniform.
4
4
  * @category Effects
5
- * @see {@link Renderable.shader} for usage
5
+ * @see {@link Renderable#addPostEffect} for usage
6
6
  * @example
7
7
  * // desaturate a sprite
8
- * mySprite.shader = new ColorMatrixEffect(renderer).saturate(0.0);
8
+ * mySprite.addPostEffect(new ColorMatrixEffect(renderer).saturate(0.0));
9
9
  * @example
10
10
  * // combine brightness + contrast on a camera
11
- * camera.shader = new ColorMatrixEffect(renderer).brightness(1.3).contrast(1.5);
11
+ * camera.addPostEffect(new ColorMatrixEffect(renderer).brightness(1.3).contrast(1.5));
12
12
  * @example
13
13
  * // update dynamically
14
14
  * effect.reset().brightness(1.5).saturate(0.5);
15
15
  */
16
16
  export default class ColorMatrixEffect extends ShaderEffect {
17
17
  /**
18
- * @param {import("../webgl_renderer.js").default} renderer - the current renderer instance
18
+ * @param {WebGLRenderer|WebGPURenderer|CanvasRenderer} renderer - the current renderer instance
19
19
  * @param {object} [options] - effect options
20
20
  * @param {ColorMatrix} [options.matrix] - an initial color matrix. Defaults to identity.
21
21
  */
22
- constructor(renderer: any, options?: {
22
+ constructor(renderer: WebGLRenderer | WebGPURenderer | CanvasRenderer, options?: {
23
23
  matrix?: ColorMatrix | undefined;
24
24
  });
25
- /**
26
- * the internal color matrix
27
- * @ignore
28
- */
29
- _matrix: ColorMatrix;
30
- /**
31
- * Push the current matrix values to the GPU.
32
- * @ignore
33
- */
34
- _syncUniform(): void;
35
25
  /**
36
26
  * Reset the color matrix to identity (no color change).
37
27
  * @returns {this} this instance for chaining
@@ -1 +1 @@
1
- {"version":3,"file":"colorMatrix.d.ts","sourceRoot":"","sources":["../../../src/video/effects/colorMatrix.js"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;;GAcG;AACH;IACC;;;;OAIG;IACH,qCAFG;QAA8B,MAAM;KACtC,EAkBA;IANA;;;OAGG;IACH,qBAAkD;IAInD;;;OAGG;IACH,qBAEC;IAED;;;OAGG;IACH,SAFa,IAAI,CAMhB;IAED;;;;OAIG;IACH,mBAHW,MAAM,GACJ,IAAI,CAMhB;IAED;;;;OAIG;IACH,iBAHW,MAAM,GACJ,IAAI,CAMhB;IAED;;;;OAIG;IACH,iBAHW,MAAM,GACJ,IAAI,CAMhB;IAED;;;;OAIG;IACH,iBAHW,MAAM,GACJ,IAAI,CAMhB;IAED;;;;OAIG;IACH,eAHW,MAAM,GACJ,IAAI,CAMhB;IAED;;;;OAIG;IACH,sBAHW,MAAM,GACJ,IAAI,CAMhB;IAED;;;;OAIG;IACH,iBAHW,WAAW,GACT,IAAI,CAMhB;IAED;;;;;OAKG;IACH,mBAHc,MAAM,EAAA,GACP,IAAI,CAMhB;CACD;yBAjKwB,mBAAmB;4BADhB,4BAA4B"}
1
+ {"version":3,"file":"colorMatrix.d.ts","sourceRoot":"","sources":["../../../src/video/effects/colorMatrix.js"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;;GAcG;AACH;IACC;;;;OAIG;IACH,sBAJW,aAAa,GAAC,cAAc,GAAC,cAAc,YAEnD;QAA8B,MAAM;KACtC,EAmBA;IAPA;;;;OAIG;IACH,qBAAkD;IAInD;;;;OAIG;IACH,qBAEC;IAED;;;OAGG;IACH,SAFa,IAAI,CAMhB;IAED;;;;OAIG;IACH,mBAHW,MAAM,GACJ,IAAI,CAMhB;IAED;;;;OAIG;IACH,iBAHW,MAAM,GACJ,IAAI,CAMhB;IAED;;;;OAIG;IACH,iBAHW,MAAM,GACJ,IAAI,CAMhB;IAED;;;;OAIG;IACH,iBAHW,MAAM,GACJ,IAAI,CAMhB;IAED;;;;OAIG;IACH,eAHW,MAAM,GACJ,IAAI,CAMhB;IAED;;;;OAIG;IACH,sBAHW,MAAM,GACJ,IAAI,CAMhB;IAED;;;;OAIG;IACH,iBAHW,WAAW,GACT,IAAI,CAMhB;IAED;;;;;OAKG;IACH,mBAHc,MAAM,EAAA,GACP,IAAI,CAMhB;CACD;yBAnKwB,mBAAmB;4BADhB,4BAA4B"}
@@ -2,21 +2,21 @@
2
2
  * A shader effect that desaturates (grayscales) the sprite.
3
3
  * Commonly used for disabled states, death effects, or petrification.
4
4
  * @category Effects
5
- * @see {@link Renderable.shader} for usage
5
+ * @see {@link Renderable#addPostEffect} for usage
6
6
  * @example
7
7
  * // full grayscale
8
- * mySprite.shader = new DesaturateEffect(renderer);
8
+ * mySprite.addPostEffect(new DesaturateEffect(renderer));
9
9
  * @example
10
10
  * // partial desaturation (50%)
11
- * mySprite.shader = new DesaturateEffect(renderer, { intensity: 0.5 });
11
+ * mySprite.addPostEffect(new DesaturateEffect(renderer, { intensity: 0.5 }));
12
12
  */
13
13
  export default class DesaturateEffect extends ColorMatrixEffect {
14
14
  /**
15
- * @param {import("../webgl_renderer.js").default} renderer - the current renderer instance
15
+ * @param {WebGLRenderer|WebGPURenderer|CanvasRenderer} renderer - the current renderer instance
16
16
  * @param {object} [options] - effect options
17
17
  * @param {number} [options.intensity=1.0] - desaturation intensity (0.0 = full color, 1.0 = grayscale)
18
18
  */
19
- constructor(renderer: any, options?: {
19
+ constructor(renderer: WebGLRenderer | WebGPURenderer | CanvasRenderer, options?: {
20
20
  intensity?: number | undefined;
21
21
  });
22
22
  intensity: number;
@@ -1 +1 @@
1
- {"version":3,"file":"desaturate.d.ts","sourceRoot":"","sources":["../../../src/video/effects/desaturate.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH;IACC;;;;OAIG;IACH,qCAFG;QAAyB,SAAS;KACpC,EAMA;IAHA,kBACgE;IAIjE;;;OAGG;IACH,oBAFW,MAAM,QAKhB;CACD;8BAnC6B,kBAAkB"}
1
+ {"version":3,"file":"desaturate.d.ts","sourceRoot":"","sources":["../../../src/video/effects/desaturate.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH;IACC;;;;OAIG;IACH,sBAJW,aAAa,GAAC,cAAc,GAAC,cAAc,YAEnD;QAAyB,SAAS;KACpC,EAMA;IAHA,kBACgE;IAIjE;;;OAGG;IACH,oBAFW,MAAM,QAKhB;CACD;8BAnC6B,kBAAkB"}
@@ -4,24 +4,24 @@
4
4
  * `progress` value increases from 0 to 1.
5
5
  * Commonly used for death, spawn, or teleport effects.
6
6
  * @category Effects
7
- * @see {@link Renderable.shader} for usage
7
+ * @see {@link Renderable#addPostEffect} for usage
8
8
  * @example
9
9
  * // create a dissolve effect
10
10
  * const dissolve = new DissolveEffect(renderer);
11
- * mySprite.shader = dissolve;
11
+ * mySprite.addPostEffect(dissolve);
12
12
  *
13
13
  * // animate the dissolve (0 = fully visible, 1 = fully dissolved)
14
14
  * dissolve.setProgress(0.5);
15
15
  */
16
16
  export default class DissolveEffect extends ShaderEffect {
17
17
  /**
18
- * @param {import("../webgl_renderer.js").default} renderer - the current renderer instance
18
+ * @param {WebGLRenderer|WebGPURenderer|CanvasRenderer} renderer - the current renderer instance
19
19
  * @param {object} [options] - effect options
20
20
  * @param {number} [options.progress=0.0] - dissolve progress (0.0 = visible, 1.0 = dissolved)
21
21
  * @param {number[]} [options.edgeColor=[1.0, 0.5, 0.0]] - color of the dissolve edge
22
22
  * @param {number} [options.edgeWidth=0.1] - width of the colored edge (0.0–1.0)
23
23
  */
24
- constructor(renderer: any, options?: {
24
+ constructor(renderer: WebGLRenderer | WebGPURenderer | CanvasRenderer, options?: {
25
25
  progress?: number | undefined;
26
26
  edgeColor?: number[] | undefined;
27
27
  edgeWidth?: number | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"dissolve.d.ts","sourceRoot":"","sources":["../../../src/video/effects/dissolve.js"],"names":[],"mappings":"AA8DA;;;;;;;;;;;;;;GAcG;AACH;IACC;;;;;;OAMG;IACH,qCAJG;QAAyB,QAAQ;QACN,SAAS;QACX,SAAS;KACpC,EA0DA;IAPA,iBAAuC;IASxC;;;OAGG;IACH,mBAFW,MAAM,QAKhB;IAED;;;OAGG;IACH,oBAFW,MAAM,EAAE,QAIlB;CACD;yBAhKwB,mBAAmB"}
1
+ {"version":3,"file":"dissolve.d.ts","sourceRoot":"","sources":["../../../src/video/effects/dissolve.js"],"names":[],"mappings":"AA8DA;;;;;;;;;;;;;;GAcG;AACH;IACC;;;;;;OAMG;IACH,sBANW,aAAa,GAAC,cAAc,GAAC,cAAc,YAEnD;QAAyB,QAAQ;QACN,SAAS;QACX,SAAS;KACpC,EA0DA;IAPA,iBAAuC;IASxC;;;OAGG;IACH,mBAFW,MAAM,QAKhB;IAED;;;OAGG;IACH,oBAFW,MAAM,EAAE,QAIlB;CACD;yBAhKwB,mBAAmB"}