1681-engine 0.0.0-stage → 0.5.9

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 (831) hide show
  1. package/CHANGELOG.md +357 -0
  2. package/LICENSE +21 -0
  3. package/README.md +164 -2
  4. package/dist/1681-engine.js +471 -0
  5. package/dist/ambient/ColorGrade.js +40 -0
  6. package/dist/ambient/DayClock.js +56 -0
  7. package/dist/ambient/WeatherLayer.js +90 -0
  8. package/dist/ambient/grade.js +12 -0
  9. package/dist/ambient/weather.js +51 -0
  10. package/dist/anim/AnimStateMachine.js +163 -0
  11. package/dist/anim/Animator.js +66 -0
  12. package/dist/anim/animStateCompile.js +112 -0
  13. package/dist/anim/animStateSystem.js +16 -0
  14. package/dist/anim/animationSystem.js +14 -0
  15. package/dist/anim/asepriteSlices.js +21 -0
  16. package/dist/anim/asepriteTags.js +34 -0
  17. package/dist/anim/parseAseprite.js +82 -0
  18. package/dist/assets/AssetLoader.js +202 -0
  19. package/dist/assets/loadAseprite.js +49 -0
  20. package/dist/assets/takeCleanerWorker-DTcI_Jqr.js +30 -0
  21. package/dist/assets/textureAtlas.js +58 -0
  22. package/dist/audio/Footsteps.js +25 -0
  23. package/dist/audio/MusicPlayer.js +77 -0
  24. package/dist/audio/SoundEngine.js +125 -0
  25. package/dist/audio/cleanTake.js +29 -0
  26. package/dist/audio/music/ElementVoice.js +34 -0
  27. package/dist/audio/music/GraphVoice.js +38 -0
  28. package/dist/audio/music/MusicChannel.js +57 -0
  29. package/dist/audio/music/musicVoice.js +12 -0
  30. package/dist/audio/sampleBank.js +81 -0
  31. package/dist/audio/soundTable.js +8 -0
  32. package/dist/audio/synth.js +35 -0
  33. package/dist/core/BitmapLabel.js +48 -0
  34. package/dist/core/Camera.js +149 -0
  35. package/dist/core/Clock.js +40 -0
  36. package/dist/core/Graphics.js +68 -0
  37. package/dist/core/Group.js +28 -0
  38. package/dist/core/Image.js +50 -0
  39. package/dist/core/ObjectFactory.js +54 -0
  40. package/dist/core/Pointer.js +80 -0
  41. package/dist/core/Rectangle.js +50 -0
  42. package/dist/core/Stage.js +85 -0
  43. package/dist/core/Text.js +21 -0
  44. package/dist/core/TextureRegistry.js +141 -0
  45. package/dist/core/Timeline.js +210 -0
  46. package/dist/core/TimelineBuilder.js +72 -0
  47. package/dist/core/TimelineChild.js +83 -0
  48. package/dist/core/Tweener.js +135 -0
  49. package/dist/core/atlas.js +37 -0
  50. package/dist/core/atlasPlan.js +21 -0
  51. package/dist/core/blendLayer.js +11 -0
  52. package/dist/core/eases.js +20 -0
  53. package/dist/core/gameObject.js +117 -0
  54. package/dist/core/pixelZoom.js +43 -0
  55. package/dist/core/pixiPatches.js +17 -0
  56. package/dist/core/runDue.js +28 -0
  57. package/dist/core/silhouette.js +49 -0
  58. package/dist/core/timelinePlace.js +23 -0
  59. package/dist/core/tweenProps.js +11 -0
  60. package/dist/debug/DebugOverlay.js +93 -0
  61. package/dist/debug/DrawCallCounter.js +44 -0
  62. package/dist/debug/ErrorLog.js +21 -0
  63. package/dist/debug/FrameStats.js +41 -0
  64. package/dist/debug/inspectWorld.js +28 -0
  65. package/dist/diagnostics/ErrorDeduper.js +26 -0
  66. package/dist/diagnostics/FrameSampler.js +41 -0
  67. package/dist/diagnostics/bootWatch.js +20 -0
  68. package/dist/diagnostics/captureErrors.js +26 -0
  69. package/dist/diagnostics/contextLoss.js +24 -0
  70. package/dist/diagnostics/frameStats.js +30 -0
  71. package/dist/diagnostics/gpuInfo.js +21 -0
  72. package/dist/diagnostics/renderGuard.js +23 -0
  73. package/dist/ecs/SparseSet.js +54 -0
  74. package/dist/ecs/World.js +306 -0
  75. package/dist/ecs/fields.js +25 -0
  76. package/dist/engine/Engine.js +106 -0
  77. package/dist/engine/FixedLoop.js +36 -0
  78. package/dist/engine/HiddenPause.js +27 -0
  79. package/dist/engine/Scene.js +78 -0
  80. package/dist/engine/SceneManager.js +72 -0
  81. package/dist/events/EventBus.js +41 -0
  82. package/dist/fx/Afterimages.js +82 -0
  83. package/dist/fx/FloatingText.js +71 -0
  84. package/dist/fx/hitStop.js +27 -0
  85. package/dist/fx/viewCull.js +9 -0
  86. package/dist/i18n/Translator.js +71 -0
  87. package/dist/i18n/extractStrings.js +57 -0
  88. package/dist/i18n/formatMessage.js +18 -0
  89. package/dist/input/Actions.js +139 -0
  90. package/dist/input/AimGesture.js +74 -0
  91. package/dist/input/Keyboard.js +53 -0
  92. package/dist/input/Keymap.js +170 -0
  93. package/dist/input/TargetLock.js +72 -0
  94. package/dist/input/aimAxis.js +7 -0
  95. package/dist/input/keyChord.js +28 -0
  96. package/dist/input/longPress.js +31 -0
  97. package/dist/input/rumble.js +42 -0
  98. package/dist/input/stickAxis.js +22 -0
  99. package/dist/input/touchDetect.js +6 -0
  100. package/dist/light/LightLayer.js +83 -0
  101. package/dist/nav/MinHeap.js +38 -0
  102. package/dist/nav/findPath.js +77 -0
  103. package/dist/nav/navGrid.js +35 -0
  104. package/dist/nav/nearestOpen.js +18 -0
  105. package/dist/nav/straightenPath.js +50 -0
  106. package/dist/net/Connection.js +107 -0
  107. package/dist/net/InterpolationBuffer.js +56 -0
  108. package/dist/net/PredictedMover.js +60 -0
  109. package/dist/net/Room.js +91 -0
  110. package/dist/net/RoomHost.js +100 -0
  111. package/dist/net/cadence.js +21 -0
  112. package/dist/net/constants.js +10 -0
  113. package/dist/net/lobby/LobbyClient.js +123 -0
  114. package/dist/net/lobby/LobbyHost.js +365 -0
  115. package/dist/net/lobby/LobbyRooms.js +65 -0
  116. package/dist/net/lobby/Matchmaker.js +105 -0
  117. package/dist/net/movement.js +84 -0
  118. package/dist/net/protocol.js +10 -0
  119. package/dist/net/reconnect.js +10 -0
  120. package/dist/net/serverClock.js +21 -0
  121. package/dist/net/snapshotCodec.js +91 -0
  122. package/dist/parallax/Parallax.js +31 -0
  123. package/dist/parallax/ParallaxLayer.js +69 -0
  124. package/dist/parallax/parallaxMath.js +26 -0
  125. package/dist/particles/Emitter.js +107 -0
  126. package/dist/particles/ParticleBudget.js +31 -0
  127. package/dist/particles/ParticleSim.js +59 -0
  128. package/dist/particles/particleCurves.js +47 -0
  129. package/dist/particles/particleSampling.js +29 -0
  130. package/dist/physics/Body.js +201 -0
  131. package/dist/physics/BroadPhase.js +55 -0
  132. package/dist/physics/Contact.js +75 -0
  133. package/dist/physics/ContactSolver.js +69 -0
  134. package/dist/physics/PhysicsWorld.js +220 -0
  135. package/dist/physics/SpatialHash.js +38 -0
  136. package/dist/physics/collide.js +75 -0
  137. package/dist/physics/collidePolygon.js +93 -0
  138. package/dist/physics/contactReport.js +13 -0
  139. package/dist/physics/drawColliders.js +30 -0
  140. package/dist/physics/physicsSystem.js +7 -0
  141. package/dist/physics/polygon.js +79 -0
  142. package/dist/physics/raycast.js +61 -0
  143. package/dist/physics/syncToBody.js +18 -0
  144. package/dist/physics/tileBodies.js +58 -0
  145. package/dist/physics/types.js +7 -0
  146. package/dist/pixel/Darkness.js +169 -0
  147. package/dist/pixel/DitherVignette.js +56 -0
  148. package/dist/pixel/Evaporation.js +84 -0
  149. package/dist/pixel/NightShade.js +33 -0
  150. package/dist/pixel/PixelLayer.js +210 -0
  151. package/dist/pixel/PixelMarks.js +99 -0
  152. package/dist/pixel/SwayProp.js +74 -0
  153. package/dist/pixel/aimPixels.js +67 -0
  154. package/dist/pixel/lights.js +43 -0
  155. package/dist/pixel/nineSlice.js +61 -0
  156. package/dist/pixel/paintLayer.js +35 -0
  157. package/dist/pixel/palette.js +56 -0
  158. package/dist/pixel/pixel.js +277 -0
  159. package/dist/pixel/pixelPaint.js +197 -0
  160. package/dist/pixel/pixelParticles.js +35 -0
  161. package/dist/pixel/pixelTone.js +163 -0
  162. package/dist/pixel/propKit.js +40 -0
  163. package/dist/pixel/ramp.js +101 -0
  164. package/dist/pixel/selout.js +34 -0
  165. package/dist/pixel/spritePixels.js +58 -0
  166. package/dist/pixel/swayRig.js +86 -0
  167. package/dist/pixel/vignetteMask.js +23 -0
  168. package/dist/pixel/weatherArt.js +60 -0
  169. package/dist/pixel.js +96 -0
  170. package/dist/platform/appResume.js +18 -0
  171. package/dist/platform/fullscreen.js +52 -0
  172. package/dist/platform/orientation.js +26 -0
  173. package/dist/platform/pointerLock.js +37 -0
  174. package/dist/platform/reducedMotion.js +23 -0
  175. package/dist/platform/timeoutSignal.js +14 -0
  176. package/dist/platform/touch.js +32 -0
  177. package/dist/postfx/BloomFilter.js +64 -0
  178. package/dist/postfx/ChromaticAberrationFilter.js +24 -0
  179. package/dist/postfx/ColorAdjustFilter.js +75 -0
  180. package/dist/postfx/CrtFilter.js +41 -0
  181. package/dist/postfx/PixelateFilter.js +26 -0
  182. package/dist/postfx/PostFx.js +122 -0
  183. package/dist/postfx/ShockwaveFilter.js +48 -0
  184. package/dist/postfx/VignetteFilter.js +36 -0
  185. package/dist/postfx/fxAnimator.js +37 -0
  186. package/dist/postfx/fxShader.js +127 -0
  187. package/dist/postfx.js +25 -0
  188. package/dist/react/ChoiceDialog.js +50 -0
  189. package/dist/react/ConfirmDialog.js +52 -0
  190. package/dist/react/Glyph.js +62 -0
  191. package/dist/react/Modal.js +37 -0
  192. package/dist/react/Panel.js +23 -0
  193. package/dist/react/PixelImage.js +23 -0
  194. package/dist/react/Select.js +98 -0
  195. package/dist/react/Slider.js +61 -0
  196. package/dist/react/SplitPane.js +23 -0
  197. package/dist/react/TabStrip.js +31 -0
  198. package/dist/react/TitleTips.js +41 -0
  199. package/dist/react/Tooltip.js +27 -0
  200. package/dist/react/UiProvider.js +49 -0
  201. package/dist/react/baseCss.js +221 -0
  202. package/dist/react/choiceStore.js +22 -0
  203. package/dist/react/classNames.js +18 -0
  204. package/dist/react/confirmStore.js +29 -0
  205. package/dist/react/labels.js +17 -0
  206. package/dist/react/placement.js +48 -0
  207. package/dist/react/useFillSheet.js +22 -0
  208. package/dist/react/useFitToViewport.js +28 -0
  209. package/dist/react/usePicked.js +12 -0
  210. package/dist/react/useStore.js +8 -0
  211. package/dist/react/useViewport.js +16 -0
  212. package/dist/react.js +77 -0
  213. package/dist/rig/PosePlayer.js +91 -0
  214. package/dist/rig/RigView.js +124 -0
  215. package/dist/rig/Skeleton.js +30 -0
  216. package/dist/rig/humanoid.js +5 -0
  217. package/dist/rig/humanoid.json.js +29 -0
  218. package/dist/rig/humanoidPoses.js +29 -0
  219. package/dist/rig/poseMath.js +53 -0
  220. package/dist/rig/poses.json.js +149 -0
  221. package/dist/save/Autosaver.js +53 -0
  222. package/dist/save/MemoryBackend.js +18 -0
  223. package/dist/save/SaveStore.js +102 -0
  224. package/dist/save/WebStorageBackend.js +26 -0
  225. package/dist/save/checksum.js +9 -0
  226. package/dist/save/migrateSave.js +26 -0
  227. package/dist/settings.js +26 -0
  228. package/dist/tilemap/TilemapView.js +68 -0
  229. package/dist/tilemap/collision.js +24 -0
  230. package/dist/tilemap/tiled.js +137 -0
  231. package/dist/transitions/CrossfadeTransition.js +23 -0
  232. package/dist/transitions/DitherWipeTransition.js +69 -0
  233. package/dist/transitions/FadeTransition.js +33 -0
  234. package/dist/transitions/Letterbox.js +41 -0
  235. package/dist/transitions/ditherMask.js +14 -0
  236. package/dist/transitions/transitionTo.js +27 -0
  237. package/dist/transitions/tweenDone.js +14 -0
  238. package/dist/types/ambient/ColorGrade.d.ts +41 -0
  239. package/dist/types/ambient/ColorGrade.d.ts.map +1 -0
  240. package/dist/types/ambient/DayClock.d.ts +80 -0
  241. package/dist/types/ambient/DayClock.d.ts.map +1 -0
  242. package/dist/types/ambient/WeatherLayer.d.ts +78 -0
  243. package/dist/types/ambient/WeatherLayer.d.ts.map +1 -0
  244. package/dist/types/ambient/grade.d.ts +22 -0
  245. package/dist/types/ambient/grade.d.ts.map +1 -0
  246. package/dist/types/ambient/weather.d.ts +49 -0
  247. package/dist/types/ambient/weather.d.ts.map +1 -0
  248. package/dist/types/anim/AnimStateMachine.d.ts +80 -0
  249. package/dist/types/anim/AnimStateMachine.d.ts.map +1 -0
  250. package/dist/types/anim/Animator.d.ts +50 -0
  251. package/dist/types/anim/Animator.d.ts.map +1 -0
  252. package/dist/types/anim/animStateCompile.d.ts +52 -0
  253. package/dist/types/anim/animStateCompile.d.ts.map +1 -0
  254. package/dist/types/anim/animStateSystem.d.ts +10 -0
  255. package/dist/types/anim/animStateSystem.d.ts.map +1 -0
  256. package/dist/types/anim/animStateTypes.d.ts +50 -0
  257. package/dist/types/anim/animStateTypes.d.ts.map +1 -0
  258. package/dist/types/anim/animationSystem.d.ts +13 -0
  259. package/dist/types/anim/animationSystem.d.ts.map +1 -0
  260. package/dist/types/anim/asepriteSlices.d.ts +19 -0
  261. package/dist/types/anim/asepriteSlices.d.ts.map +1 -0
  262. package/dist/types/anim/asepriteTags.d.ts +16 -0
  263. package/dist/types/anim/asepriteTags.d.ts.map +1 -0
  264. package/dist/types/anim/asepriteTypes.d.ts +159 -0
  265. package/dist/types/anim/asepriteTypes.d.ts.map +1 -0
  266. package/dist/types/anim/parseAseprite.d.ts +21 -0
  267. package/dist/types/anim/parseAseprite.d.ts.map +1 -0
  268. package/dist/types/assets/AssetLoader.d.ts +140 -0
  269. package/dist/types/assets/AssetLoader.d.ts.map +1 -0
  270. package/dist/types/assets/loadAseprite.d.ts +27 -0
  271. package/dist/types/assets/loadAseprite.d.ts.map +1 -0
  272. package/dist/types/assets/textureAtlas.d.ts +35 -0
  273. package/dist/types/assets/textureAtlas.d.ts.map +1 -0
  274. package/dist/types/audio/Footsteps.d.ts +33 -0
  275. package/dist/types/audio/Footsteps.d.ts.map +1 -0
  276. package/dist/types/audio/MusicPlayer.d.ts +65 -0
  277. package/dist/types/audio/MusicPlayer.d.ts.map +1 -0
  278. package/dist/types/audio/SoundEngine.d.ts +47 -0
  279. package/dist/types/audio/SoundEngine.d.ts.map +1 -0
  280. package/dist/types/audio/cleanTake.d.ts +3 -0
  281. package/dist/types/audio/cleanTake.d.ts.map +1 -0
  282. package/dist/types/audio/music/ElementVoice.d.ts +14 -0
  283. package/dist/types/audio/music/ElementVoice.d.ts.map +1 -0
  284. package/dist/types/audio/music/GraphVoice.d.ts +22 -0
  285. package/dist/types/audio/music/GraphVoice.d.ts.map +1 -0
  286. package/dist/types/audio/music/MusicChannel.d.ts +35 -0
  287. package/dist/types/audio/music/MusicChannel.d.ts.map +1 -0
  288. package/dist/types/audio/music/musicVoice.d.ts +26 -0
  289. package/dist/types/audio/music/musicVoice.d.ts.map +1 -0
  290. package/dist/types/audio/sampleBank.d.ts +27 -0
  291. package/dist/types/audio/sampleBank.d.ts.map +1 -0
  292. package/dist/types/audio/soundTable.d.ts +14 -0
  293. package/dist/types/audio/soundTable.d.ts.map +1 -0
  294. package/dist/types/audio/synth.d.ts +34 -0
  295. package/dist/types/audio/synth.d.ts.map +1 -0
  296. package/dist/types/audio/takeCleanerWorker.d.ts +2 -0
  297. package/dist/types/audio/takeCleanerWorker.d.ts.map +1 -0
  298. package/dist/types/core/BitmapLabel.d.ts +36 -0
  299. package/dist/types/core/BitmapLabel.d.ts.map +1 -0
  300. package/dist/types/core/Camera.d.ts +115 -0
  301. package/dist/types/core/Camera.d.ts.map +1 -0
  302. package/dist/types/core/Clock.d.ts +23 -0
  303. package/dist/types/core/Clock.d.ts.map +1 -0
  304. package/dist/types/core/Graphics.d.ts +37 -0
  305. package/dist/types/core/Graphics.d.ts.map +1 -0
  306. package/dist/types/core/Group.d.ts +15 -0
  307. package/dist/types/core/Group.d.ts.map +1 -0
  308. package/dist/types/core/Image.d.ts +25 -0
  309. package/dist/types/core/Image.d.ts.map +1 -0
  310. package/dist/types/core/ObjectFactory.d.ts +34 -0
  311. package/dist/types/core/ObjectFactory.d.ts.map +1 -0
  312. package/dist/types/core/Pointer.d.ts +45 -0
  313. package/dist/types/core/Pointer.d.ts.map +1 -0
  314. package/dist/types/core/Rectangle.d.ts +26 -0
  315. package/dist/types/core/Rectangle.d.ts.map +1 -0
  316. package/dist/types/core/Stage.d.ts +58 -0
  317. package/dist/types/core/Stage.d.ts.map +1 -0
  318. package/dist/types/core/Text.d.ts +22 -0
  319. package/dist/types/core/Text.d.ts.map +1 -0
  320. package/dist/types/core/TextureRegistry.d.ts +90 -0
  321. package/dist/types/core/TextureRegistry.d.ts.map +1 -0
  322. package/dist/types/core/Timeline.d.ts +115 -0
  323. package/dist/types/core/Timeline.d.ts.map +1 -0
  324. package/dist/types/core/TimelineBuilder.d.ts +53 -0
  325. package/dist/types/core/TimelineBuilder.d.ts.map +1 -0
  326. package/dist/types/core/TimelineChild.d.ts +51 -0
  327. package/dist/types/core/TimelineChild.d.ts.map +1 -0
  328. package/dist/types/core/Tweener.d.ts +70 -0
  329. package/dist/types/core/Tweener.d.ts.map +1 -0
  330. package/dist/types/core/atlas.d.ts +16 -0
  331. package/dist/types/core/atlas.d.ts.map +1 -0
  332. package/dist/types/core/atlasPlan.d.ts +34 -0
  333. package/dist/types/core/atlasPlan.d.ts.map +1 -0
  334. package/dist/types/core/blendLayer.d.ts +23 -0
  335. package/dist/types/core/blendLayer.d.ts.map +1 -0
  336. package/dist/types/core/eases.d.ts +3 -0
  337. package/dist/types/core/eases.d.ts.map +1 -0
  338. package/dist/types/core/gameObject.d.ts +42 -0
  339. package/dist/types/core/gameObject.d.ts.map +1 -0
  340. package/dist/types/core/pixelZoom.d.ts +45 -0
  341. package/dist/types/core/pixelZoom.d.ts.map +1 -0
  342. package/dist/types/core/pixiPatches.d.ts +9 -0
  343. package/dist/types/core/pixiPatches.d.ts.map +1 -0
  344. package/dist/types/core/runDue.d.ts +15 -0
  345. package/dist/types/core/runDue.d.ts.map +1 -0
  346. package/dist/types/core/silhouette.d.ts +16 -0
  347. package/dist/types/core/silhouette.d.ts.map +1 -0
  348. package/dist/types/core/timelinePlace.d.ts +23 -0
  349. package/dist/types/core/timelinePlace.d.ts.map +1 -0
  350. package/dist/types/core/tweenProps.d.ts +8 -0
  351. package/dist/types/core/tweenProps.d.ts.map +1 -0
  352. package/dist/types/core/types.d.ts +4 -0
  353. package/dist/types/core/types.d.ts.map +1 -0
  354. package/dist/types/debug/DebugOverlay.d.ts +63 -0
  355. package/dist/types/debug/DebugOverlay.d.ts.map +1 -0
  356. package/dist/types/debug/DrawCallCounter.d.ts +20 -0
  357. package/dist/types/debug/DrawCallCounter.d.ts.map +1 -0
  358. package/dist/types/debug/ErrorLog.d.ts +20 -0
  359. package/dist/types/debug/ErrorLog.d.ts.map +1 -0
  360. package/dist/types/debug/FrameStats.d.ts +21 -0
  361. package/dist/types/debug/FrameStats.d.ts.map +1 -0
  362. package/dist/types/debug/inspectWorld.d.ts +14 -0
  363. package/dist/types/debug/inspectWorld.d.ts.map +1 -0
  364. package/dist/types/diagnostics/ErrorDeduper.d.ts +17 -0
  365. package/dist/types/diagnostics/ErrorDeduper.d.ts.map +1 -0
  366. package/dist/types/diagnostics/FrameSampler.d.ts +37 -0
  367. package/dist/types/diagnostics/FrameSampler.d.ts.map +1 -0
  368. package/dist/types/diagnostics/bootWatch.d.ts +25 -0
  369. package/dist/types/diagnostics/bootWatch.d.ts.map +1 -0
  370. package/dist/types/diagnostics/captureErrors.d.ts +24 -0
  371. package/dist/types/diagnostics/captureErrors.d.ts.map +1 -0
  372. package/dist/types/diagnostics/contextLoss.d.ts +35 -0
  373. package/dist/types/diagnostics/contextLoss.d.ts.map +1 -0
  374. package/dist/types/diagnostics/frameStats.d.ts +30 -0
  375. package/dist/types/diagnostics/frameStats.d.ts.map +1 -0
  376. package/dist/types/diagnostics/gpuInfo.d.ts +9 -0
  377. package/dist/types/diagnostics/gpuInfo.d.ts.map +1 -0
  378. package/dist/types/diagnostics/renderGuard.d.ts +12 -0
  379. package/dist/types/diagnostics/renderGuard.d.ts.map +1 -0
  380. package/dist/types/ecs/SparseSet.d.ts +25 -0
  381. package/dist/types/ecs/SparseSet.d.ts.map +1 -0
  382. package/dist/types/ecs/World.d.ts +137 -0
  383. package/dist/types/ecs/World.d.ts.map +1 -0
  384. package/dist/types/ecs/fields.d.ts +34 -0
  385. package/dist/types/ecs/fields.d.ts.map +1 -0
  386. package/dist/types/engine/Engine.d.ts +96 -0
  387. package/dist/types/engine/Engine.d.ts.map +1 -0
  388. package/dist/types/engine/FixedLoop.d.ts +32 -0
  389. package/dist/types/engine/FixedLoop.d.ts.map +1 -0
  390. package/dist/types/engine/HiddenPause.d.ts +22 -0
  391. package/dist/types/engine/HiddenPause.d.ts.map +1 -0
  392. package/dist/types/engine/Scene.d.ts +67 -0
  393. package/dist/types/engine/Scene.d.ts.map +1 -0
  394. package/dist/types/engine/SceneManager.d.ts +36 -0
  395. package/dist/types/engine/SceneManager.d.ts.map +1 -0
  396. package/dist/types/events/EventBus.d.ts +20 -0
  397. package/dist/types/events/EventBus.d.ts.map +1 -0
  398. package/dist/types/fx/Afterimages.d.ts +62 -0
  399. package/dist/types/fx/Afterimages.d.ts.map +1 -0
  400. package/dist/types/fx/FloatingText.d.ts +71 -0
  401. package/dist/types/fx/FloatingText.d.ts.map +1 -0
  402. package/dist/types/fx/hitStop.d.ts +20 -0
  403. package/dist/types/fx/hitStop.d.ts.map +1 -0
  404. package/dist/types/fx/viewCull.d.ts +14 -0
  405. package/dist/types/fx/viewCull.d.ts.map +1 -0
  406. package/dist/types/i18n/Translator.d.ts +52 -0
  407. package/dist/types/i18n/Translator.d.ts.map +1 -0
  408. package/dist/types/i18n/extractStrings.d.ts +25 -0
  409. package/dist/types/i18n/extractStrings.d.ts.map +1 -0
  410. package/dist/types/i18n/formatMessage.d.ts +10 -0
  411. package/dist/types/i18n/formatMessage.d.ts.map +1 -0
  412. package/dist/types/index.d.ts +164 -0
  413. package/dist/types/index.d.ts.map +1 -0
  414. package/dist/types/input/Actions.d.ts +100 -0
  415. package/dist/types/input/Actions.d.ts.map +1 -0
  416. package/dist/types/input/AimGesture.d.ts +106 -0
  417. package/dist/types/input/AimGesture.d.ts.map +1 -0
  418. package/dist/types/input/Keyboard.d.ts +30 -0
  419. package/dist/types/input/Keyboard.d.ts.map +1 -0
  420. package/dist/types/input/Keymap.d.ts +85 -0
  421. package/dist/types/input/Keymap.d.ts.map +1 -0
  422. package/dist/types/input/TargetLock.d.ts +56 -0
  423. package/dist/types/input/TargetLock.d.ts.map +1 -0
  424. package/dist/types/input/aimAxis.d.ts +9 -0
  425. package/dist/types/input/aimAxis.d.ts.map +1 -0
  426. package/dist/types/input/keyChord.d.ts +15 -0
  427. package/dist/types/input/keyChord.d.ts.map +1 -0
  428. package/dist/types/input/longPress.d.ts +21 -0
  429. package/dist/types/input/longPress.d.ts.map +1 -0
  430. package/dist/types/input/rumble.d.ts +41 -0
  431. package/dist/types/input/rumble.d.ts.map +1 -0
  432. package/dist/types/input/stickAxis.d.ts +26 -0
  433. package/dist/types/input/stickAxis.d.ts.map +1 -0
  434. package/dist/types/input/touchDetect.d.ts +18 -0
  435. package/dist/types/input/touchDetect.d.ts.map +1 -0
  436. package/dist/types/light/LightLayer.d.ts +65 -0
  437. package/dist/types/light/LightLayer.d.ts.map +1 -0
  438. package/dist/types/nav/MinHeap.d.ts +15 -0
  439. package/dist/types/nav/MinHeap.d.ts.map +1 -0
  440. package/dist/types/nav/findPath.d.ts +38 -0
  441. package/dist/types/nav/findPath.d.ts.map +1 -0
  442. package/dist/types/nav/navGrid.d.ts +48 -0
  443. package/dist/types/nav/navGrid.d.ts.map +1 -0
  444. package/dist/types/nav/nearestOpen.d.ts +8 -0
  445. package/dist/types/nav/nearestOpen.d.ts.map +1 -0
  446. package/dist/types/nav/straightenPath.d.ts +13 -0
  447. package/dist/types/nav/straightenPath.d.ts.map +1 -0
  448. package/dist/types/net/Connection.d.ts +88 -0
  449. package/dist/types/net/Connection.d.ts.map +1 -0
  450. package/dist/types/net/InterpolationBuffer.d.ts +36 -0
  451. package/dist/types/net/InterpolationBuffer.d.ts.map +1 -0
  452. package/dist/types/net/PredictedMover.d.ts +43 -0
  453. package/dist/types/net/PredictedMover.d.ts.map +1 -0
  454. package/dist/types/net/Room.d.ts +69 -0
  455. package/dist/types/net/Room.d.ts.map +1 -0
  456. package/dist/types/net/RoomHost.d.ts +74 -0
  457. package/dist/types/net/RoomHost.d.ts.map +1 -0
  458. package/dist/types/net/cadence.d.ts +22 -0
  459. package/dist/types/net/cadence.d.ts.map +1 -0
  460. package/dist/types/net/constants.d.ts +33 -0
  461. package/dist/types/net/constants.d.ts.map +1 -0
  462. package/dist/types/net/lobby/LobbyClient.d.ts +107 -0
  463. package/dist/types/net/lobby/LobbyClient.d.ts.map +1 -0
  464. package/dist/types/net/lobby/LobbyHost.d.ts +147 -0
  465. package/dist/types/net/lobby/LobbyHost.d.ts.map +1 -0
  466. package/dist/types/net/lobby/LobbyRooms.d.ts +56 -0
  467. package/dist/types/net/lobby/LobbyRooms.d.ts.map +1 -0
  468. package/dist/types/net/lobby/Matchmaker.d.ts +57 -0
  469. package/dist/types/net/lobby/Matchmaker.d.ts.map +1 -0
  470. package/dist/types/net/lobby/index.d.ts +6 -0
  471. package/dist/types/net/lobby/index.d.ts.map +1 -0
  472. package/dist/types/net/lobby/lobbyProtocol.d.ts +143 -0
  473. package/dist/types/net/lobby/lobbyProtocol.d.ts.map +1 -0
  474. package/dist/types/net/movement.d.ts +50 -0
  475. package/dist/types/net/movement.d.ts.map +1 -0
  476. package/dist/types/net/protocol.d.ts +59 -0
  477. package/dist/types/net/protocol.d.ts.map +1 -0
  478. package/dist/types/net/reconnect.d.ts +14 -0
  479. package/dist/types/net/reconnect.d.ts.map +1 -0
  480. package/dist/types/net/serverClock.d.ts +14 -0
  481. package/dist/types/net/serverClock.d.ts.map +1 -0
  482. package/dist/types/net/snapshotCodec.d.ts +55 -0
  483. package/dist/types/net/snapshotCodec.d.ts.map +1 -0
  484. package/dist/types/parallax/Parallax.d.ts +37 -0
  485. package/dist/types/parallax/Parallax.d.ts.map +1 -0
  486. package/dist/types/parallax/ParallaxLayer.d.ts +80 -0
  487. package/dist/types/parallax/ParallaxLayer.d.ts.map +1 -0
  488. package/dist/types/parallax/parallaxMath.d.ts +50 -0
  489. package/dist/types/parallax/parallaxMath.d.ts.map +1 -0
  490. package/dist/types/particles/Emitter.d.ts +97 -0
  491. package/dist/types/particles/Emitter.d.ts.map +1 -0
  492. package/dist/types/particles/ParticleBudget.d.ts +28 -0
  493. package/dist/types/particles/ParticleBudget.d.ts.map +1 -0
  494. package/dist/types/particles/ParticleSim.d.ts +38 -0
  495. package/dist/types/particles/ParticleSim.d.ts.map +1 -0
  496. package/dist/types/particles/particleCurves.d.ts +21 -0
  497. package/dist/types/particles/particleCurves.d.ts.map +1 -0
  498. package/dist/types/particles/particleSampling.d.ts +20 -0
  499. package/dist/types/particles/particleSampling.d.ts.map +1 -0
  500. package/dist/types/physics/Body.d.ts +130 -0
  501. package/dist/types/physics/Body.d.ts.map +1 -0
  502. package/dist/types/physics/BroadPhase.d.ts +26 -0
  503. package/dist/types/physics/BroadPhase.d.ts.map +1 -0
  504. package/dist/types/physics/Contact.d.ts +62 -0
  505. package/dist/types/physics/Contact.d.ts.map +1 -0
  506. package/dist/types/physics/ContactSolver.d.ts +29 -0
  507. package/dist/types/physics/ContactSolver.d.ts.map +1 -0
  508. package/dist/types/physics/PhysicsWorld.d.ts +78 -0
  509. package/dist/types/physics/PhysicsWorld.d.ts.map +1 -0
  510. package/dist/types/physics/PhysicsWorldOptions.d.ts +24 -0
  511. package/dist/types/physics/PhysicsWorldOptions.d.ts.map +1 -0
  512. package/dist/types/physics/SpatialHash.d.ts +23 -0
  513. package/dist/types/physics/SpatialHash.d.ts.map +1 -0
  514. package/dist/types/physics/collide.d.ts +27 -0
  515. package/dist/types/physics/collide.d.ts.map +1 -0
  516. package/dist/types/physics/collidePolygon.d.ts +14 -0
  517. package/dist/types/physics/collidePolygon.d.ts.map +1 -0
  518. package/dist/types/physics/contactReport.d.ts +8 -0
  519. package/dist/types/physics/contactReport.d.ts.map +1 -0
  520. package/dist/types/physics/drawColliders.d.ts +43 -0
  521. package/dist/types/physics/drawColliders.d.ts.map +1 -0
  522. package/dist/types/physics/physicsSystem.d.ts +5 -0
  523. package/dist/types/physics/physicsSystem.d.ts.map +1 -0
  524. package/dist/types/physics/polygon.d.ts +28 -0
  525. package/dist/types/physics/polygon.d.ts.map +1 -0
  526. package/dist/types/physics/raycast.d.ts +19 -0
  527. package/dist/types/physics/raycast.d.ts.map +1 -0
  528. package/dist/types/physics/syncToBody.d.ts +16 -0
  529. package/dist/types/physics/syncToBody.d.ts.map +1 -0
  530. package/dist/types/physics/tileBodies.d.ts +36 -0
  531. package/dist/types/physics/tileBodies.d.ts.map +1 -0
  532. package/dist/types/physics/types.d.ts +116 -0
  533. package/dist/types/physics/types.d.ts.map +1 -0
  534. package/dist/types/pixel/Darkness.d.ts +90 -0
  535. package/dist/types/pixel/Darkness.d.ts.map +1 -0
  536. package/dist/types/pixel/DitherVignette.d.ts +35 -0
  537. package/dist/types/pixel/DitherVignette.d.ts.map +1 -0
  538. package/dist/types/pixel/Evaporation.d.ts +30 -0
  539. package/dist/types/pixel/Evaporation.d.ts.map +1 -0
  540. package/dist/types/pixel/NightShade.d.ts +38 -0
  541. package/dist/types/pixel/NightShade.d.ts.map +1 -0
  542. package/dist/types/pixel/PixelLayer.d.ts +85 -0
  543. package/dist/types/pixel/PixelLayer.d.ts.map +1 -0
  544. package/dist/types/pixel/PixelMarks.d.ts +68 -0
  545. package/dist/types/pixel/PixelMarks.d.ts.map +1 -0
  546. package/dist/types/pixel/SwayProp.d.ts +52 -0
  547. package/dist/types/pixel/SwayProp.d.ts.map +1 -0
  548. package/dist/types/pixel/aimPixels.d.ts +23 -0
  549. package/dist/types/pixel/aimPixels.d.ts.map +1 -0
  550. package/dist/types/pixel/index.d.ts +33 -0
  551. package/dist/types/pixel/index.d.ts.map +1 -0
  552. package/dist/types/pixel/lights.d.ts +34 -0
  553. package/dist/types/pixel/lights.d.ts.map +1 -0
  554. package/dist/types/pixel/nineSlice.d.ts +71 -0
  555. package/dist/types/pixel/nineSlice.d.ts.map +1 -0
  556. package/dist/types/pixel/paintLayer.d.ts +35 -0
  557. package/dist/types/pixel/paintLayer.d.ts.map +1 -0
  558. package/dist/types/pixel/palette.d.ts +58 -0
  559. package/dist/types/pixel/palette.d.ts.map +1 -0
  560. package/dist/types/pixel/pixel.d.ts +80 -0
  561. package/dist/types/pixel/pixel.d.ts.map +1 -0
  562. package/dist/types/pixel/pixelPaint.d.ts +44 -0
  563. package/dist/types/pixel/pixelPaint.d.ts.map +1 -0
  564. package/dist/types/pixel/pixelParticles.d.ts +21 -0
  565. package/dist/types/pixel/pixelParticles.d.ts.map +1 -0
  566. package/dist/types/pixel/pixelTone.d.ts +51 -0
  567. package/dist/types/pixel/pixelTone.d.ts.map +1 -0
  568. package/dist/types/pixel/propKit.d.ts +26 -0
  569. package/dist/types/pixel/propKit.d.ts.map +1 -0
  570. package/dist/types/pixel/ramp.d.ts +57 -0
  571. package/dist/types/pixel/ramp.d.ts.map +1 -0
  572. package/dist/types/pixel/selout.d.ts +3 -0
  573. package/dist/types/pixel/selout.d.ts.map +1 -0
  574. package/dist/types/pixel/spritePixels.d.ts +29 -0
  575. package/dist/types/pixel/spritePixels.d.ts.map +1 -0
  576. package/dist/types/pixel/swayRig.d.ts +72 -0
  577. package/dist/types/pixel/swayRig.d.ts.map +1 -0
  578. package/dist/types/pixel/vignetteMask.d.ts +16 -0
  579. package/dist/types/pixel/vignetteMask.d.ts.map +1 -0
  580. package/dist/types/pixel/weatherArt.d.ts +29 -0
  581. package/dist/types/pixel/weatherArt.d.ts.map +1 -0
  582. package/dist/types/platform/appResume.d.ts +25 -0
  583. package/dist/types/platform/appResume.d.ts.map +1 -0
  584. package/dist/types/platform/fullscreen.d.ts +37 -0
  585. package/dist/types/platform/fullscreen.d.ts.map +1 -0
  586. package/dist/types/platform/orientation.d.ts +19 -0
  587. package/dist/types/platform/orientation.d.ts.map +1 -0
  588. package/dist/types/platform/pointerLock.d.ts +26 -0
  589. package/dist/types/platform/pointerLock.d.ts.map +1 -0
  590. package/dist/types/platform/reducedMotion.d.ts +20 -0
  591. package/dist/types/platform/reducedMotion.d.ts.map +1 -0
  592. package/dist/types/platform/timeoutSignal.d.ts +6 -0
  593. package/dist/types/platform/timeoutSignal.d.ts.map +1 -0
  594. package/dist/types/platform/touch.d.ts +10 -0
  595. package/dist/types/platform/touch.d.ts.map +1 -0
  596. package/dist/types/postfx/BloomFilter.d.ts +33 -0
  597. package/dist/types/postfx/BloomFilter.d.ts.map +1 -0
  598. package/dist/types/postfx/ChromaticAberrationFilter.d.ts +11 -0
  599. package/dist/types/postfx/ChromaticAberrationFilter.d.ts.map +1 -0
  600. package/dist/types/postfx/ColorAdjustFilter.d.ts +32 -0
  601. package/dist/types/postfx/ColorAdjustFilter.d.ts.map +1 -0
  602. package/dist/types/postfx/CrtFilter.d.ts +16 -0
  603. package/dist/types/postfx/CrtFilter.d.ts.map +1 -0
  604. package/dist/types/postfx/PixelateFilter.d.ts +8 -0
  605. package/dist/types/postfx/PixelateFilter.d.ts.map +1 -0
  606. package/dist/types/postfx/PostFx.d.ts +92 -0
  607. package/dist/types/postfx/PostFx.d.ts.map +1 -0
  608. package/dist/types/postfx/ShockwaveFilter.d.ts +20 -0
  609. package/dist/types/postfx/ShockwaveFilter.d.ts.map +1 -0
  610. package/dist/types/postfx/VignetteFilter.d.ts +19 -0
  611. package/dist/types/postfx/VignetteFilter.d.ts.map +1 -0
  612. package/dist/types/postfx/fxAnimator.d.ts +32 -0
  613. package/dist/types/postfx/fxAnimator.d.ts.map +1 -0
  614. package/dist/types/postfx/fxShader.d.ts +49 -0
  615. package/dist/types/postfx/fxShader.d.ts.map +1 -0
  616. package/dist/types/postfx/index.d.ts +11 -0
  617. package/dist/types/postfx/index.d.ts.map +1 -0
  618. package/dist/types/react/ChoiceDialog.d.ts +8 -0
  619. package/dist/types/react/ChoiceDialog.d.ts.map +1 -0
  620. package/dist/types/react/ConfirmDialog.d.ts +9 -0
  621. package/dist/types/react/ConfirmDialog.d.ts.map +1 -0
  622. package/dist/types/react/Glyph.d.ts +54 -0
  623. package/dist/types/react/Glyph.d.ts.map +1 -0
  624. package/dist/types/react/Modal.d.ts +22 -0
  625. package/dist/types/react/Modal.d.ts.map +1 -0
  626. package/dist/types/react/Panel.d.ts +29 -0
  627. package/dist/types/react/Panel.d.ts.map +1 -0
  628. package/dist/types/react/PixelImage.d.ts +19 -0
  629. package/dist/types/react/PixelImage.d.ts.map +1 -0
  630. package/dist/types/react/Select.d.ts +27 -0
  631. package/dist/types/react/Select.d.ts.map +1 -0
  632. package/dist/types/react/Slider.d.ts +24 -0
  633. package/dist/types/react/Slider.d.ts.map +1 -0
  634. package/dist/types/react/SplitPane.d.ts +26 -0
  635. package/dist/types/react/SplitPane.d.ts.map +1 -0
  636. package/dist/types/react/TabStrip.d.ts +31 -0
  637. package/dist/types/react/TabStrip.d.ts.map +1 -0
  638. package/dist/types/react/TitleTips.d.ts +15 -0
  639. package/dist/types/react/TitleTips.d.ts.map +1 -0
  640. package/dist/types/react/Tooltip.d.ts +22 -0
  641. package/dist/types/react/Tooltip.d.ts.map +1 -0
  642. package/dist/types/react/UiProvider.d.ts +52 -0
  643. package/dist/types/react/UiProvider.d.ts.map +1 -0
  644. package/dist/types/react/baseCss.d.ts +27 -0
  645. package/dist/types/react/baseCss.d.ts.map +1 -0
  646. package/dist/types/react/choiceStore.d.ts +34 -0
  647. package/dist/types/react/choiceStore.d.ts.map +1 -0
  648. package/dist/types/react/classNames.d.ts +12 -0
  649. package/dist/types/react/classNames.d.ts.map +1 -0
  650. package/dist/types/react/confirmStore.d.ts +30 -0
  651. package/dist/types/react/confirmStore.d.ts.map +1 -0
  652. package/dist/types/react/index.d.ts +33 -0
  653. package/dist/types/react/index.d.ts.map +1 -0
  654. package/dist/types/react/labels.d.ts +24 -0
  655. package/dist/types/react/labels.d.ts.map +1 -0
  656. package/dist/types/react/placement.d.ts +59 -0
  657. package/dist/types/react/placement.d.ts.map +1 -0
  658. package/dist/types/react/useFillSheet.d.ts +9 -0
  659. package/dist/types/react/useFillSheet.d.ts.map +1 -0
  660. package/dist/types/react/useFitToViewport.d.ts +20 -0
  661. package/dist/types/react/useFitToViewport.d.ts.map +1 -0
  662. package/dist/types/react/usePicked.d.ts +9 -0
  663. package/dist/types/react/usePicked.d.ts.map +1 -0
  664. package/dist/types/react/useStore.d.ts +8 -0
  665. package/dist/types/react/useStore.d.ts.map +1 -0
  666. package/dist/types/react/useViewport.d.ts +4 -0
  667. package/dist/types/react/useViewport.d.ts.map +1 -0
  668. package/dist/types/rig/PosePlayer.d.ts +64 -0
  669. package/dist/types/rig/PosePlayer.d.ts.map +1 -0
  670. package/dist/types/rig/RigView.d.ts +68 -0
  671. package/dist/types/rig/RigView.d.ts.map +1 -0
  672. package/dist/types/rig/Skeleton.d.ts +14 -0
  673. package/dist/types/rig/Skeleton.d.ts.map +1 -0
  674. package/dist/types/rig/humanoid.d.ts +4 -0
  675. package/dist/types/rig/humanoid.d.ts.map +1 -0
  676. package/dist/types/rig/humanoidPoses.d.ts +117 -0
  677. package/dist/types/rig/humanoidPoses.d.ts.map +1 -0
  678. package/dist/types/rig/poseMath.d.ts +14 -0
  679. package/dist/types/rig/poseMath.d.ts.map +1 -0
  680. package/dist/types/rig/rigTypes.d.ts +82 -0
  681. package/dist/types/rig/rigTypes.d.ts.map +1 -0
  682. package/dist/types/save/Autosaver.d.ts +43 -0
  683. package/dist/types/save/Autosaver.d.ts.map +1 -0
  684. package/dist/types/save/MemoryBackend.d.ts +10 -0
  685. package/dist/types/save/MemoryBackend.d.ts.map +1 -0
  686. package/dist/types/save/SaveBackend.d.ts +14 -0
  687. package/dist/types/save/SaveBackend.d.ts.map +1 -0
  688. package/dist/types/save/SaveStore.d.ts +73 -0
  689. package/dist/types/save/SaveStore.d.ts.map +1 -0
  690. package/dist/types/save/WebStorageBackend.d.ts +14 -0
  691. package/dist/types/save/WebStorageBackend.d.ts.map +1 -0
  692. package/dist/types/save/checksum.d.ts +7 -0
  693. package/dist/types/save/checksum.d.ts.map +1 -0
  694. package/dist/types/save/migrateSave.d.ts +17 -0
  695. package/dist/types/save/migrateSave.d.ts.map +1 -0
  696. package/dist/types/settings.d.ts +25 -0
  697. package/dist/types/settings.d.ts.map +1 -0
  698. package/dist/types/tilemap/TilemapView.d.ts +42 -0
  699. package/dist/types/tilemap/TilemapView.d.ts.map +1 -0
  700. package/dist/types/tilemap/collision.d.ts +16 -0
  701. package/dist/types/tilemap/collision.d.ts.map +1 -0
  702. package/dist/types/tilemap/tiled.d.ts +104 -0
  703. package/dist/types/tilemap/tiled.d.ts.map +1 -0
  704. package/dist/types/transitions/CrossfadeTransition.d.ts +20 -0
  705. package/dist/types/transitions/CrossfadeTransition.d.ts.map +1 -0
  706. package/dist/types/transitions/DitherWipeTransition.d.ts +35 -0
  707. package/dist/types/transitions/DitherWipeTransition.d.ts.map +1 -0
  708. package/dist/types/transitions/FadeTransition.d.ts +20 -0
  709. package/dist/types/transitions/FadeTransition.d.ts.map +1 -0
  710. package/dist/types/transitions/Letterbox.d.ts +33 -0
  711. package/dist/types/transitions/Letterbox.d.ts.map +1 -0
  712. package/dist/types/transitions/Transition.d.ts +22 -0
  713. package/dist/types/transitions/Transition.d.ts.map +1 -0
  714. package/dist/types/transitions/ditherMask.d.ts +13 -0
  715. package/dist/types/transitions/ditherMask.d.ts.map +1 -0
  716. package/dist/types/transitions/transitionTo.d.ts +16 -0
  717. package/dist/types/transitions/transitionTo.d.ts.map +1 -0
  718. package/dist/types/transitions/tweenDone.d.ts +5 -0
  719. package/dist/types/transitions/tweenDone.d.ts.map +1 -0
  720. package/dist/types/ui/Bar.d.ts +41 -0
  721. package/dist/types/ui/Bar.d.ts.map +1 -0
  722. package/dist/types/ui/Button.d.ts +47 -0
  723. package/dist/types/ui/Button.d.ts.map +1 -0
  724. package/dist/types/ui/Dialog.d.ts +47 -0
  725. package/dist/types/ui/Dialog.d.ts.map +1 -0
  726. package/dist/types/ui/FocusManager.d.ts +53 -0
  727. package/dist/types/ui/FocusManager.d.ts.map +1 -0
  728. package/dist/types/ui/Label.d.ts +24 -0
  729. package/dist/types/ui/Label.d.ts.map +1 -0
  730. package/dist/types/ui/List.d.ts +23 -0
  731. package/dist/types/ui/List.d.ts.map +1 -0
  732. package/dist/types/ui/Panel.d.ts +38 -0
  733. package/dist/types/ui/Panel.d.ts.map +1 -0
  734. package/dist/types/ui/ScrollView.d.ts +56 -0
  735. package/dist/types/ui/ScrollView.d.ts.map +1 -0
  736. package/dist/types/ui/Slider.d.ts +47 -0
  737. package/dist/types/ui/Slider.d.ts.map +1 -0
  738. package/dist/types/ui/Stack.d.ts +16 -0
  739. package/dist/types/ui/Stack.d.ts.map +1 -0
  740. package/dist/types/ui/Toggle.d.ts +31 -0
  741. package/dist/types/ui/Toggle.d.ts.map +1 -0
  742. package/dist/types/ui/UiHost.d.ts +18 -0
  743. package/dist/types/ui/UiHost.d.ts.map +1 -0
  744. package/dist/types/ui/UiPointerGate.d.ts +17 -0
  745. package/dist/types/ui/UiPointerGate.d.ts.map +1 -0
  746. package/dist/types/ui/UiRoot.d.ts +73 -0
  747. package/dist/types/ui/UiRoot.d.ts.map +1 -0
  748. package/dist/types/ui/Widget.d.ts +56 -0
  749. package/dist/types/ui/Widget.d.ts.map +1 -0
  750. package/dist/types/ui/dom/DomOverlay.d.ts +52 -0
  751. package/dist/types/ui/dom/DomOverlay.d.ts.map +1 -0
  752. package/dist/types/ui/dom/DomWorldAnchors.d.ts +50 -0
  753. package/dist/types/ui/dom/DomWorldAnchors.d.ts.map +1 -0
  754. package/dist/types/ui/dom/InputShield.d.ts +20 -0
  755. package/dist/types/ui/dom/InputShield.d.ts.map +1 -0
  756. package/dist/types/ui/dom/createStore.d.ts +22 -0
  757. package/dist/types/ui/dom/createStore.d.ts.map +1 -0
  758. package/dist/types/ui/dom/shieldDecision.d.ts +34 -0
  759. package/dist/types/ui/dom/shieldDecision.d.ts.map +1 -0
  760. package/dist/types/ui/dom/worldToScreen.d.ts +24 -0
  761. package/dist/types/ui/dom/worldToScreen.d.ts.map +1 -0
  762. package/dist/types/ui/index.d.ts +42 -0
  763. package/dist/types/ui/index.d.ts.map +1 -0
  764. package/dist/types/ui/layout/anchor.d.ts +9 -0
  765. package/dist/types/ui/layout/anchor.d.ts.map +1 -0
  766. package/dist/types/ui/layout/barDrain.d.ts +25 -0
  767. package/dist/types/ui/layout/barDrain.d.ts.map +1 -0
  768. package/dist/types/ui/layout/fitToViewport.d.ts +32 -0
  769. package/dist/types/ui/layout/fitToViewport.d.ts.map +1 -0
  770. package/dist/types/ui/layout/focusNav.d.ts +13 -0
  771. package/dist/types/ui/layout/focusNav.d.ts.map +1 -0
  772. package/dist/types/ui/layout/geometry.d.ts +35 -0
  773. package/dist/types/ui/layout/geometry.d.ts.map +1 -0
  774. package/dist/types/ui/layout/listWidth.d.ts +13 -0
  775. package/dist/types/ui/layout/listWidth.d.ts.map +1 -0
  776. package/dist/types/ui/layout/placeTooltip.d.ts +23 -0
  777. package/dist/types/ui/layout/placeTooltip.d.ts.map +1 -0
  778. package/dist/types/ui/layout/scroll.d.ts +17 -0
  779. package/dist/types/ui/layout/scroll.d.ts.map +1 -0
  780. package/dist/types/ui/layout/slider.d.ts +7 -0
  781. package/dist/types/ui/layout/slider.d.ts.map +1 -0
  782. package/dist/types/ui/layout/stack.d.ts +26 -0
  783. package/dist/types/ui/layout/stack.d.ts.map +1 -0
  784. package/dist/types/ui/layout/wrapRow.d.ts +6 -0
  785. package/dist/types/ui/layout/wrapRow.d.ts.map +1 -0
  786. package/dist/types/ui/rich/RichText.d.ts +48 -0
  787. package/dist/types/ui/rich/RichText.d.ts.map +1 -0
  788. package/dist/types/ui/rich/richFonts.d.ts +70 -0
  789. package/dist/types/ui/rich/richFonts.d.ts.map +1 -0
  790. package/dist/types/ui/rich/richLayout.d.ts +76 -0
  791. package/dist/types/ui/rich/richLayout.d.ts.map +1 -0
  792. package/dist/types/ui/rich/richMarkup.d.ts +48 -0
  793. package/dist/types/ui/rich/richMarkup.d.ts.map +1 -0
  794. package/dist/ui/Bar.js +53 -0
  795. package/dist/ui/Button.js +57 -0
  796. package/dist/ui/Dialog.js +55 -0
  797. package/dist/ui/FocusManager.js +96 -0
  798. package/dist/ui/Label.js +35 -0
  799. package/dist/ui/List.js +44 -0
  800. package/dist/ui/Panel.js +37 -0
  801. package/dist/ui/ScrollView.js +95 -0
  802. package/dist/ui/Slider.js +54 -0
  803. package/dist/ui/Stack.js +27 -0
  804. package/dist/ui/Toggle.js +36 -0
  805. package/dist/ui/UiHost.js +8 -0
  806. package/dist/ui/UiPointerGate.js +24 -0
  807. package/dist/ui/UiRoot.js +92 -0
  808. package/dist/ui/Widget.js +89 -0
  809. package/dist/ui/dom/DomOverlay.js +58 -0
  810. package/dist/ui/dom/DomWorldAnchors.js +58 -0
  811. package/dist/ui/dom/InputShield.js +26 -0
  812. package/dist/ui/dom/createStore.js +41 -0
  813. package/dist/ui/dom/shieldDecision.js +35 -0
  814. package/dist/ui/dom/worldToScreen.js +10 -0
  815. package/dist/ui/layout/anchor.js +19 -0
  816. package/dist/ui/layout/barDrain.js +24 -0
  817. package/dist/ui/layout/fitToViewport.js +16 -0
  818. package/dist/ui/layout/focusNav.js +41 -0
  819. package/dist/ui/layout/geometry.js +20 -0
  820. package/dist/ui/layout/listWidth.js +9 -0
  821. package/dist/ui/layout/placeTooltip.js +27 -0
  822. package/dist/ui/layout/scroll.js +23 -0
  823. package/dist/ui/layout/slider.js +19 -0
  824. package/dist/ui/layout/stack.js +26 -0
  825. package/dist/ui/layout/wrapRow.js +12 -0
  826. package/dist/ui/rich/RichText.js +87 -0
  827. package/dist/ui/rich/richFonts.js +105 -0
  828. package/dist/ui/rich/richLayout.js +132 -0
  829. package/dist/ui/rich/richMarkup.js +67 -0
  830. package/dist/ui.js +95 -0
  831. package/package.json +112 -4
