1681-engine 0.0.0-stage → 0.5.8

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 (1014) hide show
  1. package/CHANGELOG.md +304 -0
  2. package/LICENSE +21 -0
  3. package/README.md +164 -2
  4. package/dist/1681-engine.js +417 -0
  5. package/dist/1681-engine.js.map +1 -0
  6. package/dist/ambient/ColorGrade.js +41 -0
  7. package/dist/ambient/ColorGrade.js.map +1 -0
  8. package/dist/ambient/DayClock.js +57 -0
  9. package/dist/ambient/DayClock.js.map +1 -0
  10. package/dist/ambient/WeatherLayer.js +91 -0
  11. package/dist/ambient/WeatherLayer.js.map +1 -0
  12. package/dist/ambient/grade.js +13 -0
  13. package/dist/ambient/grade.js.map +1 -0
  14. package/dist/ambient/weather.js +52 -0
  15. package/dist/ambient/weather.js.map +1 -0
  16. package/dist/anim/AnimStateMachine.js +164 -0
  17. package/dist/anim/AnimStateMachine.js.map +1 -0
  18. package/dist/anim/Animator.js +67 -0
  19. package/dist/anim/Animator.js.map +1 -0
  20. package/dist/anim/animStateCompile.js +113 -0
  21. package/dist/anim/animStateCompile.js.map +1 -0
  22. package/dist/anim/animStateSystem.js +17 -0
  23. package/dist/anim/animStateSystem.js.map +1 -0
  24. package/dist/anim/animationSystem.js +15 -0
  25. package/dist/anim/animationSystem.js.map +1 -0
  26. package/dist/anim/asepriteSlices.js +22 -0
  27. package/dist/anim/asepriteSlices.js.map +1 -0
  28. package/dist/anim/asepriteTags.js +35 -0
  29. package/dist/anim/asepriteTags.js.map +1 -0
  30. package/dist/anim/parseAseprite.js +83 -0
  31. package/dist/anim/parseAseprite.js.map +1 -0
  32. package/dist/assets/AssetLoader.js +104 -0
  33. package/dist/assets/AssetLoader.js.map +1 -0
  34. package/dist/assets/loadAseprite.js +50 -0
  35. package/dist/assets/loadAseprite.js.map +1 -0
  36. package/dist/assets/takeCleanerWorker-DTcI_Jqr.js +31 -0
  37. package/dist/assets/takeCleanerWorker-DTcI_Jqr.js.map +1 -0
  38. package/dist/audio/Footsteps.js +26 -0
  39. package/dist/audio/Footsteps.js.map +1 -0
  40. package/dist/audio/MusicPlayer.js +78 -0
  41. package/dist/audio/MusicPlayer.js.map +1 -0
  42. package/dist/audio/SoundEngine.js +119 -0
  43. package/dist/audio/SoundEngine.js.map +1 -0
  44. package/dist/audio/cleanTake.js +30 -0
  45. package/dist/audio/cleanTake.js.map +1 -0
  46. package/dist/audio/music/ElementVoice.js +35 -0
  47. package/dist/audio/music/ElementVoice.js.map +1 -0
  48. package/dist/audio/music/GraphVoice.js +39 -0
  49. package/dist/audio/music/GraphVoice.js.map +1 -0
  50. package/dist/audio/music/MusicChannel.js +58 -0
  51. package/dist/audio/music/MusicChannel.js.map +1 -0
  52. package/dist/audio/music/musicVoice.js +13 -0
  53. package/dist/audio/music/musicVoice.js.map +1 -0
  54. package/dist/audio/sampleBank.js +82 -0
  55. package/dist/audio/sampleBank.js.map +1 -0
  56. package/dist/audio/soundTable.js +9 -0
  57. package/dist/audio/soundTable.js.map +1 -0
  58. package/dist/audio/synth.js +36 -0
  59. package/dist/audio/synth.js.map +1 -0
  60. package/dist/core/BitmapLabel.js +49 -0
  61. package/dist/core/BitmapLabel.js.map +1 -0
  62. package/dist/core/Camera.js +150 -0
  63. package/dist/core/Camera.js.map +1 -0
  64. package/dist/core/Clock.js +30 -0
  65. package/dist/core/Clock.js.map +1 -0
  66. package/dist/core/Graphics.js +69 -0
  67. package/dist/core/Graphics.js.map +1 -0
  68. package/dist/core/Group.js +29 -0
  69. package/dist/core/Group.js.map +1 -0
  70. package/dist/core/Image.js +51 -0
  71. package/dist/core/Image.js.map +1 -0
  72. package/dist/core/ObjectFactory.js +55 -0
  73. package/dist/core/ObjectFactory.js.map +1 -0
  74. package/dist/core/Pointer.js +58 -0
  75. package/dist/core/Pointer.js.map +1 -0
  76. package/dist/core/Rectangle.js +51 -0
  77. package/dist/core/Rectangle.js.map +1 -0
  78. package/dist/core/Stage.js +86 -0
  79. package/dist/core/Stage.js.map +1 -0
  80. package/dist/core/Text.js +22 -0
  81. package/dist/core/Text.js.map +1 -0
  82. package/dist/core/TextureRegistry.js +111 -0
  83. package/dist/core/TextureRegistry.js.map +1 -0
  84. package/dist/core/Timeline.js +211 -0
  85. package/dist/core/Timeline.js.map +1 -0
  86. package/dist/core/TimelineBuilder.js +73 -0
  87. package/dist/core/TimelineBuilder.js.map +1 -0
  88. package/dist/core/TimelineChild.js +84 -0
  89. package/dist/core/TimelineChild.js.map +1 -0
  90. package/dist/core/Tweener.js +136 -0
  91. package/dist/core/Tweener.js.map +1 -0
  92. package/dist/core/atlas.js +38 -0
  93. package/dist/core/atlas.js.map +1 -0
  94. package/dist/core/atlasPlan.js +22 -0
  95. package/dist/core/atlasPlan.js.map +1 -0
  96. package/dist/core/eases.js +21 -0
  97. package/dist/core/eases.js.map +1 -0
  98. package/dist/core/gameObject.js +115 -0
  99. package/dist/core/gameObject.js.map +1 -0
  100. package/dist/core/pixiPatches.js +18 -0
  101. package/dist/core/pixiPatches.js.map +1 -0
  102. package/dist/core/timelinePlace.js +24 -0
  103. package/dist/core/timelinePlace.js.map +1 -0
  104. package/dist/core/tweenProps.js +12 -0
  105. package/dist/core/tweenProps.js.map +1 -0
  106. package/dist/debug/DebugOverlay.js +94 -0
  107. package/dist/debug/DebugOverlay.js.map +1 -0
  108. package/dist/debug/DrawCallCounter.js +41 -0
  109. package/dist/debug/DrawCallCounter.js.map +1 -0
  110. package/dist/debug/ErrorLog.js +22 -0
  111. package/dist/debug/ErrorLog.js.map +1 -0
  112. package/dist/debug/FrameStats.js +42 -0
  113. package/dist/debug/FrameStats.js.map +1 -0
  114. package/dist/debug/inspectWorld.js +29 -0
  115. package/dist/debug/inspectWorld.js.map +1 -0
  116. package/dist/diagnostics/ErrorDeduper.js +27 -0
  117. package/dist/diagnostics/ErrorDeduper.js.map +1 -0
  118. package/dist/diagnostics/FrameSampler.js +42 -0
  119. package/dist/diagnostics/FrameSampler.js.map +1 -0
  120. package/dist/diagnostics/bootWatch.js +21 -0
  121. package/dist/diagnostics/bootWatch.js.map +1 -0
  122. package/dist/diagnostics/captureErrors.js +27 -0
  123. package/dist/diagnostics/captureErrors.js.map +1 -0
  124. package/dist/diagnostics/contextLoss.js +25 -0
  125. package/dist/diagnostics/contextLoss.js.map +1 -0
  126. package/dist/diagnostics/frameStats.js +31 -0
  127. package/dist/diagnostics/frameStats.js.map +1 -0
  128. package/dist/diagnostics/gpuInfo.js +22 -0
  129. package/dist/diagnostics/gpuInfo.js.map +1 -0
  130. package/dist/diagnostics/renderGuard.js +24 -0
  131. package/dist/diagnostics/renderGuard.js.map +1 -0
  132. package/dist/ecs/SparseSet.js +55 -0
  133. package/dist/ecs/SparseSet.js.map +1 -0
  134. package/dist/ecs/World.js +307 -0
  135. package/dist/ecs/World.js.map +1 -0
  136. package/dist/ecs/fields.js +26 -0
  137. package/dist/ecs/fields.js.map +1 -0
  138. package/dist/engine/Engine.js +82 -0
  139. package/dist/engine/Engine.js.map +1 -0
  140. package/dist/engine/FixedLoop.js +37 -0
  141. package/dist/engine/FixedLoop.js.map +1 -0
  142. package/dist/engine/Scene.js +79 -0
  143. package/dist/engine/Scene.js.map +1 -0
  144. package/dist/engine/SceneManager.js +73 -0
  145. package/dist/engine/SceneManager.js.map +1 -0
  146. package/dist/events/EventBus.js +42 -0
  147. package/dist/events/EventBus.js.map +1 -0
  148. package/dist/fx/FloatingText.js +72 -0
  149. package/dist/fx/FloatingText.js.map +1 -0
  150. package/dist/fx/hitStop.js +28 -0
  151. package/dist/fx/hitStop.js.map +1 -0
  152. package/dist/fx/viewCull.js +10 -0
  153. package/dist/fx/viewCull.js.map +1 -0
  154. package/dist/i18n/Translator.js +72 -0
  155. package/dist/i18n/Translator.js.map +1 -0
  156. package/dist/i18n/extractStrings.js +58 -0
  157. package/dist/i18n/extractStrings.js.map +1 -0
  158. package/dist/i18n/formatMessage.js +19 -0
  159. package/dist/i18n/formatMessage.js.map +1 -0
  160. package/dist/input/Actions.js +131 -0
  161. package/dist/input/Actions.js.map +1 -0
  162. package/dist/input/AimGesture.js +75 -0
  163. package/dist/input/AimGesture.js.map +1 -0
  164. package/dist/input/Keyboard.js +54 -0
  165. package/dist/input/Keyboard.js.map +1 -0
  166. package/dist/input/Keymap.js +171 -0
  167. package/dist/input/Keymap.js.map +1 -0
  168. package/dist/input/TargetLock.js +73 -0
  169. package/dist/input/TargetLock.js.map +1 -0
  170. package/dist/input/aimAxis.js +8 -0
  171. package/dist/input/aimAxis.js.map +1 -0
  172. package/dist/input/keyChord.js +29 -0
  173. package/dist/input/keyChord.js.map +1 -0
  174. package/dist/input/longPress.js +32 -0
  175. package/dist/input/longPress.js.map +1 -0
  176. package/dist/input/stickAxis.js +23 -0
  177. package/dist/input/stickAxis.js.map +1 -0
  178. package/dist/input/touchDetect.js +7 -0
  179. package/dist/input/touchDetect.js.map +1 -0
  180. package/dist/light/LightLayer.js +84 -0
  181. package/dist/light/LightLayer.js.map +1 -0
  182. package/dist/nav/MinHeap.js +39 -0
  183. package/dist/nav/MinHeap.js.map +1 -0
  184. package/dist/nav/findPath.js +78 -0
  185. package/dist/nav/findPath.js.map +1 -0
  186. package/dist/nav/navGrid.js +36 -0
  187. package/dist/nav/navGrid.js.map +1 -0
  188. package/dist/nav/nearestOpen.js +19 -0
  189. package/dist/nav/nearestOpen.js.map +1 -0
  190. package/dist/nav/straightenPath.js +51 -0
  191. package/dist/nav/straightenPath.js.map +1 -0
  192. package/dist/net/Connection.js +84 -0
  193. package/dist/net/Connection.js.map +1 -0
  194. package/dist/net/InterpolationBuffer.js +57 -0
  195. package/dist/net/InterpolationBuffer.js.map +1 -0
  196. package/dist/net/PredictedMover.js +61 -0
  197. package/dist/net/PredictedMover.js.map +1 -0
  198. package/dist/net/Room.js +92 -0
  199. package/dist/net/Room.js.map +1 -0
  200. package/dist/net/RoomHost.js +101 -0
  201. package/dist/net/RoomHost.js.map +1 -0
  202. package/dist/net/cadence.js +22 -0
  203. package/dist/net/cadence.js.map +1 -0
  204. package/dist/net/constants.js +11 -0
  205. package/dist/net/constants.js.map +1 -0
  206. package/dist/net/lobby/LobbyClient.js +124 -0
  207. package/dist/net/lobby/LobbyClient.js.map +1 -0
  208. package/dist/net/lobby/LobbyHost.js +366 -0
  209. package/dist/net/lobby/LobbyHost.js.map +1 -0
  210. package/dist/net/lobby/LobbyRooms.js +66 -0
  211. package/dist/net/lobby/LobbyRooms.js.map +1 -0
  212. package/dist/net/lobby/Matchmaker.js +106 -0
  213. package/dist/net/lobby/Matchmaker.js.map +1 -0
  214. package/dist/net/movement.js +83 -0
  215. package/dist/net/movement.js.map +1 -0
  216. package/dist/net/protocol.js +11 -0
  217. package/dist/net/protocol.js.map +1 -0
  218. package/dist/net/serverClock.js +22 -0
  219. package/dist/net/serverClock.js.map +1 -0
  220. package/dist/net/snapshotCodec.js +92 -0
  221. package/dist/net/snapshotCodec.js.map +1 -0
  222. package/dist/parallax/Parallax.js +32 -0
  223. package/dist/parallax/Parallax.js.map +1 -0
  224. package/dist/parallax/ParallaxLayer.js +70 -0
  225. package/dist/parallax/ParallaxLayer.js.map +1 -0
  226. package/dist/parallax/parallaxMath.js +27 -0
  227. package/dist/parallax/parallaxMath.js.map +1 -0
  228. package/dist/particles/Emitter.js +108 -0
  229. package/dist/particles/Emitter.js.map +1 -0
  230. package/dist/particles/ParticleBudget.js +32 -0
  231. package/dist/particles/ParticleBudget.js.map +1 -0
  232. package/dist/particles/ParticleSim.js +60 -0
  233. package/dist/particles/ParticleSim.js.map +1 -0
  234. package/dist/particles/particleCurves.js +48 -0
  235. package/dist/particles/particleCurves.js.map +1 -0
  236. package/dist/particles/particleSampling.js +30 -0
  237. package/dist/particles/particleSampling.js.map +1 -0
  238. package/dist/physics/Body.js +202 -0
  239. package/dist/physics/Body.js.map +1 -0
  240. package/dist/physics/BroadPhase.js +56 -0
  241. package/dist/physics/BroadPhase.js.map +1 -0
  242. package/dist/physics/Contact.js +76 -0
  243. package/dist/physics/Contact.js.map +1 -0
  244. package/dist/physics/ContactSolver.js +70 -0
  245. package/dist/physics/ContactSolver.js.map +1 -0
  246. package/dist/physics/PhysicsWorld.js +221 -0
  247. package/dist/physics/PhysicsWorld.js.map +1 -0
  248. package/dist/physics/SpatialHash.js +39 -0
  249. package/dist/physics/SpatialHash.js.map +1 -0
  250. package/dist/physics/collide.js +76 -0
  251. package/dist/physics/collide.js.map +1 -0
  252. package/dist/physics/collidePolygon.js +94 -0
  253. package/dist/physics/collidePolygon.js.map +1 -0
  254. package/dist/physics/contactReport.js +14 -0
  255. package/dist/physics/contactReport.js.map +1 -0
  256. package/dist/physics/drawColliders.js +31 -0
  257. package/dist/physics/drawColliders.js.map +1 -0
  258. package/dist/physics/physicsSystem.js +8 -0
  259. package/dist/physics/physicsSystem.js.map +1 -0
  260. package/dist/physics/polygon.js +80 -0
  261. package/dist/physics/polygon.js.map +1 -0
  262. package/dist/physics/raycast.js +62 -0
  263. package/dist/physics/raycast.js.map +1 -0
  264. package/dist/physics/syncToBody.js +19 -0
  265. package/dist/physics/syncToBody.js.map +1 -0
  266. package/dist/physics/tileBodies.js +59 -0
  267. package/dist/physics/tileBodies.js.map +1 -0
  268. package/dist/physics/types.js +8 -0
  269. package/dist/physics/types.js.map +1 -0
  270. package/dist/pixel/Darkness.js +166 -0
  271. package/dist/pixel/Darkness.js.map +1 -0
  272. package/dist/pixel/DitherVignette.js +57 -0
  273. package/dist/pixel/DitherVignette.js.map +1 -0
  274. package/dist/pixel/Evaporation.js +85 -0
  275. package/dist/pixel/Evaporation.js.map +1 -0
  276. package/dist/pixel/NightShade.js +34 -0
  277. package/dist/pixel/NightShade.js.map +1 -0
  278. package/dist/pixel/PixelLayer.js +211 -0
  279. package/dist/pixel/PixelLayer.js.map +1 -0
  280. package/dist/pixel/SwayProp.js +75 -0
  281. package/dist/pixel/SwayProp.js.map +1 -0
  282. package/dist/pixel/lights.js +44 -0
  283. package/dist/pixel/lights.js.map +1 -0
  284. package/dist/pixel/nineSlice.js +62 -0
  285. package/dist/pixel/nineSlice.js.map +1 -0
  286. package/dist/pixel/paintLayer.js +36 -0
  287. package/dist/pixel/paintLayer.js.map +1 -0
  288. package/dist/pixel/palette.js +57 -0
  289. package/dist/pixel/palette.js.map +1 -0
  290. package/dist/pixel/pixel.js +278 -0
  291. package/dist/pixel/pixel.js.map +1 -0
  292. package/dist/pixel/pixelPaint.js +194 -0
  293. package/dist/pixel/pixelPaint.js.map +1 -0
  294. package/dist/pixel/pixelTone.js +164 -0
  295. package/dist/pixel/pixelTone.js.map +1 -0
  296. package/dist/pixel/propKit.js +41 -0
  297. package/dist/pixel/propKit.js.map +1 -0
  298. package/dist/pixel/ramp.js +102 -0
  299. package/dist/pixel/ramp.js.map +1 -0
  300. package/dist/pixel/selout.js +35 -0
  301. package/dist/pixel/selout.js.map +1 -0
  302. package/dist/pixel/spritePixels.js +59 -0
  303. package/dist/pixel/spritePixels.js.map +1 -0
  304. package/dist/pixel/swayRig.js +87 -0
  305. package/dist/pixel/swayRig.js.map +1 -0
  306. package/dist/pixel/vignetteMask.js +24 -0
  307. package/dist/pixel/vignetteMask.js.map +1 -0
  308. package/dist/pixel/weatherArt.js +61 -0
  309. package/dist/pixel/weatherArt.js.map +1 -0
  310. package/dist/pixel.js +90 -0
  311. package/dist/pixel.js.map +1 -0
  312. package/dist/platform/touch.js +33 -0
  313. package/dist/platform/touch.js.map +1 -0
  314. package/dist/postfx/BloomFilter.js +65 -0
  315. package/dist/postfx/BloomFilter.js.map +1 -0
  316. package/dist/postfx/ChromaticAberrationFilter.js +25 -0
  317. package/dist/postfx/ChromaticAberrationFilter.js.map +1 -0
  318. package/dist/postfx/ColorAdjustFilter.js +76 -0
  319. package/dist/postfx/ColorAdjustFilter.js.map +1 -0
  320. package/dist/postfx/CrtFilter.js +42 -0
  321. package/dist/postfx/CrtFilter.js.map +1 -0
  322. package/dist/postfx/PixelateFilter.js +27 -0
  323. package/dist/postfx/PixelateFilter.js.map +1 -0
  324. package/dist/postfx/PostFx.js +123 -0
  325. package/dist/postfx/PostFx.js.map +1 -0
  326. package/dist/postfx/ShockwaveFilter.js +49 -0
  327. package/dist/postfx/ShockwaveFilter.js.map +1 -0
  328. package/dist/postfx/VignetteFilter.js +37 -0
  329. package/dist/postfx/VignetteFilter.js.map +1 -0
  330. package/dist/postfx/fxAnimator.js +38 -0
  331. package/dist/postfx/fxAnimator.js.map +1 -0
  332. package/dist/postfx/fxShader.js +128 -0
  333. package/dist/postfx/fxShader.js.map +1 -0
  334. package/dist/postfx.js +26 -0
  335. package/dist/postfx.js.map +1 -0
  336. package/dist/react/ChoiceDialog.js +51 -0
  337. package/dist/react/ChoiceDialog.js.map +1 -0
  338. package/dist/react/ConfirmDialog.js +53 -0
  339. package/dist/react/ConfirmDialog.js.map +1 -0
  340. package/dist/react/Glyph.js +63 -0
  341. package/dist/react/Glyph.js.map +1 -0
  342. package/dist/react/Modal.js +38 -0
  343. package/dist/react/Modal.js.map +1 -0
  344. package/dist/react/Panel.js +24 -0
  345. package/dist/react/Panel.js.map +1 -0
  346. package/dist/react/PixelImage.js +24 -0
  347. package/dist/react/PixelImage.js.map +1 -0
  348. package/dist/react/Select.js +99 -0
  349. package/dist/react/Select.js.map +1 -0
  350. package/dist/react/Slider.js +62 -0
  351. package/dist/react/Slider.js.map +1 -0
  352. package/dist/react/SplitPane.js +24 -0
  353. package/dist/react/SplitPane.js.map +1 -0
  354. package/dist/react/TabStrip.js +32 -0
  355. package/dist/react/TabStrip.js.map +1 -0
  356. package/dist/react/TitleTips.js +42 -0
  357. package/dist/react/TitleTips.js.map +1 -0
  358. package/dist/react/Tooltip.js +28 -0
  359. package/dist/react/Tooltip.js.map +1 -0
  360. package/dist/react/UiProvider.js +50 -0
  361. package/dist/react/UiProvider.js.map +1 -0
  362. package/dist/react/baseCss.js +222 -0
  363. package/dist/react/baseCss.js.map +1 -0
  364. package/dist/react/choiceStore.js +23 -0
  365. package/dist/react/choiceStore.js.map +1 -0
  366. package/dist/react/classNames.js +19 -0
  367. package/dist/react/classNames.js.map +1 -0
  368. package/dist/react/confirmStore.js +30 -0
  369. package/dist/react/confirmStore.js.map +1 -0
  370. package/dist/react/labels.js +18 -0
  371. package/dist/react/labels.js.map +1 -0
  372. package/dist/react/placement.js +49 -0
  373. package/dist/react/placement.js.map +1 -0
  374. package/dist/react/useFillSheet.js +23 -0
  375. package/dist/react/useFillSheet.js.map +1 -0
  376. package/dist/react/useFitToViewport.js +29 -0
  377. package/dist/react/useFitToViewport.js.map +1 -0
  378. package/dist/react/usePicked.js +13 -0
  379. package/dist/react/usePicked.js.map +1 -0
  380. package/dist/react/useStore.js +9 -0
  381. package/dist/react/useStore.js.map +1 -0
  382. package/dist/react/useViewport.js +17 -0
  383. package/dist/react/useViewport.js.map +1 -0
  384. package/dist/react.js +78 -0
  385. package/dist/react.js.map +1 -0
  386. package/dist/rig/PosePlayer.js +92 -0
  387. package/dist/rig/PosePlayer.js.map +1 -0
  388. package/dist/rig/RigView.js +125 -0
  389. package/dist/rig/RigView.js.map +1 -0
  390. package/dist/rig/Skeleton.js +31 -0
  391. package/dist/rig/Skeleton.js.map +1 -0
  392. package/dist/rig/humanoid.js +6 -0
  393. package/dist/rig/humanoid.js.map +1 -0
  394. package/dist/rig/humanoid.json.js +30 -0
  395. package/dist/rig/humanoid.json.js.map +1 -0
  396. package/dist/rig/humanoidPoses.js +30 -0
  397. package/dist/rig/humanoidPoses.js.map +1 -0
  398. package/dist/rig/poseMath.js +54 -0
  399. package/dist/rig/poseMath.js.map +1 -0
  400. package/dist/rig/poses.json.js +150 -0
  401. package/dist/rig/poses.json.js.map +1 -0
  402. package/dist/save/Autosaver.js +54 -0
  403. package/dist/save/Autosaver.js.map +1 -0
  404. package/dist/save/MemoryBackend.js +19 -0
  405. package/dist/save/MemoryBackend.js.map +1 -0
  406. package/dist/save/SaveStore.js +103 -0
  407. package/dist/save/SaveStore.js.map +1 -0
  408. package/dist/save/WebStorageBackend.js +27 -0
  409. package/dist/save/WebStorageBackend.js.map +1 -0
  410. package/dist/save/checksum.js +10 -0
  411. package/dist/save/checksum.js.map +1 -0
  412. package/dist/save/migrateSave.js +27 -0
  413. package/dist/save/migrateSave.js.map +1 -0
  414. package/dist/settings.js +27 -0
  415. package/dist/settings.js.map +1 -0
  416. package/dist/tilemap/TilemapView.js +69 -0
  417. package/dist/tilemap/TilemapView.js.map +1 -0
  418. package/dist/tilemap/collision.js +25 -0
  419. package/dist/tilemap/collision.js.map +1 -0
  420. package/dist/tilemap/tiled.js +138 -0
  421. package/dist/tilemap/tiled.js.map +1 -0
  422. package/dist/transitions/CrossfadeTransition.js +24 -0
  423. package/dist/transitions/CrossfadeTransition.js.map +1 -0
  424. package/dist/transitions/DitherWipeTransition.js +70 -0
  425. package/dist/transitions/DitherWipeTransition.js.map +1 -0
  426. package/dist/transitions/FadeTransition.js +34 -0
  427. package/dist/transitions/FadeTransition.js.map +1 -0
  428. package/dist/transitions/Letterbox.js +42 -0
  429. package/dist/transitions/Letterbox.js.map +1 -0
  430. package/dist/transitions/ditherMask.js +15 -0
  431. package/dist/transitions/ditherMask.js.map +1 -0
  432. package/dist/transitions/transitionTo.js +28 -0
  433. package/dist/transitions/transitionTo.js.map +1 -0
  434. package/dist/transitions/tweenDone.js +15 -0
  435. package/dist/transitions/tweenDone.js.map +1 -0
  436. package/dist/types/ambient/ColorGrade.d.ts +41 -0
  437. package/dist/types/ambient/ColorGrade.d.ts.map +1 -0
  438. package/dist/types/ambient/DayClock.d.ts +80 -0
  439. package/dist/types/ambient/DayClock.d.ts.map +1 -0
  440. package/dist/types/ambient/WeatherLayer.d.ts +78 -0
  441. package/dist/types/ambient/WeatherLayer.d.ts.map +1 -0
  442. package/dist/types/ambient/grade.d.ts +22 -0
  443. package/dist/types/ambient/grade.d.ts.map +1 -0
  444. package/dist/types/ambient/weather.d.ts +49 -0
  445. package/dist/types/ambient/weather.d.ts.map +1 -0
  446. package/dist/types/anim/AnimStateMachine.d.ts +80 -0
  447. package/dist/types/anim/AnimStateMachine.d.ts.map +1 -0
  448. package/dist/types/anim/Animator.d.ts +50 -0
  449. package/dist/types/anim/Animator.d.ts.map +1 -0
  450. package/dist/types/anim/animStateCompile.d.ts +52 -0
  451. package/dist/types/anim/animStateCompile.d.ts.map +1 -0
  452. package/dist/types/anim/animStateSystem.d.ts +10 -0
  453. package/dist/types/anim/animStateSystem.d.ts.map +1 -0
  454. package/dist/types/anim/animStateTypes.d.ts +50 -0
  455. package/dist/types/anim/animStateTypes.d.ts.map +1 -0
  456. package/dist/types/anim/animationSystem.d.ts +13 -0
  457. package/dist/types/anim/animationSystem.d.ts.map +1 -0
  458. package/dist/types/anim/asepriteSlices.d.ts +19 -0
  459. package/dist/types/anim/asepriteSlices.d.ts.map +1 -0
  460. package/dist/types/anim/asepriteTags.d.ts +16 -0
  461. package/dist/types/anim/asepriteTags.d.ts.map +1 -0
  462. package/dist/types/anim/asepriteTypes.d.ts +159 -0
  463. package/dist/types/anim/asepriteTypes.d.ts.map +1 -0
  464. package/dist/types/anim/parseAseprite.d.ts +21 -0
  465. package/dist/types/anim/parseAseprite.d.ts.map +1 -0
  466. package/dist/types/assets/AssetLoader.d.ts +85 -0
  467. package/dist/types/assets/AssetLoader.d.ts.map +1 -0
  468. package/dist/types/assets/loadAseprite.d.ts +27 -0
  469. package/dist/types/assets/loadAseprite.d.ts.map +1 -0
  470. package/dist/types/audio/Footsteps.d.ts +33 -0
  471. package/dist/types/audio/Footsteps.d.ts.map +1 -0
  472. package/dist/types/audio/MusicPlayer.d.ts +65 -0
  473. package/dist/types/audio/MusicPlayer.d.ts.map +1 -0
  474. package/dist/types/audio/SoundEngine.d.ts +42 -0
  475. package/dist/types/audio/SoundEngine.d.ts.map +1 -0
  476. package/dist/types/audio/cleanTake.d.ts +3 -0
  477. package/dist/types/audio/cleanTake.d.ts.map +1 -0
  478. package/dist/types/audio/music/ElementVoice.d.ts +14 -0
  479. package/dist/types/audio/music/ElementVoice.d.ts.map +1 -0
  480. package/dist/types/audio/music/GraphVoice.d.ts +22 -0
  481. package/dist/types/audio/music/GraphVoice.d.ts.map +1 -0
  482. package/dist/types/audio/music/MusicChannel.d.ts +35 -0
  483. package/dist/types/audio/music/MusicChannel.d.ts.map +1 -0
  484. package/dist/types/audio/music/musicVoice.d.ts +26 -0
  485. package/dist/types/audio/music/musicVoice.d.ts.map +1 -0
  486. package/dist/types/audio/sampleBank.d.ts +27 -0
  487. package/dist/types/audio/sampleBank.d.ts.map +1 -0
  488. package/dist/types/audio/soundTable.d.ts +14 -0
  489. package/dist/types/audio/soundTable.d.ts.map +1 -0
  490. package/dist/types/audio/synth.d.ts +34 -0
  491. package/dist/types/audio/synth.d.ts.map +1 -0
  492. package/dist/types/audio/takeCleanerWorker.d.ts +2 -0
  493. package/dist/types/audio/takeCleanerWorker.d.ts.map +1 -0
  494. package/dist/types/core/BitmapLabel.d.ts +36 -0
  495. package/dist/types/core/BitmapLabel.d.ts.map +1 -0
  496. package/dist/types/core/Camera.d.ts +115 -0
  497. package/dist/types/core/Camera.d.ts.map +1 -0
  498. package/dist/types/core/Clock.d.ts +11 -0
  499. package/dist/types/core/Clock.d.ts.map +1 -0
  500. package/dist/types/core/Graphics.d.ts +37 -0
  501. package/dist/types/core/Graphics.d.ts.map +1 -0
  502. package/dist/types/core/Group.d.ts +15 -0
  503. package/dist/types/core/Group.d.ts.map +1 -0
  504. package/dist/types/core/Image.d.ts +25 -0
  505. package/dist/types/core/Image.d.ts.map +1 -0
  506. package/dist/types/core/ObjectFactory.d.ts +34 -0
  507. package/dist/types/core/ObjectFactory.d.ts.map +1 -0
  508. package/dist/types/core/Pointer.d.ts +27 -0
  509. package/dist/types/core/Pointer.d.ts.map +1 -0
  510. package/dist/types/core/Rectangle.d.ts +26 -0
  511. package/dist/types/core/Rectangle.d.ts.map +1 -0
  512. package/dist/types/core/Stage.d.ts +58 -0
  513. package/dist/types/core/Stage.d.ts.map +1 -0
  514. package/dist/types/core/Text.d.ts +22 -0
  515. package/dist/types/core/Text.d.ts.map +1 -0
  516. package/dist/types/core/TextureRegistry.d.ts +51 -0
  517. package/dist/types/core/TextureRegistry.d.ts.map +1 -0
  518. package/dist/types/core/Timeline.d.ts +115 -0
  519. package/dist/types/core/Timeline.d.ts.map +1 -0
  520. package/dist/types/core/TimelineBuilder.d.ts +53 -0
  521. package/dist/types/core/TimelineBuilder.d.ts.map +1 -0
  522. package/dist/types/core/TimelineChild.d.ts +51 -0
  523. package/dist/types/core/TimelineChild.d.ts.map +1 -0
  524. package/dist/types/core/Tweener.d.ts +70 -0
  525. package/dist/types/core/Tweener.d.ts.map +1 -0
  526. package/dist/types/core/atlas.d.ts +16 -0
  527. package/dist/types/core/atlas.d.ts.map +1 -0
  528. package/dist/types/core/atlasPlan.d.ts +34 -0
  529. package/dist/types/core/atlasPlan.d.ts.map +1 -0
  530. package/dist/types/core/eases.d.ts +3 -0
  531. package/dist/types/core/eases.d.ts.map +1 -0
  532. package/dist/types/core/gameObject.d.ts +42 -0
  533. package/dist/types/core/gameObject.d.ts.map +1 -0
  534. package/dist/types/core/pixiPatches.d.ts +9 -0
  535. package/dist/types/core/pixiPatches.d.ts.map +1 -0
  536. package/dist/types/core/timelinePlace.d.ts +23 -0
  537. package/dist/types/core/timelinePlace.d.ts.map +1 -0
  538. package/dist/types/core/tweenProps.d.ts +8 -0
  539. package/dist/types/core/tweenProps.d.ts.map +1 -0
  540. package/dist/types/core/types.d.ts +4 -0
  541. package/dist/types/core/types.d.ts.map +1 -0
  542. package/dist/types/debug/DebugOverlay.d.ts +63 -0
  543. package/dist/types/debug/DebugOverlay.d.ts.map +1 -0
  544. package/dist/types/debug/DrawCallCounter.d.ts +20 -0
  545. package/dist/types/debug/DrawCallCounter.d.ts.map +1 -0
  546. package/dist/types/debug/ErrorLog.d.ts +20 -0
  547. package/dist/types/debug/ErrorLog.d.ts.map +1 -0
  548. package/dist/types/debug/FrameStats.d.ts +21 -0
  549. package/dist/types/debug/FrameStats.d.ts.map +1 -0
  550. package/dist/types/debug/inspectWorld.d.ts +14 -0
  551. package/dist/types/debug/inspectWorld.d.ts.map +1 -0
  552. package/dist/types/diagnostics/ErrorDeduper.d.ts +17 -0
  553. package/dist/types/diagnostics/ErrorDeduper.d.ts.map +1 -0
  554. package/dist/types/diagnostics/FrameSampler.d.ts +37 -0
  555. package/dist/types/diagnostics/FrameSampler.d.ts.map +1 -0
  556. package/dist/types/diagnostics/bootWatch.d.ts +25 -0
  557. package/dist/types/diagnostics/bootWatch.d.ts.map +1 -0
  558. package/dist/types/diagnostics/captureErrors.d.ts +24 -0
  559. package/dist/types/diagnostics/captureErrors.d.ts.map +1 -0
  560. package/dist/types/diagnostics/contextLoss.d.ts +35 -0
  561. package/dist/types/diagnostics/contextLoss.d.ts.map +1 -0
  562. package/dist/types/diagnostics/frameStats.d.ts +30 -0
  563. package/dist/types/diagnostics/frameStats.d.ts.map +1 -0
  564. package/dist/types/diagnostics/gpuInfo.d.ts +9 -0
  565. package/dist/types/diagnostics/gpuInfo.d.ts.map +1 -0
  566. package/dist/types/diagnostics/renderGuard.d.ts +12 -0
  567. package/dist/types/diagnostics/renderGuard.d.ts.map +1 -0
  568. package/dist/types/ecs/SparseSet.d.ts +25 -0
  569. package/dist/types/ecs/SparseSet.d.ts.map +1 -0
  570. package/dist/types/ecs/World.d.ts +137 -0
  571. package/dist/types/ecs/World.d.ts.map +1 -0
  572. package/dist/types/ecs/fields.d.ts +34 -0
  573. package/dist/types/ecs/fields.d.ts.map +1 -0
  574. package/dist/types/engine/Engine.d.ts +80 -0
  575. package/dist/types/engine/Engine.d.ts.map +1 -0
  576. package/dist/types/engine/FixedLoop.d.ts +32 -0
  577. package/dist/types/engine/FixedLoop.d.ts.map +1 -0
  578. package/dist/types/engine/Scene.d.ts +67 -0
  579. package/dist/types/engine/Scene.d.ts.map +1 -0
  580. package/dist/types/engine/SceneManager.d.ts +36 -0
  581. package/dist/types/engine/SceneManager.d.ts.map +1 -0
  582. package/dist/types/events/EventBus.d.ts +20 -0
  583. package/dist/types/events/EventBus.d.ts.map +1 -0
  584. package/dist/types/fx/FloatingText.d.ts +71 -0
  585. package/dist/types/fx/FloatingText.d.ts.map +1 -0
  586. package/dist/types/fx/hitStop.d.ts +20 -0
  587. package/dist/types/fx/hitStop.d.ts.map +1 -0
  588. package/dist/types/fx/viewCull.d.ts +14 -0
  589. package/dist/types/fx/viewCull.d.ts.map +1 -0
  590. package/dist/types/i18n/Translator.d.ts +52 -0
  591. package/dist/types/i18n/Translator.d.ts.map +1 -0
  592. package/dist/types/i18n/extractStrings.d.ts +25 -0
  593. package/dist/types/i18n/extractStrings.d.ts.map +1 -0
  594. package/dist/types/i18n/formatMessage.d.ts +10 -0
  595. package/dist/types/i18n/formatMessage.d.ts.map +1 -0
  596. package/dist/types/index.d.ts +149 -0
  597. package/dist/types/index.d.ts.map +1 -0
  598. package/dist/types/input/Actions.d.ts +94 -0
  599. package/dist/types/input/Actions.d.ts.map +1 -0
  600. package/dist/types/input/AimGesture.d.ts +106 -0
  601. package/dist/types/input/AimGesture.d.ts.map +1 -0
  602. package/dist/types/input/Keyboard.d.ts +30 -0
  603. package/dist/types/input/Keyboard.d.ts.map +1 -0
  604. package/dist/types/input/Keymap.d.ts +85 -0
  605. package/dist/types/input/Keymap.d.ts.map +1 -0
  606. package/dist/types/input/TargetLock.d.ts +56 -0
  607. package/dist/types/input/TargetLock.d.ts.map +1 -0
  608. package/dist/types/input/aimAxis.d.ts +9 -0
  609. package/dist/types/input/aimAxis.d.ts.map +1 -0
  610. package/dist/types/input/keyChord.d.ts +15 -0
  611. package/dist/types/input/keyChord.d.ts.map +1 -0
  612. package/dist/types/input/longPress.d.ts +21 -0
  613. package/dist/types/input/longPress.d.ts.map +1 -0
  614. package/dist/types/input/stickAxis.d.ts +26 -0
  615. package/dist/types/input/stickAxis.d.ts.map +1 -0
  616. package/dist/types/input/touchDetect.d.ts +18 -0
  617. package/dist/types/input/touchDetect.d.ts.map +1 -0
  618. package/dist/types/light/LightLayer.d.ts +65 -0
  619. package/dist/types/light/LightLayer.d.ts.map +1 -0
  620. package/dist/types/nav/MinHeap.d.ts +15 -0
  621. package/dist/types/nav/MinHeap.d.ts.map +1 -0
  622. package/dist/types/nav/findPath.d.ts +38 -0
  623. package/dist/types/nav/findPath.d.ts.map +1 -0
  624. package/dist/types/nav/navGrid.d.ts +48 -0
  625. package/dist/types/nav/navGrid.d.ts.map +1 -0
  626. package/dist/types/nav/nearestOpen.d.ts +8 -0
  627. package/dist/types/nav/nearestOpen.d.ts.map +1 -0
  628. package/dist/types/nav/straightenPath.d.ts +13 -0
  629. package/dist/types/nav/straightenPath.d.ts.map +1 -0
  630. package/dist/types/net/Connection.d.ts +66 -0
  631. package/dist/types/net/Connection.d.ts.map +1 -0
  632. package/dist/types/net/InterpolationBuffer.d.ts +36 -0
  633. package/dist/types/net/InterpolationBuffer.d.ts.map +1 -0
  634. package/dist/types/net/PredictedMover.d.ts +43 -0
  635. package/dist/types/net/PredictedMover.d.ts.map +1 -0
  636. package/dist/types/net/Room.d.ts +69 -0
  637. package/dist/types/net/Room.d.ts.map +1 -0
  638. package/dist/types/net/RoomHost.d.ts +74 -0
  639. package/dist/types/net/RoomHost.d.ts.map +1 -0
  640. package/dist/types/net/cadence.d.ts +22 -0
  641. package/dist/types/net/cadence.d.ts.map +1 -0
  642. package/dist/types/net/constants.d.ts +24 -0
  643. package/dist/types/net/constants.d.ts.map +1 -0
  644. package/dist/types/net/lobby/LobbyClient.d.ts +107 -0
  645. package/dist/types/net/lobby/LobbyClient.d.ts.map +1 -0
  646. package/dist/types/net/lobby/LobbyHost.d.ts +147 -0
  647. package/dist/types/net/lobby/LobbyHost.d.ts.map +1 -0
  648. package/dist/types/net/lobby/LobbyRooms.d.ts +56 -0
  649. package/dist/types/net/lobby/LobbyRooms.d.ts.map +1 -0
  650. package/dist/types/net/lobby/Matchmaker.d.ts +57 -0
  651. package/dist/types/net/lobby/Matchmaker.d.ts.map +1 -0
  652. package/dist/types/net/lobby/index.d.ts +6 -0
  653. package/dist/types/net/lobby/index.d.ts.map +1 -0
  654. package/dist/types/net/lobby/lobbyProtocol.d.ts +143 -0
  655. package/dist/types/net/lobby/lobbyProtocol.d.ts.map +1 -0
  656. package/dist/types/net/movement.d.ts +50 -0
  657. package/dist/types/net/movement.d.ts.map +1 -0
  658. package/dist/types/net/protocol.d.ts +59 -0
  659. package/dist/types/net/protocol.d.ts.map +1 -0
  660. package/dist/types/net/serverClock.d.ts +14 -0
  661. package/dist/types/net/serverClock.d.ts.map +1 -0
  662. package/dist/types/net/snapshotCodec.d.ts +55 -0
  663. package/dist/types/net/snapshotCodec.d.ts.map +1 -0
  664. package/dist/types/parallax/Parallax.d.ts +37 -0
  665. package/dist/types/parallax/Parallax.d.ts.map +1 -0
  666. package/dist/types/parallax/ParallaxLayer.d.ts +80 -0
  667. package/dist/types/parallax/ParallaxLayer.d.ts.map +1 -0
  668. package/dist/types/parallax/parallaxMath.d.ts +50 -0
  669. package/dist/types/parallax/parallaxMath.d.ts.map +1 -0
  670. package/dist/types/particles/Emitter.d.ts +97 -0
  671. package/dist/types/particles/Emitter.d.ts.map +1 -0
  672. package/dist/types/particles/ParticleBudget.d.ts +28 -0
  673. package/dist/types/particles/ParticleBudget.d.ts.map +1 -0
  674. package/dist/types/particles/ParticleSim.d.ts +38 -0
  675. package/dist/types/particles/ParticleSim.d.ts.map +1 -0
  676. package/dist/types/particles/particleCurves.d.ts +21 -0
  677. package/dist/types/particles/particleCurves.d.ts.map +1 -0
  678. package/dist/types/particles/particleSampling.d.ts +20 -0
  679. package/dist/types/particles/particleSampling.d.ts.map +1 -0
  680. package/dist/types/physics/Body.d.ts +130 -0
  681. package/dist/types/physics/Body.d.ts.map +1 -0
  682. package/dist/types/physics/BroadPhase.d.ts +26 -0
  683. package/dist/types/physics/BroadPhase.d.ts.map +1 -0
  684. package/dist/types/physics/Contact.d.ts +62 -0
  685. package/dist/types/physics/Contact.d.ts.map +1 -0
  686. package/dist/types/physics/ContactSolver.d.ts +29 -0
  687. package/dist/types/physics/ContactSolver.d.ts.map +1 -0
  688. package/dist/types/physics/PhysicsWorld.d.ts +78 -0
  689. package/dist/types/physics/PhysicsWorld.d.ts.map +1 -0
  690. package/dist/types/physics/PhysicsWorldOptions.d.ts +24 -0
  691. package/dist/types/physics/PhysicsWorldOptions.d.ts.map +1 -0
  692. package/dist/types/physics/SpatialHash.d.ts +23 -0
  693. package/dist/types/physics/SpatialHash.d.ts.map +1 -0
  694. package/dist/types/physics/collide.d.ts +27 -0
  695. package/dist/types/physics/collide.d.ts.map +1 -0
  696. package/dist/types/physics/collidePolygon.d.ts +14 -0
  697. package/dist/types/physics/collidePolygon.d.ts.map +1 -0
  698. package/dist/types/physics/contactReport.d.ts +8 -0
  699. package/dist/types/physics/contactReport.d.ts.map +1 -0
  700. package/dist/types/physics/drawColliders.d.ts +43 -0
  701. package/dist/types/physics/drawColliders.d.ts.map +1 -0
  702. package/dist/types/physics/physicsSystem.d.ts +5 -0
  703. package/dist/types/physics/physicsSystem.d.ts.map +1 -0
  704. package/dist/types/physics/polygon.d.ts +28 -0
  705. package/dist/types/physics/polygon.d.ts.map +1 -0
  706. package/dist/types/physics/raycast.d.ts +19 -0
  707. package/dist/types/physics/raycast.d.ts.map +1 -0
  708. package/dist/types/physics/syncToBody.d.ts +16 -0
  709. package/dist/types/physics/syncToBody.d.ts.map +1 -0
  710. package/dist/types/physics/tileBodies.d.ts +36 -0
  711. package/dist/types/physics/tileBodies.d.ts.map +1 -0
  712. package/dist/types/physics/types.d.ts +116 -0
  713. package/dist/types/physics/types.d.ts.map +1 -0
  714. package/dist/types/pixel/Darkness.d.ts +78 -0
  715. package/dist/types/pixel/Darkness.d.ts.map +1 -0
  716. package/dist/types/pixel/DitherVignette.d.ts +35 -0
  717. package/dist/types/pixel/DitherVignette.d.ts.map +1 -0
  718. package/dist/types/pixel/Evaporation.d.ts +30 -0
  719. package/dist/types/pixel/Evaporation.d.ts.map +1 -0
  720. package/dist/types/pixel/NightShade.d.ts +38 -0
  721. package/dist/types/pixel/NightShade.d.ts.map +1 -0
  722. package/dist/types/pixel/PixelLayer.d.ts +85 -0
  723. package/dist/types/pixel/PixelLayer.d.ts.map +1 -0
  724. package/dist/types/pixel/SwayProp.d.ts +52 -0
  725. package/dist/types/pixel/SwayProp.d.ts.map +1 -0
  726. package/dist/types/pixel/index.d.ts +31 -0
  727. package/dist/types/pixel/index.d.ts.map +1 -0
  728. package/dist/types/pixel/lights.d.ts +34 -0
  729. package/dist/types/pixel/lights.d.ts.map +1 -0
  730. package/dist/types/pixel/nineSlice.d.ts +71 -0
  731. package/dist/types/pixel/nineSlice.d.ts.map +1 -0
  732. package/dist/types/pixel/paintLayer.d.ts +35 -0
  733. package/dist/types/pixel/paintLayer.d.ts.map +1 -0
  734. package/dist/types/pixel/palette.d.ts +58 -0
  735. package/dist/types/pixel/palette.d.ts.map +1 -0
  736. package/dist/types/pixel/pixel.d.ts +80 -0
  737. package/dist/types/pixel/pixel.d.ts.map +1 -0
  738. package/dist/types/pixel/pixelPaint.d.ts +43 -0
  739. package/dist/types/pixel/pixelPaint.d.ts.map +1 -0
  740. package/dist/types/pixel/pixelTone.d.ts +51 -0
  741. package/dist/types/pixel/pixelTone.d.ts.map +1 -0
  742. package/dist/types/pixel/propKit.d.ts +26 -0
  743. package/dist/types/pixel/propKit.d.ts.map +1 -0
  744. package/dist/types/pixel/ramp.d.ts +57 -0
  745. package/dist/types/pixel/ramp.d.ts.map +1 -0
  746. package/dist/types/pixel/selout.d.ts +3 -0
  747. package/dist/types/pixel/selout.d.ts.map +1 -0
  748. package/dist/types/pixel/spritePixels.d.ts +29 -0
  749. package/dist/types/pixel/spritePixels.d.ts.map +1 -0
  750. package/dist/types/pixel/swayRig.d.ts +72 -0
  751. package/dist/types/pixel/swayRig.d.ts.map +1 -0
  752. package/dist/types/pixel/vignetteMask.d.ts +16 -0
  753. package/dist/types/pixel/vignetteMask.d.ts.map +1 -0
  754. package/dist/types/pixel/weatherArt.d.ts +29 -0
  755. package/dist/types/pixel/weatherArt.d.ts.map +1 -0
  756. package/dist/types/platform/touch.d.ts +10 -0
  757. package/dist/types/platform/touch.d.ts.map +1 -0
  758. package/dist/types/postfx/BloomFilter.d.ts +33 -0
  759. package/dist/types/postfx/BloomFilter.d.ts.map +1 -0
  760. package/dist/types/postfx/ChromaticAberrationFilter.d.ts +11 -0
  761. package/dist/types/postfx/ChromaticAberrationFilter.d.ts.map +1 -0
  762. package/dist/types/postfx/ColorAdjustFilter.d.ts +32 -0
  763. package/dist/types/postfx/ColorAdjustFilter.d.ts.map +1 -0
  764. package/dist/types/postfx/CrtFilter.d.ts +16 -0
  765. package/dist/types/postfx/CrtFilter.d.ts.map +1 -0
  766. package/dist/types/postfx/PixelateFilter.d.ts +8 -0
  767. package/dist/types/postfx/PixelateFilter.d.ts.map +1 -0
  768. package/dist/types/postfx/PostFx.d.ts +92 -0
  769. package/dist/types/postfx/PostFx.d.ts.map +1 -0
  770. package/dist/types/postfx/ShockwaveFilter.d.ts +20 -0
  771. package/dist/types/postfx/ShockwaveFilter.d.ts.map +1 -0
  772. package/dist/types/postfx/VignetteFilter.d.ts +19 -0
  773. package/dist/types/postfx/VignetteFilter.d.ts.map +1 -0
  774. package/dist/types/postfx/fxAnimator.d.ts +32 -0
  775. package/dist/types/postfx/fxAnimator.d.ts.map +1 -0
  776. package/dist/types/postfx/fxShader.d.ts +49 -0
  777. package/dist/types/postfx/fxShader.d.ts.map +1 -0
  778. package/dist/types/postfx/index.d.ts +11 -0
  779. package/dist/types/postfx/index.d.ts.map +1 -0
  780. package/dist/types/react/ChoiceDialog.d.ts +8 -0
  781. package/dist/types/react/ChoiceDialog.d.ts.map +1 -0
  782. package/dist/types/react/ConfirmDialog.d.ts +9 -0
  783. package/dist/types/react/ConfirmDialog.d.ts.map +1 -0
  784. package/dist/types/react/Glyph.d.ts +54 -0
  785. package/dist/types/react/Glyph.d.ts.map +1 -0
  786. package/dist/types/react/Modal.d.ts +22 -0
  787. package/dist/types/react/Modal.d.ts.map +1 -0
  788. package/dist/types/react/Panel.d.ts +29 -0
  789. package/dist/types/react/Panel.d.ts.map +1 -0
  790. package/dist/types/react/PixelImage.d.ts +19 -0
  791. package/dist/types/react/PixelImage.d.ts.map +1 -0
  792. package/dist/types/react/Select.d.ts +27 -0
  793. package/dist/types/react/Select.d.ts.map +1 -0
  794. package/dist/types/react/Slider.d.ts +24 -0
  795. package/dist/types/react/Slider.d.ts.map +1 -0
  796. package/dist/types/react/SplitPane.d.ts +26 -0
  797. package/dist/types/react/SplitPane.d.ts.map +1 -0
  798. package/dist/types/react/TabStrip.d.ts +31 -0
  799. package/dist/types/react/TabStrip.d.ts.map +1 -0
  800. package/dist/types/react/TitleTips.d.ts +15 -0
  801. package/dist/types/react/TitleTips.d.ts.map +1 -0
  802. package/dist/types/react/Tooltip.d.ts +22 -0
  803. package/dist/types/react/Tooltip.d.ts.map +1 -0
  804. package/dist/types/react/UiProvider.d.ts +52 -0
  805. package/dist/types/react/UiProvider.d.ts.map +1 -0
  806. package/dist/types/react/baseCss.d.ts +27 -0
  807. package/dist/types/react/baseCss.d.ts.map +1 -0
  808. package/dist/types/react/choiceStore.d.ts +34 -0
  809. package/dist/types/react/choiceStore.d.ts.map +1 -0
  810. package/dist/types/react/classNames.d.ts +12 -0
  811. package/dist/types/react/classNames.d.ts.map +1 -0
  812. package/dist/types/react/confirmStore.d.ts +30 -0
  813. package/dist/types/react/confirmStore.d.ts.map +1 -0
  814. package/dist/types/react/index.d.ts +33 -0
  815. package/dist/types/react/index.d.ts.map +1 -0
  816. package/dist/types/react/labels.d.ts +24 -0
  817. package/dist/types/react/labels.d.ts.map +1 -0
  818. package/dist/types/react/placement.d.ts +59 -0
  819. package/dist/types/react/placement.d.ts.map +1 -0
  820. package/dist/types/react/useFillSheet.d.ts +9 -0
  821. package/dist/types/react/useFillSheet.d.ts.map +1 -0
  822. package/dist/types/react/useFitToViewport.d.ts +20 -0
  823. package/dist/types/react/useFitToViewport.d.ts.map +1 -0
  824. package/dist/types/react/usePicked.d.ts +9 -0
  825. package/dist/types/react/usePicked.d.ts.map +1 -0
  826. package/dist/types/react/useStore.d.ts +8 -0
  827. package/dist/types/react/useStore.d.ts.map +1 -0
  828. package/dist/types/react/useViewport.d.ts +4 -0
  829. package/dist/types/react/useViewport.d.ts.map +1 -0
  830. package/dist/types/rig/PosePlayer.d.ts +64 -0
  831. package/dist/types/rig/PosePlayer.d.ts.map +1 -0
  832. package/dist/types/rig/RigView.d.ts +68 -0
  833. package/dist/types/rig/RigView.d.ts.map +1 -0
  834. package/dist/types/rig/Skeleton.d.ts +14 -0
  835. package/dist/types/rig/Skeleton.d.ts.map +1 -0
  836. package/dist/types/rig/humanoid.d.ts +4 -0
  837. package/dist/types/rig/humanoid.d.ts.map +1 -0
  838. package/dist/types/rig/humanoidPoses.d.ts +117 -0
  839. package/dist/types/rig/humanoidPoses.d.ts.map +1 -0
  840. package/dist/types/rig/poseMath.d.ts +14 -0
  841. package/dist/types/rig/poseMath.d.ts.map +1 -0
  842. package/dist/types/rig/rigTypes.d.ts +82 -0
  843. package/dist/types/rig/rigTypes.d.ts.map +1 -0
  844. package/dist/types/save/Autosaver.d.ts +43 -0
  845. package/dist/types/save/Autosaver.d.ts.map +1 -0
  846. package/dist/types/save/MemoryBackend.d.ts +10 -0
  847. package/dist/types/save/MemoryBackend.d.ts.map +1 -0
  848. package/dist/types/save/SaveBackend.d.ts +14 -0
  849. package/dist/types/save/SaveBackend.d.ts.map +1 -0
  850. package/dist/types/save/SaveStore.d.ts +73 -0
  851. package/dist/types/save/SaveStore.d.ts.map +1 -0
  852. package/dist/types/save/WebStorageBackend.d.ts +14 -0
  853. package/dist/types/save/WebStorageBackend.d.ts.map +1 -0
  854. package/dist/types/save/checksum.d.ts +7 -0
  855. package/dist/types/save/checksum.d.ts.map +1 -0
  856. package/dist/types/save/migrateSave.d.ts +17 -0
  857. package/dist/types/save/migrateSave.d.ts.map +1 -0
  858. package/dist/types/settings.d.ts +25 -0
  859. package/dist/types/settings.d.ts.map +1 -0
  860. package/dist/types/tilemap/TilemapView.d.ts +42 -0
  861. package/dist/types/tilemap/TilemapView.d.ts.map +1 -0
  862. package/dist/types/tilemap/collision.d.ts +16 -0
  863. package/dist/types/tilemap/collision.d.ts.map +1 -0
  864. package/dist/types/tilemap/tiled.d.ts +104 -0
  865. package/dist/types/tilemap/tiled.d.ts.map +1 -0
  866. package/dist/types/transitions/CrossfadeTransition.d.ts +20 -0
  867. package/dist/types/transitions/CrossfadeTransition.d.ts.map +1 -0
  868. package/dist/types/transitions/DitherWipeTransition.d.ts +35 -0
  869. package/dist/types/transitions/DitherWipeTransition.d.ts.map +1 -0
  870. package/dist/types/transitions/FadeTransition.d.ts +20 -0
  871. package/dist/types/transitions/FadeTransition.d.ts.map +1 -0
  872. package/dist/types/transitions/Letterbox.d.ts +33 -0
  873. package/dist/types/transitions/Letterbox.d.ts.map +1 -0
  874. package/dist/types/transitions/Transition.d.ts +22 -0
  875. package/dist/types/transitions/Transition.d.ts.map +1 -0
  876. package/dist/types/transitions/ditherMask.d.ts +13 -0
  877. package/dist/types/transitions/ditherMask.d.ts.map +1 -0
  878. package/dist/types/transitions/transitionTo.d.ts +16 -0
  879. package/dist/types/transitions/transitionTo.d.ts.map +1 -0
  880. package/dist/types/transitions/tweenDone.d.ts +5 -0
  881. package/dist/types/transitions/tweenDone.d.ts.map +1 -0
  882. package/dist/types/ui/Bar.d.ts +41 -0
  883. package/dist/types/ui/Bar.d.ts.map +1 -0
  884. package/dist/types/ui/Button.d.ts +47 -0
  885. package/dist/types/ui/Button.d.ts.map +1 -0
  886. package/dist/types/ui/Dialog.d.ts +47 -0
  887. package/dist/types/ui/Dialog.d.ts.map +1 -0
  888. package/dist/types/ui/FocusManager.d.ts +53 -0
  889. package/dist/types/ui/FocusManager.d.ts.map +1 -0
  890. package/dist/types/ui/Label.d.ts +24 -0
  891. package/dist/types/ui/Label.d.ts.map +1 -0
  892. package/dist/types/ui/List.d.ts +23 -0
  893. package/dist/types/ui/List.d.ts.map +1 -0
  894. package/dist/types/ui/Panel.d.ts +38 -0
  895. package/dist/types/ui/Panel.d.ts.map +1 -0
  896. package/dist/types/ui/ScrollView.d.ts +56 -0
  897. package/dist/types/ui/ScrollView.d.ts.map +1 -0
  898. package/dist/types/ui/Slider.d.ts +47 -0
  899. package/dist/types/ui/Slider.d.ts.map +1 -0
  900. package/dist/types/ui/Stack.d.ts +16 -0
  901. package/dist/types/ui/Stack.d.ts.map +1 -0
  902. package/dist/types/ui/Toggle.d.ts +31 -0
  903. package/dist/types/ui/Toggle.d.ts.map +1 -0
  904. package/dist/types/ui/UiHost.d.ts +18 -0
  905. package/dist/types/ui/UiHost.d.ts.map +1 -0
  906. package/dist/types/ui/UiPointerGate.d.ts +17 -0
  907. package/dist/types/ui/UiPointerGate.d.ts.map +1 -0
  908. package/dist/types/ui/UiRoot.d.ts +73 -0
  909. package/dist/types/ui/UiRoot.d.ts.map +1 -0
  910. package/dist/types/ui/Widget.d.ts +56 -0
  911. package/dist/types/ui/Widget.d.ts.map +1 -0
  912. package/dist/types/ui/dom/DomOverlay.d.ts +52 -0
  913. package/dist/types/ui/dom/DomOverlay.d.ts.map +1 -0
  914. package/dist/types/ui/dom/DomWorldAnchors.d.ts +50 -0
  915. package/dist/types/ui/dom/DomWorldAnchors.d.ts.map +1 -0
  916. package/dist/types/ui/dom/InputShield.d.ts +20 -0
  917. package/dist/types/ui/dom/InputShield.d.ts.map +1 -0
  918. package/dist/types/ui/dom/createStore.d.ts +22 -0
  919. package/dist/types/ui/dom/createStore.d.ts.map +1 -0
  920. package/dist/types/ui/dom/shieldDecision.d.ts +34 -0
  921. package/dist/types/ui/dom/shieldDecision.d.ts.map +1 -0
  922. package/dist/types/ui/dom/worldToScreen.d.ts +24 -0
  923. package/dist/types/ui/dom/worldToScreen.d.ts.map +1 -0
  924. package/dist/types/ui/index.d.ts +38 -0
  925. package/dist/types/ui/index.d.ts.map +1 -0
  926. package/dist/types/ui/layout/anchor.d.ts +9 -0
  927. package/dist/types/ui/layout/anchor.d.ts.map +1 -0
  928. package/dist/types/ui/layout/barDrain.d.ts +25 -0
  929. package/dist/types/ui/layout/barDrain.d.ts.map +1 -0
  930. package/dist/types/ui/layout/fitToViewport.d.ts +32 -0
  931. package/dist/types/ui/layout/fitToViewport.d.ts.map +1 -0
  932. package/dist/types/ui/layout/focusNav.d.ts +13 -0
  933. package/dist/types/ui/layout/focusNav.d.ts.map +1 -0
  934. package/dist/types/ui/layout/geometry.d.ts +35 -0
  935. package/dist/types/ui/layout/geometry.d.ts.map +1 -0
  936. package/dist/types/ui/layout/listWidth.d.ts +13 -0
  937. package/dist/types/ui/layout/listWidth.d.ts.map +1 -0
  938. package/dist/types/ui/layout/placeTooltip.d.ts +23 -0
  939. package/dist/types/ui/layout/placeTooltip.d.ts.map +1 -0
  940. package/dist/types/ui/layout/scroll.d.ts +17 -0
  941. package/dist/types/ui/layout/scroll.d.ts.map +1 -0
  942. package/dist/types/ui/layout/slider.d.ts +7 -0
  943. package/dist/types/ui/layout/slider.d.ts.map +1 -0
  944. package/dist/types/ui/layout/stack.d.ts +26 -0
  945. package/dist/types/ui/layout/stack.d.ts.map +1 -0
  946. package/dist/types/ui/layout/wrapRow.d.ts +6 -0
  947. package/dist/types/ui/layout/wrapRow.d.ts.map +1 -0
  948. package/dist/ui/Bar.js +54 -0
  949. package/dist/ui/Bar.js.map +1 -0
  950. package/dist/ui/Button.js +58 -0
  951. package/dist/ui/Button.js.map +1 -0
  952. package/dist/ui/Dialog.js +56 -0
  953. package/dist/ui/Dialog.js.map +1 -0
  954. package/dist/ui/FocusManager.js +97 -0
  955. package/dist/ui/FocusManager.js.map +1 -0
  956. package/dist/ui/Label.js +36 -0
  957. package/dist/ui/Label.js.map +1 -0
  958. package/dist/ui/List.js +45 -0
  959. package/dist/ui/List.js.map +1 -0
  960. package/dist/ui/Panel.js +38 -0
  961. package/dist/ui/Panel.js.map +1 -0
  962. package/dist/ui/ScrollView.js +96 -0
  963. package/dist/ui/ScrollView.js.map +1 -0
  964. package/dist/ui/Slider.js +55 -0
  965. package/dist/ui/Slider.js.map +1 -0
  966. package/dist/ui/Stack.js +28 -0
  967. package/dist/ui/Stack.js.map +1 -0
  968. package/dist/ui/Toggle.js +37 -0
  969. package/dist/ui/Toggle.js.map +1 -0
  970. package/dist/ui/UiHost.js +9 -0
  971. package/dist/ui/UiHost.js.map +1 -0
  972. package/dist/ui/UiPointerGate.js +25 -0
  973. package/dist/ui/UiPointerGate.js.map +1 -0
  974. package/dist/ui/UiRoot.js +93 -0
  975. package/dist/ui/UiRoot.js.map +1 -0
  976. package/dist/ui/Widget.js +90 -0
  977. package/dist/ui/Widget.js.map +1 -0
  978. package/dist/ui/dom/DomOverlay.js +59 -0
  979. package/dist/ui/dom/DomOverlay.js.map +1 -0
  980. package/dist/ui/dom/DomWorldAnchors.js +59 -0
  981. package/dist/ui/dom/DomWorldAnchors.js.map +1 -0
  982. package/dist/ui/dom/InputShield.js +27 -0
  983. package/dist/ui/dom/InputShield.js.map +1 -0
  984. package/dist/ui/dom/createStore.js +42 -0
  985. package/dist/ui/dom/createStore.js.map +1 -0
  986. package/dist/ui/dom/shieldDecision.js +36 -0
  987. package/dist/ui/dom/shieldDecision.js.map +1 -0
  988. package/dist/ui/dom/worldToScreen.js +11 -0
  989. package/dist/ui/dom/worldToScreen.js.map +1 -0
  990. package/dist/ui/layout/anchor.js +20 -0
  991. package/dist/ui/layout/anchor.js.map +1 -0
  992. package/dist/ui/layout/barDrain.js +25 -0
  993. package/dist/ui/layout/barDrain.js.map +1 -0
  994. package/dist/ui/layout/fitToViewport.js +17 -0
  995. package/dist/ui/layout/fitToViewport.js.map +1 -0
  996. package/dist/ui/layout/focusNav.js +42 -0
  997. package/dist/ui/layout/focusNav.js.map +1 -0
  998. package/dist/ui/layout/geometry.js +21 -0
  999. package/dist/ui/layout/geometry.js.map +1 -0
  1000. package/dist/ui/layout/listWidth.js +10 -0
  1001. package/dist/ui/layout/listWidth.js.map +1 -0
  1002. package/dist/ui/layout/placeTooltip.js +28 -0
  1003. package/dist/ui/layout/placeTooltip.js.map +1 -0
  1004. package/dist/ui/layout/scroll.js +24 -0
  1005. package/dist/ui/layout/scroll.js.map +1 -0
  1006. package/dist/ui/layout/slider.js +20 -0
  1007. package/dist/ui/layout/slider.js.map +1 -0
  1008. package/dist/ui/layout/stack.js +27 -0
  1009. package/dist/ui/layout/stack.js.map +1 -0
  1010. package/dist/ui/layout/wrapRow.js +13 -0
  1011. package/dist/ui/layout/wrapRow.js.map +1 -0
  1012. package/dist/ui.js +85 -0
  1013. package/dist/ui.js.map +1 -0
  1014. package/package.json +115 -4
