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,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,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,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
|
+
};
|