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,82 @@
|
|
|
1
|
+
import { solidSilhouette as u, fillSolid as c } from "../core/silhouette.js";
|
|
2
|
+
let g = 0;
|
|
3
|
+
class x {
|
|
4
|
+
constructor(t, s = {}) {
|
|
5
|
+
this.stage = t, this.tints = s.tints?.length ? s.tints : [16777215], this.alpha = s.alpha ?? 0.6, this.durationMs = s.durationMs ?? 260, this.spacingMs = s.spacingMs ?? 22, this.endScale = s.endScale ?? 0.85, this.blend = s.blend ?? "add", this.slots = Math.max(1, s.slots ?? 16);
|
|
6
|
+
}
|
|
7
|
+
stage;
|
|
8
|
+
tints;
|
|
9
|
+
alpha;
|
|
10
|
+
durationMs;
|
|
11
|
+
spacingMs;
|
|
12
|
+
endScale;
|
|
13
|
+
blend;
|
|
14
|
+
slots;
|
|
15
|
+
prefix = `afterimage${++g}_`;
|
|
16
|
+
/** The copy wearing each ring slot's texture: it goes before its texture is painted over. */
|
|
17
|
+
slotUsers = [];
|
|
18
|
+
slot = 0;
|
|
19
|
+
fading = /* @__PURE__ */ new Set();
|
|
20
|
+
free = [];
|
|
21
|
+
lastAt = Number.NEGATIVE_INFINITY;
|
|
22
|
+
count = 0;
|
|
23
|
+
/**
|
|
24
|
+
* Leaves a copy of `body` as drawn now, standing at world (x, y) with draw order `depth` (default just behind a
|
|
25
|
+
* body sorted by `y`), unless one was left less than `spacingMs` before `now`. Answers the copy, or null when none
|
|
26
|
+
* was laid (too soon, or the frame could not be read): a caller drawing its own speed streaks between copies
|
|
27
|
+
* follows that.
|
|
28
|
+
*/
|
|
29
|
+
trail(t, s, i, r, l = i - 1) {
|
|
30
|
+
if (r - this.lastAt < this.spacingMs) return null;
|
|
31
|
+
const e = this.copyOf(t, s, i);
|
|
32
|
+
return e ? (this.lastAt = r, e.setOrigin(t.originX, t.originY).setFlipX(t.flipX).setScale(t.scaleX, t.scaleY).setRotation(t.rotation).setAlpha(this.alpha).setDepth(l).setBlendMode(this.blend), e.tint = this.tints[this.count++ % this.tints.length], this.fading.add(e), this.stage.tweens.add({
|
|
33
|
+
targets: e,
|
|
34
|
+
alpha: 0,
|
|
35
|
+
scaleX: t.scaleX * this.endScale,
|
|
36
|
+
scaleY: t.scaleY * this.endScale,
|
|
37
|
+
duration: this.durationMs,
|
|
38
|
+
onComplete: () => this.spend(e)
|
|
39
|
+
}), e) : null;
|
|
40
|
+
}
|
|
41
|
+
/** Copies still fading. */
|
|
42
|
+
get active() {
|
|
43
|
+
return this.fading.size;
|
|
44
|
+
}
|
|
45
|
+
copyOf(t, s, i) {
|
|
46
|
+
const r = this.stage.textures;
|
|
47
|
+
if (!r.isLive(t.textureKey)) {
|
|
48
|
+
const f = u(t.texture);
|
|
49
|
+
if (!f) return null;
|
|
50
|
+
const n = this.free.pop(), d = n && !n.destroyed ? n.setTexture(t.textureKey, t.frameName) : this.stage.add.image(s, i, t.textureKey, t.frameName);
|
|
51
|
+
return d.texture = f, d.setPosition(s, i).setVisible(!0);
|
|
52
|
+
}
|
|
53
|
+
const l = this.slot;
|
|
54
|
+
this.slot = (l + 1) % this.slots;
|
|
55
|
+
const e = this.slotUsers[l];
|
|
56
|
+
e && !e.destroyed && (this.stage.tweens.killTweensOf(e), this.fading.delete(e), e.setVisible(!1));
|
|
57
|
+
const a = this.prefix + l;
|
|
58
|
+
r.snapshotInto(t.textureKey, t.frameName, a);
|
|
59
|
+
const h = r.get(a, "0");
|
|
60
|
+
c(h.source.resource), h.source.update();
|
|
61
|
+
const o = e && !e.destroyed ? e.setTexture(a, "0").setPosition(s, i).setVisible(!0) : this.stage.add.image(s, i, a, "0");
|
|
62
|
+
return this.slotUsers[l] = o, o;
|
|
63
|
+
}
|
|
64
|
+
/** A faded copy: hidden and kept for the next one (a ring slot's copy stays with its slot). */
|
|
65
|
+
spend(t) {
|
|
66
|
+
this.fading.delete(t), !t.destroyed && (t.setVisible(!1), !this.slotUsers.includes(t) && (this.free.length < this.slots ? this.free.push(t) : t.destroy()));
|
|
67
|
+
}
|
|
68
|
+
/** Takes every copy off the stage and frees the ring's textures. */
|
|
69
|
+
destroy() {
|
|
70
|
+
for (const t of this.fading)
|
|
71
|
+
this.stage.tweens.killTweensOf(t), this.slotUsers.includes(t) || t.destroy();
|
|
72
|
+
this.fading.clear();
|
|
73
|
+
for (const t of this.free) t.destroy();
|
|
74
|
+
this.free.length = 0;
|
|
75
|
+
for (const t of this.slotUsers) t && !t.destroyed && t.destroy();
|
|
76
|
+
for (let t = 0; t < this.slotUsers.length; t++) this.stage.textures.remove(this.prefix + t);
|
|
77
|
+
this.slotUsers.length = 0;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
export {
|
|
81
|
+
x as Afterimages
|
|
82
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { installLabelFont as k } from "../core/BitmapLabel.js";
|
|
2
|
+
const d = (n) => `${n.size}|${n.color}`;
|
|
3
|
+
class m {
|
|
4
|
+
constructor(t, s) {
|
|
5
|
+
this.stage = t, this.options = s, this.stroke = s.stroke ?? "#140e18", this.strokeWidth = s.strokeWidth ?? ((i) => Math.max(2, Math.round(i / 5))), this.resolution = s.resolution ?? 4, this.keep = s.keepPerStyle ?? 24;
|
|
6
|
+
}
|
|
7
|
+
stage;
|
|
8
|
+
options;
|
|
9
|
+
pools = /* @__PURE__ */ new Map();
|
|
10
|
+
stroke;
|
|
11
|
+
strokeWidth;
|
|
12
|
+
resolution;
|
|
13
|
+
keep;
|
|
14
|
+
/**
|
|
15
|
+
* Bakes the fonts of `styles`, one a task starting `delayMs` from now, so no frame pays for them all at once — ten
|
|
16
|
+
* at once froze a world's first frame half a second (each font measures and kerns every glyph). Returns a cancel.
|
|
17
|
+
*/
|
|
18
|
+
warm(t, s = 1e3, i = 50) {
|
|
19
|
+
const o = [...t];
|
|
20
|
+
let r;
|
|
21
|
+
const e = () => {
|
|
22
|
+
const h = o.shift();
|
|
23
|
+
h && (this.install(h), r = setTimeout(e, i));
|
|
24
|
+
};
|
|
25
|
+
return r = setTimeout(e, s), () => clearTimeout(r);
|
|
26
|
+
}
|
|
27
|
+
/** Bakes one style's font now. */
|
|
28
|
+
install(t) {
|
|
29
|
+
k(this.options.fontFamily, t.size, t.color, this.stroke, this.strokeWidth(t.size), this.resolution, this.options.glyphs);
|
|
30
|
+
}
|
|
31
|
+
/** A label ready to animate: shown, opaque, unscaled, anchored at its bottom centre on (x, y). */
|
|
32
|
+
take(t, s, i, o) {
|
|
33
|
+
const r = this.pools.get(d(o));
|
|
34
|
+
let e = r?.pop();
|
|
35
|
+
for (; e && e.destroyed; ) e = r?.pop();
|
|
36
|
+
return e ? (e.setText(i), e.position.set(t, s), e.alpha = 1, e.setScale(1), e.visible = !0) : (e = this.stage.add.label(t, s, i, this.options.fontFamily, o.size, o.color, this.stroke, this.strokeWidth(o.size), this.resolution, this.options.glyphs).setOrigin(0.5, 1), this.options.parent && this.options.parent.addChild(e)), this.options.depth !== void 0 && e.setDepth(this.options.depth), e;
|
|
37
|
+
}
|
|
38
|
+
/** Hands a finished label back for reuse. */
|
|
39
|
+
release(t, s) {
|
|
40
|
+
if (t.destroyed) return;
|
|
41
|
+
const i = d(s);
|
|
42
|
+
let o = this.pools.get(i);
|
|
43
|
+
if (o || this.pools.set(i, o = []), o.length >= this.keep) {
|
|
44
|
+
t.destroy();
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
t.visible = !1, o.push(t);
|
|
48
|
+
}
|
|
49
|
+
/** A label that pops, rises, fades and goes back to the pool by itself, on the stage's own tweens. */
|
|
50
|
+
float(t, s, i, o, r = {}) {
|
|
51
|
+
const { rise: e = 16, driftX: h = 0, pop: a = 1.4, popMs: c = 120, holdMs: f = 350, fadeMs: u = 500 } = r, l = this.take(t, s, i, o), p = this.stage.tweens;
|
|
52
|
+
return a !== 1 && (l.setScale(a), p.add({ targets: l, scale: 1, duration: c, ease: "Back.Out" })), p.add({
|
|
53
|
+
targets: l,
|
|
54
|
+
x: t + h,
|
|
55
|
+
y: s - e,
|
|
56
|
+
alpha: 0,
|
|
57
|
+
delay: f,
|
|
58
|
+
duration: u,
|
|
59
|
+
ease: "Sine.In",
|
|
60
|
+
onComplete: () => this.release(l, o)
|
|
61
|
+
}), l;
|
|
62
|
+
}
|
|
63
|
+
/** Destroys every pooled label (a scene ending); labels still out are the scene's to free. */
|
|
64
|
+
clear() {
|
|
65
|
+
for (const t of this.pools.values()) for (const s of t) s.destroyed || s.destroy();
|
|
66
|
+
this.pools.clear();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export {
|
|
70
|
+
m as FloatingText
|
|
71
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
function o(n, r) {
|
|
2
|
+
const t = Math.min(140, 40 + Math.max(0, n) * 400);
|
|
3
|
+
return Math.round(t + (r ? 40 : 0));
|
|
4
|
+
}
|
|
5
|
+
function e(n, r, t) {
|
|
6
|
+
return n ? t ? 2 : 1 : Math.min(3, 2 + (r > 0.2 ? 1 : 0) + (t ? 1 : 0));
|
|
7
|
+
}
|
|
8
|
+
const i = 120;
|
|
9
|
+
function h(n, r) {
|
|
10
|
+
return r >= 1 || n <= 0 ? 0 : Math.round(n * (1 - r) * (1 - r));
|
|
11
|
+
}
|
|
12
|
+
const u = 400;
|
|
13
|
+
function M(n, r, t) {
|
|
14
|
+
return t ? 0 : n ? r ? 60 : 0 : r ? 140 : 70;
|
|
15
|
+
}
|
|
16
|
+
function a(n) {
|
|
17
|
+
return n ? u : 0;
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
u as HEAVY_FLASH_GAP_MS,
|
|
21
|
+
i as RECOIL_MS,
|
|
22
|
+
o as hitStopMs,
|
|
23
|
+
a as hurtFlashGapMs,
|
|
24
|
+
M as hurtFlashMs,
|
|
25
|
+
h as recoilAt,
|
|
26
|
+
e as recoilPx
|
|
27
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
function u(o, e, n, t) {
|
|
2
|
+
const s = o.width, l = o.height;
|
|
3
|
+
if (!s || !l || !(o.zoom > 0)) return !0;
|
|
4
|
+
const r = o.scrollX ?? 0, h = o.scrollY ?? 0;
|
|
5
|
+
return e >= r - t && n >= h - t && e <= r + s / o.zoom + t && n <= h + l / o.zoom + t;
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
u as inView
|
|
9
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { sourceText as n, formatMessage as o } from "./formatMessage.js";
|
|
2
|
+
class c {
|
|
3
|
+
source;
|
|
4
|
+
lang;
|
|
5
|
+
catalogs = /* @__PURE__ */ new Map();
|
|
6
|
+
listeners = /* @__PURE__ */ new Set();
|
|
7
|
+
rules = /* @__PURE__ */ new Map();
|
|
8
|
+
reported = /* @__PURE__ */ new Set();
|
|
9
|
+
onMissing;
|
|
10
|
+
constructor(t = {}) {
|
|
11
|
+
this.source = t.source ?? "en", this.lang = t.language ?? this.source, this.onMissing = t.onMissing;
|
|
12
|
+
}
|
|
13
|
+
get language() {
|
|
14
|
+
return this.lang;
|
|
15
|
+
}
|
|
16
|
+
/** Languages with a catalog, plus the source. */
|
|
17
|
+
get languages() {
|
|
18
|
+
return [.../* @__PURE__ */ new Set([this.source, ...this.catalogs.keys()])];
|
|
19
|
+
}
|
|
20
|
+
/** Adds (or merges into) a language's catalog; subscribers hear of it when it is the language shown. */
|
|
21
|
+
addCatalog(t, e) {
|
|
22
|
+
const s = this.catalogs.get(t);
|
|
23
|
+
this.catalogs.set(t, s ? { ...s, ...e } : e), t === this.lang && this.notify();
|
|
24
|
+
}
|
|
25
|
+
setLanguage(t) {
|
|
26
|
+
t !== this.lang && (this.lang = t, this.notify());
|
|
27
|
+
}
|
|
28
|
+
/** Calls `fn` with the language after every switch; the returned function stops it. */
|
|
29
|
+
subscribe(t) {
|
|
30
|
+
return this.listeners.add(t), () => this.listeners.delete(t);
|
|
31
|
+
}
|
|
32
|
+
/** Whether the current language has its own line for `key`. */
|
|
33
|
+
has(t) {
|
|
34
|
+
return this.catalogs.get(this.lang)?.[t] !== void 0;
|
|
35
|
+
}
|
|
36
|
+
tr = (t, ...e) => {
|
|
37
|
+
const s = this.lookup(t);
|
|
38
|
+
let i;
|
|
39
|
+
return s === void 0 ? i = n(t) : typeof s == "string" ? i = s : i = s.other ?? n(t), o(i, e);
|
|
40
|
+
};
|
|
41
|
+
trn = (t, e, s, ...i) => {
|
|
42
|
+
const r = this.lookup(e), a = [s, ...i];
|
|
43
|
+
if (r === void 0) return o(n(this.category(this.source, s) === "one" ? t : e), a);
|
|
44
|
+
if (typeof r == "string") return o(r, a);
|
|
45
|
+
const l = r[this.category(this.lang, s)] ?? r.other ?? n(e);
|
|
46
|
+
return o(l, a);
|
|
47
|
+
};
|
|
48
|
+
lookup(t) {
|
|
49
|
+
const e = this.catalogs.get(this.lang)?.[t];
|
|
50
|
+
if (e === void 0 && this.lang !== this.source && this.onMissing) {
|
|
51
|
+
const s = `${this.lang}\0${t}`;
|
|
52
|
+
this.reported.has(s) || (this.reported.add(s), this.onMissing(t, this.lang));
|
|
53
|
+
}
|
|
54
|
+
return e;
|
|
55
|
+
}
|
|
56
|
+
category(t, e) {
|
|
57
|
+
let s = this.rules.get(t);
|
|
58
|
+
return s || (s = new Intl.PluralRules(t), this.rules.set(t, s)), s.select(e);
|
|
59
|
+
}
|
|
60
|
+
notify() {
|
|
61
|
+
for (const t of [...this.listeners])
|
|
62
|
+
try {
|
|
63
|
+
t(this.lang);
|
|
64
|
+
} catch (e) {
|
|
65
|
+
console.error("[i18n] a language listener failed", e);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export {
|
|
70
|
+
c as Translator
|
|
71
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
function v(n, i = {}) {
|
|
2
|
+
const f = i.single ?? ["tr"], u = i.plural ?? ["trn"], o = [...f, ...u].map((l) => l.replace(/[$.*+?^()[\]{}|\\]/g, "\\$&"));
|
|
3
|
+
if (o.length === 0) return [];
|
|
4
|
+
const e = new RegExp(`(?<![\\w$])(${o.join("|")})\\s*\\(`, "g"), c = [];
|
|
5
|
+
let r = 1, t = 0;
|
|
6
|
+
for (const l of n.matchAll(e)) {
|
|
7
|
+
const s = l[1], a = h(n, l.index + l[0].length);
|
|
8
|
+
if (!a) continue;
|
|
9
|
+
for (; t < l.index; t++) n.charCodeAt(t) === 10 && r++;
|
|
10
|
+
if (!u.includes(s)) {
|
|
11
|
+
c.push({ key: a.value, fn: s, line: r });
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
let d = p(n, a.end);
|
|
15
|
+
if (n[d] !== ",") continue;
|
|
16
|
+
const g = h(n, d + 1);
|
|
17
|
+
g && c.push({ key: g.value, one: a.value, fn: s, line: r });
|
|
18
|
+
}
|
|
19
|
+
return c;
|
|
20
|
+
}
|
|
21
|
+
function p(n, i) {
|
|
22
|
+
for (; i < n.length && /\s/.test(n[i]); ) i++;
|
|
23
|
+
return i;
|
|
24
|
+
}
|
|
25
|
+
const m = { n: `
|
|
26
|
+
`, t: " ", r: "\r", b: "\b", f: "\f", v: "\v", 0: "\0" };
|
|
27
|
+
function h(n, i) {
|
|
28
|
+
const f = p(n, i), u = n[f];
|
|
29
|
+
if (u !== "'" && u !== '"' && u !== "`") return null;
|
|
30
|
+
let o = "";
|
|
31
|
+
for (let e = f + 1; e < n.length; e++) {
|
|
32
|
+
const c = n[e];
|
|
33
|
+
if (c === u) return { value: o, end: e + 1 };
|
|
34
|
+
if (u !== "`" && c === `
|
|
35
|
+
` || u === "`" && c === "$" && n[e + 1] === "{") return null;
|
|
36
|
+
if (c !== "\\") {
|
|
37
|
+
o += c;
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
const r = n[++e];
|
|
41
|
+
if (r === void 0) return null;
|
|
42
|
+
if (r !== `
|
|
43
|
+
`) {
|
|
44
|
+
if (r === "u" || r === "x") {
|
|
45
|
+
const t = r === "u" && n[e + 1] === "{", l = t ? n.slice(e + 2, n.indexOf("}", e)) : n.slice(e + 1, e + (r === "u" ? 5 : 3)), s = Number.parseInt(l, 16);
|
|
46
|
+
if (Number.isNaN(s)) return null;
|
|
47
|
+
o += String.fromCodePoint(s), e += t ? l.length + 2 : l.length;
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
o += m[r] ?? r;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
v as extractStrings
|
|
57
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const u = "|";
|
|
2
|
+
function f(n) {
|
|
3
|
+
const r = n.lastIndexOf("|");
|
|
4
|
+
return r < 0 ? n : n.slice(0, r);
|
|
5
|
+
}
|
|
6
|
+
function c(n, r) {
|
|
7
|
+
return n.indexOf("{") < 0 && n.indexOf("}") < 0 ? n : n.replace(/\{\{|\}\}|\{(\d+)\}/g, (e, t) => {
|
|
8
|
+
if (e === "{{") return "{";
|
|
9
|
+
if (e === "}}") return "}";
|
|
10
|
+
const i = Number(t);
|
|
11
|
+
return i < r.length ? String(r[i]) : e;
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
u as CONTEXT_MARK,
|
|
16
|
+
c as formatMessage,
|
|
17
|
+
f as sourceText
|
|
18
|
+
};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { parseChord as c, chordHeld as l } from "./keyChord.js";
|
|
2
|
+
import { rumblePad as f } from "./rumble.js";
|
|
3
|
+
const u = ["a", "b", "x", "y", "lb", "rb", "lt", "rt", "select", "start", "ls", "rs", "up", "down", "left", "right", "home"], w = ["lx", "ly", "rx", "ry"];
|
|
4
|
+
class g {
|
|
5
|
+
constructor(t, e, s = {}) {
|
|
6
|
+
this.keyboard = t, this.bindings = new Map(Object.entries(e)), this.deadZone = s.deadZone ?? 0.25, this.gamepads = s.gamepads ?? (() => typeof navigator < "u" && typeof navigator.getGamepads == "function" ? navigator.getGamepads() : []);
|
|
7
|
+
}
|
|
8
|
+
keyboard;
|
|
9
|
+
bindings;
|
|
10
|
+
virtual = /* @__PURE__ */ new Set();
|
|
11
|
+
virtualDown = /* @__PURE__ */ new Set();
|
|
12
|
+
/** Analog value of each action this step (0–1), and last step's, for edges. */
|
|
13
|
+
now = /* @__PURE__ */ new Map();
|
|
14
|
+
before = /* @__PURE__ */ new Map();
|
|
15
|
+
deadZone;
|
|
16
|
+
gamepads;
|
|
17
|
+
/** Parsed chords by binding string; null for a plain key. */
|
|
18
|
+
chords = /* @__PURE__ */ new Map();
|
|
19
|
+
/** Keys a chord holds this step: their bare bindings read 0 until the key comes up. */
|
|
20
|
+
claimed = /* @__PURE__ */ new Set();
|
|
21
|
+
keyDown = (t) => this.keyboard !== null && (this.keyboard.isDown(t) || this.keyboard.pressed(t));
|
|
22
|
+
/** Replaces one action's bindings (a player's rebinding). */
|
|
23
|
+
bind(t, e) {
|
|
24
|
+
this.bindings.set(t, [...e]);
|
|
25
|
+
}
|
|
26
|
+
bindingsOf(t) {
|
|
27
|
+
return this.bindings.get(t) ?? [];
|
|
28
|
+
}
|
|
29
|
+
/** A touch UI's virtual button went down: `touch:<name>` bindings read it. */
|
|
30
|
+
press(t) {
|
|
31
|
+
this.virtual.add(t), this.virtualDown.add(t);
|
|
32
|
+
}
|
|
33
|
+
release(t) {
|
|
34
|
+
this.virtual.delete(t);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Rumbles the gamepads the actions read: every connected one, or only `padIndex` among them. Resolves true when any
|
|
38
|
+
* played; a pad without rumble is skipped silently.
|
|
39
|
+
*/
|
|
40
|
+
async rumble(t, e) {
|
|
41
|
+
const s = this.gamepads(), i = e === void 0 ? s : [s[e] ?? null];
|
|
42
|
+
return (await Promise.all(i.map((r) => r ? f(r, t) : Promise.resolve(!1)))).includes(!0);
|
|
43
|
+
}
|
|
44
|
+
/** Reads every device once; call at the start of each simulation step. */
|
|
45
|
+
poll() {
|
|
46
|
+
[this.before, this.now] = [this.now, this.before], this.now.clear();
|
|
47
|
+
const t = this.gamepads().filter((e) => e !== null);
|
|
48
|
+
this.claimChords();
|
|
49
|
+
for (const [e, s] of this.bindings) {
|
|
50
|
+
let i = 0;
|
|
51
|
+
for (const o of s) i = Math.max(i, this.read(o, t));
|
|
52
|
+
i > 0 && this.now.set(e, i);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/** Held this step. */
|
|
56
|
+
down(t) {
|
|
57
|
+
return (this.now.get(t) ?? 0) > 0;
|
|
58
|
+
}
|
|
59
|
+
/** How far it is held (0–1): 1 for a key, the trigger or stick amount for analog input. */
|
|
60
|
+
value(t) {
|
|
61
|
+
return this.now.get(t) ?? 0;
|
|
62
|
+
}
|
|
63
|
+
/** Went down this step. */
|
|
64
|
+
pressed(t) {
|
|
65
|
+
return this.down(t) && !((this.before.get(t) ?? 0) > 0);
|
|
66
|
+
}
|
|
67
|
+
/** Came up this step. */
|
|
68
|
+
released(t) {
|
|
69
|
+
return !this.down(t) && (this.before.get(t) ?? 0) > 0;
|
|
70
|
+
}
|
|
71
|
+
/** `value(positive) - value(negative)`, in −1…1. */
|
|
72
|
+
axis(t, e) {
|
|
73
|
+
return this.value(e) - this.value(t);
|
|
74
|
+
}
|
|
75
|
+
/** A 2D direction from four actions, never longer than 1 (a diagonal is not faster). */
|
|
76
|
+
vector(t, e, s, i) {
|
|
77
|
+
const o = this.axis(t, e), r = this.axis(s, i), n = Math.hypot(o, r);
|
|
78
|
+
return n > 1 ? [o / n, r / n] : [o, r];
|
|
79
|
+
}
|
|
80
|
+
/** Ends the step: the keyboard forgets its edges; virtual taps shorter than a step have now been seen. */
|
|
81
|
+
endStep() {
|
|
82
|
+
this.keyboard?.endStep(), this.virtualDown.clear();
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Drops every pending edge: what went down or up since the last step is forgotten, and what is held now counts as
|
|
86
|
+
* already held, so the next `poll` reports no `pressed` or `released` for it. For input that sat unread while
|
|
87
|
+
* something else had the keys (a pause menu over the level; `SceneManager.pop` calls it through `Scene.useInput`).
|
|
88
|
+
*/
|
|
89
|
+
flush() {
|
|
90
|
+
this.keyboard?.endStep(), this.virtualDown.clear(), this.poll(), this.before = new Map(this.now);
|
|
91
|
+
}
|
|
92
|
+
chordOf(t) {
|
|
93
|
+
let e = this.chords.get(t);
|
|
94
|
+
return e === void 0 && (e = t.startsWith("pad:") || t.startsWith("touch:") ? null : c(t), this.chords.set(t, e)), e;
|
|
95
|
+
}
|
|
96
|
+
/** Marks the keys held chords use, and frees those whose key has come up. */
|
|
97
|
+
claimChords() {
|
|
98
|
+
for (const t of this.claimed) this.keyDown(t) || this.claimed.delete(t);
|
|
99
|
+
if (this.keyboard)
|
|
100
|
+
for (const t of this.bindings.values())
|
|
101
|
+
for (const e of t) {
|
|
102
|
+
const s = this.chordOf(e);
|
|
103
|
+
s && l(s, this.keyDown) && this.claimed.add(s.code);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
read(t, e) {
|
|
107
|
+
if (t.startsWith("touch:")) {
|
|
108
|
+
const i = t.slice(6);
|
|
109
|
+
return this.virtual.has(i) || this.virtualDown.has(i) ? 1 : 0;
|
|
110
|
+
}
|
|
111
|
+
if (t.startsWith("pad:")) {
|
|
112
|
+
const i = t.slice(4);
|
|
113
|
+
let o = 0;
|
|
114
|
+
const r = i.endsWith("+") ? 1 : i.endsWith("-") ? -1 : 0;
|
|
115
|
+
if (r !== 0) {
|
|
116
|
+
const h = w.indexOf(i.slice(0, -1));
|
|
117
|
+
if (h < 0) return 0;
|
|
118
|
+
for (const a of e) {
|
|
119
|
+
const d = (a.axes[h] ?? 0) * r;
|
|
120
|
+
d > this.deadZone && (o = Math.max(o, (d - this.deadZone) / (1 - this.deadZone)));
|
|
121
|
+
}
|
|
122
|
+
return Math.min(1, o);
|
|
123
|
+
}
|
|
124
|
+
const n = u.indexOf(i);
|
|
125
|
+
if (n < 0) return 0;
|
|
126
|
+
for (const h of e) {
|
|
127
|
+
const a = h.buttons[n];
|
|
128
|
+
a?.pressed && (o = Math.max(o, a.value > 0 ? a.value : 1));
|
|
129
|
+
}
|
|
130
|
+
return Math.min(1, o);
|
|
131
|
+
}
|
|
132
|
+
const s = this.chordOf(t);
|
|
133
|
+
return s ? l(s, this.keyDown) ? 1 : 0 : this.claimed.has(t) ? 0 : this.keyDown(t) ? 1 : 0;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
export {
|
|
137
|
+
g as Actions,
|
|
138
|
+
u as PAD_BUTTONS
|
|
139
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
const u = 10, y = 28, d = 180, S = 0.2;
|
|
2
|
+
function o(s, t = !0, n = 10, i = 28, e = 180) {
|
|
3
|
+
return t && s < e ? i : n;
|
|
4
|
+
}
|
|
5
|
+
class _ {
|
|
6
|
+
dragged = !1;
|
|
7
|
+
over = !1;
|
|
8
|
+
/** Where the knob is drawn, clamped to the circle, relative to the button's centre. */
|
|
9
|
+
knob = { x: 0, y: 0 };
|
|
10
|
+
/** The knob as a vector of length ≤ 1: what the world reads. */
|
|
11
|
+
share = { x: 0, y: 0 };
|
|
12
|
+
radius;
|
|
13
|
+
sensitivity;
|
|
14
|
+
centreCancels;
|
|
15
|
+
tapSlop;
|
|
16
|
+
earlySlop;
|
|
17
|
+
pressMs;
|
|
18
|
+
centre;
|
|
19
|
+
constructor(t) {
|
|
20
|
+
this.radius = Math.max(1e-6, t.radius), this.sensitivity = t.sensitivity ?? 1, this.centreCancels = t.centreCancels ?? !0, this.tapSlop = t.tapSlop ?? 10, this.earlySlop = t.earlySlop ?? 28, this.pressMs = t.pressMs ?? 180, this.centre = t.centre ?? 0.2;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The thumb at `rawX, rawY` from the button's centre, `overCancel` when it is over the cancel zone, `ms` since it
|
|
24
|
+
* went down (Infinity skips the landing slop). Once a drag, always a drag for this press.
|
|
25
|
+
*/
|
|
26
|
+
move(t, n, i = !1, e = 1 / 0) {
|
|
27
|
+
Math.hypot(t, n) > o(e, !0, this.tapSlop, this.earlySlop, this.pressMs) && (this.dragged = !0), this.over = i;
|
|
28
|
+
const r = t * this.sensitivity, a = n * this.sensitivity, c = Math.hypot(r, a), h = c > this.radius ? this.radius / c : 1;
|
|
29
|
+
this.knob = { x: r * h, y: a * h }, this.share = { x: this.knob.x / this.radius, y: this.knob.y / this.radius };
|
|
30
|
+
}
|
|
31
|
+
/** A drag has begun: show the aim from now on. */
|
|
32
|
+
get aiming() {
|
|
33
|
+
return this.dragged;
|
|
34
|
+
}
|
|
35
|
+
get centred() {
|
|
36
|
+
return Math.hypot(this.share.x, this.share.y) < this.centre;
|
|
37
|
+
}
|
|
38
|
+
/** Letting go now would cast nothing (draw the cancel zone lit). */
|
|
39
|
+
get cancelling() {
|
|
40
|
+
return this.dragged && (this.over || this.centreCancels && this.centred);
|
|
41
|
+
}
|
|
42
|
+
up() {
|
|
43
|
+
return this.dragged ? this.cancelling ? "cancel" : this.centred ? "tap" : "cast" : "tap";
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function l(s, t = 0.2) {
|
|
47
|
+
return Math.max(0, Math.min(1, (s - t) / (1 - t)));
|
|
48
|
+
}
|
|
49
|
+
function g(s, t, n, i = 0.2) {
|
|
50
|
+
const e = Math.hypot(s, t);
|
|
51
|
+
if (e < 1e-6) return { x: 0, y: 0 };
|
|
52
|
+
const r = i + (1 - i) * Math.min(1, e / n);
|
|
53
|
+
return { x: s / e * r, y: t / e * r };
|
|
54
|
+
}
|
|
55
|
+
function p(s, t, n, i, e = 0.2) {
|
|
56
|
+
const r = Math.hypot(n.x, n.y), a = r > 1e-6 ? Math.atan2(n.y, n.x) : i;
|
|
57
|
+
if (t.kind === "point") {
|
|
58
|
+
const M = l(r, e) * t.range;
|
|
59
|
+
return { aim: a, x: s.x + Math.cos(a) * M, y: s.y + Math.sin(a) * M };
|
|
60
|
+
}
|
|
61
|
+
const c = t.snap ? Math.round(a / t.snap) * t.snap : a, h = t.backwards ? c + Math.PI : c;
|
|
62
|
+
return { aim: h, x: s.x + Math.cos(h) * t.length, y: s.y + Math.sin(h) * t.length };
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
S as AIM_CENTRE,
|
|
66
|
+
y as AIM_EARLY_SLOP,
|
|
67
|
+
d as AIM_PRESS_MS,
|
|
68
|
+
u as AIM_TAP_SLOP,
|
|
69
|
+
_ as AimGesture,
|
|
70
|
+
p as aimPoint,
|
|
71
|
+
o as dragSlop,
|
|
72
|
+
l as spotReach,
|
|
73
|
+
g as spotShare
|
|
74
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
class h {
|
|
2
|
+
held = /* @__PURE__ */ new Set();
|
|
3
|
+
down = /* @__PURE__ */ new Set();
|
|
4
|
+
up = /* @__PURE__ */ new Set();
|
|
5
|
+
cleanup = [];
|
|
6
|
+
constructor(e = window) {
|
|
7
|
+
const n = (t) => {
|
|
8
|
+
const s = t.code;
|
|
9
|
+
t.repeat || this.held.has(s) || (this.held.add(s), this.down.add(s));
|
|
10
|
+
}, d = (t) => {
|
|
11
|
+
const s = t.code;
|
|
12
|
+
this.held.delete(s) && this.up.add(s);
|
|
13
|
+
}, r = () => {
|
|
14
|
+
for (const t of this.held) this.up.add(t);
|
|
15
|
+
this.held.clear();
|
|
16
|
+
};
|
|
17
|
+
e.addEventListener("keydown", n), e.addEventListener("keyup", d), window.addEventListener("blur", r), this.cleanup.push(
|
|
18
|
+
() => e.removeEventListener("keydown", n),
|
|
19
|
+
() => e.removeEventListener("keyup", d),
|
|
20
|
+
() => window.removeEventListener("blur", r)
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
isDown(e) {
|
|
24
|
+
return this.held.has(e);
|
|
25
|
+
}
|
|
26
|
+
/** Any of these keys is held. */
|
|
27
|
+
anyDown(...e) {
|
|
28
|
+
return e.some((n) => this.held.has(n));
|
|
29
|
+
}
|
|
30
|
+
/** Went down since the last `endStep`. */
|
|
31
|
+
pressed(e) {
|
|
32
|
+
return this.down.has(e);
|
|
33
|
+
}
|
|
34
|
+
/** Came up since the last `endStep`. */
|
|
35
|
+
released(e) {
|
|
36
|
+
return this.up.has(e);
|
|
37
|
+
}
|
|
38
|
+
/** -1, 0 or 1 from two sets of keys: `axis(['KeyA', 'ArrowLeft'], ['KeyD', 'ArrowRight'])`. */
|
|
39
|
+
axis(e, n) {
|
|
40
|
+
return (this.anyDown(...n) ? 1 : 0) - (this.anyDown(...e) ? 1 : 0);
|
|
41
|
+
}
|
|
42
|
+
/** Forgets this step's edges; held keys stay held. */
|
|
43
|
+
endStep() {
|
|
44
|
+
this.down.clear(), this.up.clear();
|
|
45
|
+
}
|
|
46
|
+
destroy() {
|
|
47
|
+
for (const e of this.cleanup.splice(0)) e();
|
|
48
|
+
this.held.clear(), this.endStep();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
h as Keyboard
|
|
53
|
+
};
|