@@ -0,0 +1,170 @@
1
+ class g {
2
+ binds;
3
+ defaults;
4
+ reserved;
5
+ fixed;
6
+ listeners = [];
7
+ /**
8
+ * `reserved`: keys never bound (default Escape, Enter, Tab; pass `undefined` for the default). `fixed`: inputs each
9
+ * action always has besides the player's keys (gamepad, touch, a reserved key), never saved or rebound.
10
+ */
11
+ constructor(t, s = ["Escape", "Enter", "Tab"], e = {}) {
12
+ this.defaults = { ...t }, this.reserved = new Set(s), this.fixed = { ...e }, this.binds = this.fresh();
13
+ }
14
+ fresh() {
15
+ const t = {};
16
+ for (const s of this.actions()) t[s] = this.defaults[s].filter((e) => !this.reserved.has(e));
17
+ return t;
18
+ }
19
+ /** Every action, in the order the defaults named them. */
20
+ actions() {
21
+ return Object.keys(this.defaults);
22
+ }
23
+ isReserved(t) {
24
+ return this.reserved.has(t);
25
+ }
26
+ /** The keys of one action; the first is the one a settings screen shows and edits. */
27
+ keysFor(t) {
28
+ return this.binds[t] ?? [];
29
+ }
30
+ /** The inputs an action always has besides the player's keys (the constructor's `fixed`). */
31
+ fixedFor(t) {
32
+ return this.fixed[t] ?? [];
33
+ }
34
+ /** Which action a key belongs to, or undefined. */
35
+ actionFor(t) {
36
+ for (const s of this.actions()) if (this.binds[s].includes(t)) return s;
37
+ }
38
+ /**
39
+ * Puts `code` first on `action`, taking it off whatever else held it; returns the actions that lost it (to tell the
40
+ * player). A reserved key is refused (returns null). An action stripped of its last key keeps none: it is unbound
41
+ * until something is put back on it.
42
+ */
43
+ bind(t, s) {
44
+ if (this.reserved.has(s) || !(t in this.binds)) return null;
45
+ const e = [];
46
+ for (const n of this.actions())
47
+ n === t || !this.binds[n].includes(s) || (this.binds[n] = this.binds[n].filter((a) => a !== s), e.push(n));
48
+ const h = this.binds[t].slice(1).filter((n) => n !== s);
49
+ return this.binds[t] = [s, ...h], this.changed(), e;
50
+ }
51
+ /** Takes every key off `action`. */
52
+ unbind(t) {
53
+ this.binds[t]?.length && (this.binds[t] = [], this.changed());
54
+ }
55
+ /** Every action back on its defaults. */
56
+ reset() {
57
+ this.binds = this.fresh(), this.changed();
58
+ }
59
+ /** A plain object to store wherever the game keeps its settings. */
60
+ toJSON() {
61
+ const t = {};
62
+ for (const s of this.actions()) t[s] = [...this.binds[s]];
63
+ return t;
64
+ }
65
+ /**
66
+ * A saved set laid over this build's defaults. Only actions this build knows are read, so an old save cannot leave
67
+ * a key bound to nothing; an action newer than the save keeps its defaults only where no saved action holds that key
68
+ * (the saved one is what the player chose). Anything malformed is ignored.
69
+ */
70
+ load(t) {
71
+ this.binds = u(this.defaults, t, this.reserved), this.changed();
72
+ }
73
+ /**
74
+ * Hands the bindings to an `Actions`: each action's keys, then its fixed inputs, then its `extra` ones. Only the
75
+ * keymap's actions are bound, so the `Actions` may hold more (menu actions alongside the rebindable ones, each on
76
+ * its own fixed inputs); those are left as they are. Fixed and extra inputs are the game's, so neither the reserved
77
+ * keys nor one-key-one-action apply to them.
78
+ */
79
+ applyTo(t, s = {}) {
80
+ for (const e of this.actions()) t.bind(e, [...this.binds[e], ...this.fixed[e] ?? [], ...s[e] ?? []]);
81
+ }
82
+ /** Called after every change; returns a function that stops it. */
83
+ onChange(t) {
84
+ return this.listeners.push(t), () => {
85
+ const s = this.listeners.indexOf(t);
86
+ s >= 0 && this.listeners.splice(s, 1);
87
+ };
88
+ }
89
+ changed() {
90
+ for (const t of [...this.listeners]) t();
91
+ }
92
+ }
93
+ function u(i, t, s = /* @__PURE__ */ new Set()) {
94
+ const e = Object.keys(i), h = {}, n = /* @__PURE__ */ new Set(), a = t && typeof t == "object" ? t : {};
95
+ for (const r of e) {
96
+ const o = a[r];
97
+ Array.isArray(o) && o.every((f) => typeof f == "string") ? (h[r] = [...new Set(o)].filter((f) => !s.has(f)), n.add(r)) : h[r] = i[r].filter((f) => !s.has(f));
98
+ }
99
+ const l = /* @__PURE__ */ new Map();
100
+ for (const r of e)
101
+ n.has(r) && (h[r] = h[r].filter((o) => l.has(o) ? !1 : (l.set(o, r), !0)));
102
+ for (const r of e) n.has(r) || (h[r] = h[r].filter((o) => !l.has(o)));
103
+ return h;
104
+ }
105
+ function b(i) {
106
+ const t = () => {
107
+ try {
108
+ return typeof localStorage > "u" ? null : localStorage;
109
+ } catch {
110
+ return null;
111
+ }
112
+ };
113
+ return {
114
+ read() {
115
+ try {
116
+ const s = t()?.getItem(i);
117
+ return s ? JSON.parse(s) : null;
118
+ } catch {
119
+ return null;
120
+ }
121
+ },
122
+ write(s) {
123
+ try {
124
+ t()?.setItem(i, JSON.stringify(s));
125
+ } catch {
126
+ }
127
+ },
128
+ clear() {
129
+ try {
130
+ t()?.removeItem(i);
131
+ } catch {
132
+ }
133
+ }
134
+ };
135
+ }
136
+ const c = {
137
+ Space: "Space",
138
+ ShiftLeft: "Shift",
139
+ ShiftRight: "Right Shift",
140
+ ControlLeft: "Ctrl",
141
+ ControlRight: "Right Ctrl",
142
+ AltLeft: "Alt",
143
+ AltRight: "Right Alt",
144
+ ArrowUp: "Up",
145
+ ArrowDown: "Down",
146
+ ArrowLeft: "Left",
147
+ ArrowRight: "Right",
148
+ Backquote: "`",
149
+ Minus: "-",
150
+ Equal: "=",
151
+ Semicolon: ";",
152
+ Quote: "'",
153
+ Comma: ",",
154
+ Period: ".",
155
+ Slash: "/",
156
+ Backslash: "\\",
157
+ BracketLeft: "[",
158
+ BracketRight: "]"
159
+ };
160
+ function d(i, t = {}) {
161
+ if (i.length > 1 && i.includes("+")) return i.split("+").map((e) => d(e, t)).join("+");
162
+ const s = t[i];
163
+ return s !== void 0 ? s : i.startsWith("Key") ? i.slice(3) : i.startsWith("Digit") ? i.slice(5) : i.startsWith("Numpad") ? `Num ${i.slice(6)}` : c[i] ?? i;
164
+ }
165
+ export {
166
+ g as Keymap,
167
+ d as keyLabel,
168
+ b as keymapStorage,
169
+ u as mergeKeymap
170
+ };
@@ -0,0 +1,72 @@
1
+ const _ = 220, g = 300, d = 50 * Math.PI / 180;
2
+ function p(e, n) {
3
+ let t = (e - n) % (Math.PI * 2);
4
+ return t > Math.PI && (t -= Math.PI * 2), t < -Math.PI && (t += Math.PI * 2), t;
5
+ }
6
+ function y(e, n, t, i = 220, s = d) {
7
+ if (Math.hypot(n.x, n.y) < 1e-6) return null;
8
+ const h = Math.atan2(n.y, n.x);
9
+ let l = null, u = 1 / 0;
10
+ for (const a of t) {
11
+ const o = Math.hypot(a.x - e.x, a.y - e.y);
12
+ if (o > i) continue;
13
+ const r = o < 1 ? 0 : Math.abs(p(Math.atan2(a.y - e.y, a.x - e.x), h));
14
+ if (r > s) continue;
15
+ const f = r / s + 0.35 * o / i;
16
+ f < u && (u = f, l = a.id);
17
+ }
18
+ return l;
19
+ }
20
+ function K(e, n, t = 220) {
21
+ let i = null, s = 1 / 0;
22
+ for (const c of n) {
23
+ const h = Math.hypot(c.x - e.x, c.y - e.y);
24
+ h > t || (h < s || h === s && i !== null && c.id < i) && (s = h, i = c.id);
25
+ }
26
+ return i;
27
+ }
28
+ function R(e, n, t, i = 300) {
29
+ if (n === null) return null;
30
+ const s = t.find((c) => c.id === n);
31
+ return !s || Math.hypot(s.x - e.x, s.y - e.y) > i ? null : s;
32
+ }
33
+ class b {
34
+ constructor(n, t = {}) {
35
+ this.bodies = n, this.pickRange = t.pickRange ?? 220, this.keepRange = t.keepRange ?? 300, this.cone = t.cone ?? d;
36
+ }
37
+ bodies;
38
+ id = null;
39
+ pickRange;
40
+ keepRange;
41
+ cone;
42
+ /** The id held, without checking it still stands (use `current` for that). */
43
+ get locked() {
44
+ return this.id;
45
+ }
46
+ /** A drag in `dir` from `from`: locks what it points at; pointing at nothing keeps the old lock. */
47
+ pick(n, t) {
48
+ const i = y(n, t, this.bodies(), this.pickRange, this.cone);
49
+ return i !== null && (this.id = i), this.id;
50
+ }
51
+ /** Locks the nearest body, every call, whatever was held. */
52
+ pickNearest(n) {
53
+ return this.id = K(n, this.bodies(), this.pickRange), this.id;
54
+ }
55
+ /** The held body if it still holds; a lock that no longer does is dropped. */
56
+ current(n) {
57
+ const t = R(n, this.id, this.bodies(), this.keepRange);
58
+ return t || (this.id = null), t;
59
+ }
60
+ clear() {
61
+ this.id = null;
62
+ }
63
+ }
64
+ export {
65
+ g as LOCK_KEEP_RANGE,
66
+ d as LOCK_PICK_CONE,
67
+ _ as LOCK_PICK_RANGE,
68
+ b as TargetLock,
69
+ R as keptTarget,
70
+ K as nearestTarget,
71
+ y as pickTarget
72
+ };
@@ -0,0 +1,7 @@
1
+ function h(t) {
2
+ const s = Math.cos(t), a = Math.sin(t), n = Math.sin(Math.PI / 8);
3
+ return { dx: Math.abs(s) > n ? Math.sign(s) : 0, dy: Math.abs(a) > n ? Math.sign(a) : 0 };
4
+ }
5
+ export {
6
+ h as aimAxis
7
+ };
@@ -0,0 +1,28 @@
1
+ const o = {
2
+ Shift: ["ShiftLeft", "ShiftRight"],
3
+ Ctrl: ["ControlLeft", "ControlRight"],
4
+ Alt: ["AltLeft", "AltRight"],
5
+ Meta: ["MetaLeft", "MetaRight"]
6
+ };
7
+ function l(e) {
8
+ const t = e.split("+");
9
+ if (t.length < 2) return null;
10
+ const r = t[t.length - 1];
11
+ if (!r) return null;
12
+ const n = [];
13
+ for (const i of t.slice(0, -1)) {
14
+ const f = o[i];
15
+ if (!f) return null;
16
+ n.push(f);
17
+ }
18
+ return { code: r, modifiers: n };
19
+ }
20
+ function s(e, t) {
21
+ if (!t(e.code)) return !1;
22
+ for (const [r, n] of e.modifiers) if (!t(r) && !t(n)) return !1;
23
+ return !0;
24
+ }
25
+ export {
26
+ s as chordHeld,
27
+ l as parseChord
28
+ };
@@ -0,0 +1,31 @@
1
+ class r {
2
+ constructor(s = 480, i = 10) {
3
+ this.ms = s, this.slop = i;
4
+ }
5
+ ms;
6
+ slop;
7
+ finger = null;
8
+ done = !1;
9
+ down(s, i, n, t) {
10
+ if (this.finger) {
11
+ this.finger = null, this.done = !0;
12
+ return;
13
+ }
14
+ this.finger = { id: s, x: i, y: n, at: t }, this.done = !1;
15
+ }
16
+ move(s, i, n) {
17
+ const t = this.finger;
18
+ t && t.id === s && Math.hypot(i - t.x, n - t.y) > this.slop && (this.finger = null);
19
+ }
20
+ up(s) {
21
+ this.finger?.id === s && (this.finger = null), this.finger || (this.done = !1);
22
+ }
23
+ /** Where the press is, the first time this is asked at or after `ms`; null otherwise. */
24
+ fire(s) {
25
+ const i = this.finger;
26
+ return !i || this.done || s - i.at < this.ms ? null : (this.done = !0, { x: i.x, y: i.y });
27
+ }
28
+ }
29
+ export {
30
+ r as LongPress
31
+ };
@@ -0,0 +1,42 @@
1
+ function u(t) {
2
+ return t !== void 0 && t > 0 ? Math.min(1, t) : 0;
3
+ }
4
+ function o(t) {
5
+ const a = t.durationMs !== void 0 && t.durationMs > 0 ? t.durationMs : 200;
6
+ return {
7
+ duration: Math.min(5e3, a),
8
+ startDelay: t.startDelayMs !== void 0 && t.startDelayMs > 0 ? t.startDelayMs : 0,
9
+ strongMagnitude: u(t.strong),
10
+ weakMagnitude: u(t.weak)
11
+ };
12
+ }
13
+ function i() {
14
+ return typeof navigator < "u" && typeof navigator.getGamepads == "function" ? navigator.getGamepads() : [];
15
+ }
16
+ async function c(t, a) {
17
+ const r = t?.vibrationActuator;
18
+ if (!r || typeof r.playEffect != "function") return !1;
19
+ const e = o(a);
20
+ if (e.strongMagnitude === 0 && e.weakMagnitude === 0) return !1;
21
+ try {
22
+ const n = await r.playEffect("dual-rumble", e);
23
+ return n === "complete" || n === "preempted" || n === void 0;
24
+ } catch {
25
+ return !1;
26
+ }
27
+ }
28
+ function s(t, a, r = i) {
29
+ return c(r()[t], a);
30
+ }
31
+ async function d(t, a = i) {
32
+ try {
33
+ await a()[t]?.vibrationActuator?.reset?.();
34
+ } catch {
35
+ }
36
+ }
37
+ export {
38
+ s as rumble,
39
+ c as rumblePad,
40
+ o as rumbleParams,
41
+ d as stopRumble
42
+ };
@@ -0,0 +1,22 @@
1
+ const a = 0.28;
2
+ function h(t, n, r) {
3
+ if (r <= 0) return { x: 0, y: 0 };
4
+ const o = Math.hypot(t, n);
5
+ if (o === 0) return { x: 0, y: 0 };
6
+ const c = o > r ? 1 / o : 1 / r;
7
+ return { x: t * c, y: n * c };
8
+ }
9
+ function s(t, n = 0.28) {
10
+ return Math.hypot(t.x, t.y) >= n;
11
+ }
12
+ function i(t, n = 0.28) {
13
+ if (!s(t, n)) return { dx: 0, dy: 0 };
14
+ const o = Math.round(Math.atan2(t.y, t.x) / (Math.PI / 4)) * (Math.PI / 4), c = (e) => Math.abs(e) < 1e-9 ? 0 : Math.sign(e);
15
+ return { dx: c(Math.cos(o)), dy: c(Math.sin(o)) };
16
+ }
17
+ export {
18
+ a as STICK_DEAD_ZONE,
19
+ s as stickActive,
20
+ i as stickToAxis,
21
+ h as stickVector
22
+ };
@@ -0,0 +1,6 @@
1
+ function e(r) {
2
+ return r.override === "1" || r.override === "on" ? !0 : r.override === "0" || r.override === "off" ? !1 : r.native ? !0 : r.coarse && r.touchPoints > 0;
3
+ }
4
+ export {
5
+ e as detectTouch
6
+ };
@@ -0,0 +1,83 @@
1
+ import { RenderTexture as M, Sprite as c, Container as w, Texture as f } from "pixi.js";
2
+ let o = null;
3
+ function m() {
4
+ if (o) return o;
5
+ const h = 256, t = document.createElement("canvas");
6
+ t.width = t.height = h;
7
+ const s = t.getContext("2d");
8
+ if (!s) return f.EMPTY;
9
+ const e = s.createRadialGradient(h / 2, h / 2, 0, h / 2, h / 2, h / 2);
10
+ return e.addColorStop(0, "rgba(255,255,255,1)"), e.addColorStop(0.35, "rgba(255,255,255,0.75)"), e.addColorStop(0.7, "rgba(255,255,255,0.25)"), e.addColorStop(1, "rgba(255,255,255,0)"), s.fillStyle = e, s.fillRect(0, 0, h, h), o = f.from(t), o.source.scaleMode = "linear", o;
11
+ }
12
+ class x {
13
+ constructor(t, s = {}) {
14
+ this.stage = t, this.ambient = s.ambient ?? 658468, this.darkness = s.darkness ?? 0.85, this.tint = s.tint ?? 0.35, this.squash = s.squash ?? 1, this.scratch.addChild(this.sheet, this.holes), this.rt = M.create({ width: 1, height: 1 }), this.view = new c(this.rt), this.washes.blendMode = "add", t.screen.addChild(this.view, this.washes), this.unsubscribe = t.onResize(() => this.fit()), this.fit();
15
+ }
16
+ stage;
17
+ lights = /* @__PURE__ */ new Set();
18
+ scratch = new w();
19
+ sheet = new c(f.WHITE);
20
+ holes = new w();
21
+ washes = new w();
22
+ view;
23
+ rt;
24
+ pool = [];
25
+ ambient;
26
+ darkness;
27
+ tint;
28
+ squash;
29
+ unsubscribe;
30
+ add(t) {
31
+ return this.lights.add(t), t;
32
+ }
33
+ remove(t) {
34
+ this.lights.delete(t);
35
+ }
36
+ clear() {
37
+ this.lights.clear();
38
+ }
39
+ /** Changes the dark: its colour and how dark (a day/night cycle eases these). */
40
+ setAmbient(t, s) {
41
+ this.ambient = t, this.darkness = Math.min(1, Math.max(0, s));
42
+ }
43
+ /** Redraws the dark with this frame's lights. Call once a frame, after the camera moved. */
44
+ update(t = performance.now()) {
45
+ const s = this.darkness > 4e-3;
46
+ if (this.view.visible = s, this.washes.visible = s, !s) return;
47
+ const e = this.stage.cameras.main, a = e.zoom;
48
+ this.sheet.tint = this.ambient, this.sheet.alpha = this.darkness;
49
+ let b = 0;
50
+ for (const i of this.lights) {
51
+ if (i.on === !1 || i.radius <= 0) continue;
52
+ const d = (i.x - e.scrollX) * a, u = (i.y - e.scrollY) * a, p = i.flicker ? 1 + Math.sin(t / 97 + i.x) * Math.sin(t / 53 + i.y) * i.flicker : 1, r = i.radius * a * p;
53
+ if (d < -r || u < -r || d > e.width + r || u > e.height + r) continue;
54
+ const n = this.sprites(b++), g = Math.min(1, Math.max(0, i.intensity ?? 1));
55
+ for (const l of [n.hole, n.wash])
56
+ l.visible = !0, l.position.set(d, u), l.width = r * 2, l.height = r * 2 * this.squash;
57
+ n.hole.alpha = g, n.wash.tint = i.color ?? 16773340, n.wash.alpha = g * this.tint;
58
+ }
59
+ for (let i = b; i < this.pool.length; i++)
60
+ this.pool[i].hole.visible = !1, this.pool[i].wash.visible = !1;
61
+ this.stage.app.renderer.render({ container: this.scratch, target: this.rt, clear: !0 });
62
+ }
63
+ destroy() {
64
+ this.unsubscribe(), this.view.destroy(), this.washes.destroy({ children: !0 }), this.scratch.destroy({ children: !0 }), this.rt.destroy(!0), this.lights.clear();
65
+ }
66
+ sprites(t) {
67
+ let s = this.pool[t];
68
+ if (!s) {
69
+ const e = new c(m());
70
+ e.anchor.set(0.5), e.blendMode = "erase";
71
+ const a = new c(m());
72
+ a.anchor.set(0.5), this.holes.addChild(e), this.washes.addChild(a), s = { hole: e, wash: a }, this.pool.push(s);
73
+ }
74
+ return s;
75
+ }
76
+ fit() {
77
+ const t = Math.max(1, Math.ceil(this.stage.width)), s = Math.max(1, Math.ceil(this.stage.height));
78
+ this.rt.resize(t, s), this.sheet.width = t, this.sheet.height = s;
79
+ }
80
+ }
81
+ export {
82
+ x as LightLayer
83
+ };
@@ -0,0 +1,38 @@
1
+ class c {
2
+ items = [];
3
+ prio = [];
4
+ get size() {
5
+ return this.items.length;
6
+ }
7
+ push(s, e) {
8
+ const h = this.items, o = this.prio;
9
+ h.push(s), o.push(e);
10
+ let i = h.length - 1;
11
+ for (; i > 0; ) {
12
+ const t = i - 1 >> 1;
13
+ if (o[t] <= o[i]) break;
14
+ [h[t], h[i]] = [h[i], h[t]], [o[t], o[i]] = [o[i], o[t]], i = t;
15
+ }
16
+ }
17
+ /** The index with the lowest priority, removed. Only call while `size > 0`. */
18
+ pop() {
19
+ const s = this.items, e = this.prio, h = s[0], o = s.pop(), i = e.pop();
20
+ if (s.length > 0) {
21
+ s[0] = o, e[0] = i;
22
+ let t = 0;
23
+ for (; ; ) {
24
+ const p = t * 2 + 1, l = p + 1;
25
+ let n = t;
26
+ if (p < s.length && e[p] < e[n] && (n = p), l < s.length && e[l] < e[n] && (n = l), n === t) break;
27
+ [s[t], s[n]] = [s[n], s[t]], [e[t], e[n]] = [e[n], e[t]], t = n;
28
+ }
29
+ }
30
+ return h;
31
+ }
32
+ clear() {
33
+ this.items.length = 0, this.prio.length = 0;
34
+ }
35
+ }
36
+ export {
37
+ c as MinHeap
38
+ };
@@ -0,0 +1,77 @@
1
+ import { MinHeap as z } from "./MinHeap.js";
2
+ import { isOpen as C, NAV_STEPS as N, canStep as P } from "./navGrid.js";
3
+ import { nearestOpen as T } from "./nearestOpen.js";
4
+ function U(t, n) {
5
+ const e = Math.abs(t), c = Math.abs(n);
6
+ return e + c + (Math.SQRT2 - 2) * Math.min(e, c);
7
+ }
8
+ function W(t) {
9
+ if ("test" in t) return { test: t.test, estimate: t.estimate ?? (() => 0) };
10
+ const n = t.reach ?? 0;
11
+ return {
12
+ test: (e, c) => Math.hypot(e - t.x, c - t.y) <= n + 1e-9,
13
+ // less the goal's own radius: never more than the real remaining cost
14
+ estimate: (e, c) => Math.max(0, U(t.x - e, t.y - c) - n)
15
+ };
16
+ }
17
+ function Q(t, n, e, c = {}) {
18
+ const { cost: f, endOnly: S, maxNodes: w = 14e3 } = c, s = C(t, n.x, n.y) ? n : T(t, n.x, n.y);
19
+ if (!s) return null;
20
+ const i = W(e);
21
+ if (i.test(s.x, s.y)) return [{ x: s.x, y: s.y }];
22
+ const r = t.width, m = r * t.height, y = new Float64Array(m).fill(1 / 0), M = new Int32Array(m).fill(-1), I = new Uint8Array(m), u = new z(), h = s.y * r + s.x;
23
+ y[h] = 0, u.push(h, i.estimate(s.x, s.y));
24
+ let x = 0;
25
+ for (; u.size > 0 && x < w; ) {
26
+ const o = u.pop();
27
+ if (I[o]) continue;
28
+ I[o] = 1, x++;
29
+ const l = o % r, O = o / r | 0;
30
+ if (i.test(l, O)) {
31
+ const p = [];
32
+ for (let a = o; a !== -1; a = M[a]) p.push({ x: a % r, y: a / r | 0 });
33
+ return p.reverse();
34
+ }
35
+ for (const [p, a, A] of N) {
36
+ if (!P(t, l, O, p, a, S, i.test)) continue;
37
+ const d = l + p, b = O + a, F = b * r + d;
38
+ if (I[F]) continue;
39
+ const v = y[o] + A + (f ? f(d, b) : 0);
40
+ v >= y[F] || (y[F] = v, M[F] = o, u.push(F, v + i.estimate(d, b)));
41
+ }
42
+ }
43
+ return null;
44
+ }
45
+ function R(t, n, e = {}) {
46
+ const { cost: c, endOnly: f, maxCost: S = 1 / 0 } = e, w = t.width, s = w * t.height, i = new Float32Array(s).fill(1 / 0), r = C(t, n.x, n.y) ? n : T(t, n.x, n.y);
47
+ if (!r) return i;
48
+ const m = new Uint8Array(s), y = new z(), M = r.y * w + r.x;
49
+ i[M] = 0, y.push(M, 0);
50
+ const I = () => !0;
51
+ for (; y.size > 0; ) {
52
+ const u = y.pop();
53
+ if (m[u]) continue;
54
+ m[u] = 1;
55
+ const h = u % w, x = u / w | 0;
56
+ if (!(u !== M && f?.(h, x)))
57
+ for (const [o, l, O] of N) {
58
+ if (!P(t, h, x, o, l, f, I) || f && o !== 0 && l !== 0 && (f(h + o, x) || f(h, x + l))) continue;
59
+ const p = h + o, a = x + l, A = a * w + p;
60
+ if (m[A]) continue;
61
+ const d = i[u] + O + (c ? c(p, a) : 0);
62
+ d >= i[A] || d > S || (i[A] = d, y.push(A, d));
63
+ }
64
+ }
65
+ return i;
66
+ }
67
+ function V(t) {
68
+ let n = 0;
69
+ for (let e = 0; e < t.length; e++) t[e] !== 1 / 0 && n++;
70
+ return n;
71
+ }
72
+ export {
73
+ Q as findPath,
74
+ R as floodFill,
75
+ U as octile,
76
+ V as reachedCount
77
+ };
@@ -0,0 +1,35 @@
1
+ import { isSolidTile as s } from "../net/movement.js";
2
+ function S(r, n, t) {
3
+ return { width: r, height: n, walkable: t };
4
+ }
5
+ function T(r) {
6
+ return { width: r.width, height: r.height, walkable: (n, t) => !s(r, n, t) };
7
+ }
8
+ function e(r, n, t) {
9
+ return n >= 0 && t >= 0 && n < r.width && t < r.height && r.walkable(n, t);
10
+ }
11
+ function w(r, n = 1.4) {
12
+ return (t, i) => !e(r, t + 1, i) || !e(r, t - 1, i) || !e(r, t, i + 1) || !e(r, t, i - 1) ? n : 0;
13
+ }
14
+ const p = [
15
+ [1, 0, 1],
16
+ [-1, 0, 1],
17
+ [0, 1, 1],
18
+ [0, -1, 1],
19
+ [1, 1, Math.SQRT2],
20
+ [1, -1, Math.SQRT2],
21
+ [-1, 1, Math.SQRT2],
22
+ [-1, -1, Math.SQRT2]
23
+ ];
24
+ function M(r, n, t, i, a, f, u) {
25
+ const o = n + i, h = t + a;
26
+ return !(!e(r, o, h) || f && f(o, h) && !u(o, h) || i !== 0 && a !== 0 && (!e(r, n + i, t) || !e(r, n, t + a) || f && (f(n + i, t) && !u(n + i, t) || f(n, t + a) && !u(n, t + a))));
27
+ }
28
+ export {
29
+ p as NAV_STEPS,
30
+ M as canStep,
31
+ e as isOpen,
32
+ S as navGrid,
33
+ T as navGridFromCollision,
34
+ w as nearWallCost
35
+ };
@@ -0,0 +1,18 @@
1
+ import { isOpen as b } from "./navGrid.js";
2
+ function c(s, f, i, u = 12, l = (e, t) => b(s, e, t)) {
3
+ if (l(f, i)) return { x: f, y: i };
4
+ for (let e = 1; e <= u; e++) {
5
+ let t = null, o = 1 / 0;
6
+ for (let n = -e; n <= e; n++)
7
+ for (let r = -e; r <= e; r++) {
8
+ if (Math.max(Math.abs(r), Math.abs(n)) !== e || !l(f + r, i + n)) continue;
9
+ const a = r * r + n * n;
10
+ a < o && (o = a, t = { x: f + r, y: i + n });
11
+ }
12
+ if (t) return t;
13
+ }
14
+ return null;
15
+ }
16
+ export {
17
+ c as nearestOpen
18
+ };
@@ -0,0 +1,50 @@
1
+ import { canStep as S } from "./navGrid.js";
2
+ const T = 48;
3
+ function C(o, t, l = {}) {
4
+ if (t.length < 3) return t.slice();
5
+ const u = l.cost, i = (n, s, c) => (c ? Math.SQRT2 : 1) + (u ? u(n, s) : 0), r = [0];
6
+ for (let n = 1; n < t.length; n++) {
7
+ const s = t[n - 1], c = t[n];
8
+ r.push(r[n - 1] + i(c.x, c.y, s.x !== c.x && s.y !== c.y));
9
+ }
10
+ const b = t[t.length - 1], f = [t[0]];
11
+ let e = 0;
12
+ for (; e < t.length - 1; ) {
13
+ let n = !1;
14
+ for (let s = Math.min(t.length - 1, e + T); s >= e + 2 && !n; s--) {
15
+ const c = r[s] - r[e] + 1e-6;
16
+ for (const h of [!0, !1]) {
17
+ const g = W(o, t[e], t[s], h, l.endOnly, b, c, i);
18
+ if (g) {
19
+ f.push(...g), e = s, n = !0;
20
+ break;
21
+ }
22
+ }
23
+ }
24
+ n || f.push(t[++e]);
25
+ }
26
+ return f;
27
+ }
28
+ function W(o, t, l, u, i, r, b, f) {
29
+ const e = l.x - t.x, n = l.y - t.y, s = Math.min(Math.abs(e), Math.abs(n)), c = Math.max(Math.abs(e), Math.abs(n)) - s, h = [Math.sign(e), Math.sign(n)], g = Math.abs(e) > Math.abs(n) ? [Math.sign(e), 0] : [0, Math.sign(n)], w = u ? [[h, s], [g, c]] : [[g, c], [h, s]], O = (x, y) => x === r.x && y === r.y, d = [];
30
+ let a = t.x, M = t.y, m = 0;
31
+ for (const [[x, y], P] of w)
32
+ for (let k = 0; k < P; k++) {
33
+ if (!S(o, a, M, x, y, i, O) || (a += x, M += y, m += f(a, M, x !== 0 && y !== 0), m > b)) return null;
34
+ d.push({ x: a, y: M });
35
+ }
36
+ return d;
37
+ }
38
+ function D(o) {
39
+ if (o.length < 3) return o.slice();
40
+ const t = [o[0]];
41
+ for (let l = 1; l < o.length - 1; l++) {
42
+ const u = t[t.length - 1], i = o[l], r = o[l + 1];
43
+ (i.x - u.x) * (r.y - i.y) !== (i.y - u.y) * (r.x - i.x) && t.push(i);
44
+ }
45
+ return t.push(o[o.length - 1]), t;
46
+ }
47
+ export {
48
+ D as simplifyPath,
49
+ C as straightenPath
50
+ };