@@ -0,0 +1,70 @@
1
+ import { Container as b, TilingSprite as y, Texture as z, CanvasSource as C } from "pixi.js";
2
+ import { DITHER_LEVELS as g, wipeLevel as M, ditherCovered as R } from "./ditherMask.js";
3
+ import { tweenDone as S } from "./tweenDone.js";
4
+ let d = null;
5
+ function f() {
6
+ if (d) return d;
7
+ d = [];
8
+ for (let u = 0; u <= g; u++) {
9
+ const t = document.createElement("canvas");
10
+ t.width = 4, t.height = 4;
11
+ const n = t.getContext("2d");
12
+ n.fillStyle = "#ffffff";
13
+ for (let o = 0; o < 4; o++) for (let e = 0; e < 4; e++) R(u, e, o) && n.fillRect(e, o, 1, 1);
14
+ d.push(new z({ source: new C({ resource: t, scaleMode: "nearest" }) }));
15
+ }
16
+ return d;
17
+ }
18
+ class L {
19
+ constructor(t = {}) {
20
+ this.options = t;
21
+ }
22
+ options;
23
+ bands = [];
24
+ root = null;
25
+ stopResize = null;
26
+ state = { p: 0 };
27
+ reversed = !1;
28
+ async cover(t) {
29
+ this.root = new b(), t.layer.addChild(this.root), this.layout(t), this.stopResize = t.stage.onResize(() => this.layout(t)), this.state.p = 0, this.reversed = !1, await this.run(t, 1);
30
+ }
31
+ async reveal(t) {
32
+ this.root && (this.reversed = !0, await this.run(t, 0));
33
+ }
34
+ dispose() {
35
+ this.stopResize?.(), this.stopResize = null, this.root?.destroy({ children: !0 }), this.root = null, this.bands.length = 0;
36
+ }
37
+ run(t, n) {
38
+ return S(t.stage, {
39
+ targets: this.state,
40
+ p: n,
41
+ duration: this.options.duration ?? 450,
42
+ ease: "Linear",
43
+ onUpdate: () => this.paint()
44
+ });
45
+ }
46
+ layout(t) {
47
+ const n = this.root;
48
+ for (const h of n.removeChildren()) h.destroy();
49
+ this.bands.length = 0;
50
+ const o = Math.max(1, Math.round(this.options.cell ?? t.stage.cameras.main.zoom)), e = o * 4, r = t.stage.width, i = t.stage.height, s = this.options.direction ?? "right", a = s === "left" || s === "right", p = s === "none" ? 0 : a ? r : i, c = s === "none" ? 0 : Math.max(e, Math.ceil(p / 32 / e) * e), v = s === "none" ? 1 : Math.ceil(p / c);
51
+ for (let h = 0; h < v; h++) {
52
+ const m = s === "none" || !a ? r : c, w = s === "none" || a ? i : c, l = new y({ texture: f()[0], width: m, height: w });
53
+ l.tileScale.set(o, o), s !== "none" && (a ? l.x = h * c : l.y = h * c), l.tint = this.options.color ?? 0, n.addChild(l), this.bands.push(l);
54
+ }
55
+ this.paint();
56
+ }
57
+ paint() {
58
+ const t = this.options.direction ?? "right", n = t === "none" ? 1 : this.options.softness ?? 0.35, o = f(), e = this.bands.length;
59
+ for (let r = 0; r < e; r++) {
60
+ let i = t === "none" ? 0.5 : (r + 0.5) / e;
61
+ (t === "left" || t === "up") && (i = 1 - i), this.reversed && (i = 1 - i);
62
+ const s = t === "none" ? Math.round(this.state.p * g) : M(this.state.p, i, n), a = this.bands[r];
63
+ a.visible = s > 0, a.texture = o[s];
64
+ }
65
+ }
66
+ }
67
+ export {
68
+ L as DitherWipeTransition
69
+ };
70
+ //# sourceMappingURL=DitherWipeTransition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DitherWipeTransition.js","sources":["../../src/transitions/DitherWipeTransition.ts"],"sourcesContent":["import { CanvasSource, Container, Texture, TilingSprite } from 'pixi.js';\nimport type { Transition, TransitionContext } from './Transition';\nimport { DITHER_LEVELS, ditherCovered, wipeLevel } from './ditherMask';\nimport { tweenDone } from './tweenDone';\n\nexport interface DitherWipeOptions {\n /** `0xrrggbb` (default black). */\n color?: number;\n /** Ms for each half (default 450). */\n duration?: number;\n /** The way the wipe travels, or 'none' for the whole screen dissolving at once (default 'right'). */\n direction?: 'left' | 'right' | 'up' | 'down' | 'none';\n /** Screen pixels per dither cell (default the main camera's zoom, so a cell is one world pixel). */\n cell?: number;\n /** Share of the screen the dithered edge spans (default 0.35). */\n softness?: number;\n}\n\n/** One 4×4 tile per dither level, white on clear, shared by every wipe (17 tiny textures for the page's life). */\nlet patterns: Texture[] | null = null;\n\nfunction patternTextures(): Texture[] {\n if (patterns) return patterns;\n patterns = [];\n for (let level = 0; level <= DITHER_LEVELS; level++) {\n const canvas = document.createElement('canvas');\n canvas.width = 4;\n canvas.height = 4;\n const g = canvas.getContext('2d')!;\n g.fillStyle = '#ffffff';\n for (let y = 0; y < 4; y++) for (let x = 0; x < 4; x++) if (ditherCovered(level, x, y)) g.fillRect(x, y, 1, 1);\n patterns.push(new Texture({ source: new CanvasSource({ resource: canvas, scaleMode: 'nearest' }) }));\n }\n return patterns;\n}\n\n/**\n * A pixel-friendly wipe: the screen fills with an ordered-dither pattern whose density sweeps across it, in hard\n * whole cells rather than a smooth gradient. The screen is cut into bands along the direction of travel, each a\n * tiling sprite of one dither level, so a frame costs a texture swap per band rather than a rect per cell (a\n * 1080p screen at 2-px cells is half a million cells). Bands are whole tiles wide so the pattern runs on unbroken.\n */\nexport class DitherWipeTransition implements Transition {\n private readonly bands: TilingSprite[] = [];\n private root: Container | null = null;\n private stopResize: (() => void) | null = null;\n private readonly state = { p: 0 };\n private reversed = false;\n\n constructor(private readonly options: DitherWipeOptions = {}) {}\n\n async cover(ctx: TransitionContext): Promise<void> {\n this.root = new Container();\n ctx.layer.addChild(this.root);\n this.layout(ctx);\n this.stopResize = ctx.stage.onResize(() => this.layout(ctx));\n this.state.p = 0;\n this.reversed = false;\n await this.run(ctx, 1);\n }\n\n async reveal(ctx: TransitionContext): Promise<void> {\n if (!this.root) return;\n // the covered part retreats the way the wipe came in, so the sweep reads as one motion across the swap\n this.reversed = true;\n await this.run(ctx, 0);\n }\n\n dispose(): void {\n this.stopResize?.();\n this.stopResize = null;\n this.root?.destroy({ children: true });\n this.root = null;\n this.bands.length = 0;\n }\n\n private run(ctx: TransitionContext, to: number): Promise<void> {\n return tweenDone(ctx.stage, {\n targets: this.state,\n p: to,\n duration: this.options.duration ?? 450,\n ease: 'Linear',\n onUpdate: () => this.paint(),\n });\n }\n\n private layout(ctx: TransitionContext): void {\n const root = this.root!;\n for (const b of root.removeChildren()) b.destroy();\n this.bands.length = 0;\n const cell = Math.max(1, Math.round(this.options.cell ?? ctx.stage.cameras.main.zoom));\n const tile = cell * 4;\n const w = ctx.stage.width;\n const h = ctx.stage.height;\n const dir = this.options.direction ?? 'right';\n const horizontal = dir === 'left' || dir === 'right';\n const span = dir === 'none' ? 0 : horizontal ? w : h;\n // about 32 bands across, each a whole number of tiles\n const bandSize = dir === 'none' ? 0 : Math.max(tile, Math.ceil(span / 32 / tile) * tile);\n const count = dir === 'none' ? 1 : Math.ceil(span / bandSize);\n for (let i = 0; i < count; i++) {\n const bw = dir === 'none' || !horizontal ? w : bandSize;\n const bh = dir === 'none' || horizontal ? h : bandSize;\n const s = new TilingSprite({ texture: patternTextures()[0]!, width: bw, height: bh });\n s.tileScale.set(cell, cell);\n if (dir !== 'none') {\n if (horizontal) s.x = i * bandSize;\n else s.y = i * bandSize;\n }\n s.tint = this.options.color ?? 0x000000;\n root.addChild(s);\n this.bands.push(s);\n }\n this.paint();\n }\n\n private paint(): void {\n const dir = this.options.direction ?? 'right';\n const soft = dir === 'none' ? 1 : (this.options.softness ?? 0.35);\n const textures = patternTextures();\n const n = this.bands.length;\n for (let i = 0; i < n; i++) {\n let u = dir === 'none' ? 0.5 : (i + 0.5) / n;\n if (dir === 'left' || dir === 'up') u = 1 - u;\n if (this.reversed) u = 1 - u;\n const level = dir === 'none' ? Math.round(this.state.p * DITHER_LEVELS) : wipeLevel(this.state.p, u, soft);\n const band = this.bands[i]!;\n band.visible = level > 0;\n band.texture = textures[level]!;\n }\n }\n}\n"],"names":["patterns","patternTextures","level","DITHER_LEVELS","canvas","g","y","x","ditherCovered","Texture","CanvasSource","DitherWipeTransition","options","ctx","Container","to","tweenDone","root","b","cell","tile","w","h","dir","horizontal","span","bandSize","count","i","bw","bh","s","TilingSprite","soft","textures","n","u","wipeLevel","band"],"mappings":";;;AAmBA,IAAIA,IAA6B;AAEjC,SAASC,IAA6B;AACpC,MAAID,EAAU,QAAOA;AACrB,EAAAA,IAAW,CAAA;AACX,WAASE,IAAQ,GAAGA,KAASC,GAAeD,KAAS;AACnD,UAAME,IAAS,SAAS,cAAc,QAAQ;AAC9C,IAAAA,EAAO,QAAQ,GACfA,EAAO,SAAS;AAChB,UAAMC,IAAID,EAAO,WAAW,IAAI;AAChC,IAAAC,EAAE,YAAY;AACd,aAASC,IAAI,GAAGA,IAAI,GAAGA,IAAK,UAASC,IAAI,GAAGA,IAAI,GAAGA,KAASC,EAAcN,GAAOK,GAAGD,CAAC,OAAK,SAASC,GAAGD,GAAG,GAAG,CAAC;AAC7G,IAAAN,EAAS,KAAK,IAAIS,EAAQ,EAAE,QAAQ,IAAIC,EAAa,EAAE,UAAUN,GAAQ,WAAW,UAAA,CAAW,EAAA,CAAG,CAAC;AAAA,EACrG;AACA,SAAOJ;AACT;AAQO,MAAMW,EAA2C;AAAA,EAOtD,YAA6BC,IAA6B,IAAI;AAAjC,SAAA,UAAAA;AAAA,EAAkC;AAAA,EAAlC;AAAA,EANZ,QAAwB,CAAA;AAAA,EACjC,OAAyB;AAAA,EACzB,aAAkC;AAAA,EACzB,QAAQ,EAAE,GAAG,EAAA;AAAA,EACtB,WAAW;AAAA,EAInB,MAAM,MAAMC,GAAuC;AACjD,SAAK,OAAO,IAAIC,EAAA,GAChBD,EAAI,MAAM,SAAS,KAAK,IAAI,GAC5B,KAAK,OAAOA,CAAG,GACf,KAAK,aAAaA,EAAI,MAAM,SAAS,MAAM,KAAK,OAAOA,CAAG,CAAC,GAC3D,KAAK,MAAM,IAAI,GACf,KAAK,WAAW,IAChB,MAAM,KAAK,IAAIA,GAAK,CAAC;AAAA,EACvB;AAAA,EAEA,MAAM,OAAOA,GAAuC;AAClD,IAAK,KAAK,SAEV,KAAK,WAAW,IAChB,MAAM,KAAK,IAAIA,GAAK,CAAC;AAAA,EACvB;AAAA,EAEA,UAAgB;AACd,SAAK,aAAA,GACL,KAAK,aAAa,MAClB,KAAK,MAAM,QAAQ,EAAE,UAAU,IAAM,GACrC,KAAK,OAAO,MACZ,KAAK,MAAM,SAAS;AAAA,EACtB;AAAA,EAEQ,IAAIA,GAAwBE,GAA2B;AAC7D,WAAOC,EAAUH,EAAI,OAAO;AAAA,MAC1B,SAAS,KAAK;AAAA,MACd,GAAGE;AAAA,MACH,UAAU,KAAK,QAAQ,YAAY;AAAA,MACnC,MAAM;AAAA,MACN,UAAU,MAAM,KAAK,MAAA;AAAA,IAAM,CAC5B;AAAA,EACH;AAAA,EAEQ,OAAOF,GAA8B;AAC3C,UAAMI,IAAO,KAAK;AAClB,eAAWC,KAAKD,EAAK,eAAA,KAAoB,QAAA;AACzC,SAAK,MAAM,SAAS;AACpB,UAAME,IAAO,KAAK,IAAI,GAAG,KAAK,MAAM,KAAK,QAAQ,QAAQN,EAAI,MAAM,QAAQ,KAAK,IAAI,CAAC,GAC/EO,IAAOD,IAAO,GACdE,IAAIR,EAAI,MAAM,OACdS,IAAIT,EAAI,MAAM,QACdU,IAAM,KAAK,QAAQ,aAAa,SAChCC,IAAaD,MAAQ,UAAUA,MAAQ,SACvCE,IAAOF,MAAQ,SAAS,IAAIC,IAAaH,IAAIC,GAE7CI,IAAWH,MAAQ,SAAS,IAAI,KAAK,IAAIH,GAAM,KAAK,KAAKK,IAAO,KAAKL,CAAI,IAAIA,CAAI,GACjFO,IAAQJ,MAAQ,SAAS,IAAI,KAAK,KAAKE,IAAOC,CAAQ;AAC5D,aAASE,IAAI,GAAGA,IAAID,GAAOC,KAAK;AAC9B,YAAMC,IAAKN,MAAQ,UAAU,CAACC,IAAaH,IAAIK,GACzCI,IAAKP,MAAQ,UAAUC,IAAaF,IAAII,GACxCK,IAAI,IAAIC,EAAa,EAAE,SAAS/B,EAAA,EAAkB,CAAC,GAAI,OAAO4B,GAAI,QAAQC,GAAI;AACpF,MAAAC,EAAE,UAAU,IAAIZ,GAAMA,CAAI,GACtBI,MAAQ,WACNC,IAAYO,EAAE,IAAIH,IAAIF,IACrBK,EAAE,IAAIH,IAAIF,IAEjBK,EAAE,OAAO,KAAK,QAAQ,SAAS,GAC/Bd,EAAK,SAASc,CAAC,GACf,KAAK,MAAM,KAAKA,CAAC;AAAA,IACnB;AACA,SAAK,MAAA;AAAA,EACP;AAAA,EAEQ,QAAc;AACpB,UAAMR,IAAM,KAAK,QAAQ,aAAa,SAChCU,IAAOV,MAAQ,SAAS,IAAK,KAAK,QAAQ,YAAY,MACtDW,IAAWjC,EAAA,GACXkC,IAAI,KAAK,MAAM;AACrB,aAASP,IAAI,GAAGA,IAAIO,GAAGP,KAAK;AAC1B,UAAIQ,IAAIb,MAAQ,SAAS,OAAOK,IAAI,OAAOO;AAC3C,OAAIZ,MAAQ,UAAUA,MAAQ,cAAU,IAAIa,IACxC,KAAK,aAAUA,IAAI,IAAIA;AAC3B,YAAMlC,IAAQqB,MAAQ,SAAS,KAAK,MAAM,KAAK,MAAM,IAAIpB,CAAa,IAAIkC,EAAU,KAAK,MAAM,GAAGD,GAAGH,CAAI,GACnGK,IAAO,KAAK,MAAMV,CAAC;AACzB,MAAAU,EAAK,UAAUpC,IAAQ,GACvBoC,EAAK,UAAUJ,EAAShC,CAAK;AAAA,IAC/B;AAAA,EACF;AACF;"}
@@ -0,0 +1,34 @@
1
+ import { Sprite as o, Texture as a } from "pixi.js";
2
+ import { tweenDone as i } from "./tweenDone.js";
3
+ class l {
4
+ constructor(t = {}) {
5
+ this.options = t;
6
+ }
7
+ options;
8
+ sheet = null;
9
+ stopResize = null;
10
+ async cover(t) {
11
+ const e = new o(a.WHITE);
12
+ e.tint = this.options.color ?? 0, e.alpha = 0, this.sheet = e, t.layer.addChild(e);
13
+ const s = () => {
14
+ e.width = t.stage.width, e.height = t.stage.height;
15
+ };
16
+ s(), this.stopResize = t.stage.onResize(s), await i(t.stage, { targets: e, alpha: 1, duration: this.options.duration ?? 300, ease: "Sine.InOut" });
17
+ }
18
+ async reveal(t) {
19
+ this.sheet && await i(t.stage, {
20
+ targets: this.sheet,
21
+ alpha: 0,
22
+ delay: this.options.hold ?? 0,
23
+ duration: this.options.duration ?? 300,
24
+ ease: "Sine.InOut"
25
+ });
26
+ }
27
+ dispose() {
28
+ this.stopResize?.(), this.stopResize = null, this.sheet?.destroy(), this.sheet = null;
29
+ }
30
+ }
31
+ export {
32
+ l as FadeTransition
33
+ };
34
+ //# sourceMappingURL=FadeTransition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FadeTransition.js","sources":["../../src/transitions/FadeTransition.ts"],"sourcesContent":["import { Sprite, Texture } from 'pixi.js';\nimport type { Transition, TransitionContext } from './Transition';\nimport { tweenDone } from './tweenDone';\n\nexport interface FadeOptions {\n /** `0xrrggbb` (default black). */\n color?: number;\n /** Ms for each half (default 300). */\n duration?: number;\n /** Ms to rest fully covered before revealing (default 0). */\n hold?: number;\n}\n\n/** Fades to a colour, swaps the scene, fades back. */\nexport class FadeTransition implements Transition {\n private sheet: Sprite | null = null;\n private stopResize: (() => void) | null = null;\n\n constructor(private readonly options: FadeOptions = {}) {}\n\n async cover(ctx: TransitionContext): Promise<void> {\n const sheet = new Sprite(Texture.WHITE);\n sheet.tint = this.options.color ?? 0x000000;\n sheet.alpha = 0;\n this.sheet = sheet;\n ctx.layer.addChild(sheet);\n const fit = () => {\n sheet.width = ctx.stage.width;\n sheet.height = ctx.stage.height;\n };\n fit();\n this.stopResize = ctx.stage.onResize(fit);\n await tweenDone(ctx.stage, { targets: sheet, alpha: 1, duration: this.options.duration ?? 300, ease: 'Sine.InOut' });\n }\n\n async reveal(ctx: TransitionContext): Promise<void> {\n if (!this.sheet) return;\n await tweenDone(ctx.stage, {\n targets: this.sheet,\n alpha: 0,\n delay: this.options.hold ?? 0,\n duration: this.options.duration ?? 300,\n ease: 'Sine.InOut',\n });\n }\n\n dispose(): void {\n this.stopResize?.();\n this.stopResize = null;\n this.sheet?.destroy();\n this.sheet = null;\n }\n}\n"],"names":["FadeTransition","options","ctx","sheet","Sprite","Texture","fit","tweenDone"],"mappings":";;AAcO,MAAMA,EAAqC;AAAA,EAIhD,YAA6BC,IAAuB,IAAI;AAA3B,SAAA,UAAAA;AAAA,EAA4B;AAAA,EAA5B;AAAA,EAHrB,QAAuB;AAAA,EACvB,aAAkC;AAAA,EAI1C,MAAM,MAAMC,GAAuC;AACjD,UAAMC,IAAQ,IAAIC,EAAOC,EAAQ,KAAK;AACtC,IAAAF,EAAM,OAAO,KAAK,QAAQ,SAAS,GACnCA,EAAM,QAAQ,GACd,KAAK,QAAQA,GACbD,EAAI,MAAM,SAASC,CAAK;AACxB,UAAMG,IAAM,MAAM;AAChB,MAAAH,EAAM,QAAQD,EAAI,MAAM,OACxBC,EAAM,SAASD,EAAI,MAAM;AAAA,IAC3B;AACA,IAAAI,EAAA,GACA,KAAK,aAAaJ,EAAI,MAAM,SAASI,CAAG,GACxC,MAAMC,EAAUL,EAAI,OAAO,EAAE,SAASC,GAAO,OAAO,GAAG,UAAU,KAAK,QAAQ,YAAY,KAAK,MAAM,cAAc;AAAA,EACrH;AAAA,EAEA,MAAM,OAAOD,GAAuC;AAClD,IAAK,KAAK,SACV,MAAMK,EAAUL,EAAI,OAAO;AAAA,MACzB,SAAS,KAAK;AAAA,MACd,OAAO;AAAA,MACP,OAAO,KAAK,QAAQ,QAAQ;AAAA,MAC5B,UAAU,KAAK,QAAQ,YAAY;AAAA,MACnC,MAAM;AAAA,IAAA,CACP;AAAA,EACH;AAAA,EAEA,UAAgB;AACd,SAAK,aAAA,GACL,KAAK,aAAa,MAClB,KAAK,OAAO,QAAA,GACZ,KAAK,QAAQ;AAAA,EACf;AACF;"}
@@ -0,0 +1,42 @@
1
+ import { Container as h, Sprite as i, Texture as o } from "pixi.js";
2
+ import { tweenDone as r } from "./tweenDone.js";
3
+ class l {
4
+ constructor(t, s = {}) {
5
+ this.stage = t, this.options = s;
6
+ for (const e of [this.top, this.bottom]) e.tint = s.color ?? 0;
7
+ this.view.addChild(this.top, this.bottom), this.view.visible = !1, t.screen.addChild(this.view), this.stopResize = t.onResize(() => this.layout()), this.layout();
8
+ }
9
+ stage;
10
+ options;
11
+ view = new h();
12
+ top = new i(o.WHITE);
13
+ bottom = new i(o.WHITE);
14
+ /** 0 hidden, 1 fully in. */
15
+ state = { k: 0 };
16
+ stopResize;
17
+ /** Whether the bars are (partly) in. */
18
+ get shown() {
19
+ return this.state.k > 0;
20
+ }
21
+ /** Slides the bars in over `ms` (0: at once). */
22
+ show(t = 400) {
23
+ return this.to(1, t);
24
+ }
25
+ hide(t = 400) {
26
+ return this.to(0, t);
27
+ }
28
+ destroy() {
29
+ this.stage.tweens.killTweensOf(this.state), this.stopResize(), this.view.destroy({ children: !0 });
30
+ }
31
+ to(t, s) {
32
+ return this.stage.tweens.killTweensOf(this.state), s <= 0 ? (this.state.k = t, this.layout(), Promise.resolve()) : r(this.stage, { targets: this.state, k: t, duration: s, ease: "Sine.InOut", onUpdate: () => this.layout() });
33
+ }
34
+ layout() {
35
+ const t = this.stage.width, s = this.stage.height, e = Math.round(s * (this.options.share ?? 0.12) * this.state.k);
36
+ this.view.visible = e > 0, this.top.width = t, this.top.height = e, this.bottom.width = t, this.bottom.height = e, this.bottom.y = s - e;
37
+ }
38
+ }
39
+ export {
40
+ l as Letterbox
41
+ };
42
+ //# sourceMappingURL=Letterbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Letterbox.js","sources":["../../src/transitions/Letterbox.ts"],"sourcesContent":["import { Container, Sprite, Texture } from 'pixi.js';\nimport type { Stage } from '../core/Stage';\nimport { tweenDone } from './tweenDone';\n\nexport interface LetterboxOptions {\n /** Each bar's height as a share of the screen's (default 0.12). */\n share?: number;\n /** `0xrrggbb` (default black). */\n color?: number;\n}\n\n/**\n * Cinema bars for a cut scene: two bars slide in from the top and bottom of the screen and back out. They live on\n * the stage's screen layer, above what was there when they were made; a HUD added later draws over them, so hide it\n * for the scene. Bar heights are whole screen pixels at every step of the slide.\n */\nexport class Letterbox {\n readonly view = new Container();\n private readonly top = new Sprite(Texture.WHITE);\n private readonly bottom = new Sprite(Texture.WHITE);\n /** 0 hidden, 1 fully in. */\n private readonly state = { k: 0 };\n private readonly stopResize: () => void;\n\n constructor(\n private readonly stage: Stage,\n private readonly options: LetterboxOptions = {},\n ) {\n for (const bar of [this.top, this.bottom]) bar.tint = options.color ?? 0x000000;\n this.view.addChild(this.top, this.bottom);\n this.view.visible = false;\n stage.screen.addChild(this.view);\n this.stopResize = stage.onResize(() => this.layout());\n this.layout();\n }\n\n /** Whether the bars are (partly) in. */\n get shown(): boolean {\n return this.state.k > 0;\n }\n\n /** Slides the bars in over `ms` (0: at once). */\n show(ms = 400): Promise<void> {\n return this.to(1, ms);\n }\n\n hide(ms = 400): Promise<void> {\n return this.to(0, ms);\n }\n\n destroy(): void {\n this.stage.tweens.killTweensOf(this.state);\n this.stopResize();\n this.view.destroy({ children: true });\n }\n\n private to(k: number, ms: number): Promise<void> {\n this.stage.tweens.killTweensOf(this.state);\n if (ms <= 0) {\n this.state.k = k;\n this.layout();\n return Promise.resolve();\n }\n return tweenDone(this.stage, { targets: this.state, k, duration: ms, ease: 'Sine.InOut', onUpdate: () => this.layout() });\n }\n\n private layout(): void {\n const w = this.stage.width;\n const h = this.stage.height;\n const bar = Math.round(h * (this.options.share ?? 0.12) * this.state.k);\n this.view.visible = bar > 0;\n this.top.width = w;\n this.top.height = bar;\n this.bottom.width = w;\n this.bottom.height = bar;\n this.bottom.y = h - bar;\n }\n}\n"],"names":["Letterbox","stage","options","bar","Container","Sprite","Texture","ms","k","tweenDone","w","h"],"mappings":";;AAgBO,MAAMA,EAAU;AAAA,EAQrB,YACmBC,GACAC,IAA4B,IAC7C;AAFiB,SAAA,QAAAD,GACA,KAAA,UAAAC;AAEjB,eAAWC,KAAO,CAAC,KAAK,KAAK,KAAK,MAAM,EAAG,CAAAA,EAAI,OAAOD,EAAQ,SAAS;AACvE,SAAK,KAAK,SAAS,KAAK,KAAK,KAAK,MAAM,GACxC,KAAK,KAAK,UAAU,IACpBD,EAAM,OAAO,SAAS,KAAK,IAAI,GAC/B,KAAK,aAAaA,EAAM,SAAS,MAAM,KAAK,QAAQ,GACpD,KAAK,OAAA;AAAA,EACP;AAAA,EATmB;AAAA,EACA;AAAA,EATV,OAAO,IAAIG,EAAA;AAAA,EACH,MAAM,IAAIC,EAAOC,EAAQ,KAAK;AAAA,EAC9B,SAAS,IAAID,EAAOC,EAAQ,KAAK;AAAA;AAAA,EAEjC,QAAQ,EAAE,GAAG,EAAA;AAAA,EACb;AAAA;AAAA,EAejB,IAAI,QAAiB;AACnB,WAAO,KAAK,MAAM,IAAI;AAAA,EACxB;AAAA;AAAA,EAGA,KAAKC,IAAK,KAAoB;AAC5B,WAAO,KAAK,GAAG,GAAGA,CAAE;AAAA,EACtB;AAAA,EAEA,KAAKA,IAAK,KAAoB;AAC5B,WAAO,KAAK,GAAG,GAAGA,CAAE;AAAA,EACtB;AAAA,EAEA,UAAgB;AACd,SAAK,MAAM,OAAO,aAAa,KAAK,KAAK,GACzC,KAAK,WAAA,GACL,KAAK,KAAK,QAAQ,EAAE,UAAU,IAAM;AAAA,EACtC;AAAA,EAEQ,GAAGC,GAAWD,GAA2B;AAE/C,WADA,KAAK,MAAM,OAAO,aAAa,KAAK,KAAK,GACrCA,KAAM,KACR,KAAK,MAAM,IAAIC,GACf,KAAK,OAAA,GACE,QAAQ,QAAA,KAEVC,EAAU,KAAK,OAAO,EAAE,SAAS,KAAK,OAAO,GAAAD,GAAG,UAAUD,GAAI,MAAM,cAAc,UAAU,MAAM,KAAK,OAAA,GAAU;AAAA,EAC1H;AAAA,EAEQ,SAAe;AACrB,UAAMG,IAAI,KAAK,MAAM,OACfC,IAAI,KAAK,MAAM,QACfR,IAAM,KAAK,MAAMQ,KAAK,KAAK,QAAQ,SAAS,QAAQ,KAAK,MAAM,CAAC;AACtE,SAAK,KAAK,UAAUR,IAAM,GAC1B,KAAK,IAAI,QAAQO,GACjB,KAAK,IAAI,SAASP,GAClB,KAAK,OAAO,QAAQO,GACpB,KAAK,OAAO,SAASP,GACrB,KAAK,OAAO,IAAIQ,IAAIR;AAAA,EACtB;AACF;"}
@@ -0,0 +1,15 @@
1
+ const s = [0, 8, 2, 10, 12, 4, 14, 6, 3, 11, 1, 9, 15, 7, 13, 5], f = 16;
2
+ function a(t, n, o) {
3
+ return s[(o & 3) * 4 + (n & 3)] < t;
4
+ }
5
+ function i(t, n, o) {
6
+ const r = Math.max(1e-3, o), e = (t * (1 + r) - n) / r, c = e <= 0 ? 0 : e >= 1 ? 1 : e;
7
+ return Math.round(c * f);
8
+ }
9
+ export {
10
+ s as BAYER4,
11
+ f as DITHER_LEVELS,
12
+ a as ditherCovered,
13
+ i as wipeLevel
14
+ };
15
+ //# sourceMappingURL=ditherMask.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ditherMask.js","sources":["../../src/transitions/ditherMask.ts"],"sourcesContent":["/** The 4×4 ordered-dither (Bayer) matrix, thresholds 0–15 row by row. */\nexport const BAYER4: readonly number[] = [0, 8, 2, 10, 12, 4, 14, 6, 3, 11, 1, 9, 15, 7, 13, 5];\n\n/** Dither levels from empty (0) to solid (16): a level n covers the n cells of the 4×4 tile with the lowest thresholds. */\nexport const DITHER_LEVELS = 16;\n\n/** Whether cell (x, y) of a tiled 4×4 pattern is covered at `level` (0–16). */\nexport function ditherCovered(level: number, x: number, y: number): boolean {\n return BAYER4[(y & 3) * 4 + (x & 3)]! < level;\n}\n\n/**\n * The dither level of one band of a wipe. `progress` 0–1 runs the wipe; `position` 0–1 is the band's centre along\n * the direction of travel; `softness` (0–1) is how much of the screen the dithered edge spans. At progress 0 every\n * band is empty, at 1 every band is solid, and in between the edge sweeps across with its gradient in dither steps.\n */\nexport function wipeLevel(progress: number, position: number, softness: number): number {\n const soft = Math.max(1e-3, softness);\n const front = progress * (1 + soft);\n const local = (front - position) / soft;\n const k = local <= 0 ? 0 : local >= 1 ? 1 : local;\n return Math.round(k * DITHER_LEVELS);\n}\n"],"names":["BAYER4","DITHER_LEVELS","ditherCovered","level","x","y","wipeLevel","progress","position","softness","soft","local","k"],"mappings":"AACO,MAAMA,IAA4B,CAAC,GAAG,GAAG,GAAG,IAAI,IAAI,GAAG,IAAI,GAAG,GAAG,IAAI,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC,GAGjFC,IAAgB;AAGtB,SAASC,EAAcC,GAAeC,GAAWC,GAAoB;AAC1E,SAAOL,GAAQK,IAAI,KAAK,KAAKD,IAAI,EAAE,IAAKD;AAC1C;AAOO,SAASG,EAAUC,GAAkBC,GAAkBC,GAA0B;AACtF,QAAMC,IAAO,KAAK,IAAI,MAAMD,CAAQ,GAE9BE,KADQJ,KAAY,IAAIG,KACPF,KAAYE,GAC7BE,IAAID,KAAS,IAAI,IAAIA,KAAS,IAAI,IAAIA;AAC5C,SAAO,KAAK,MAAMC,IAAIX,CAAa;AACrC;"}
@@ -0,0 +1,28 @@
1
+ import { Container as l } from "pixi.js";
2
+ const c = /* @__PURE__ */ new WeakMap();
3
+ function f(t, a, e, s = "replace") {
4
+ const o = (c.get(t) ?? Promise.resolve()).then(() => i(t, a, e, s)), p = o.catch(() => {
5
+ });
6
+ return c.set(t, p), p.then(() => {
7
+ c.get(t) === p && c.delete(t);
8
+ }), o;
9
+ }
10
+ async function i(t, a, e, s) {
11
+ const r = new l();
12
+ t.app.stage.addChild(r);
13
+ const o = { stage: t.stage, app: t.app, layer: r };
14
+ try {
15
+ if (await e.cover(o), s === "pop") await t.scenes.pop();
16
+ else {
17
+ if (!a) throw new Error(`transitionTo: '${s}' needs a scene`);
18
+ await (s === "push" ? t.scenes.push(a) : t.scenes.replace(a));
19
+ }
20
+ await e.reveal(o);
21
+ } finally {
22
+ e.dispose(), r.destroy({ children: !0 });
23
+ }
24
+ }
25
+ export {
26
+ f as transitionTo
27
+ };
28
+ //# sourceMappingURL=transitionTo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transitionTo.js","sources":["../../src/transitions/transitionTo.ts"],"sourcesContent":["import { Container } from 'pixi.js';\nimport type { Engine } from '../engine/Engine';\nimport type { Scene } from '../engine/Scene';\nimport type { Transition, TransitionContext } from './Transition';\n\n/** How the scene stack changes under the transition. */\nexport type TransitionMode = 'replace' | 'push' | 'pop';\n\n/** Transitions running per engine, so a second one waits for the first instead of drawing over it. */\nconst running = new WeakMap<Engine, Promise<void>>();\n\n/**\n * Changes scene behind a transition: covers the screen, runs `engine.scenes.replace(next)` (or `push`, or `pop`, for\n * which `next` is ignored) — waiting out an async `onEnter` while covered — then reveals. Resolves when the reveal\n * ends. The overlay is removed and the transition disposed even when the scene change throws, which is re-thrown.\n *\n * ```ts\n * await transitionTo(engine, new Level2(), new FadeTransition({ duration: 250 }));\n * ```\n */\nexport function transitionTo(engine: Engine, next: Scene | null, transition: Transition, mode: TransitionMode = 'replace'): Promise<void> {\n const before = running.get(engine) ?? Promise.resolve();\n const job = before.then(() => run(engine, next, transition, mode));\n const tail = job.catch(() => undefined);\n running.set(engine, tail);\n void tail.then(() => {\n if (running.get(engine) === tail) running.delete(engine);\n });\n return job;\n}\n\nasync function run(engine: Engine, next: Scene | null, transition: Transition, mode: TransitionMode): Promise<void> {\n const layer = new Container();\n // over the screen layer, so it covers every scene's HUD too, including the HUD the next scene is about to add\n engine.app.stage.addChild(layer);\n const ctx: TransitionContext = { stage: engine.stage, app: engine.app, layer };\n try {\n await transition.cover(ctx);\n if (mode === 'pop') await engine.scenes.pop();\n else {\n if (!next) throw new Error(`transitionTo: '${mode}' needs a scene`);\n await (mode === 'push' ? engine.scenes.push(next) : engine.scenes.replace(next));\n }\n await transition.reveal(ctx);\n } finally {\n transition.dispose();\n layer.destroy({ children: true });\n }\n}\n"],"names":["running","transitionTo","engine","next","transition","mode","job","run","tail","layer","Container","ctx"],"mappings":";AASA,MAAMA,wBAAc,QAAA;AAWb,SAASC,EAAaC,GAAgBC,GAAoBC,GAAwBC,IAAuB,WAA0B;AAExI,QAAMC,KADSN,EAAQ,IAAIE,CAAM,KAAK,QAAQ,QAAA,GAC3B,KAAK,MAAMK,EAAIL,GAAQC,GAAMC,GAAYC,CAAI,CAAC,GAC3DG,IAAOF,EAAI,MAAM,MAAA;AAAA,GAAe;AACtC,SAAAN,EAAQ,IAAIE,GAAQM,CAAI,GACnBA,EAAK,KAAK,MAAM;AACnB,IAAIR,EAAQ,IAAIE,CAAM,MAAMM,KAAMR,EAAQ,OAAOE,CAAM;AAAA,EACzD,CAAC,GACMI;AACT;AAEA,eAAeC,EAAIL,GAAgBC,GAAoBC,GAAwBC,GAAqC;AAClH,QAAMI,IAAQ,IAAIC,EAAA;AAElB,EAAAR,EAAO,IAAI,MAAM,SAASO,CAAK;AAC/B,QAAME,IAAyB,EAAE,OAAOT,EAAO,OAAO,KAAKA,EAAO,KAAK,OAAAO,EAAA;AACvE,MAAI;AAEF,QADA,MAAML,EAAW,MAAMO,CAAG,GACtBN,MAAS,MAAO,OAAMH,EAAO,OAAO,IAAA;AAAA,SACnC;AACH,UAAI,CAACC,EAAM,OAAM,IAAI,MAAM,kBAAkBE,CAAI,iBAAiB;AAClE,aAAOA,MAAS,SAASH,EAAO,OAAO,KAAKC,CAAI,IAAID,EAAO,OAAO,QAAQC,CAAI;AAAA,IAChF;AACA,UAAMC,EAAW,OAAOO,CAAG;AAAA,EAC7B,UAAA;AACE,IAAAP,EAAW,QAAA,GACXK,EAAM,QAAQ,EAAE,UAAU,GAAA,CAAM;AAAA,EAClC;AACF;"}
@@ -0,0 +1,15 @@
1
+ function r(n, e) {
2
+ return new Promise((o) => {
3
+ const t = e.onComplete;
4
+ n.tweens.add({
5
+ ...e,
6
+ onComplete: () => {
7
+ t?.(), o();
8
+ }
9
+ });
10
+ });
11
+ }
12
+ export {
13
+ r as tweenDone
14
+ };
15
+ //# sourceMappingURL=tweenDone.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tweenDone.js","sources":["../../src/transitions/tweenDone.ts"],"sourcesContent":["import type { Stage } from '../core/Stage';\nimport type { TweenConfig } from '../core/Tweener';\n\n/** Runs a tween on the stage and resolves when it completes: the awaitable form transitions are built from. */\nexport function tweenDone(stage: Stage, config: TweenConfig): Promise<void> {\n return new Promise((resolve) => {\n const done = config.onComplete;\n stage.tweens.add({\n ...config,\n onComplete: () => {\n done?.();\n resolve();\n },\n });\n });\n}\n"],"names":["tweenDone","stage","config","resolve","done"],"mappings":"AAIO,SAASA,EAAUC,GAAcC,GAAoC;AAC1E,SAAO,IAAI,QAAQ,CAACC,MAAY;AAC9B,UAAMC,IAAOF,EAAO;AACpB,IAAAD,EAAM,OAAO,IAAI;AAAA,MACf,GAAGC;AAAA,MACH,YAAY,MAAM;AAChB,QAAAE,IAAA,GACAD,EAAA;AAAA,MACF;AAAA,IAAA,CACD;AAAA,EACH,CAAC;AACH;"}
@@ -0,0 +1,41 @@
1
+ import { type Container } from 'pixi.js';
2
+ import type { Stage } from '../core/Stage.js';
3
+ import { type GradeState } from './grade.js';
4
+ /** Where the sheet goes among its parent's children. */
5
+ export type GradePlacement = 'top' | 'bottom';
6
+ export interface ColorGradeOptions {
7
+ /** How often (ms) the grade is read again: the hour moves slowly, so not every frame (default 500). */
8
+ readEveryMs?: number;
9
+ /** The container the sheet is added to (default the stage's screen layer). */
10
+ parent?: Container;
11
+ /**
12
+ * `'top'` (the default) adds the sheet over everything already in `parent`, so it tints a HUD made before it and
13
+ * not one made after. `'bottom'` puts it under every child `parent` has or will have: on the screen layer that is
14
+ * over the world and under every HUD, whatever order they were made in — usually what a grade wants.
15
+ */
16
+ placement?: GradePlacement;
17
+ }
18
+ /**
19
+ * A colour laid over the whole screen in **multiply**, so it tints the world (a marsh mossy, a peak ember, a dead
20
+ * land pale) without washing the art toward white the way a normal-blend sheet would. One white quad, tinted: no
21
+ * filter pass, which is what a phone can spare every frame.
22
+ *
23
+ * `read` returns the grade now (`gradeAt` from a place's `Grade` and `DayClock`'s night, say); it is asked a few
24
+ * times a second, and a grade that comes to white is not drawn at all. Give `placement: 'bottom'` to keep it off the
25
+ * HUD (see `ColorGradeOptions.placement`).
26
+ */
27
+ export declare class ColorGrade {
28
+ private readonly stage;
29
+ private readonly read;
30
+ private readonly sheet;
31
+ private readAt;
32
+ private blank;
33
+ private readonly every;
34
+ constructor(stage: Stage, read: () => GradeState | null, options?: ColorGradeOptions);
35
+ /** Reads the grade again on the next update (the place changed). */
36
+ invalidate(): void;
37
+ /** `enabled`: the game's setting, and off under a battery saver — a full-screen blend is a cost on a phone. */
38
+ update(now: number, enabled?: boolean): void;
39
+ destroy(): void;
40
+ }
41
+ //# sourceMappingURL=ColorGrade.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorGrade.d.ts","sourceRoot":"","sources":["../../../src/ambient/ColorGrade.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAEtD,wDAAwD;AACxD,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,QAAQ,CAAC;AAE9C,MAAM,WAAW,iBAAiB;IAChC,uGAAuG;IACvG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;CAC5B;AAED;;;;;;;;GAQG;AACH,qBAAa,UAAU;IAOnB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,IAAI;IAPvB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA0C;IAChE,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;gBAGZ,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,MAAM,UAAU,GAAG,IAAI,EAC9C,OAAO,GAAE,iBAAsB;IAUjC,oEAAoE;IACpE,UAAU,IAAI,IAAI;IAIlB,+GAA+G;IAC/G,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,UAAO,GAAG,IAAI;IAoBzC,OAAO,IAAI,IAAI;CAGhB"}
@@ -0,0 +1,80 @@
1
+ /**
2
+ * A time of day read off a wall clock, so every client that agrees on the time (`serverNow`) stands in the same dusk
3
+ * without a packet between them. Pure: no Pixi, no clock of its own — the caller hands in the time, and what draws
4
+ * the night (a `LightLayer`, the pixel `NightShade`) or a HUD badge reads what this returns.
5
+ *
6
+ * ```ts
7
+ * const clock = new DayClock({
8
+ * periodMs: 2 * 3600_000, // a game day every two real hours
9
+ * keys: [
10
+ * { at: 0, color: 0x0a1030, alpha: 0.52 },
11
+ * { at: 0.3, color: 0xfff0d8, alpha: 0 },
12
+ * { at: 0.7, color: 0xffb070, alpha: 0 },
13
+ * { at: 0.86, color: 0x0a1030, alpha: 0.52 },
14
+ * ],
15
+ * phases: [{ id: 'dawn', from: 0.2 }, { id: 'day', from: 0.3 }, { id: 'dusk', from: 0.7 }, { id: 'night', from: 0.8 }],
16
+ * });
17
+ * const day = clock.at(serverNow()); // { phase, id, color, alpha, night }
18
+ * ```
19
+ *
20
+ * Phase 0 is midnight and 0.5 noon. Keys are the grade laid over the outdoor world at points of the day, mixed
21
+ * between neighbours; a key at 0 and one at 1 with the same values make midnight seamless.
22
+ */
23
+ /** The world's grade at one point of the day: its colour (0xRRGGBB) and how strongly it is laid (0 by day). */
24
+ export interface DayKey {
25
+ at: number;
26
+ color: number;
27
+ alpha: number;
28
+ }
29
+ /** A named part of the day starting at `from` (0..1); the last one runs on through midnight. */
30
+ export interface DayPhase<P extends string = string> {
31
+ id: P;
32
+ from: number;
33
+ }
34
+ export interface DayClockOptions<P extends string = string> {
35
+ /** Real milliseconds a whole game day lasts. */
36
+ periodMs: number;
37
+ /** Shifts the day against the wall clock (the same offset on every client keeps them together). */
38
+ offsetMs?: number;
39
+ /** At least one key. */
40
+ keys: readonly DayKey[];
41
+ /** Optional names for parts of the day; without them `id` is ''. */
42
+ phases?: readonly DayPhase<P>[];
43
+ }
44
+ export interface DayState<P extends string = string> {
45
+ /** 0..1 through the game day: 0 midnight, 0.5 noon. */
46
+ phase: number;
47
+ /** The part of the day `phase` falls in. */
48
+ id: P | '';
49
+ /** The grade over the outdoor world, 0xRRGGBB. */
50
+ color: number;
51
+ /** How strongly the grade is laid (0 at full day). */
52
+ alpha: number;
53
+ /** 0 by day, 1 at the darkest key: how much lamps matter. */
54
+ night: number;
55
+ }
56
+ /** `a` taken `t` of the way to `b`, per channel, 0xRRGGBB. */
57
+ export declare function mixRgb(a: number, b: number, t: number): number;
58
+ export declare class DayClock<P extends string = string> {
59
+ private readonly periodMs;
60
+ private readonly offsetMs;
61
+ private readonly keys;
62
+ private readonly phases;
63
+ private readonly maxAlpha;
64
+ /** A phase held still (a debug command, a cut scene at midnight); null follows the clock. */
65
+ private held;
66
+ constructor(options: DayClockOptions<P>);
67
+ /** Holds the day at `phase` (0..1), or lets it run again with null. */
68
+ hold(phase: number | null): void;
69
+ /** Where the day stands at wall time `ms` (0..1). */
70
+ phaseAt(ms: number): number;
71
+ at(ms: number): DayState<P>;
72
+ }
73
+ /** A day's phase as a 24-hour clock, "HH:MM" (phase 0 is midnight). */
74
+ export declare function clockText(phase: number): string;
75
+ /**
76
+ * The night's colour pulled toward a place's own (a marsh mossy, a wood blue) as it deepens: `share` of the way at
77
+ * full night, nothing by day.
78
+ */
79
+ export declare function tintNight(day: Pick<DayState, 'color' | 'night'>, tint: number | undefined, share?: number): number;
80
+ //# sourceMappingURL=DayClock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DayClock.d.ts","sourceRoot":"","sources":["../../../src/ambient/DayClock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,+GAA+G;AAC/G,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,gGAAgG;AAChG,MAAM,WAAW,QAAQ,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IACjD,EAAE,EAAE,CAAC,CAAC;IACN,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IACxD,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,mGAAmG;IACnG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wBAAwB;IACxB,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,oEAAoE;IACpE,MAAM,CAAC,EAAE,SAAS,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;CACjC;AAED,MAAM,WAAW,QAAQ,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IACjD,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC;IACX,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAC;CACf;AAED,8DAA8D;AAC9D,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAG9D;AAED,qBAAa,QAAQ,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC7C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAW;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgB;IACvC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,6FAA6F;IAC7F,OAAO,CAAC,IAAI,CAAuB;gBAEvB,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC;IAWvC,uEAAuE;IACvE,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAIhC,qDAAqD;IACrD,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAM3B,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC;CA0B5B;AAED,uEAAuE;AACvE,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAG/C;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,SAAM,GAAG,MAAM,CAE/G"}
@@ -0,0 +1,78 @@
1
+ import type { ViewRect } from '../core/Camera.js';
2
+ import type { Stage } from '../core/Stage.js';
3
+ import type { WeatherState } from './weather.js';
4
+ /**
5
+ * How one kind of weather moves:
6
+ * - `fall`: streaks falling at a slant onto a ground line somewhere in view, half of them leaving a two-frame splash
7
+ * (rain);
8
+ * - `flake`: bits drifting down and swaying as they fall, each on its own phase (snow, ash, petals);
9
+ * - `bank`: a few wide sprites drifting slowly sideways, laid over the bodies (fog, mist, smoke).
10
+ */
11
+ export type WeatherMotion = 'fall' | 'flake' | 'bank';
12
+ export interface WeatherLook {
13
+ motion: WeatherMotion;
14
+ /** Particles at full strength; fewer show as the weather thins. Keep it in the low hundreds on a phone. */
15
+ max: number;
16
+ /** Texture keys, handed out in turn (repeat a key to make it commoner). */
17
+ keys: readonly string[];
18
+ /** `fall` only: the splash's two frames. Without them a drop simply vanishes where it lands. */
19
+ splash?: readonly [string, string];
20
+ /** World px a second, [lo, hi] each (defaults suit each motion). */
21
+ vx?: readonly [number, number];
22
+ vy?: readonly [number, number];
23
+ /** `flake` only: how far (px) a flake sways either side as it falls (default 4). */
24
+ sway?: number;
25
+ /** A screen-wide tint the kind lays over everything (fog is mostly tint), at `tintAlpha` × strength. */
26
+ tint?: number;
27
+ tintAlpha?: number;
28
+ }
29
+ export interface WeatherLayerOptions<K extends string> {
30
+ looks: Readonly<Partial<Record<K, WeatherLook>>>;
31
+ /** Depth of falling particles in the world layer: over the bodies, under the names (default 900_001). */
32
+ depth?: number;
33
+ /** Depth of fog banks (default 900_010). */
34
+ bankDepth?: number;
35
+ /** Depth of splashes: with the ground effects, so a body standing in the rain is not splashed over (default 0). */
36
+ splashDepth?: number;
37
+ /** Round positions to whole world pixels (default true): pixel art wants it, smooth art may not. */
38
+ snap?: boolean;
39
+ /** Where randomness comes from (default `Math.random`); the look of a shower need not be shared between clients. */
40
+ random?: () => number;
41
+ }
42
+ /**
43
+ * The weather on screen: a capped pool of particles that lives only inside the camera's view, plus a light screen
44
+ * tint for the kinds that change the air. Feed it a `WeatherState` each frame (from `weatherAt`, so it fades in and
45
+ * out exactly when every other client's does); the pool is rebuilt only when the kind changes, and a thinning shower
46
+ * hides particles rather than freeing them.
47
+ *
48
+ * The art is the game's: name texture keys per kind (the pixel module's `paintWeatherArt` paints a set in whole
49
+ * pixels).
50
+ */
51
+ export declare class WeatherLayer<K extends string> {
52
+ private readonly stage;
53
+ private readonly options;
54
+ private readonly drops;
55
+ private kind;
56
+ private look;
57
+ private readonly tint;
58
+ private readonly depth;
59
+ private readonly bankDepth;
60
+ private readonly splashDepth;
61
+ private readonly snap;
62
+ private readonly random;
63
+ constructor(stage: Stage, options: WeatherLayerOptions<K>);
64
+ /**
65
+ * `now` in ms, `dt` the frame's ms, `view` the camera's world view. `share` (0..1) thins the pool on top of the
66
+ * weather's own strength (a reduced-effects setting keeps half).
67
+ */
68
+ update(now: number, dt: number, view: ViewRect, weather: WeatherState<K>, share?: number): void;
69
+ private rebuild;
70
+ private between;
71
+ private place;
72
+ private spawn;
73
+ private stepFall;
74
+ private stepFlake;
75
+ private stepBank;
76
+ destroy(): void;
77
+ }
78
+ //# sourceMappingURL=WeatherLayer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WeatherLayer.d.ts","sourceRoot":"","sources":["../../../src/ambient/WeatherLayer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE9C;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAEtD,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,aAAa,CAAC;IACtB,2GAA2G;IAC3G,GAAG,EAAE,MAAM,CAAC;IACZ,2EAA2E;IAC3E,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,gGAAgG;IAChG,MAAM,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,oEAAoE;IACpE,EAAE,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,EAAE,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,oFAAoF;IACpF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wGAAwG;IACxG,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,MAAM;IACnD,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IACjD,yGAAyG;IACzG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mHAAmH;IACnH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oGAAoG;IACpG,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,oHAAoH;IACpH,MAAM,CAAC,EAAE,MAAM,MAAM,CAAC;CACvB;AAsBD;;;;;;;;GAQG;AACH,qBAAa,YAAY,CAAC,CAAC,SAAS,MAAM;IAYtC,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAZ1B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;IACpC,OAAO,CAAC,IAAI,CAAwB;IACpC,OAAO,CAAC,IAAI,CAA0B;IACtC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA0C;IAC/D,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAU;IAC/B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;gBAGnB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAWlD;;;OAGG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,KAAK,SAAI,GAAG,IAAI;IA2B1F,OAAO,CAAC,OAAO;IAkBf,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,KAAK;IAyBb,OAAO,CAAC,QAAQ;IAuBhB,OAAO,CAAC,SAAS;IAajB,OAAO,CAAC,QAAQ;IAOhB,OAAO,IAAI,IAAI;CAKhB"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The pure half of a colour grade: how strong a place's colour is laid at a point of the day, and the multiply colour
3
+ * that leaves the same result. `ColorGrade` draws it.
4
+ */
5
+ /** A place's grade: its colour (0xRRGGBB) and how strongly it is laid by day and by night (0..1). */
6
+ export interface Grade {
7
+ color: number;
8
+ day: number;
9
+ night: number;
10
+ }
11
+ export interface GradeState {
12
+ color: number;
13
+ alpha: number;
14
+ }
15
+ /**
16
+ * The grade at `night` (0 by day, 1 at full night, `DayClock`'s `night`), never past `max`: a grade is a light
17
+ * tint, and one laid too strong washes every sprite toward one colour.
18
+ */
19
+ export declare function gradeAt(grade: Grade, night: number, max?: number): GradeState;
20
+ /** `color` taken `share` of the way from white: what a multiply sheet of that colour at that opacity leaves. */
21
+ export declare function mixToWhite(color: number, share: number): number;
22
+ //# sourceMappingURL=grade.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grade.d.ts","sourceRoot":"","sources":["../../../src/ambient/grade.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,qGAAqG;AACrG,MAAM,WAAW,KAAK;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,SAAO,GAAG,UAAU,CAG3E;AAED,gHAAgH;AAChH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAI/D"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Weather rolled from wall time alone, so two players standing in the same place are rained on together without a
3
+ * packet between them. Pure and deterministic: the same key, time and table give the same sky on every machine.
4
+ *
5
+ * Time is cut into slots; each slot rolls one entry of a weighted list from a hash of the key and the slot number,
6
+ * and a change of kind fades out at the end of its slot and in at the start of the next. Places can share one sky:
7
+ * a key listed in a `skies` group takes its kind from the group's roll (so the rain does not stop at a map's edge)
8
+ * and only its strength from its own list. The kind `'clear'` means no weather and has no strength.
9
+ *
10
+ * ```ts
11
+ * const TABLE: WeatherTable = {
12
+ * slotMs: 12 * 60_000,
13
+ * fadeMs: 40_000,
14
+ * places: { meadow: [{ kind: 'clear', weight: 4 }, { kind: 'rain', weight: 3, intensity: [0.4, 1] }] },
15
+ * };
16
+ * const w = weatherAt('meadow', serverNow(), TABLE); // { kind: 'rain', intensity: 0.7 }
17
+ * ```
18
+ */
19
+ export interface WeatherEntry<K extends string = string> {
20
+ kind: K | 'clear';
21
+ weight: number;
22
+ /** The strength range rolled for this kind, [lo, hi] in 0..1 (default [1, 1]). */
23
+ intensity?: readonly [number, number];
24
+ }
25
+ export interface WeatherSky<K extends string = string> {
26
+ /** The place keys under this sky. */
27
+ places: readonly string[];
28
+ entries: readonly WeatherEntry<K>[];
29
+ }
30
+ export interface WeatherTable<K extends string = string> {
31
+ /** How long one roll of the sky lasts. */
32
+ slotMs: number;
33
+ /** How long a change of kind takes to fade out and in. */
34
+ fadeMs: number;
35
+ /** Each place's own list; a place with none (a cave) has no weather, even inside a sky. */
36
+ places: Readonly<Record<string, readonly WeatherEntry<K>[]>>;
37
+ /** Groups of neighbouring places that share one sky, by group id. */
38
+ skies?: Readonly<Record<string, WeatherSky<K>>>;
39
+ }
40
+ export interface WeatherState<K extends string = string> {
41
+ kind: K | 'clear';
42
+ /** 0..1, already faded round a change of kind; 0 when clear. */
43
+ intensity: number;
44
+ }
45
+ /** FNV-1a over the text, then an avalanche: a stable number in [0, 1). */
46
+ export declare function hash01(text: string): number;
47
+ /** The weather over place `key` at wall time `ms`. */
48
+ export declare function weatherAt<K extends string>(key: string, ms: number, table: WeatherTable<K>): WeatherState<K>;
49
+ //# sourceMappingURL=weather.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"weather.d.ts","sourceRoot":"","sources":["../../../src/ambient/weather.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IACrD,IAAI,EAAE,CAAC,GAAG,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,kFAAkF;IAClF,SAAS,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC;AAED,MAAM,WAAW,UAAU,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IACnD,qCAAqC;IACrC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,OAAO,EAAE,SAAS,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;CACrC;AAED,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IACrD,0CAA0C;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,MAAM,EAAE,MAAM,CAAC;IACf,2FAA2F;IAC3F,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7D,qEAAqE;IACrE,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACjD;AAED,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IACrD,IAAI,EAAE,CAAC,GAAG,OAAO,CAAC;IAClB,gEAAgE;IAChE,SAAS,EAAE,MAAM,CAAC;CACnB;AAID,0EAA0E;AAC1E,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAU3C;AAiCD,sDAAsD;AACtD,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAuB5G"}