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.
- package/CHANGELOG.md +357 -0
- package/LICENSE +21 -0
- package/README.md +164 -2
- package/dist/1681-engine.js +471 -0
- package/dist/ambient/ColorGrade.js +40 -0
- package/dist/ambient/DayClock.js +56 -0
- package/dist/ambient/WeatherLayer.js +90 -0
- package/dist/ambient/grade.js +12 -0
- package/dist/ambient/weather.js +51 -0
- package/dist/anim/AnimStateMachine.js +163 -0
- package/dist/anim/Animator.js +66 -0
- package/dist/anim/animStateCompile.js +112 -0
- package/dist/anim/animStateSystem.js +16 -0
- package/dist/anim/animationSystem.js +14 -0
- package/dist/anim/asepriteSlices.js +21 -0
- package/dist/anim/asepriteTags.js +34 -0
- package/dist/anim/parseAseprite.js +82 -0
- package/dist/assets/AssetLoader.js +202 -0
- package/dist/assets/loadAseprite.js +49 -0
- package/dist/assets/takeCleanerWorker-DTcI_Jqr.js +30 -0
- package/dist/assets/textureAtlas.js +58 -0
- package/dist/audio/Footsteps.js +25 -0
- package/dist/audio/MusicPlayer.js +77 -0
- package/dist/audio/SoundEngine.js +125 -0
- package/dist/audio/cleanTake.js +29 -0
- package/dist/audio/music/ElementVoice.js +34 -0
- package/dist/audio/music/GraphVoice.js +38 -0
- package/dist/audio/music/MusicChannel.js +57 -0
- package/dist/audio/music/musicVoice.js +12 -0
- package/dist/audio/sampleBank.js +81 -0
- package/dist/audio/soundTable.js +8 -0
- package/dist/audio/synth.js +35 -0
- package/dist/core/BitmapLabel.js +48 -0
- package/dist/core/Camera.js +149 -0
- package/dist/core/Clock.js +40 -0
- package/dist/core/Graphics.js +68 -0
- package/dist/core/Group.js +28 -0
- package/dist/core/Image.js +50 -0
- package/dist/core/ObjectFactory.js +54 -0
- package/dist/core/Pointer.js +80 -0
- package/dist/core/Rectangle.js +50 -0
- package/dist/core/Stage.js +85 -0
- package/dist/core/Text.js +21 -0
- package/dist/core/TextureRegistry.js +141 -0
- package/dist/core/Timeline.js +210 -0
- package/dist/core/TimelineBuilder.js +72 -0
- package/dist/core/TimelineChild.js +83 -0
- package/dist/core/Tweener.js +135 -0
- package/dist/core/atlas.js +37 -0
- package/dist/core/atlasPlan.js +21 -0
- package/dist/core/blendLayer.js +11 -0
- package/dist/core/eases.js +20 -0
- package/dist/core/gameObject.js +117 -0
- package/dist/core/pixelZoom.js +43 -0
- package/dist/core/pixiPatches.js +17 -0
- package/dist/core/runDue.js +28 -0
- package/dist/core/silhouette.js +49 -0
- package/dist/core/timelinePlace.js +23 -0
- package/dist/core/tweenProps.js +11 -0
- package/dist/debug/DebugOverlay.js +93 -0
- package/dist/debug/DrawCallCounter.js +44 -0
- package/dist/debug/ErrorLog.js +21 -0
- package/dist/debug/FrameStats.js +41 -0
- package/dist/debug/inspectWorld.js +28 -0
- package/dist/diagnostics/ErrorDeduper.js +26 -0
- package/dist/diagnostics/FrameSampler.js +41 -0
- package/dist/diagnostics/bootWatch.js +20 -0
- package/dist/diagnostics/captureErrors.js +26 -0
- package/dist/diagnostics/contextLoss.js +24 -0
- package/dist/diagnostics/frameStats.js +30 -0
- package/dist/diagnostics/gpuInfo.js +21 -0
- package/dist/diagnostics/renderGuard.js +23 -0
- package/dist/ecs/SparseSet.js +54 -0
- package/dist/ecs/World.js +306 -0
- package/dist/ecs/fields.js +25 -0
- package/dist/engine/Engine.js +106 -0
- package/dist/engine/FixedLoop.js +36 -0
- package/dist/engine/HiddenPause.js +27 -0
- package/dist/engine/Scene.js +78 -0
- package/dist/engine/SceneManager.js +72 -0
- package/dist/events/EventBus.js +41 -0
- package/dist/fx/Afterimages.js +82 -0
- package/dist/fx/FloatingText.js +71 -0
- package/dist/fx/hitStop.js +27 -0
- package/dist/fx/viewCull.js +9 -0
- package/dist/i18n/Translator.js +71 -0
- package/dist/i18n/extractStrings.js +57 -0
- package/dist/i18n/formatMessage.js +18 -0
- package/dist/input/Actions.js +139 -0
- package/dist/input/AimGesture.js +74 -0
- package/dist/input/Keyboard.js +53 -0
- package/dist/input/Keymap.js +170 -0
- package/dist/input/TargetLock.js +72 -0
- package/dist/input/aimAxis.js +7 -0
- package/dist/input/keyChord.js +28 -0
- package/dist/input/longPress.js +31 -0
- package/dist/input/rumble.js +42 -0
- package/dist/input/stickAxis.js +22 -0
- package/dist/input/touchDetect.js +6 -0
- package/dist/light/LightLayer.js +83 -0
- package/dist/nav/MinHeap.js +38 -0
- package/dist/nav/findPath.js +77 -0
- package/dist/nav/navGrid.js +35 -0
- package/dist/nav/nearestOpen.js +18 -0
- package/dist/nav/straightenPath.js +50 -0
- package/dist/net/Connection.js +107 -0
- package/dist/net/InterpolationBuffer.js +56 -0
- package/dist/net/PredictedMover.js +60 -0
- package/dist/net/Room.js +91 -0
- package/dist/net/RoomHost.js +100 -0
- package/dist/net/cadence.js +21 -0
- package/dist/net/constants.js +10 -0
- package/dist/net/lobby/LobbyClient.js +123 -0
- package/dist/net/lobby/LobbyHost.js +365 -0
- package/dist/net/lobby/LobbyRooms.js +65 -0
- package/dist/net/lobby/Matchmaker.js +105 -0
- package/dist/net/movement.js +84 -0
- package/dist/net/protocol.js +10 -0
- package/dist/net/reconnect.js +10 -0
- package/dist/net/serverClock.js +21 -0
- package/dist/net/snapshotCodec.js +91 -0
- package/dist/parallax/Parallax.js +31 -0
- package/dist/parallax/ParallaxLayer.js +69 -0
- package/dist/parallax/parallaxMath.js +26 -0
- package/dist/particles/Emitter.js +107 -0
- package/dist/particles/ParticleBudget.js +31 -0
- package/dist/particles/ParticleSim.js +59 -0
- package/dist/particles/particleCurves.js +47 -0
- package/dist/particles/particleSampling.js +29 -0
- package/dist/physics/Body.js +201 -0
- package/dist/physics/BroadPhase.js +55 -0
- package/dist/physics/Contact.js +75 -0
- package/dist/physics/ContactSolver.js +69 -0
- package/dist/physics/PhysicsWorld.js +220 -0
- package/dist/physics/SpatialHash.js +38 -0
- package/dist/physics/collide.js +75 -0
- package/dist/physics/collidePolygon.js +93 -0
- package/dist/physics/contactReport.js +13 -0
- package/dist/physics/drawColliders.js +30 -0
- package/dist/physics/physicsSystem.js +7 -0
- package/dist/physics/polygon.js +79 -0
- package/dist/physics/raycast.js +61 -0
- package/dist/physics/syncToBody.js +18 -0
- package/dist/physics/tileBodies.js +58 -0
- package/dist/physics/types.js +7 -0
- package/dist/pixel/Darkness.js +169 -0
- package/dist/pixel/DitherVignette.js +56 -0
- package/dist/pixel/Evaporation.js +84 -0
- package/dist/pixel/NightShade.js +33 -0
- package/dist/pixel/PixelLayer.js +210 -0
- package/dist/pixel/PixelMarks.js +99 -0
- package/dist/pixel/SwayProp.js +74 -0
- package/dist/pixel/aimPixels.js +67 -0
- package/dist/pixel/lights.js +43 -0
- package/dist/pixel/nineSlice.js +61 -0
- package/dist/pixel/paintLayer.js +35 -0
- package/dist/pixel/palette.js +56 -0
- package/dist/pixel/pixel.js +277 -0
- package/dist/pixel/pixelPaint.js +197 -0
- package/dist/pixel/pixelParticles.js +35 -0
- package/dist/pixel/pixelTone.js +163 -0
- package/dist/pixel/propKit.js +40 -0
- package/dist/pixel/ramp.js +101 -0
- package/dist/pixel/selout.js +34 -0
- package/dist/pixel/spritePixels.js +58 -0
- package/dist/pixel/swayRig.js +86 -0
- package/dist/pixel/vignetteMask.js +23 -0
- package/dist/pixel/weatherArt.js +60 -0
- package/dist/pixel.js +96 -0
- package/dist/platform/appResume.js +18 -0
- package/dist/platform/fullscreen.js +52 -0
- package/dist/platform/orientation.js +26 -0
- package/dist/platform/pointerLock.js +37 -0
- package/dist/platform/reducedMotion.js +23 -0
- package/dist/platform/timeoutSignal.js +14 -0
- package/dist/platform/touch.js +32 -0
- package/dist/postfx/BloomFilter.js +64 -0
- package/dist/postfx/ChromaticAberrationFilter.js +24 -0
- package/dist/postfx/ColorAdjustFilter.js +75 -0
- package/dist/postfx/CrtFilter.js +41 -0
- package/dist/postfx/PixelateFilter.js +26 -0
- package/dist/postfx/PostFx.js +122 -0
- package/dist/postfx/ShockwaveFilter.js +48 -0
- package/dist/postfx/VignetteFilter.js +36 -0
- package/dist/postfx/fxAnimator.js +37 -0
- package/dist/postfx/fxShader.js +127 -0
- package/dist/postfx.js +25 -0
- package/dist/react/ChoiceDialog.js +50 -0
- package/dist/react/ConfirmDialog.js +52 -0
- package/dist/react/Glyph.js +62 -0
- package/dist/react/Modal.js +37 -0
- package/dist/react/Panel.js +23 -0
- package/dist/react/PixelImage.js +23 -0
- package/dist/react/Select.js +98 -0
- package/dist/react/Slider.js +61 -0
- package/dist/react/SplitPane.js +23 -0
- package/dist/react/TabStrip.js +31 -0
- package/dist/react/TitleTips.js +41 -0
- package/dist/react/Tooltip.js +27 -0
- package/dist/react/UiProvider.js +49 -0
- package/dist/react/baseCss.js +221 -0
- package/dist/react/choiceStore.js +22 -0
- package/dist/react/classNames.js +18 -0
- package/dist/react/confirmStore.js +29 -0
- package/dist/react/labels.js +17 -0
- package/dist/react/placement.js +48 -0
- package/dist/react/useFillSheet.js +22 -0
- package/dist/react/useFitToViewport.js +28 -0
- package/dist/react/usePicked.js +12 -0
- package/dist/react/useStore.js +8 -0
- package/dist/react/useViewport.js +16 -0
- package/dist/react.js +77 -0
- package/dist/rig/PosePlayer.js +91 -0
- package/dist/rig/RigView.js +124 -0
- package/dist/rig/Skeleton.js +30 -0
- package/dist/rig/humanoid.js +5 -0
- package/dist/rig/humanoid.json.js +29 -0
- package/dist/rig/humanoidPoses.js +29 -0
- package/dist/rig/poseMath.js +53 -0
- package/dist/rig/poses.json.js +149 -0
- package/dist/save/Autosaver.js +53 -0
- package/dist/save/MemoryBackend.js +18 -0
- package/dist/save/SaveStore.js +102 -0
- package/dist/save/WebStorageBackend.js +26 -0
- package/dist/save/checksum.js +9 -0
- package/dist/save/migrateSave.js +26 -0
- package/dist/settings.js +26 -0
- package/dist/tilemap/TilemapView.js +68 -0
- package/dist/tilemap/collision.js +24 -0
- package/dist/tilemap/tiled.js +137 -0
- package/dist/transitions/CrossfadeTransition.js +23 -0
- package/dist/transitions/DitherWipeTransition.js +69 -0
- package/dist/transitions/FadeTransition.js +33 -0
- package/dist/transitions/Letterbox.js +41 -0
- package/dist/transitions/ditherMask.js +14 -0
- package/dist/transitions/transitionTo.js +27 -0
- package/dist/transitions/tweenDone.js +14 -0
- package/dist/types/ambient/ColorGrade.d.ts +41 -0
- package/dist/types/ambient/ColorGrade.d.ts.map +1 -0
- package/dist/types/ambient/DayClock.d.ts +80 -0
- package/dist/types/ambient/DayClock.d.ts.map +1 -0
- package/dist/types/ambient/WeatherLayer.d.ts +78 -0
- package/dist/types/ambient/WeatherLayer.d.ts.map +1 -0
- package/dist/types/ambient/grade.d.ts +22 -0
- package/dist/types/ambient/grade.d.ts.map +1 -0
- package/dist/types/ambient/weather.d.ts +49 -0
- package/dist/types/ambient/weather.d.ts.map +1 -0
- package/dist/types/anim/AnimStateMachine.d.ts +80 -0
- package/dist/types/anim/AnimStateMachine.d.ts.map +1 -0
- package/dist/types/anim/Animator.d.ts +50 -0
- package/dist/types/anim/Animator.d.ts.map +1 -0
- package/dist/types/anim/animStateCompile.d.ts +52 -0
- package/dist/types/anim/animStateCompile.d.ts.map +1 -0
- package/dist/types/anim/animStateSystem.d.ts +10 -0
- package/dist/types/anim/animStateSystem.d.ts.map +1 -0
- package/dist/types/anim/animStateTypes.d.ts +50 -0
- package/dist/types/anim/animStateTypes.d.ts.map +1 -0
- package/dist/types/anim/animationSystem.d.ts +13 -0
- package/dist/types/anim/animationSystem.d.ts.map +1 -0
- package/dist/types/anim/asepriteSlices.d.ts +19 -0
- package/dist/types/anim/asepriteSlices.d.ts.map +1 -0
- package/dist/types/anim/asepriteTags.d.ts +16 -0
- package/dist/types/anim/asepriteTags.d.ts.map +1 -0
- package/dist/types/anim/asepriteTypes.d.ts +159 -0
- package/dist/types/anim/asepriteTypes.d.ts.map +1 -0
- package/dist/types/anim/parseAseprite.d.ts +21 -0
- package/dist/types/anim/parseAseprite.d.ts.map +1 -0
- package/dist/types/assets/AssetLoader.d.ts +140 -0
- package/dist/types/assets/AssetLoader.d.ts.map +1 -0
- package/dist/types/assets/loadAseprite.d.ts +27 -0
- package/dist/types/assets/loadAseprite.d.ts.map +1 -0
- package/dist/types/assets/textureAtlas.d.ts +35 -0
- package/dist/types/assets/textureAtlas.d.ts.map +1 -0
- package/dist/types/audio/Footsteps.d.ts +33 -0
- package/dist/types/audio/Footsteps.d.ts.map +1 -0
- package/dist/types/audio/MusicPlayer.d.ts +65 -0
- package/dist/types/audio/MusicPlayer.d.ts.map +1 -0
- package/dist/types/audio/SoundEngine.d.ts +47 -0
- package/dist/types/audio/SoundEngine.d.ts.map +1 -0
- package/dist/types/audio/cleanTake.d.ts +3 -0
- package/dist/types/audio/cleanTake.d.ts.map +1 -0
- package/dist/types/audio/music/ElementVoice.d.ts +14 -0
- package/dist/types/audio/music/ElementVoice.d.ts.map +1 -0
- package/dist/types/audio/music/GraphVoice.d.ts +22 -0
- package/dist/types/audio/music/GraphVoice.d.ts.map +1 -0
- package/dist/types/audio/music/MusicChannel.d.ts +35 -0
- package/dist/types/audio/music/MusicChannel.d.ts.map +1 -0
- package/dist/types/audio/music/musicVoice.d.ts +26 -0
- package/dist/types/audio/music/musicVoice.d.ts.map +1 -0
- package/dist/types/audio/sampleBank.d.ts +27 -0
- package/dist/types/audio/sampleBank.d.ts.map +1 -0
- package/dist/types/audio/soundTable.d.ts +14 -0
- package/dist/types/audio/soundTable.d.ts.map +1 -0
- package/dist/types/audio/synth.d.ts +34 -0
- package/dist/types/audio/synth.d.ts.map +1 -0
- package/dist/types/audio/takeCleanerWorker.d.ts +2 -0
- package/dist/types/audio/takeCleanerWorker.d.ts.map +1 -0
- package/dist/types/core/BitmapLabel.d.ts +36 -0
- package/dist/types/core/BitmapLabel.d.ts.map +1 -0
- package/dist/types/core/Camera.d.ts +115 -0
- package/dist/types/core/Camera.d.ts.map +1 -0
- package/dist/types/core/Clock.d.ts +23 -0
- package/dist/types/core/Clock.d.ts.map +1 -0
- package/dist/types/core/Graphics.d.ts +37 -0
- package/dist/types/core/Graphics.d.ts.map +1 -0
- package/dist/types/core/Group.d.ts +15 -0
- package/dist/types/core/Group.d.ts.map +1 -0
- package/dist/types/core/Image.d.ts +25 -0
- package/dist/types/core/Image.d.ts.map +1 -0
- package/dist/types/core/ObjectFactory.d.ts +34 -0
- package/dist/types/core/ObjectFactory.d.ts.map +1 -0
- package/dist/types/core/Pointer.d.ts +45 -0
- package/dist/types/core/Pointer.d.ts.map +1 -0
- package/dist/types/core/Rectangle.d.ts +26 -0
- package/dist/types/core/Rectangle.d.ts.map +1 -0
- package/dist/types/core/Stage.d.ts +58 -0
- package/dist/types/core/Stage.d.ts.map +1 -0
- package/dist/types/core/Text.d.ts +22 -0
- package/dist/types/core/Text.d.ts.map +1 -0
- package/dist/types/core/TextureRegistry.d.ts +90 -0
- package/dist/types/core/TextureRegistry.d.ts.map +1 -0
- package/dist/types/core/Timeline.d.ts +115 -0
- package/dist/types/core/Timeline.d.ts.map +1 -0
- package/dist/types/core/TimelineBuilder.d.ts +53 -0
- package/dist/types/core/TimelineBuilder.d.ts.map +1 -0
- package/dist/types/core/TimelineChild.d.ts +51 -0
- package/dist/types/core/TimelineChild.d.ts.map +1 -0
- package/dist/types/core/Tweener.d.ts +70 -0
- package/dist/types/core/Tweener.d.ts.map +1 -0
- package/dist/types/core/atlas.d.ts +16 -0
- package/dist/types/core/atlas.d.ts.map +1 -0
- package/dist/types/core/atlasPlan.d.ts +34 -0
- package/dist/types/core/atlasPlan.d.ts.map +1 -0
- package/dist/types/core/blendLayer.d.ts +23 -0
- package/dist/types/core/blendLayer.d.ts.map +1 -0
- package/dist/types/core/eases.d.ts +3 -0
- package/dist/types/core/eases.d.ts.map +1 -0
- package/dist/types/core/gameObject.d.ts +42 -0
- package/dist/types/core/gameObject.d.ts.map +1 -0
- package/dist/types/core/pixelZoom.d.ts +45 -0
- package/dist/types/core/pixelZoom.d.ts.map +1 -0
- package/dist/types/core/pixiPatches.d.ts +9 -0
- package/dist/types/core/pixiPatches.d.ts.map +1 -0
- package/dist/types/core/runDue.d.ts +15 -0
- package/dist/types/core/runDue.d.ts.map +1 -0
- package/dist/types/core/silhouette.d.ts +16 -0
- package/dist/types/core/silhouette.d.ts.map +1 -0
- package/dist/types/core/timelinePlace.d.ts +23 -0
- package/dist/types/core/timelinePlace.d.ts.map +1 -0
- package/dist/types/core/tweenProps.d.ts +8 -0
- package/dist/types/core/tweenProps.d.ts.map +1 -0
- package/dist/types/core/types.d.ts +4 -0
- package/dist/types/core/types.d.ts.map +1 -0
- package/dist/types/debug/DebugOverlay.d.ts +63 -0
- package/dist/types/debug/DebugOverlay.d.ts.map +1 -0
- package/dist/types/debug/DrawCallCounter.d.ts +20 -0
- package/dist/types/debug/DrawCallCounter.d.ts.map +1 -0
- package/dist/types/debug/ErrorLog.d.ts +20 -0
- package/dist/types/debug/ErrorLog.d.ts.map +1 -0
- package/dist/types/debug/FrameStats.d.ts +21 -0
- package/dist/types/debug/FrameStats.d.ts.map +1 -0
- package/dist/types/debug/inspectWorld.d.ts +14 -0
- package/dist/types/debug/inspectWorld.d.ts.map +1 -0
- package/dist/types/diagnostics/ErrorDeduper.d.ts +17 -0
- package/dist/types/diagnostics/ErrorDeduper.d.ts.map +1 -0
- package/dist/types/diagnostics/FrameSampler.d.ts +37 -0
- package/dist/types/diagnostics/FrameSampler.d.ts.map +1 -0
- package/dist/types/diagnostics/bootWatch.d.ts +25 -0
- package/dist/types/diagnostics/bootWatch.d.ts.map +1 -0
- package/dist/types/diagnostics/captureErrors.d.ts +24 -0
- package/dist/types/diagnostics/captureErrors.d.ts.map +1 -0
- package/dist/types/diagnostics/contextLoss.d.ts +35 -0
- package/dist/types/diagnostics/contextLoss.d.ts.map +1 -0
- package/dist/types/diagnostics/frameStats.d.ts +30 -0
- package/dist/types/diagnostics/frameStats.d.ts.map +1 -0
- package/dist/types/diagnostics/gpuInfo.d.ts +9 -0
- package/dist/types/diagnostics/gpuInfo.d.ts.map +1 -0
- package/dist/types/diagnostics/renderGuard.d.ts +12 -0
- package/dist/types/diagnostics/renderGuard.d.ts.map +1 -0
- package/dist/types/ecs/SparseSet.d.ts +25 -0
- package/dist/types/ecs/SparseSet.d.ts.map +1 -0
- package/dist/types/ecs/World.d.ts +137 -0
- package/dist/types/ecs/World.d.ts.map +1 -0
- package/dist/types/ecs/fields.d.ts +34 -0
- package/dist/types/ecs/fields.d.ts.map +1 -0
- package/dist/types/engine/Engine.d.ts +96 -0
- package/dist/types/engine/Engine.d.ts.map +1 -0
- package/dist/types/engine/FixedLoop.d.ts +32 -0
- package/dist/types/engine/FixedLoop.d.ts.map +1 -0
- package/dist/types/engine/HiddenPause.d.ts +22 -0
- package/dist/types/engine/HiddenPause.d.ts.map +1 -0
- package/dist/types/engine/Scene.d.ts +67 -0
- package/dist/types/engine/Scene.d.ts.map +1 -0
- package/dist/types/engine/SceneManager.d.ts +36 -0
- package/dist/types/engine/SceneManager.d.ts.map +1 -0
- package/dist/types/events/EventBus.d.ts +20 -0
- package/dist/types/events/EventBus.d.ts.map +1 -0
- package/dist/types/fx/Afterimages.d.ts +62 -0
- package/dist/types/fx/Afterimages.d.ts.map +1 -0
- package/dist/types/fx/FloatingText.d.ts +71 -0
- package/dist/types/fx/FloatingText.d.ts.map +1 -0
- package/dist/types/fx/hitStop.d.ts +20 -0
- package/dist/types/fx/hitStop.d.ts.map +1 -0
- package/dist/types/fx/viewCull.d.ts +14 -0
- package/dist/types/fx/viewCull.d.ts.map +1 -0
- package/dist/types/i18n/Translator.d.ts +52 -0
- package/dist/types/i18n/Translator.d.ts.map +1 -0
- package/dist/types/i18n/extractStrings.d.ts +25 -0
- package/dist/types/i18n/extractStrings.d.ts.map +1 -0
- package/dist/types/i18n/formatMessage.d.ts +10 -0
- package/dist/types/i18n/formatMessage.d.ts.map +1 -0
- package/dist/types/index.d.ts +164 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/input/Actions.d.ts +100 -0
- package/dist/types/input/Actions.d.ts.map +1 -0
- package/dist/types/input/AimGesture.d.ts +106 -0
- package/dist/types/input/AimGesture.d.ts.map +1 -0
- package/dist/types/input/Keyboard.d.ts +30 -0
- package/dist/types/input/Keyboard.d.ts.map +1 -0
- package/dist/types/input/Keymap.d.ts +85 -0
- package/dist/types/input/Keymap.d.ts.map +1 -0
- package/dist/types/input/TargetLock.d.ts +56 -0
- package/dist/types/input/TargetLock.d.ts.map +1 -0
- package/dist/types/input/aimAxis.d.ts +9 -0
- package/dist/types/input/aimAxis.d.ts.map +1 -0
- package/dist/types/input/keyChord.d.ts +15 -0
- package/dist/types/input/keyChord.d.ts.map +1 -0
- package/dist/types/input/longPress.d.ts +21 -0
- package/dist/types/input/longPress.d.ts.map +1 -0
- package/dist/types/input/rumble.d.ts +41 -0
- package/dist/types/input/rumble.d.ts.map +1 -0
- package/dist/types/input/stickAxis.d.ts +26 -0
- package/dist/types/input/stickAxis.d.ts.map +1 -0
- package/dist/types/input/touchDetect.d.ts +18 -0
- package/dist/types/input/touchDetect.d.ts.map +1 -0
- package/dist/types/light/LightLayer.d.ts +65 -0
- package/dist/types/light/LightLayer.d.ts.map +1 -0
- package/dist/types/nav/MinHeap.d.ts +15 -0
- package/dist/types/nav/MinHeap.d.ts.map +1 -0
- package/dist/types/nav/findPath.d.ts +38 -0
- package/dist/types/nav/findPath.d.ts.map +1 -0
- package/dist/types/nav/navGrid.d.ts +48 -0
- package/dist/types/nav/navGrid.d.ts.map +1 -0
- package/dist/types/nav/nearestOpen.d.ts +8 -0
- package/dist/types/nav/nearestOpen.d.ts.map +1 -0
- package/dist/types/nav/straightenPath.d.ts +13 -0
- package/dist/types/nav/straightenPath.d.ts.map +1 -0
- package/dist/types/net/Connection.d.ts +88 -0
- package/dist/types/net/Connection.d.ts.map +1 -0
- package/dist/types/net/InterpolationBuffer.d.ts +36 -0
- package/dist/types/net/InterpolationBuffer.d.ts.map +1 -0
- package/dist/types/net/PredictedMover.d.ts +43 -0
- package/dist/types/net/PredictedMover.d.ts.map +1 -0
- package/dist/types/net/Room.d.ts +69 -0
- package/dist/types/net/Room.d.ts.map +1 -0
- package/dist/types/net/RoomHost.d.ts +74 -0
- package/dist/types/net/RoomHost.d.ts.map +1 -0
- package/dist/types/net/cadence.d.ts +22 -0
- package/dist/types/net/cadence.d.ts.map +1 -0
- package/dist/types/net/constants.d.ts +33 -0
- package/dist/types/net/constants.d.ts.map +1 -0
- package/dist/types/net/lobby/LobbyClient.d.ts +107 -0
- package/dist/types/net/lobby/LobbyClient.d.ts.map +1 -0
- package/dist/types/net/lobby/LobbyHost.d.ts +147 -0
- package/dist/types/net/lobby/LobbyHost.d.ts.map +1 -0
- package/dist/types/net/lobby/LobbyRooms.d.ts +56 -0
- package/dist/types/net/lobby/LobbyRooms.d.ts.map +1 -0
- package/dist/types/net/lobby/Matchmaker.d.ts +57 -0
- package/dist/types/net/lobby/Matchmaker.d.ts.map +1 -0
- package/dist/types/net/lobby/index.d.ts +6 -0
- package/dist/types/net/lobby/index.d.ts.map +1 -0
- package/dist/types/net/lobby/lobbyProtocol.d.ts +143 -0
- package/dist/types/net/lobby/lobbyProtocol.d.ts.map +1 -0
- package/dist/types/net/movement.d.ts +50 -0
- package/dist/types/net/movement.d.ts.map +1 -0
- package/dist/types/net/protocol.d.ts +59 -0
- package/dist/types/net/protocol.d.ts.map +1 -0
- package/dist/types/net/reconnect.d.ts +14 -0
- package/dist/types/net/reconnect.d.ts.map +1 -0
- package/dist/types/net/serverClock.d.ts +14 -0
- package/dist/types/net/serverClock.d.ts.map +1 -0
- package/dist/types/net/snapshotCodec.d.ts +55 -0
- package/dist/types/net/snapshotCodec.d.ts.map +1 -0
- package/dist/types/parallax/Parallax.d.ts +37 -0
- package/dist/types/parallax/Parallax.d.ts.map +1 -0
- package/dist/types/parallax/ParallaxLayer.d.ts +80 -0
- package/dist/types/parallax/ParallaxLayer.d.ts.map +1 -0
- package/dist/types/parallax/parallaxMath.d.ts +50 -0
- package/dist/types/parallax/parallaxMath.d.ts.map +1 -0
- package/dist/types/particles/Emitter.d.ts +97 -0
- package/dist/types/particles/Emitter.d.ts.map +1 -0
- package/dist/types/particles/ParticleBudget.d.ts +28 -0
- package/dist/types/particles/ParticleBudget.d.ts.map +1 -0
- package/dist/types/particles/ParticleSim.d.ts +38 -0
- package/dist/types/particles/ParticleSim.d.ts.map +1 -0
- package/dist/types/particles/particleCurves.d.ts +21 -0
- package/dist/types/particles/particleCurves.d.ts.map +1 -0
- package/dist/types/particles/particleSampling.d.ts +20 -0
- package/dist/types/particles/particleSampling.d.ts.map +1 -0
- package/dist/types/physics/Body.d.ts +130 -0
- package/dist/types/physics/Body.d.ts.map +1 -0
- package/dist/types/physics/BroadPhase.d.ts +26 -0
- package/dist/types/physics/BroadPhase.d.ts.map +1 -0
- package/dist/types/physics/Contact.d.ts +62 -0
- package/dist/types/physics/Contact.d.ts.map +1 -0
- package/dist/types/physics/ContactSolver.d.ts +29 -0
- package/dist/types/physics/ContactSolver.d.ts.map +1 -0
- package/dist/types/physics/PhysicsWorld.d.ts +78 -0
- package/dist/types/physics/PhysicsWorld.d.ts.map +1 -0
- package/dist/types/physics/PhysicsWorldOptions.d.ts +24 -0
- package/dist/types/physics/PhysicsWorldOptions.d.ts.map +1 -0
- package/dist/types/physics/SpatialHash.d.ts +23 -0
- package/dist/types/physics/SpatialHash.d.ts.map +1 -0
- package/dist/types/physics/collide.d.ts +27 -0
- package/dist/types/physics/collide.d.ts.map +1 -0
- package/dist/types/physics/collidePolygon.d.ts +14 -0
- package/dist/types/physics/collidePolygon.d.ts.map +1 -0
- package/dist/types/physics/contactReport.d.ts +8 -0
- package/dist/types/physics/contactReport.d.ts.map +1 -0
- package/dist/types/physics/drawColliders.d.ts +43 -0
- package/dist/types/physics/drawColliders.d.ts.map +1 -0
- package/dist/types/physics/physicsSystem.d.ts +5 -0
- package/dist/types/physics/physicsSystem.d.ts.map +1 -0
- package/dist/types/physics/polygon.d.ts +28 -0
- package/dist/types/physics/polygon.d.ts.map +1 -0
- package/dist/types/physics/raycast.d.ts +19 -0
- package/dist/types/physics/raycast.d.ts.map +1 -0
- package/dist/types/physics/syncToBody.d.ts +16 -0
- package/dist/types/physics/syncToBody.d.ts.map +1 -0
- package/dist/types/physics/tileBodies.d.ts +36 -0
- package/dist/types/physics/tileBodies.d.ts.map +1 -0
- package/dist/types/physics/types.d.ts +116 -0
- package/dist/types/physics/types.d.ts.map +1 -0
- package/dist/types/pixel/Darkness.d.ts +90 -0
- package/dist/types/pixel/Darkness.d.ts.map +1 -0
- package/dist/types/pixel/DitherVignette.d.ts +35 -0
- package/dist/types/pixel/DitherVignette.d.ts.map +1 -0
- package/dist/types/pixel/Evaporation.d.ts +30 -0
- package/dist/types/pixel/Evaporation.d.ts.map +1 -0
- package/dist/types/pixel/NightShade.d.ts +38 -0
- package/dist/types/pixel/NightShade.d.ts.map +1 -0
- package/dist/types/pixel/PixelLayer.d.ts +85 -0
- package/dist/types/pixel/PixelLayer.d.ts.map +1 -0
- package/dist/types/pixel/PixelMarks.d.ts +68 -0
- package/dist/types/pixel/PixelMarks.d.ts.map +1 -0
- package/dist/types/pixel/SwayProp.d.ts +52 -0
- package/dist/types/pixel/SwayProp.d.ts.map +1 -0
- package/dist/types/pixel/aimPixels.d.ts +23 -0
- package/dist/types/pixel/aimPixels.d.ts.map +1 -0
- package/dist/types/pixel/index.d.ts +33 -0
- package/dist/types/pixel/index.d.ts.map +1 -0
- package/dist/types/pixel/lights.d.ts +34 -0
- package/dist/types/pixel/lights.d.ts.map +1 -0
- package/dist/types/pixel/nineSlice.d.ts +71 -0
- package/dist/types/pixel/nineSlice.d.ts.map +1 -0
- package/dist/types/pixel/paintLayer.d.ts +35 -0
- package/dist/types/pixel/paintLayer.d.ts.map +1 -0
- package/dist/types/pixel/palette.d.ts +58 -0
- package/dist/types/pixel/palette.d.ts.map +1 -0
- package/dist/types/pixel/pixel.d.ts +80 -0
- package/dist/types/pixel/pixel.d.ts.map +1 -0
- package/dist/types/pixel/pixelPaint.d.ts +44 -0
- package/dist/types/pixel/pixelPaint.d.ts.map +1 -0
- package/dist/types/pixel/pixelParticles.d.ts +21 -0
- package/dist/types/pixel/pixelParticles.d.ts.map +1 -0
- package/dist/types/pixel/pixelTone.d.ts +51 -0
- package/dist/types/pixel/pixelTone.d.ts.map +1 -0
- package/dist/types/pixel/propKit.d.ts +26 -0
- package/dist/types/pixel/propKit.d.ts.map +1 -0
- package/dist/types/pixel/ramp.d.ts +57 -0
- package/dist/types/pixel/ramp.d.ts.map +1 -0
- package/dist/types/pixel/selout.d.ts +3 -0
- package/dist/types/pixel/selout.d.ts.map +1 -0
- package/dist/types/pixel/spritePixels.d.ts +29 -0
- package/dist/types/pixel/spritePixels.d.ts.map +1 -0
- package/dist/types/pixel/swayRig.d.ts +72 -0
- package/dist/types/pixel/swayRig.d.ts.map +1 -0
- package/dist/types/pixel/vignetteMask.d.ts +16 -0
- package/dist/types/pixel/vignetteMask.d.ts.map +1 -0
- package/dist/types/pixel/weatherArt.d.ts +29 -0
- package/dist/types/pixel/weatherArt.d.ts.map +1 -0
- package/dist/types/platform/appResume.d.ts +25 -0
- package/dist/types/platform/appResume.d.ts.map +1 -0
- package/dist/types/platform/fullscreen.d.ts +37 -0
- package/dist/types/platform/fullscreen.d.ts.map +1 -0
- package/dist/types/platform/orientation.d.ts +19 -0
- package/dist/types/platform/orientation.d.ts.map +1 -0
- package/dist/types/platform/pointerLock.d.ts +26 -0
- package/dist/types/platform/pointerLock.d.ts.map +1 -0
- package/dist/types/platform/reducedMotion.d.ts +20 -0
- package/dist/types/platform/reducedMotion.d.ts.map +1 -0
- package/dist/types/platform/timeoutSignal.d.ts +6 -0
- package/dist/types/platform/timeoutSignal.d.ts.map +1 -0
- package/dist/types/platform/touch.d.ts +10 -0
- package/dist/types/platform/touch.d.ts.map +1 -0
- package/dist/types/postfx/BloomFilter.d.ts +33 -0
- package/dist/types/postfx/BloomFilter.d.ts.map +1 -0
- package/dist/types/postfx/ChromaticAberrationFilter.d.ts +11 -0
- package/dist/types/postfx/ChromaticAberrationFilter.d.ts.map +1 -0
- package/dist/types/postfx/ColorAdjustFilter.d.ts +32 -0
- package/dist/types/postfx/ColorAdjustFilter.d.ts.map +1 -0
- package/dist/types/postfx/CrtFilter.d.ts +16 -0
- package/dist/types/postfx/CrtFilter.d.ts.map +1 -0
- package/dist/types/postfx/PixelateFilter.d.ts +8 -0
- package/dist/types/postfx/PixelateFilter.d.ts.map +1 -0
- package/dist/types/postfx/PostFx.d.ts +92 -0
- package/dist/types/postfx/PostFx.d.ts.map +1 -0
- package/dist/types/postfx/ShockwaveFilter.d.ts +20 -0
- package/dist/types/postfx/ShockwaveFilter.d.ts.map +1 -0
- package/dist/types/postfx/VignetteFilter.d.ts +19 -0
- package/dist/types/postfx/VignetteFilter.d.ts.map +1 -0
- package/dist/types/postfx/fxAnimator.d.ts +32 -0
- package/dist/types/postfx/fxAnimator.d.ts.map +1 -0
- package/dist/types/postfx/fxShader.d.ts +49 -0
- package/dist/types/postfx/fxShader.d.ts.map +1 -0
- package/dist/types/postfx/index.d.ts +11 -0
- package/dist/types/postfx/index.d.ts.map +1 -0
- package/dist/types/react/ChoiceDialog.d.ts +8 -0
- package/dist/types/react/ChoiceDialog.d.ts.map +1 -0
- package/dist/types/react/ConfirmDialog.d.ts +9 -0
- package/dist/types/react/ConfirmDialog.d.ts.map +1 -0
- package/dist/types/react/Glyph.d.ts +54 -0
- package/dist/types/react/Glyph.d.ts.map +1 -0
- package/dist/types/react/Modal.d.ts +22 -0
- package/dist/types/react/Modal.d.ts.map +1 -0
- package/dist/types/react/Panel.d.ts +29 -0
- package/dist/types/react/Panel.d.ts.map +1 -0
- package/dist/types/react/PixelImage.d.ts +19 -0
- package/dist/types/react/PixelImage.d.ts.map +1 -0
- package/dist/types/react/Select.d.ts +27 -0
- package/dist/types/react/Select.d.ts.map +1 -0
- package/dist/types/react/Slider.d.ts +24 -0
- package/dist/types/react/Slider.d.ts.map +1 -0
- package/dist/types/react/SplitPane.d.ts +26 -0
- package/dist/types/react/SplitPane.d.ts.map +1 -0
- package/dist/types/react/TabStrip.d.ts +31 -0
- package/dist/types/react/TabStrip.d.ts.map +1 -0
- package/dist/types/react/TitleTips.d.ts +15 -0
- package/dist/types/react/TitleTips.d.ts.map +1 -0
- package/dist/types/react/Tooltip.d.ts +22 -0
- package/dist/types/react/Tooltip.d.ts.map +1 -0
- package/dist/types/react/UiProvider.d.ts +52 -0
- package/dist/types/react/UiProvider.d.ts.map +1 -0
- package/dist/types/react/baseCss.d.ts +27 -0
- package/dist/types/react/baseCss.d.ts.map +1 -0
- package/dist/types/react/choiceStore.d.ts +34 -0
- package/dist/types/react/choiceStore.d.ts.map +1 -0
- package/dist/types/react/classNames.d.ts +12 -0
- package/dist/types/react/classNames.d.ts.map +1 -0
- package/dist/types/react/confirmStore.d.ts +30 -0
- package/dist/types/react/confirmStore.d.ts.map +1 -0
- package/dist/types/react/index.d.ts +33 -0
- package/dist/types/react/index.d.ts.map +1 -0
- package/dist/types/react/labels.d.ts +24 -0
- package/dist/types/react/labels.d.ts.map +1 -0
- package/dist/types/react/placement.d.ts +59 -0
- package/dist/types/react/placement.d.ts.map +1 -0
- package/dist/types/react/useFillSheet.d.ts +9 -0
- package/dist/types/react/useFillSheet.d.ts.map +1 -0
- package/dist/types/react/useFitToViewport.d.ts +20 -0
- package/dist/types/react/useFitToViewport.d.ts.map +1 -0
- package/dist/types/react/usePicked.d.ts +9 -0
- package/dist/types/react/usePicked.d.ts.map +1 -0
- package/dist/types/react/useStore.d.ts +8 -0
- package/dist/types/react/useStore.d.ts.map +1 -0
- package/dist/types/react/useViewport.d.ts +4 -0
- package/dist/types/react/useViewport.d.ts.map +1 -0
- package/dist/types/rig/PosePlayer.d.ts +64 -0
- package/dist/types/rig/PosePlayer.d.ts.map +1 -0
- package/dist/types/rig/RigView.d.ts +68 -0
- package/dist/types/rig/RigView.d.ts.map +1 -0
- package/dist/types/rig/Skeleton.d.ts +14 -0
- package/dist/types/rig/Skeleton.d.ts.map +1 -0
- package/dist/types/rig/humanoid.d.ts +4 -0
- package/dist/types/rig/humanoid.d.ts.map +1 -0
- package/dist/types/rig/humanoidPoses.d.ts +117 -0
- package/dist/types/rig/humanoidPoses.d.ts.map +1 -0
- package/dist/types/rig/poseMath.d.ts +14 -0
- package/dist/types/rig/poseMath.d.ts.map +1 -0
- package/dist/types/rig/rigTypes.d.ts +82 -0
- package/dist/types/rig/rigTypes.d.ts.map +1 -0
- package/dist/types/save/Autosaver.d.ts +43 -0
- package/dist/types/save/Autosaver.d.ts.map +1 -0
- package/dist/types/save/MemoryBackend.d.ts +10 -0
- package/dist/types/save/MemoryBackend.d.ts.map +1 -0
- package/dist/types/save/SaveBackend.d.ts +14 -0
- package/dist/types/save/SaveBackend.d.ts.map +1 -0
- package/dist/types/save/SaveStore.d.ts +73 -0
- package/dist/types/save/SaveStore.d.ts.map +1 -0
- package/dist/types/save/WebStorageBackend.d.ts +14 -0
- package/dist/types/save/WebStorageBackend.d.ts.map +1 -0
- package/dist/types/save/checksum.d.ts +7 -0
- package/dist/types/save/checksum.d.ts.map +1 -0
- package/dist/types/save/migrateSave.d.ts +17 -0
- package/dist/types/save/migrateSave.d.ts.map +1 -0
- package/dist/types/settings.d.ts +25 -0
- package/dist/types/settings.d.ts.map +1 -0
- package/dist/types/tilemap/TilemapView.d.ts +42 -0
- package/dist/types/tilemap/TilemapView.d.ts.map +1 -0
- package/dist/types/tilemap/collision.d.ts +16 -0
- package/dist/types/tilemap/collision.d.ts.map +1 -0
- package/dist/types/tilemap/tiled.d.ts +104 -0
- package/dist/types/tilemap/tiled.d.ts.map +1 -0
- package/dist/types/transitions/CrossfadeTransition.d.ts +20 -0
- package/dist/types/transitions/CrossfadeTransition.d.ts.map +1 -0
- package/dist/types/transitions/DitherWipeTransition.d.ts +35 -0
- package/dist/types/transitions/DitherWipeTransition.d.ts.map +1 -0
- package/dist/types/transitions/FadeTransition.d.ts +20 -0
- package/dist/types/transitions/FadeTransition.d.ts.map +1 -0
- package/dist/types/transitions/Letterbox.d.ts +33 -0
- package/dist/types/transitions/Letterbox.d.ts.map +1 -0
- package/dist/types/transitions/Transition.d.ts +22 -0
- package/dist/types/transitions/Transition.d.ts.map +1 -0
- package/dist/types/transitions/ditherMask.d.ts +13 -0
- package/dist/types/transitions/ditherMask.d.ts.map +1 -0
- package/dist/types/transitions/transitionTo.d.ts +16 -0
- package/dist/types/transitions/transitionTo.d.ts.map +1 -0
- package/dist/types/transitions/tweenDone.d.ts +5 -0
- package/dist/types/transitions/tweenDone.d.ts.map +1 -0
- package/dist/types/ui/Bar.d.ts +41 -0
- package/dist/types/ui/Bar.d.ts.map +1 -0
- package/dist/types/ui/Button.d.ts +47 -0
- package/dist/types/ui/Button.d.ts.map +1 -0
- package/dist/types/ui/Dialog.d.ts +47 -0
- package/dist/types/ui/Dialog.d.ts.map +1 -0
- package/dist/types/ui/FocusManager.d.ts +53 -0
- package/dist/types/ui/FocusManager.d.ts.map +1 -0
- package/dist/types/ui/Label.d.ts +24 -0
- package/dist/types/ui/Label.d.ts.map +1 -0
- package/dist/types/ui/List.d.ts +23 -0
- package/dist/types/ui/List.d.ts.map +1 -0
- package/dist/types/ui/Panel.d.ts +38 -0
- package/dist/types/ui/Panel.d.ts.map +1 -0
- package/dist/types/ui/ScrollView.d.ts +56 -0
- package/dist/types/ui/ScrollView.d.ts.map +1 -0
- package/dist/types/ui/Slider.d.ts +47 -0
- package/dist/types/ui/Slider.d.ts.map +1 -0
- package/dist/types/ui/Stack.d.ts +16 -0
- package/dist/types/ui/Stack.d.ts.map +1 -0
- package/dist/types/ui/Toggle.d.ts +31 -0
- package/dist/types/ui/Toggle.d.ts.map +1 -0
- package/dist/types/ui/UiHost.d.ts +18 -0
- package/dist/types/ui/UiHost.d.ts.map +1 -0
- package/dist/types/ui/UiPointerGate.d.ts +17 -0
- package/dist/types/ui/UiPointerGate.d.ts.map +1 -0
- package/dist/types/ui/UiRoot.d.ts +73 -0
- package/dist/types/ui/UiRoot.d.ts.map +1 -0
- package/dist/types/ui/Widget.d.ts +56 -0
- package/dist/types/ui/Widget.d.ts.map +1 -0
- package/dist/types/ui/dom/DomOverlay.d.ts +52 -0
- package/dist/types/ui/dom/DomOverlay.d.ts.map +1 -0
- package/dist/types/ui/dom/DomWorldAnchors.d.ts +50 -0
- package/dist/types/ui/dom/DomWorldAnchors.d.ts.map +1 -0
- package/dist/types/ui/dom/InputShield.d.ts +20 -0
- package/dist/types/ui/dom/InputShield.d.ts.map +1 -0
- package/dist/types/ui/dom/createStore.d.ts +22 -0
- package/dist/types/ui/dom/createStore.d.ts.map +1 -0
- package/dist/types/ui/dom/shieldDecision.d.ts +34 -0
- package/dist/types/ui/dom/shieldDecision.d.ts.map +1 -0
- package/dist/types/ui/dom/worldToScreen.d.ts +24 -0
- package/dist/types/ui/dom/worldToScreen.d.ts.map +1 -0
- package/dist/types/ui/index.d.ts +42 -0
- package/dist/types/ui/index.d.ts.map +1 -0
- package/dist/types/ui/layout/anchor.d.ts +9 -0
- package/dist/types/ui/layout/anchor.d.ts.map +1 -0
- package/dist/types/ui/layout/barDrain.d.ts +25 -0
- package/dist/types/ui/layout/barDrain.d.ts.map +1 -0
- package/dist/types/ui/layout/fitToViewport.d.ts +32 -0
- package/dist/types/ui/layout/fitToViewport.d.ts.map +1 -0
- package/dist/types/ui/layout/focusNav.d.ts +13 -0
- package/dist/types/ui/layout/focusNav.d.ts.map +1 -0
- package/dist/types/ui/layout/geometry.d.ts +35 -0
- package/dist/types/ui/layout/geometry.d.ts.map +1 -0
- package/dist/types/ui/layout/listWidth.d.ts +13 -0
- package/dist/types/ui/layout/listWidth.d.ts.map +1 -0
- package/dist/types/ui/layout/placeTooltip.d.ts +23 -0
- package/dist/types/ui/layout/placeTooltip.d.ts.map +1 -0
- package/dist/types/ui/layout/scroll.d.ts +17 -0
- package/dist/types/ui/layout/scroll.d.ts.map +1 -0
- package/dist/types/ui/layout/slider.d.ts +7 -0
- package/dist/types/ui/layout/slider.d.ts.map +1 -0
- package/dist/types/ui/layout/stack.d.ts +26 -0
- package/dist/types/ui/layout/stack.d.ts.map +1 -0
- package/dist/types/ui/layout/wrapRow.d.ts +6 -0
- package/dist/types/ui/layout/wrapRow.d.ts.map +1 -0
- package/dist/types/ui/rich/RichText.d.ts +48 -0
- package/dist/types/ui/rich/RichText.d.ts.map +1 -0
- package/dist/types/ui/rich/richFonts.d.ts +70 -0
- package/dist/types/ui/rich/richFonts.d.ts.map +1 -0
- package/dist/types/ui/rich/richLayout.d.ts +76 -0
- package/dist/types/ui/rich/richLayout.d.ts.map +1 -0
- package/dist/types/ui/rich/richMarkup.d.ts +48 -0
- package/dist/types/ui/rich/richMarkup.d.ts.map +1 -0
- package/dist/ui/Bar.js +53 -0
- package/dist/ui/Button.js +57 -0
- package/dist/ui/Dialog.js +55 -0
- package/dist/ui/FocusManager.js +96 -0
- package/dist/ui/Label.js +35 -0
- package/dist/ui/List.js +44 -0
- package/dist/ui/Panel.js +37 -0
- package/dist/ui/ScrollView.js +95 -0
- package/dist/ui/Slider.js +54 -0
- package/dist/ui/Stack.js +27 -0
- package/dist/ui/Toggle.js +36 -0
- package/dist/ui/UiHost.js +8 -0
- package/dist/ui/UiPointerGate.js +24 -0
- package/dist/ui/UiRoot.js +92 -0
- package/dist/ui/Widget.js +89 -0
- package/dist/ui/dom/DomOverlay.js +58 -0
- package/dist/ui/dom/DomWorldAnchors.js +58 -0
- package/dist/ui/dom/InputShield.js +26 -0
- package/dist/ui/dom/createStore.js +41 -0
- package/dist/ui/dom/shieldDecision.js +35 -0
- package/dist/ui/dom/worldToScreen.js +10 -0
- package/dist/ui/layout/anchor.js +19 -0
- package/dist/ui/layout/barDrain.js +24 -0
- package/dist/ui/layout/fitToViewport.js +16 -0
- package/dist/ui/layout/focusNav.js +41 -0
- package/dist/ui/layout/geometry.js +20 -0
- package/dist/ui/layout/listWidth.js +9 -0
- package/dist/ui/layout/placeTooltip.js +27 -0
- package/dist/ui/layout/scroll.js +23 -0
- package/dist/ui/layout/slider.js +19 -0
- package/dist/ui/layout/stack.js +26 -0
- package/dist/ui/layout/wrapRow.js +12 -0
- package/dist/ui/rich/RichText.js +87 -0
- package/dist/ui/rich/richFonts.js +105 -0
- package/dist/ui/rich/richLayout.js +132 -0
- package/dist/ui/rich/richMarkup.js +67 -0
- package/dist/ui.js +95 -0
- package/package.json +112 -4
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The drag-to-aim gesture of a touch skill button (the MOBA way), kept pure so it can be tested. Pressing an aimed
|
|
3
|
+
* button opens a circle round it with a knob under the thumb; where the knob sits in that circle is where the skill
|
|
4
|
+
* goes. A press that never wanders past the tap slop is a tap (the game casts it the way a tap always does: at the
|
|
5
|
+
* locked target, the nearest enemy, the facing). Letting go over a cancel zone casts nothing; letting go with the knob
|
|
6
|
+
* back on the button casts as a tap, or cancels when `centreCancels` (the one way to cancel when there is no zone).
|
|
7
|
+
*
|
|
8
|
+
* The thumb gets a longer slop in the first `pressMs` of a press: a hard press slides as it lands, and a quick tap
|
|
9
|
+
* that slid past the plain slop became a drag that flew wherever the slide pointed.
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* const g = new AimGesture({ radius: 90, centreCancels: !hasCancelZone });
|
|
13
|
+
* // pointermove: g.move(dx, dy, overCancelZone, now - downAt)
|
|
14
|
+
* // pointerup: const end = g.up(); // 'tap' | 'cast' | 'cancel'
|
|
15
|
+
* // while g.aiming, draw the aim from aimPoint(caster, shape, g.share, facing)
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export type AimEnd = 'tap' | 'cast' | 'cancel';
|
|
19
|
+
export interface AimGestureOptions {
|
|
20
|
+
/** The circle's radius, in the same units as the thumb's offsets (CSS px). */
|
|
21
|
+
radius: number;
|
|
22
|
+
/** Scales the thumb's travel into the knob's (a sensitivity setting); the slops stay the thumb's own (default 1). */
|
|
23
|
+
sensitivity?: number;
|
|
24
|
+
/** The knob let go back on the button cancels rather than casting as a tap (default true). */
|
|
25
|
+
centreCancels?: boolean;
|
|
26
|
+
/** How far the thumb may wander before a press is a drag (default 10). */
|
|
27
|
+
tapSlop?: number;
|
|
28
|
+
/** The slop in a press's first `pressMs` (default 28). */
|
|
29
|
+
earlySlop?: number;
|
|
30
|
+
/** How long a press is "landing" (default 180 ms). */
|
|
31
|
+
pressMs?: number;
|
|
32
|
+
/** Inside this share of the radius the knob is back on the button (default 0.2). */
|
|
33
|
+
centre?: number;
|
|
34
|
+
}
|
|
35
|
+
export declare const AIM_TAP_SLOP = 10;
|
|
36
|
+
export declare const AIM_EARLY_SLOP = 28;
|
|
37
|
+
export declare const AIM_PRESS_MS = 180;
|
|
38
|
+
export declare const AIM_CENTRE = 0.2;
|
|
39
|
+
/**
|
|
40
|
+
* How far the thumb must wander, `ms` into a press, before it drags. `early` false keeps the plain slop throughout
|
|
41
|
+
* (an attack button with nothing locked: there a slide is as good as a drag).
|
|
42
|
+
*/
|
|
43
|
+
export declare function dragSlop(ms: number, early?: boolean, tapSlop?: number, earlySlop?: number, pressMs?: number): number;
|
|
44
|
+
type Point = {
|
|
45
|
+
x: number;
|
|
46
|
+
y: number;
|
|
47
|
+
};
|
|
48
|
+
export declare class AimGesture {
|
|
49
|
+
private dragged;
|
|
50
|
+
private over;
|
|
51
|
+
/** Where the knob is drawn, clamped to the circle, relative to the button's centre. */
|
|
52
|
+
knob: Point;
|
|
53
|
+
/** The knob as a vector of length ≤ 1: what the world reads. */
|
|
54
|
+
share: Point;
|
|
55
|
+
private readonly radius;
|
|
56
|
+
private readonly sensitivity;
|
|
57
|
+
private readonly centreCancels;
|
|
58
|
+
private readonly tapSlop;
|
|
59
|
+
private readonly earlySlop;
|
|
60
|
+
private readonly pressMs;
|
|
61
|
+
private readonly centre;
|
|
62
|
+
constructor(options: AimGestureOptions);
|
|
63
|
+
/**
|
|
64
|
+
* The thumb at `rawX, rawY` from the button's centre, `overCancel` when it is over the cancel zone, `ms` since it
|
|
65
|
+
* went down (Infinity skips the landing slop). Once a drag, always a drag for this press.
|
|
66
|
+
*/
|
|
67
|
+
move(rawX: number, rawY: number, overCancel?: boolean, ms?: number): void;
|
|
68
|
+
/** A drag has begun: show the aim from now on. */
|
|
69
|
+
get aiming(): boolean;
|
|
70
|
+
private get centred();
|
|
71
|
+
/** Letting go now would cast nothing (draw the cancel zone lit). */
|
|
72
|
+
get cancelling(): boolean;
|
|
73
|
+
up(): AimEnd;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* How a skill is aimed: at a spot within `range` (a blast, a blink), or along a direction for `length` (a shot, a
|
|
77
|
+
* dash; `backwards` for a leap away from the aim).
|
|
78
|
+
*/
|
|
79
|
+
export type AimShape = {
|
|
80
|
+
kind: 'point';
|
|
81
|
+
range: number;
|
|
82
|
+
} | {
|
|
83
|
+
kind: 'direction';
|
|
84
|
+
length: number;
|
|
85
|
+
backwards?: boolean;
|
|
86
|
+
snap?: number;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* How far out a spot skill's knob puts it, as a share of its range: from the centre ring's edge to the rim is the
|
|
90
|
+
* whole reach, so a knob just out of the ring lands at the caster's feet — with `share × range`, nothing nearer than
|
|
91
|
+
* the ring could ever be reached.
|
|
92
|
+
*/
|
|
93
|
+
export declare function spotReach(len: number, centre?: number): number;
|
|
94
|
+
/** The knob that puts a spot skill `dx, dy` from the caster: `spotReach`'s inverse (aim assist, replays). */
|
|
95
|
+
export declare function spotShare(dx: number, dy: number, range: number, centre?: number): Point;
|
|
96
|
+
/**
|
|
97
|
+
* Where an aimed skill goes, as a mouse would have said it: the aim angle and the ground point. A knob with no length
|
|
98
|
+
* keeps `lastAim`. A direction may snap to `snap` radians (0 or none for free aim).
|
|
99
|
+
*/
|
|
100
|
+
export declare function aimPoint(from: Point, shape: AimShape, share: Point, lastAim: number, centre?: number): {
|
|
101
|
+
aim: number;
|
|
102
|
+
x: number;
|
|
103
|
+
y: number;
|
|
104
|
+
};
|
|
105
|
+
export {};
|
|
106
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;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAUhJ"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which keys are held, by `KeyboardEvent.code` (the physical key, so WASD stays WASD on any layout). `pressed` and
|
|
3
|
+
* `released` report edges since the last `endStep`; call that once per simulation step so a tap shorter than a frame
|
|
4
|
+
* is still seen by exactly one step.
|
|
5
|
+
*
|
|
6
|
+
* It only knows keys pressed **after** it was made: a key already held when it is created (the Enter that started a
|
|
7
|
+
* level, held into it) is not down here until it is pressed again. A scene that makes its own keyboard in a field
|
|
8
|
+
* therefore starts with every key up, which is usually what a new screen wants; share one keyboard across scenes when
|
|
9
|
+
* a held key must carry over. Modifier keys are ordinary codes here (`ShiftLeft`); `Actions` reads chords from them.
|
|
10
|
+
*/
|
|
11
|
+
export declare class Keyboard {
|
|
12
|
+
private readonly held;
|
|
13
|
+
private readonly down;
|
|
14
|
+
private readonly up;
|
|
15
|
+
private readonly cleanup;
|
|
16
|
+
constructor(target?: Window | HTMLElement);
|
|
17
|
+
isDown(code: string): boolean;
|
|
18
|
+
/** Any of these keys is held. */
|
|
19
|
+
anyDown(...codes: string[]): boolean;
|
|
20
|
+
/** Went down since the last `endStep`. */
|
|
21
|
+
pressed(code: string): boolean;
|
|
22
|
+
/** Came up since the last `endStep`. */
|
|
23
|
+
released(code: string): boolean;
|
|
24
|
+
/** -1, 0 or 1 from two sets of keys: `axis(['KeyA', 'ArrowLeft'], ['KeyD', 'ArrowRight'])`. */
|
|
25
|
+
axis(negative: string[], positive: string[]): number;
|
|
26
|
+
/** Forgets this step's edges; held keys stay held. */
|
|
27
|
+
endStep(): void;
|
|
28
|
+
destroy(): void;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=Keyboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Keyboard.d.ts","sourceRoot":"","sources":["../../../src/input/Keyboard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAqB;IAC1C,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAqB;IAC1C,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAqB;IACxC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAsB;gBAElC,MAAM,GAAE,MAAM,GAAG,WAAoB;IA2BjD,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI7B,iCAAiC;IACjC,OAAO,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO;IAIpC,0CAA0C;IAC1C,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI9B,wCAAwC;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI/B,+FAA+F;IAC/F,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM;IAIpD,sDAAsD;IACtD,OAAO,IAAI,IAAI;IAKf,OAAO,IAAI,IAAI;CAKhB"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { Actions } from './Actions.js';
|
|
2
|
+
/**
|
|
3
|
+
* Which keys each action sits on, as the player has rebound them: one table the input, the key hints on screen and
|
|
4
|
+
* a settings screen all read. A binding is a `KeyboardEvent.code` (`KeyW`, `Digit1`), so it means the same physical
|
|
5
|
+
* key on every layout. Each action keeps a list (W and ArrowUp, 1 and Q); a settings screen edits the **first** and
|
|
6
|
+
* leaves the alternates alone.
|
|
7
|
+
*
|
|
8
|
+
* Two rules: one key serves one action at a time (a key bound twice would fire both, and the player could not tell
|
|
9
|
+
* which they meant), and reserved keys (Escape, Enter, Tab by default: the interface's own) are never taken.
|
|
10
|
+
*
|
|
11
|
+
* Inputs the player cannot rebind — the gamepad's, a touch button, a reserved key an action should still answer to
|
|
12
|
+
* (Escape also pausing) — are the keymap's **fixed** inputs: given once to the constructor, laid after the player's
|
|
13
|
+
* keys by `applyTo`, and untouched by either rule above.
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* const keys = new Keymap({ jump: ['Space'], left: ['KeyA', 'ArrowLeft'], pause: ['KeyP'] }, undefined, { jump: ['pad:a'], pause: ['Escape'] });
|
|
17
|
+
* keys.load(keymapStorage('my-game.keys').read());
|
|
18
|
+
* keys.onChange(() => { keys.applyTo(actions); storage.write(keys.toJSON()); });
|
|
19
|
+
* keys.bind('pause', 'KeyA'); // 'left' keeps only ArrowLeft
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare class Keymap<A extends string> {
|
|
23
|
+
private binds;
|
|
24
|
+
private readonly defaults;
|
|
25
|
+
private readonly reserved;
|
|
26
|
+
private readonly fixed;
|
|
27
|
+
private readonly listeners;
|
|
28
|
+
/**
|
|
29
|
+
* `reserved`: keys never bound (default Escape, Enter, Tab; pass `undefined` for the default). `fixed`: inputs each
|
|
30
|
+
* action always has besides the player's keys (gamepad, touch, a reserved key), never saved or rebound.
|
|
31
|
+
*/
|
|
32
|
+
constructor(defaults: Readonly<Record<A, readonly string[]>>, reserved?: Iterable<string>, fixed?: Partial<Record<A, readonly string[]>>);
|
|
33
|
+
private fresh;
|
|
34
|
+
/** Every action, in the order the defaults named them. */
|
|
35
|
+
actions(): A[];
|
|
36
|
+
isReserved(code: string): boolean;
|
|
37
|
+
/** The keys of one action; the first is the one a settings screen shows and edits. */
|
|
38
|
+
keysFor(action: A): readonly string[];
|
|
39
|
+
/** The inputs an action always has besides the player's keys (the constructor's `fixed`). */
|
|
40
|
+
fixedFor(action: A): readonly string[];
|
|
41
|
+
/** Which action a key belongs to, or undefined. */
|
|
42
|
+
actionFor(code: string): A | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Puts `code` first on `action`, taking it off whatever else held it; returns the actions that lost it (to tell the
|
|
45
|
+
* player). A reserved key is refused (returns null). An action stripped of its last key keeps none: it is unbound
|
|
46
|
+
* until something is put back on it.
|
|
47
|
+
*/
|
|
48
|
+
bind(action: A, code: string): A[] | null;
|
|
49
|
+
/** Takes every key off `action`. */
|
|
50
|
+
unbind(action: A): void;
|
|
51
|
+
/** Every action back on its defaults. */
|
|
52
|
+
reset(): void;
|
|
53
|
+
/** A plain object to store wherever the game keeps its settings. */
|
|
54
|
+
toJSON(): Record<A, string[]>;
|
|
55
|
+
/**
|
|
56
|
+
* A saved set laid over this build's defaults. Only actions this build knows are read, so an old save cannot leave
|
|
57
|
+
* a key bound to nothing; an action newer than the save keeps its defaults only where no saved action holds that key
|
|
58
|
+
* (the saved one is what the player chose). Anything malformed is ignored.
|
|
59
|
+
*/
|
|
60
|
+
load(saved: unknown): void;
|
|
61
|
+
/**
|
|
62
|
+
* Hands the bindings to an `Actions`: each action's keys, then its fixed inputs, then its `extra` ones. Only the
|
|
63
|
+
* keymap's actions are bound, so the `Actions` may hold more (menu actions alongside the rebindable ones, each on
|
|
64
|
+
* its own fixed inputs); those are left as they are. Fixed and extra inputs are the game's, so neither the reserved
|
|
65
|
+
* keys nor one-key-one-action apply to them.
|
|
66
|
+
*/
|
|
67
|
+
applyTo<B extends string>(actions: Actions<A | B>, extra?: Partial<Record<A, readonly string[]>>): void;
|
|
68
|
+
/** Called after every change; returns a function that stops it. */
|
|
69
|
+
onChange(fn: () => void): () => void;
|
|
70
|
+
private changed;
|
|
71
|
+
}
|
|
72
|
+
/** `saved` laid over `defaults` by `Keymap.load`'s rules, as a fresh object. */
|
|
73
|
+
export declare function mergeKeymap<A extends string>(defaults: Readonly<Record<A, readonly string[]>>, saved: unknown, reserved?: ReadonlySet<string>): Record<A, string[]>;
|
|
74
|
+
/** A place to keep a keymap in the browser, under a key the game names; every failure falls back quietly. */
|
|
75
|
+
export declare function keymapStorage(key: string): {
|
|
76
|
+
read(): unknown;
|
|
77
|
+
write(binds: object): void;
|
|
78
|
+
clear(): void;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* How a key code reads on screen: "KeyW" is W, "Digit1" is 1, "Numpad3" is "Num 3", a chord "Shift+Tab" each part in
|
|
82
|
+
* turn. `names` overrides any code or modifier (a game's own language for the arrows and modifiers).
|
|
83
|
+
*/
|
|
84
|
+
export declare function keyLabel(code: string, names?: Readonly<Record<string, string>>): string;
|
|
85
|
+
//# sourceMappingURL=Keymap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Keymap.d.ts","sourceRoot":"","sources":["../../../src/input/Keymap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,MAAM,CAAC,CAAC,SAAS,MAAM;IAClC,OAAO,CAAC,KAAK,CAAsB;IACnC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA+B;IACxD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAsB;IAC/C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAwC;IAC9D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAsB;IAEhD;;;OAGG;gBAED,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,EAChD,QAAQ,GAAE,QAAQ,CAAC,MAAM,CAA8B,EACvD,KAAK,GAAE,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC,CAAM;IAQnD,OAAO,CAAC,KAAK;IAMb,0DAA0D;IAC1D,OAAO,IAAI,CAAC,EAAE;IAId,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIjC,sFAAsF;IACtF,OAAO,CAAC,MAAM,EAAE,CAAC,GAAG,SAAS,MAAM,EAAE;IAIrC,6FAA6F;IAC7F,QAAQ,CAAC,MAAM,EAAE,CAAC,GAAG,SAAS,MAAM,EAAE;IAIt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C,IAAI,EAAE,MAAM,EAAE,KAAK,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM,GAAG,MAAM,CAQ3F"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Picking and holding a target on a touch screen, kept pure so it can be tested. Dragging an attack button points:
|
|
3
|
+
* the body lying closest to that direction is picked (and of two about as close to it, the nearer). A target button
|
|
4
|
+
* picks the nearest. The lock then holds — every attack, skill and the facing goes at it, even while a stick walks
|
|
5
|
+
* the body elsewhere — until that body is gone or leaves `keepRange`; a later drag that points at nothing keeps it.
|
|
6
|
+
*
|
|
7
|
+
* Bodies come from a callback as `{ id, x, y }`: the game decides what may be locked (monsters, a duel's opponent).
|
|
8
|
+
*/
|
|
9
|
+
export interface LockBody {
|
|
10
|
+
id: number;
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
}
|
|
14
|
+
type Point = {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
};
|
|
18
|
+
export declare const LOCK_PICK_RANGE = 220;
|
|
19
|
+
export declare const LOCK_KEEP_RANGE = 300;
|
|
20
|
+
/** Widest angle off the drag a body may stand and still be picked: 50° each side. */
|
|
21
|
+
export declare const LOCK_PICK_CONE: number;
|
|
22
|
+
/**
|
|
23
|
+
* The body a drag in direction `dir` (any length > 0) picks from `from`, or null. Scored by how far off the drag's
|
|
24
|
+
* line it stands, with distance as a lighter second weight, so a far body dead ahead beats a near one off to the side.
|
|
25
|
+
*/
|
|
26
|
+
export declare function pickTarget(from: Point, dir: Point, bodies: readonly LockBody[], range?: number, cone?: number): number | null;
|
|
27
|
+
/** The nearest body within `range` (ties to the lower id, so two clients pick alike), or null. */
|
|
28
|
+
export declare function nearestTarget(from: Point, bodies: readonly LockBody[], range?: number): number | null;
|
|
29
|
+
/** The locked body while the lock still holds (present, within `range`), else null. */
|
|
30
|
+
export declare function keptTarget<T extends LockBody>(from: Point, locked: number | null, bodies: readonly T[], range?: number): T | null;
|
|
31
|
+
export interface TargetLockOptions {
|
|
32
|
+
pickRange?: number;
|
|
33
|
+
keepRange?: number;
|
|
34
|
+
/** Half-angle (radians) a drag picks within. */
|
|
35
|
+
cone?: number;
|
|
36
|
+
}
|
|
37
|
+
/** The lock as state: which body is held, picked by a drag or the nearest, let go when it is gone or too far. */
|
|
38
|
+
export declare class TargetLock<T extends LockBody = LockBody> {
|
|
39
|
+
private readonly bodies;
|
|
40
|
+
private id;
|
|
41
|
+
private readonly pickRange;
|
|
42
|
+
private readonly keepRange;
|
|
43
|
+
private readonly cone;
|
|
44
|
+
constructor(bodies: () => readonly T[], options?: TargetLockOptions);
|
|
45
|
+
/** The id held, without checking it still stands (use `current` for that). */
|
|
46
|
+
get locked(): number | null;
|
|
47
|
+
/** A drag in `dir` from `from`: locks what it points at; pointing at nothing keeps the old lock. */
|
|
48
|
+
pick(from: Point, dir: Point): number | null;
|
|
49
|
+
/** Locks the nearest body, every call, whatever was held. */
|
|
50
|
+
pickNearest(from: Point): number | null;
|
|
51
|
+
/** The held body if it still holds; a lock that no longer does is dropped. */
|
|
52
|
+
current(from: Point): T | null;
|
|
53
|
+
clear(): void;
|
|
54
|
+
}
|
|
55
|
+
export {};
|
|
56
|
+
//# sourceMappingURL=TargetLock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TargetLock.d.ts","sourceRoot":"","sources":["../../../src/input/TargetLock.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,KAAK,KAAK,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtC,eAAO,MAAM,eAAe,MAAM,CAAC;AACnC,eAAO,MAAM,eAAe,MAAM,CA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GAAG,MAAM,GAAG,IAAI;IAM5C,6DAA6D;IAC7D,WAAW,CAAC,IAAI,EAAE,KAAK,GAAG,MAAM,GAAG,IAAI;IAKvC,8EAA8E;IAC9E,OAAO,CAAC,IAAI,EAAE,KAAK,GAAG,CAAC,GAAG,IAAI;IAM9B,KAAK,IAAI,IAAI;CAGd"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An aim turned into the eight-way axis the keyboard makes (each part -1, 0 or 1; `stepMover` scales a diagonal),
|
|
3
|
+
* so a step sent along it is one a key could have sent. A part counts once the aim leans past 22.5° towards it.
|
|
4
|
+
*/
|
|
5
|
+
export declare function aimAxis(aim: number): {
|
|
6
|
+
dx: number;
|
|
7
|
+
dy: number;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=aimAxis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aimAxis.d.ts","sourceRoot":"","sources":["../../../src/input/aimAxis.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAK/D"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A key binding with modifiers: `Shift+Tab`, `Ctrl+KeyS`, `Ctrl+Shift+KeyZ`. The last part is the key's
|
|
3
|
+
* `KeyboardEvent.code`; before it, any of `Shift`, `Ctrl`, `Alt`, `Meta`, either side of the keyboard counting.
|
|
4
|
+
* A chord matches while its key and every modifier it names are held; modifiers it does not name are not looked at.
|
|
5
|
+
*/
|
|
6
|
+
export interface KeyChord {
|
|
7
|
+
code: string;
|
|
8
|
+
/** The modifiers' key codes, each a pair: either one held counts. */
|
|
9
|
+
modifiers: readonly (readonly [string, string])[];
|
|
10
|
+
}
|
|
11
|
+
/** The chord a binding names, or null for a plain key (no `+`) or a malformed one (an unknown modifier). */
|
|
12
|
+
export declare function parseChord(binding: string): KeyChord | null;
|
|
13
|
+
/** Whether `chord` is held, given which keys are down. */
|
|
14
|
+
export declare function chordHeld(chord: KeyChord, down: (code: string) => boolean): boolean;
|
|
15
|
+
//# sourceMappingURL=keyChord.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyChord.d.ts","sourceRoot":"","sources":["../../../src/input/keyChord.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,qEAAqE;IACrE,SAAS,EAAE,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;CACnD;AASD,4GAA4G;AAC5G,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAY3D;AAED,0DAA0D;AAC1D,wBAAgB,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAAG,OAAO,CAInF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A long press, as pure timing so it can be tested: a finger that stays down `ms` without moving more than `slop`
|
|
3
|
+
* CSS px fires once, where it went down. A second finger, a move past the slop or a lift before the time is up is
|
|
4
|
+
* not a long press — a tap stays a tap. The caller owns the clock (`fire(now)` from a timer or a frame).
|
|
5
|
+
*/
|
|
6
|
+
export declare class LongPress {
|
|
7
|
+
readonly ms: number;
|
|
8
|
+
readonly slop: number;
|
|
9
|
+
private finger;
|
|
10
|
+
private done;
|
|
11
|
+
constructor(ms?: number, slop?: number);
|
|
12
|
+
down(id: number, x: number, y: number, now: number): void;
|
|
13
|
+
move(id: number, x: number, y: number): void;
|
|
14
|
+
up(id: number): void;
|
|
15
|
+
/** Where the press is, the first time this is asked at or after `ms`; null otherwise. */
|
|
16
|
+
fire(now: number): {
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
} | null;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=longPress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"longPress.d.ts","sourceRoot":"","sources":["../../../src/input/longPress.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qBAAa,SAAS;IAKlB,QAAQ,CAAC,EAAE;IACX,QAAQ,CAAC,IAAI;IALf,OAAO,CAAC,MAAM,CAAiE;IAC/E,OAAO,CAAC,IAAI,CAAS;gBAGV,EAAE,SAAM,EACR,IAAI,SAAK;IAGpB,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;IAWzD,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI;IAK5C,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAKpB,yFAAyF;IACzF,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;CAMnD"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gamepad rumble through the Gamepad Extensions' `vibrationActuator` (`'dual-rumble'`: Chrome, Edge, Firefox behind a
|
|
3
|
+
* flag, Safari 16.4+). A pad without one, a browser without the API, or a refusal is a silent no-op that resolves
|
|
4
|
+
* false: rumble is seasoning, never something a game should wait on or crash over.
|
|
5
|
+
*/
|
|
6
|
+
export interface RumbleOptions {
|
|
7
|
+
/** The low-frequency (heavy) motor, 0–1 (default 0). */
|
|
8
|
+
strong?: number;
|
|
9
|
+
/** The high-frequency (light) motor, 0–1 (default 0). */
|
|
10
|
+
weak?: number;
|
|
11
|
+
/** How long it shakes (ms, default 200). */
|
|
12
|
+
durationMs?: number;
|
|
13
|
+
/** Wait before starting (ms, default 0). */
|
|
14
|
+
startDelayMs?: number;
|
|
15
|
+
}
|
|
16
|
+
/** What rumble needs of a pad; `navigator.getGamepads()` entries satisfy it where the API exists. */
|
|
17
|
+
export interface RumblePad {
|
|
18
|
+
readonly vibrationActuator?: {
|
|
19
|
+
playEffect?(type: 'dual-rumble', params: {
|
|
20
|
+
duration: number;
|
|
21
|
+
startDelay: number;
|
|
22
|
+
strongMagnitude: number;
|
|
23
|
+
weakMagnitude: number;
|
|
24
|
+
}): Promise<unknown>;
|
|
25
|
+
reset?(): Promise<unknown>;
|
|
26
|
+
} | null;
|
|
27
|
+
}
|
|
28
|
+
/** The effect's parameters as the API wants them, clamped (pure, for tests and custom transports). */
|
|
29
|
+
export declare function rumbleParams(options: RumbleOptions): {
|
|
30
|
+
duration: number;
|
|
31
|
+
startDelay: number;
|
|
32
|
+
strongMagnitude: number;
|
|
33
|
+
weakMagnitude: number;
|
|
34
|
+
};
|
|
35
|
+
/** Rumbles one pad directly; resolves true when the effect played to its end. */
|
|
36
|
+
export declare function rumblePad(pad: RumblePad | null | undefined, options: RumbleOptions): Promise<boolean>;
|
|
37
|
+
/** Rumbles the pad at `padIndex` (as in `navigator.getGamepads()`); resolves false where it cannot. */
|
|
38
|
+
export declare function rumble(padIndex: number, options: RumbleOptions, pads?: () => readonly (RumblePad | null)[]): Promise<boolean>;
|
|
39
|
+
/** Stops whatever the pad at `padIndex` is playing. */
|
|
40
|
+
export declare function stopRumble(padIndex: number, pads?: () => readonly (RumblePad | null)[]): Promise<void>;
|
|
41
|
+
//# sourceMappingURL=rumble.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rumble.d.ts","sourceRoot":"","sources":["../../../src/input/rumble.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,aAAa;IAC5B,wDAAwD;IACxD,MAAM,CAAC,EAAE,MAAM,C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,CAAC,CAM3H"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The virtual joystick's arithmetic, kept pure so it can be tested. The stick hands the game the **same** axis
|
|
3
|
+
* the keyboard does — `stepMover` clamps every step to -1/0/1 on each axis (movement is eight-way, and the server
|
|
4
|
+
* reads it the same way), so an analog stick would only be rounded there anyway. The rounding happens here instead,
|
|
5
|
+
* by eight 45° sectors, so a thumb held a little off the horizontal walks straight rather than flickering between
|
|
6
|
+
* east and north-east.
|
|
7
|
+
*/
|
|
8
|
+
/** Below this share of the stick's radius the thumb is resting: no movement, and the aim falls back (touchAim.ts). */
|
|
9
|
+
export declare const STICK_DEAD_ZONE = 0.28;
|
|
10
|
+
export interface StickVector {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
}
|
|
14
|
+
/** The thumb's offset from where the stick was planted, as a vector of length at most 1 (radius = full tilt). */
|
|
15
|
+
export declare function stickVector(dx: number, dy: number, radius: number): StickVector;
|
|
16
|
+
/** True when the stick is tilted past the dead zone. */
|
|
17
|
+
export declare function stickActive(v: StickVector, deadZone?: number): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* The keyboard-shaped axis for a stick vector: each of dx, dy is -1, 0 or 1 (screen y grows downward, as the
|
|
20
|
+
* keyboard's "down" does), nothing inside the dead zone, and the nearest of the eight directions otherwise.
|
|
21
|
+
*/
|
|
22
|
+
export declare function stickToAxis(v: StickVector, deadZone?: number): {
|
|
23
|
+
dx: number;
|
|
24
|
+
dy: number;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=stickAxis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stickAxis.d.ts","sourceRoot":"","sources":["../../../src/input/stickAxis.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,sHAAsH;AACtH,eAAO,MAAM,eAAe,OAAO,CAAC;AAEpC,MAAM,WAAW,WAAW;IAC1B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,iHAAiH;AACjH,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,CAM/E;AAED,wDAAwD;AACxD,wBAAgB,WAAW,CAAC,CAAC,EAAE,WAAW,EAAE,QAAQ,SAAkB,GAAG,OAAO,CAE/E;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,WAAW,EAAE,QAAQ,SAAkB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAMlG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** What decides whether the touch controls are shown; read off the browser by `isTouchUi` (`platform/touch.ts`). */
|
|
2
|
+
export interface TouchEnv {
|
|
3
|
+
/** Running inside a native shell (`setNativeShell`: Capacitor, a kiosk…). */
|
|
4
|
+
native: boolean;
|
|
5
|
+
/** `(pointer: coarse)` matches: the **primary** pointer is a finger. */
|
|
6
|
+
coarse: boolean;
|
|
7
|
+
/** `navigator.maxTouchPoints`. */
|
|
8
|
+
touchPoints: number;
|
|
9
|
+
/** `?touch=1|0` in the URL or `localStorage` (`setTouchOverrideKey`), for trying the controls on a desktop browser. */
|
|
10
|
+
override: string | null;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Touch controls only where a finger is the main way in: the native app always, a browser whose primary pointer
|
|
14
|
+
* is coarse and that reports touch points (a phone or tablet), never a desktop — a laptop with a touch screen
|
|
15
|
+
* still has a fine primary pointer and keeps its mouse and keyboard.
|
|
16
|
+
*/
|
|
17
|
+
export declare function detectTouch(env: TouchEnv): boolean;
|
|
18
|
+
//# sourceMappingURL=touchDetect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"touchDetect.d.ts","sourceRoot":"","sources":["../../../src/input/touchDetect.ts"],"names":[],"mappings":"AAAA,oHAAoH;AACpH,MAAM,WAAW,QAAQ;IACvB,6EAA6E;IAC7E,MAAM,EAAE,OAAO,CAAC;IAChB,wEAAwE;IACxE,MAAM,EAAE,OAAO,CAAC;IAChB,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,uHAAuH;IACvH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,QAAQ,GAAG,OAAO,CAKlD"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { Stage } from '../core/Stage.js';
|
|
2
|
+
/** A light in the world. Change its fields any time (follow a body by writing `x`/`y` each frame). */
|
|
3
|
+
export interface Light {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
/** World px. */
|
|
7
|
+
radius: number;
|
|
8
|
+
/** The colour it casts on what it lights (default warm white). */
|
|
9
|
+
color?: number;
|
|
10
|
+
/** 0–1: how much of the dark it takes away, and how strong its colour (default 1). */
|
|
11
|
+
intensity?: number;
|
|
12
|
+
/** Radius wobble, 0–1 (a torch ≈ 0.08). */
|
|
13
|
+
flicker?: number;
|
|
14
|
+
/** A light off is kept but not drawn. */
|
|
15
|
+
on?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface LightLayerOptions {
|
|
18
|
+
/** Colour of the dark (default deep blue). */
|
|
19
|
+
ambient?: number;
|
|
20
|
+
/** 0 no dark at all, 1 black where nothing is lit (default 0.85). */
|
|
21
|
+
darkness?: number;
|
|
22
|
+
/** How strongly lights tint what they light, 0–1 (default 0.35). */
|
|
23
|
+
tint?: number;
|
|
24
|
+
/** A light's height over its width: the ground is seen at a slant (default 1, round; a 3/4 view ≈ 0.85). */
|
|
25
|
+
squash?: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Smooth darkness with lights cut out of it, for art that is not pixel art (the pixel module has its own dithered
|
|
29
|
+
* `Darkness`). The dark is a screen-sized texture: each light erases a soft hole in it, and lays its colour over what
|
|
30
|
+
* shows through. It sits on the screen layer, over the world and under the HUD you add after it.
|
|
31
|
+
*
|
|
32
|
+
* ```ts
|
|
33
|
+
* const night = new LightLayer(stage, { darkness: 0.9 });
|
|
34
|
+
* const torch = night.add({ x: 100, y: 80, radius: 90, color: 0xffb060, flicker: 0.08 });
|
|
35
|
+
* // each frame: torch.x = hero.x; night.update(now);
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export declare class LightLayer {
|
|
39
|
+
private readonly stage;
|
|
40
|
+
private readonly lights;
|
|
41
|
+
private readonly scratch;
|
|
42
|
+
private readonly sheet;
|
|
43
|
+
private readonly holes;
|
|
44
|
+
private readonly washes;
|
|
45
|
+
private readonly view;
|
|
46
|
+
private rt;
|
|
47
|
+
private readonly pool;
|
|
48
|
+
private ambient;
|
|
49
|
+
private darkness;
|
|
50
|
+
private readonly tint;
|
|
51
|
+
private readonly squash;
|
|
52
|
+
private readonly unsubscribe;
|
|
53
|
+
constructor(stage: Stage, options?: LightLayerOptions);
|
|
54
|
+
add(light: Light): Light;
|
|
55
|
+
remove(light: Light): void;
|
|
56
|
+
clear(): void;
|
|
57
|
+
/** Changes the dark: its colour and how dark (a day/night cycle eases these). */
|
|
58
|
+
setAmbient(color: number, darkness: number): void;
|
|
59
|
+
/** Redraws the dark with this frame's lights. Call once a frame, after the camera moved. */
|
|
60
|
+
update(now?: number): void;
|
|
61
|
+
destroy(): void;
|
|
62
|
+
private sprites;
|
|
63
|
+
private fit;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=LightLayer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LightLayer.d.ts","sourceRoot":"","sources":["../../../src/light/LightLayer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE3C,sGAAsG;AACtG,MAAM,WAAW,KAAK;IACpB,CAAC,EAAE,MAAM,CAAC;IAC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G,KAAK;IAKxB,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAI1B,KAAK,IAAI,IAAI;IAIb,iFAAiF;IACjF,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAKjD,4FAA4F;IAC5F,MAAM,CAAC,GAAG,SAAoB,GAAG,IAAI;IAqCrC,OAAO,IAAI,IAAI;IASf,OAAO,CAAC,OAAO;IAgBf,OAAO,CAAC,GAAG;CAOZ"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A binary min-heap of (index, priority) pairs, kept as two parallel arrays so a search over a big grid pushes
|
|
3
|
+
* numbers, not objects. A stale entry (pushed again at a lower priority) is left in and skipped by the caller's
|
|
4
|
+
* closed set, which is cheaper than a decrease-key.
|
|
5
|
+
*/
|
|
6
|
+
export declare class MinHeap {
|
|
7
|
+
private items;
|
|
8
|
+
private prio;
|
|
9
|
+
get size(): number;
|
|
10
|
+
push(index: number, priority: number): void;
|
|
11
|
+
/** The index with the lowest priority, removed. Only call while `size > 0`. */
|
|
12
|
+
pop(): number;
|
|
13
|
+
clear(): void;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=MinHeap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MinHeap.d.ts","sourceRoot":"","sources":["../../../src/nav/MinHeap.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qBAAa,OAAO;IAClB,OAAO,CAAC,KAAK,CAAgB;IAC7B,OAAO,CAAC,IAAI,CAAgB;IAE5B,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAe3C,+EAA+E;IAC/E,GAAG,IAAI,MAAM;IAyBb,KAAK,IAAI,IAAI;CAId"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type NavGrid, type NavOptions, type TilePoint } from './navGrid.js';
|
|
2
|
+
/**
|
|
3
|
+
* Where a path ends. A point goal is met anywhere within `reach` tiles of its tile (centre to centre; 0 = that tile
|
|
4
|
+
* only): aiming at an exact tile sent auto-walks into a spot inside a hut and left them shuffling against its wall a
|
|
5
|
+
* step from where they were already close enough. A custom goal names its own tiles, with an `estimate` of the
|
|
6
|
+
* tiles left that must never be more than the real cost (0, the default, makes the search a plain Dijkstra).
|
|
7
|
+
*/
|
|
8
|
+
export type NavGoal = {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
reach?: number;
|
|
12
|
+
} | {
|
|
13
|
+
test: (tx: number, ty: number) => boolean;
|
|
14
|
+
estimate?: (tx: number, ty: number) => number;
|
|
15
|
+
};
|
|
16
|
+
export interface FindPathOptions extends NavOptions {
|
|
17
|
+
/** Tiles settled before giving up, so a goal walled off on a big map cannot stall a frame. */
|
|
18
|
+
maxNodes?: number;
|
|
19
|
+
}
|
|
20
|
+
/** Octile distance: the cost of the cheapest eight-way walk over open ground. */
|
|
21
|
+
export declare function octile(dx: number, dy: number): number;
|
|
22
|
+
/**
|
|
23
|
+
* A* over the grid: the tiles from `from` to the goal, both included, or null when there is no way through. A start
|
|
24
|
+
* on a wall is moved to the nearest open tile. The path is the cheapest by `cost`, but among equally cheap ones it
|
|
25
|
+
* is whichever the heap settled on — often a staircase; `straightenPath` irons that out.
|
|
26
|
+
*/
|
|
27
|
+
export declare function findPath(g: NavGrid, from: TilePoint, to: NavGoal, options?: FindPathOptions): TilePoint[] | null;
|
|
28
|
+
/**
|
|
29
|
+
* Walking cost from one tile to every tile of the grid (row-major, `Infinity` where unreachable), by the same steps
|
|
30
|
+
* and costs `findPath` takes — for weighing several destinations by real distance rather than by a straight line. An
|
|
31
|
+
* end-only tile gets a cost (it can be stepped onto) but nothing is reached through it. `maxCost` stops the spread.
|
|
32
|
+
*/
|
|
33
|
+
export declare function floodFill(g: NavGrid, from: TilePoint, options?: NavOptions & {
|
|
34
|
+
maxCost?: number;
|
|
35
|
+
}): Float32Array;
|
|
36
|
+
/** How many tiles a flood reached: a quick test that a change to the ground walled nothing off. */
|
|
37
|
+
export declare function reachedCount(costs: Float32Array): number;
|
|
38
|
+
//# sourceMappingURL=findPath.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findPath.d.ts","sourceRoot":"","sources":["../../../src/nav/findPath.ts"],"names":[],"mappings":"AACA,OAAO,EAA8B,KAAK,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAGtG;;;;;GAKG;AACH,MAAM,MAAM,OAAO,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,MAAM,CAAA;CAAE,CAAC;AAE9J,MAAM,WAAW,eAAgB,SAAQ,UAAU;IACjD,8FAA8F;IAC9F,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,iFAAiF;AACjF,wBAAgB,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAIrD;AAYD;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,GAAE,eAAoB,GAAG,SAAS,EAAE,GAAG,IAAI,CA2CpH;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,GAAE,UAAU,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,YAAY,CAoCpH;AAED,mGAAmG;AACnG,wBAAgB,YAAY,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAIxD"}
|