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,202 @@
|
|
|
1
|
+
import { sound as u } from "../audio/SoundEngine.js";
|
|
2
|
+
import { parseTiled as f } from "../tilemap/tiled.js";
|
|
3
|
+
import { collectAtlasPages as l, duplicateFrames as w, parseAtlas as p } from "./textureAtlas.js";
|
|
4
|
+
function c(r, t) {
|
|
5
|
+
if (/^[a-z][a-z0-9+.-]*:/i.test(r) || r.startsWith("/")) return r;
|
|
6
|
+
const a = (t.slice(0, t.lastIndexOf("/") + 1) + r).split("/"), s = [];
|
|
7
|
+
for (const i of a)
|
|
8
|
+
i === ".." && s.length && s[s.length - 1] !== ".." && s[s.length - 1] !== "" ? s.pop() : i !== "." && s.push(i);
|
|
9
|
+
return s.join("/");
|
|
10
|
+
}
|
|
11
|
+
async function m(r) {
|
|
12
|
+
const t = await createImageBitmap(r), e = document.createElement("canvas");
|
|
13
|
+
e.width = t.width, e.height = t.height;
|
|
14
|
+
const a = e.getContext("2d");
|
|
15
|
+
if (!a) throw new Error("AssetLoader: no 2D context (out of canvas memory?)");
|
|
16
|
+
return a.drawImage(t, 0, 0), t.close(), e;
|
|
17
|
+
}
|
|
18
|
+
async function g(r, t, e) {
|
|
19
|
+
if (typeof FontFace > "u" || typeof document > "u" || !document.fonts)
|
|
20
|
+
throw new Error(`AssetLoader: this browser cannot load the font "${r}" (no FontFace)`);
|
|
21
|
+
const a = new FontFace(r, t, e);
|
|
22
|
+
await a.load(), document.fonts.add(a);
|
|
23
|
+
}
|
|
24
|
+
class $ {
|
|
25
|
+
constructor(t, e = {}) {
|
|
26
|
+
this.textures = t, this.options = e, this.fetcher = e.fetch ?? ((a) => fetch(a)), this.toCanvas = e.toCanvas ?? m;
|
|
27
|
+
}
|
|
28
|
+
textures;
|
|
29
|
+
options;
|
|
30
|
+
queue = [];
|
|
31
|
+
data = /* @__PURE__ */ new Map();
|
|
32
|
+
maps = /* @__PURE__ */ new Map();
|
|
33
|
+
atlases = /* @__PURE__ */ new Map();
|
|
34
|
+
/** Decoded audio by key; a key with bytes only waits for a context (`decodeAudio`). */
|
|
35
|
+
audioBuffers = /* @__PURE__ */ new Map();
|
|
36
|
+
audioBytes = /* @__PURE__ */ new Map();
|
|
37
|
+
decoding = /* @__PURE__ */ new Map();
|
|
38
|
+
fetcher;
|
|
39
|
+
toCanvas;
|
|
40
|
+
total = 0;
|
|
41
|
+
done = 0;
|
|
42
|
+
image(t, e) {
|
|
43
|
+
return this.add(t, async () => {
|
|
44
|
+
this.textures.addCanvas(t, await this.toCanvas(await this.blob(e)));
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/** An image cut into equal frames named 0, 1, 2…, left to right, then row by row. */
|
|
48
|
+
spritesheet(t, e, a) {
|
|
49
|
+
return this.add(t, async () => {
|
|
50
|
+
this.textures.addSpriteSheet(t, await this.toCanvas(await this.blob(e)), a);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
json(t, e) {
|
|
54
|
+
return this.add(t, async () => {
|
|
55
|
+
this.data.set(t, await (await this.request(e)).json());
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
text(t, e) {
|
|
59
|
+
return this.add(t, async () => {
|
|
60
|
+
this.data.set(t, await (await this.request(e)).text());
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/** A Tiled JSON map, then every tileset image it names (resolved beside the map file). */
|
|
64
|
+
tilemap(t, e, a = {}) {
|
|
65
|
+
return this.add(t, async () => {
|
|
66
|
+
const s = f(await (await this.request(e)).json());
|
|
67
|
+
this.maps.set(t, s);
|
|
68
|
+
const i = a.textureKey ?? ((n) => n.name);
|
|
69
|
+
for (const n of s.tilesets) this.image(i(n), c(n.image, e));
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* A TexturePacker (or Pixi) JSON atlas, hash or array format: its page image, and for a multipack atlas every page
|
|
74
|
+
* named in `meta.related_multi_packs` (each resolved beside the file naming it). The first page is the texture
|
|
75
|
+
* `key`, further pages `key~1`, `key~2`…, and every frame of every page is found as `textures.get(key, frameName)`.
|
|
76
|
+
* Counts as one asset in the progress.
|
|
77
|
+
*/
|
|
78
|
+
atlas(t, e) {
|
|
79
|
+
return this.add(t, async () => {
|
|
80
|
+
const a = this.textures.addAtlas?.bind(this.textures);
|
|
81
|
+
if (!a) throw new Error(`AssetLoader: the texture sink cannot take atlases (no addAtlas) for "${t}"`);
|
|
82
|
+
const s = await l(
|
|
83
|
+
e,
|
|
84
|
+
async (o) => p(await (await this.request(o)).json(), o),
|
|
85
|
+
c
|
|
86
|
+
), i = await Promise.all(s.map((o) => this.blob(c(o.page.image, o.url)).then((h) => this.toCanvas(h)))), n = w(s.map((o) => o.page));
|
|
87
|
+
n.length && console.warn(`[assets] atlas "${t}" names ${n.length} frame(s) on more than one page: ${n.slice(0, 5).join(", ")}`), a(t, s.map((o, h) => ({ canvas: i[h], frames: o.page.frames })));
|
|
88
|
+
const d = {};
|
|
89
|
+
for (const o of s) Object.assign(d, o.page.animations);
|
|
90
|
+
this.atlases.set(t, { frames: [...new Set(s.flatMap((o) => o.page.frames.map((h) => h.name)))], animations: d, pages: s.length });
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* A web font (woff2, woff, ttf) under `family`, added to `document.fonts` once loaded so canvas text and the DOM can
|
|
95
|
+
* use it at once — load fonts before the first `Text` is drawn, or it measures with the fallback.
|
|
96
|
+
*/
|
|
97
|
+
font(t, e, a) {
|
|
98
|
+
const s = this.options.addFont ?? g;
|
|
99
|
+
return this.add(t, async () => {
|
|
100
|
+
await s(t, await this.bytes(e), a);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* A sound file decoded into an `AudioBuffer` through the engine's audio context (`getAudio`). Before any context
|
|
105
|
+
* exists (browsers open one only after a gesture) the bytes are kept and decoded by `decodeAudio`, so a loading
|
|
106
|
+
* screen never has to wait for the player to click.
|
|
107
|
+
*/
|
|
108
|
+
audio(t, e) {
|
|
109
|
+
return this.add(t, async () => {
|
|
110
|
+
const a = await this.bytes(e);
|
|
111
|
+
this.audioBuffers.delete(t), this.decoding.delete(t);
|
|
112
|
+
const s = (this.options.audioContext ?? (() => u.audioContext))();
|
|
113
|
+
s ? this.audioBuffers.set(t, await this.decode(s, a, e)) : this.audioBytes.set(t, a);
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
/** A loaded sound, decoded; null while it waits for an audio context (`decodeAudio`). */
|
|
117
|
+
getAudio(t) {
|
|
118
|
+
const e = this.audioBuffers.get(t);
|
|
119
|
+
if (e) return e;
|
|
120
|
+
if (this.audioBytes.has(t)) return null;
|
|
121
|
+
throw new Error(`AssetLoader: no audio loaded as "${t}"`);
|
|
122
|
+
}
|
|
123
|
+
/** A loaded sound, decoding its kept bytes through `ctx` (default: the loader's context) the first time. */
|
|
124
|
+
decodeAudio(t, e) {
|
|
125
|
+
const a = this.audioBuffers.get(t);
|
|
126
|
+
if (a) return Promise.resolve(a);
|
|
127
|
+
const s = this.decoding.get(t);
|
|
128
|
+
if (s) return s;
|
|
129
|
+
const i = this.audioBytes.get(t);
|
|
130
|
+
if (!i) return Promise.reject(new Error(`AssetLoader: no audio loaded as "${t}"`));
|
|
131
|
+
const n = e ?? (this.options.audioContext ?? (() => u.audioContext))();
|
|
132
|
+
if (!n) return Promise.reject(new Error(`AssetLoader: no audio context to decode "${t}" yet`));
|
|
133
|
+
const d = this.decode(n, i, t).then(
|
|
134
|
+
(o) => (this.audioBuffers.set(t, o), this.audioBytes.delete(t), this.decoding.delete(t), o),
|
|
135
|
+
(o) => {
|
|
136
|
+
throw this.decoding.delete(t), o;
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
return this.decoding.set(t, d), d;
|
|
140
|
+
}
|
|
141
|
+
/** What a loaded atlas holds: its frame names and animations. */
|
|
142
|
+
getAtlas(t) {
|
|
143
|
+
const e = this.atlases.get(t);
|
|
144
|
+
if (!e) throw new Error(`AssetLoader: no atlas loaded as "${t}"`);
|
|
145
|
+
return e;
|
|
146
|
+
}
|
|
147
|
+
/** Runs everything queued; `onProgress` after each asset. Safe to call again after queueing more. */
|
|
148
|
+
async load(t) {
|
|
149
|
+
const e = Math.max(1, this.options.concurrency ?? 6), a = async () => {
|
|
150
|
+
for (let s = this.queue.shift(); s; s = this.queue.shift())
|
|
151
|
+
await s.run(), this.done++, t?.({ done: this.done, total: this.total, key: s.key });
|
|
152
|
+
};
|
|
153
|
+
for (; this.queue.length; ) await Promise.all(Array.from({ length: e }, a));
|
|
154
|
+
}
|
|
155
|
+
/** A loaded JSON value. */
|
|
156
|
+
getJson(t) {
|
|
157
|
+
if (!this.data.has(t)) throw new Error(`AssetLoader: no JSON or text loaded as "${t}"`);
|
|
158
|
+
return this.data.get(t);
|
|
159
|
+
}
|
|
160
|
+
/** A loaded text file. */
|
|
161
|
+
getText(t) {
|
|
162
|
+
return this.getJson(t);
|
|
163
|
+
}
|
|
164
|
+
/** A loaded Tiled map. */
|
|
165
|
+
map(t) {
|
|
166
|
+
const e = this.maps.get(t);
|
|
167
|
+
if (!e) throw new Error(`AssetLoader: no tilemap loaded as "${t}"`);
|
|
168
|
+
return e;
|
|
169
|
+
}
|
|
170
|
+
add(t, e) {
|
|
171
|
+
return this.queue.push({ key: t, run: e }), this.total++, this;
|
|
172
|
+
}
|
|
173
|
+
async request(t) {
|
|
174
|
+
const e = c(t, this.options.baseUrl ?? "");
|
|
175
|
+
let a;
|
|
176
|
+
try {
|
|
177
|
+
a = await this.fetcher(e);
|
|
178
|
+
} catch (s) {
|
|
179
|
+
throw new Error(`AssetLoader: could not fetch ${e}: ${s instanceof Error ? s.message : String(s)}`);
|
|
180
|
+
}
|
|
181
|
+
if (!a.ok) throw new Error(`AssetLoader: ${e} answered ${a.status}`);
|
|
182
|
+
return a;
|
|
183
|
+
}
|
|
184
|
+
async blob(t) {
|
|
185
|
+
return (await this.request(t)).blob();
|
|
186
|
+
}
|
|
187
|
+
async bytes(t) {
|
|
188
|
+
const e = await this.request(t);
|
|
189
|
+
return typeof e.arrayBuffer == "function" ? e.arrayBuffer() : (await e.blob()).arrayBuffer();
|
|
190
|
+
}
|
|
191
|
+
async decode(t, e, a) {
|
|
192
|
+
try {
|
|
193
|
+
return await t.decodeAudioData(e.slice(0));
|
|
194
|
+
} catch (s) {
|
|
195
|
+
throw new Error(`AssetLoader: could not decode audio ${a}: ${s instanceof Error ? s.message : String(s)}`);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
export {
|
|
200
|
+
$ as AssetLoader,
|
|
201
|
+
c as resolveUrl
|
|
202
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Texture as u, Rectangle as g } from "pixi.js";
|
|
2
|
+
import { parseAseprite as l } from "../anim/parseAseprite.js";
|
|
3
|
+
import { resolveUrl as h } from "./AssetLoader.js";
|
|
4
|
+
function p(i, t, r, a) {
|
|
5
|
+
const o = i.addCanvas(t, r);
|
|
6
|
+
for (const e of a.frames) {
|
|
7
|
+
const { x: s, y: n, w: c, h: m } = e.rect;
|
|
8
|
+
if (!e.trimmed) {
|
|
9
|
+
o.add(String(e.index), 0, s, n, c, m);
|
|
10
|
+
continue;
|
|
11
|
+
}
|
|
12
|
+
o.frames.get(String(e.index))?.destroy(), o.frames.set(
|
|
13
|
+
String(e.index),
|
|
14
|
+
new u({
|
|
15
|
+
source: o.source,
|
|
16
|
+
frame: new g(s, n, c, m),
|
|
17
|
+
orig: new g(0, 0, e.sourceW, e.sourceH),
|
|
18
|
+
trim: new g(e.offsetX, e.offsetY, c, m)
|
|
19
|
+
})
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
return o;
|
|
23
|
+
}
|
|
24
|
+
async function A(i, t, r, a = {}) {
|
|
25
|
+
const o = a.fetch ?? ((f) => fetch(f)), e = async (f) => {
|
|
26
|
+
let w;
|
|
27
|
+
try {
|
|
28
|
+
w = await o(f);
|
|
29
|
+
} catch (d) {
|
|
30
|
+
throw new Error(`loadAseprite: could not fetch ${f}: ${d instanceof Error ? d.message : String(d)}`);
|
|
31
|
+
}
|
|
32
|
+
if (!w.ok) throw new Error(`loadAseprite: ${f} answered ${w.status}`);
|
|
33
|
+
return w;
|
|
34
|
+
}, s = h(r, a.baseUrl ?? ""), n = l(await (await e(s)).json());
|
|
35
|
+
if (!n.image) throw new Error(`loadAseprite: ${s} names no sheet image (meta.image)`);
|
|
36
|
+
const c = await (await e(h(n.image, s))).blob(), m = await (a.toCanvas ?? x)(c);
|
|
37
|
+
return p(i, t, m, n), n;
|
|
38
|
+
}
|
|
39
|
+
async function x(i) {
|
|
40
|
+
const t = await createImageBitmap(i), r = document.createElement("canvas");
|
|
41
|
+
r.width = t.width, r.height = t.height;
|
|
42
|
+
const a = r.getContext("2d");
|
|
43
|
+
if (!a) throw new Error("loadAseprite: no 2D context (out of canvas memory?)");
|
|
44
|
+
return a.drawImage(t, 0, 0), t.close(), r;
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
p as addAsepriteTextures,
|
|
48
|
+
A as loadAseprite
|
|
49
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
function m(l, h) {
|
|
2
|
+
const a = l[0]?.length ?? 0, f = 1 / Math.max(1, l.length), e = new Float32Array(a);
|
|
3
|
+
for (const t of l) for (let n = 0; n < a; n++) e[n] += t[n] * f;
|
|
4
|
+
let r = 0;
|
|
5
|
+
for (let t = 0; t < a; t++) {
|
|
6
|
+
const n = Math.abs(e[t]);
|
|
7
|
+
n > r && (r = n);
|
|
8
|
+
}
|
|
9
|
+
if (r < 5e-3) return null;
|
|
10
|
+
const i = r * 0.01;
|
|
11
|
+
let s = 0;
|
|
12
|
+
for (; s < a && Math.abs(e[s]) < i; ) s++;
|
|
13
|
+
let c = a;
|
|
14
|
+
for (; c > s && Math.abs(e[c - 1]) < i; ) c--;
|
|
15
|
+
if (c <= s) return null;
|
|
16
|
+
s = Math.max(0, s - Math.round(2e-3 * h));
|
|
17
|
+
const o = e.slice(s, c);
|
|
18
|
+
let M = 0;
|
|
19
|
+
for (let t = 0; t < o.length; t++) M += o[t] * o[t];
|
|
20
|
+
const d = Math.sqrt(M / o.length), g = Math.min(0.16 / Math.max(d, 1e-6), 0.95 / r), E = Math.min(o.length, Math.round(0.01 * h));
|
|
21
|
+
for (let t = 0; t < o.length; t++) {
|
|
22
|
+
const n = o.length - t;
|
|
23
|
+
o[t] *= g * (n < E ? n / E : 1);
|
|
24
|
+
}
|
|
25
|
+
return o;
|
|
26
|
+
}
|
|
27
|
+
self.onmessage = (l) => {
|
|
28
|
+
const { id: h, channels: a, sampleRate: f } = l.data, e = m(a, f);
|
|
29
|
+
self.postMessage({ id: h, data: e }, e ? { transfer: [e.buffer] } : void 0);
|
|
30
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
function m(n) {
|
|
2
|
+
const e = n;
|
|
3
|
+
return typeof e == "object" && e !== null && [e.x, e.y, e.w, e.h].every((t) => typeof t == "number" && Number.isFinite(t));
|
|
4
|
+
}
|
|
5
|
+
function u(n, e, t) {
|
|
6
|
+
if (!m(e.frame)) throw new Error(`${t}: frame "${n}" has no frame rect`);
|
|
7
|
+
const o = e.frame, i = e.rotated === !0, a = {
|
|
8
|
+
name: n,
|
|
9
|
+
x: Math.floor(o.x),
|
|
10
|
+
y: Math.floor(o.y),
|
|
11
|
+
w: Math.floor(i ? o.h : o.w),
|
|
12
|
+
h: Math.floor(i ? o.w : o.h),
|
|
13
|
+
rotated: i,
|
|
14
|
+
sourceW: Math.floor(e.trimmed && e.sourceSize ? e.sourceSize.w : o.w),
|
|
15
|
+
sourceH: Math.floor(e.trimmed && e.sourceSize ? e.sourceSize.h : o.h)
|
|
16
|
+
};
|
|
17
|
+
if (e.trimmed !== !1 && m(e.spriteSourceSize) && e.sourceSize) {
|
|
18
|
+
const f = e.spriteSourceSize;
|
|
19
|
+
f.x === 0 && f.y === 0 && o.w === e.sourceSize.w && o.h === e.sourceSize.h || (a.trim = { x: Math.floor(f.x), y: Math.floor(f.y), w: Math.floor(o.w), h: Math.floor(o.h) }, a.sourceW = Math.floor(e.sourceSize.w), a.sourceH = Math.floor(e.sourceSize.h));
|
|
20
|
+
}
|
|
21
|
+
const r = e.anchor ?? e.pivot;
|
|
22
|
+
return r && typeof r.x == "number" && typeof r.y == "number" && (a.anchor = { x: r.x, y: r.y }), a;
|
|
23
|
+
}
|
|
24
|
+
function h(n, e = "atlas") {
|
|
25
|
+
const t = n;
|
|
26
|
+
if (typeof t != "object" || t === null || typeof t.frames != "object" || t.frames === null)
|
|
27
|
+
throw new Error(`${e}: not a TexturePacker JSON atlas (no "frames")`);
|
|
28
|
+
const o = t.meta?.image;
|
|
29
|
+
if (typeof o != "string" || o === "") throw new Error(`${e}: no "meta.image"`);
|
|
30
|
+
const i = Array.isArray(t.frames) ? t.frames.map((s, c) => u(typeof s?.filename == "string" ? s.filename : String(c), s ?? {}, e)) : Object.entries(t.frames).map(([s, c]) => u(s, c ?? {}, e)), a = Array.isArray(t.meta?.related_multi_packs) ? t.meta.related_multi_packs.filter((s) => typeof s == "string" && s !== "") : [], r = {};
|
|
31
|
+
if (typeof t.animations == "object" && t.animations !== null)
|
|
32
|
+
for (const [s, c] of Object.entries(t.animations))
|
|
33
|
+
Array.isArray(c) && (r[s] = c.filter((l) => typeof l == "string"));
|
|
34
|
+
const f = Number(t.meta?.scale);
|
|
35
|
+
return { image: o, frames: i, animations: r, related: a, scale: Number.isFinite(f) && f > 0 ? f : 1 };
|
|
36
|
+
}
|
|
37
|
+
async function y(n, e, t) {
|
|
38
|
+
const o = /* @__PURE__ */ new Set([n]), i = [], a = [n];
|
|
39
|
+
for (let r = a.shift(); r !== void 0; r = a.shift()) {
|
|
40
|
+
const f = await e(r);
|
|
41
|
+
i.push({ url: r, page: f });
|
|
42
|
+
for (const s of f.related) {
|
|
43
|
+
const c = t(s, r);
|
|
44
|
+
o.has(c) || (o.add(c), a.push(c));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return i;
|
|
48
|
+
}
|
|
49
|
+
function p(n) {
|
|
50
|
+
const e = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set();
|
|
51
|
+
for (const o of n) for (const i of o.frames) (e.has(i.name) ? t : e).add(i.name);
|
|
52
|
+
return [...t];
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
y as collectAtlasPages,
|
|
56
|
+
p as duplicateFrames,
|
|
57
|
+
h as parseAtlas
|
|
58
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { sound as n } from "./SoundEngine.js";
|
|
2
|
+
class u {
|
|
3
|
+
constructor(s) {
|
|
4
|
+
this.options = s;
|
|
5
|
+
}
|
|
6
|
+
options;
|
|
7
|
+
surfaceAt = () => {
|
|
8
|
+
};
|
|
9
|
+
/** Where the surface of a world point comes from; `undefined` is the fallback surface. */
|
|
10
|
+
setSurfaceAt(s) {
|
|
11
|
+
this.surfaceAt = s;
|
|
12
|
+
}
|
|
13
|
+
/** The surface at a world point. */
|
|
14
|
+
surface(s, o) {
|
|
15
|
+
return this.surfaceAt(s, o) ?? this.options.fallback;
|
|
16
|
+
}
|
|
17
|
+
/** One step (or a beat of hooves when `mounted`) at the feet, world x/y; `local` is the player's own. */
|
|
18
|
+
step(s, o, e, a = !1) {
|
|
19
|
+
const t = this.options, r = t.sounds[this.surface(s, o)] ?? t.sounds[t.fallback];
|
|
20
|
+
r && n.play(a ? r.hoof ?? r.step : r.step, { x: s, y: o, local: e, gain: t.gain ?? 0.5, range: t.range ?? 200, minor: !0 });
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
u as Footsteps
|
|
25
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { engineSettings as n } from "../settings.js";
|
|
2
|
+
import { isTouchUi as r } from "../platform/touch.js";
|
|
3
|
+
import { ElementVoice as i } from "./music/ElementVoice.js";
|
|
4
|
+
import { GraphVoice as o } from "./music/GraphVoice.js";
|
|
5
|
+
import { MusicChannel as h } from "./music/MusicChannel.js";
|
|
6
|
+
import { elementVolumeLocked as u } from "./music/musicVoice.js";
|
|
7
|
+
class a {
|
|
8
|
+
channels = /* @__PURE__ */ new Map();
|
|
9
|
+
route = "auto";
|
|
10
|
+
graph = null;
|
|
11
|
+
graphLocked = null;
|
|
12
|
+
pauseInBackground = null;
|
|
13
|
+
installed = !1;
|
|
14
|
+
/** Picks the route and background behaviour; call before the first track for the route to apply to every track. */
|
|
15
|
+
configure(e) {
|
|
16
|
+
return e.route && (this.route = e.route), e.pauseInBackground !== void 0 && (this.pauseInBackground = e.pauseInBackground), this;
|
|
17
|
+
}
|
|
18
|
+
/** The channel named `name`, made on first use. */
|
|
19
|
+
channel(e = "music") {
|
|
20
|
+
let t = this.channels.get(e);
|
|
21
|
+
return t || (this.install(), t = new h(() => n.getState().musicVolume, (s) => this.voiceFor(s)), this.channels.set(e, t)), t;
|
|
22
|
+
}
|
|
23
|
+
/** The url the `'music'` channel plays, if any. */
|
|
24
|
+
get current() {
|
|
25
|
+
return this.channels.get("music")?.current ?? null;
|
|
26
|
+
}
|
|
27
|
+
/** Plays `url` on the `'music'` channel. */
|
|
28
|
+
play(e, t) {
|
|
29
|
+
this.channel().play(e, t);
|
|
30
|
+
}
|
|
31
|
+
/** Fades every channel out. */
|
|
32
|
+
stop(e = 1200) {
|
|
33
|
+
for (const t of this.channels.values()) t.stop(e);
|
|
34
|
+
}
|
|
35
|
+
pause() {
|
|
36
|
+
for (const e of this.channels.values()) e.pause();
|
|
37
|
+
}
|
|
38
|
+
resume() {
|
|
39
|
+
this.wake();
|
|
40
|
+
}
|
|
41
|
+
destroy() {
|
|
42
|
+
for (const e of this.channels.values()) e.dispose();
|
|
43
|
+
this.channels.clear(), this.graph?.close(), this.graph = null;
|
|
44
|
+
}
|
|
45
|
+
voiceFor(e) {
|
|
46
|
+
const t = this.throughGraph() ? this.context() : null;
|
|
47
|
+
return t ? new o(e, t) : new i(e);
|
|
48
|
+
}
|
|
49
|
+
throughGraph() {
|
|
50
|
+
return this.route !== "auto" ? this.route === "graph" : this.graphLocked ??= u();
|
|
51
|
+
}
|
|
52
|
+
context() {
|
|
53
|
+
if (this.graph) return this.graph;
|
|
54
|
+
const e = globalThis.AudioContext ?? globalThis.webkitAudioContext;
|
|
55
|
+
return e ? (this.graph = new e(), this.graph) : null;
|
|
56
|
+
}
|
|
57
|
+
/** Retries every refused start and follows the volume; the graph's context resumes inside the gesture that called it. */
|
|
58
|
+
wake() {
|
|
59
|
+
if (this.graph && this.graph.state !== "running" && this.graph.resume().catch(() => {
|
|
60
|
+
}), !(typeof document < "u" && document.hidden))
|
|
61
|
+
for (const e of this.channels.values()) e.refresh();
|
|
62
|
+
}
|
|
63
|
+
install() {
|
|
64
|
+
if (this.installed || typeof window > "u") return;
|
|
65
|
+
this.installed = !0;
|
|
66
|
+
const e = () => this.wake();
|
|
67
|
+
for (const t of ["pointerdown", "touchend", "keydown"]) window.addEventListener(t, e, { capture: !0 });
|
|
68
|
+
n.subscribe(e), document.addEventListener("visibilitychange", () => {
|
|
69
|
+
(this.pauseInBackground ?? r()) && (document.hidden ? this.pause() : e());
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
const w = new a();
|
|
74
|
+
export {
|
|
75
|
+
a as MusicPlayer,
|
|
76
|
+
w as music
|
|
77
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { engineSettings as m } from "../settings.js";
|
|
2
|
+
import { SampleBank as E, hasTakes as y } from "./sampleBank.js";
|
|
3
|
+
import { SOUNDS as u } from "./soundTable.js";
|
|
4
|
+
import { renderRecipe as R, SYNTH_RATE as k } from "./synth.js";
|
|
5
|
+
const p = 480, _ = 10, q = 6, B = 60, F = 0.45, C = 0.05, w = 80, g = [18e3, 1800], T = { freq: 3500, gainDb: -7 }, O = 11e3;
|
|
6
|
+
class V {
|
|
7
|
+
ctx = null;
|
|
8
|
+
master = null;
|
|
9
|
+
buffers = /* @__PURE__ */ new Map();
|
|
10
|
+
samples = new E();
|
|
11
|
+
lastAt = /* @__PURE__ */ new Map();
|
|
12
|
+
voices = 0;
|
|
13
|
+
/** Where the local player stands, set by the world scene; null off the world screens. */
|
|
14
|
+
listener = () => null;
|
|
15
|
+
onRunning = () => {
|
|
16
|
+
};
|
|
17
|
+
constructor() {
|
|
18
|
+
if (typeof window > "u") return;
|
|
19
|
+
const t = () => {
|
|
20
|
+
const s = this.context();
|
|
21
|
+
if (!s || s.state === "running") return;
|
|
22
|
+
s.resume();
|
|
23
|
+
const r = s.createBufferSource();
|
|
24
|
+
r.buffer = s.createBuffer(1, 1, 22050), r.connect(s.destination), r.start();
|
|
25
|
+
}, n = ["pointerdown", "pointerup", "touchend", "keydown"], e = (s) => {
|
|
26
|
+
for (const r of n)
|
|
27
|
+
s ? window.addEventListener(r, t, { capture: !0 }) : window.removeEventListener(r, t, { capture: !0 });
|
|
28
|
+
};
|
|
29
|
+
this.onRunning = (s) => e(!s), e(!0);
|
|
30
|
+
const i = navigator.audioSession;
|
|
31
|
+
i && (i.type = "ambient"), m.subscribe((s) => {
|
|
32
|
+
this.ctx && this.master && this.master.gain.setTargetAtTime(this.level(s.sfxVolume), this.ctx.currentTime, 0.02);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The effects' audio context once something opened it (the first gesture does), else null: never created here, so
|
|
37
|
+
* asking does not open a context the browser would hold suspended. `AssetLoader.audio` decodes through it.
|
|
38
|
+
*/
|
|
39
|
+
get audioContext() {
|
|
40
|
+
return this.ctx;
|
|
41
|
+
}
|
|
42
|
+
play(t, n = {}) {
|
|
43
|
+
if (!t || !u.recipes[t] && !y(t) || m.getState().sfxVolume <= 0) return;
|
|
44
|
+
const e = this.ctx;
|
|
45
|
+
if (!e || e.state !== "running" || this.voices >= (n.minor ? q : _)) return;
|
|
46
|
+
let i = (n.gain ?? 1) * (n.local ? 1 : F), s = 0, r = 0;
|
|
47
|
+
if (n.x !== void 0 && n.y !== void 0) {
|
|
48
|
+
const o = this.listener();
|
|
49
|
+
if (o) {
|
|
50
|
+
const M = n.x - o.x, d = Math.hypot(M, n.y - o.y), b = Math.min(p, n.range ?? p);
|
|
51
|
+
if (d >= b) return;
|
|
52
|
+
i *= Math.pow(1 - d / b, 1.5), r = d / p, s = Math.max(-0.7, Math.min(0.7, M / 320));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (i < 0.03) return;
|
|
56
|
+
const x = performance.now();
|
|
57
|
+
if (x - (this.lastAt.get(t) ?? -1e9) < B) return;
|
|
58
|
+
const v = this.samples.take(e, t), l = v ?? this.buffer(e, t);
|
|
59
|
+
if (!l) return;
|
|
60
|
+
v && (i *= u.recipes[t]?.fileGain ?? 1), this.lastAt.set(t, x);
|
|
61
|
+
const c = e.createBufferSource();
|
|
62
|
+
c.buffer = l;
|
|
63
|
+
const S = u.recipes[t]?.jitter ?? C;
|
|
64
|
+
c.playbackRate.value = 1 + (Math.random() * 2 - 1) * S;
|
|
65
|
+
const a = e.createGain();
|
|
66
|
+
a.gain.value = Math.min(1, i);
|
|
67
|
+
const h = e.createStereoPanner();
|
|
68
|
+
h.pan.value = s;
|
|
69
|
+
const f = e.createBiquadFilter();
|
|
70
|
+
f.type = "lowpass", f.frequency.value = g[0] * Math.pow(g[1] / g[0], r), c.connect(f).connect(a).connect(h).connect(this.master), this.voices++, c.onended = () => {
|
|
71
|
+
this.voices--, c.disconnect(), f.disconnect(), a.disconnect(), h.disconnect();
|
|
72
|
+
}, c.start();
|
|
73
|
+
const A = l.duration / c.playbackRate.value * 1e3;
|
|
74
|
+
if (n.maxMs !== void 0 && A > n.maxMs) {
|
|
75
|
+
const o = e.currentTime + Math.max(w, n.maxMs) / 1e3;
|
|
76
|
+
a.gain.setValueAtTime(a.gain.value, o - w / 1e3), a.gain.linearRampToValueAtTime(0, o), c.stop(o);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
level(t) {
|
|
80
|
+
return Math.max(0, Math.min(1, t)) * u.master;
|
|
81
|
+
}
|
|
82
|
+
context() {
|
|
83
|
+
if (this.ctx) return this.ctx;
|
|
84
|
+
if (typeof AudioContext > "u") return null;
|
|
85
|
+
this.ctx = new AudioContext(), this.master = this.ctx.createGain(), this.master.gain.value = this.level(m.getState().sfxVolume);
|
|
86
|
+
const t = this.ctx.createBiquadFilter();
|
|
87
|
+
t.type = "highshelf", t.frequency.value = T.freq, t.gain.value = T.gainDb;
|
|
88
|
+
const n = this.ctx.createBiquadFilter();
|
|
89
|
+
n.type = "lowpass", n.frequency.value = O, this.master.connect(t).connect(n).connect(this.ctx.destination);
|
|
90
|
+
const e = this.ctx, i = () => {
|
|
91
|
+
const s = e.state === "running";
|
|
92
|
+
this.onRunning(s), s && this.prerender(e);
|
|
93
|
+
};
|
|
94
|
+
return e.addEventListener("statechange", i), e.state === "running" && queueMicrotask(i), e;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Starts decoding every recorded take and renders every recipe not rendered yet, one per task, once the context
|
|
98
|
+
* first runs — so the first swing of a fight does not pay for its sound in that frame.
|
|
99
|
+
*/
|
|
100
|
+
prerender(t) {
|
|
101
|
+
for (const i of this.samples.names()) this.samples.load(t, i);
|
|
102
|
+
const n = Object.keys(u.recipes).filter((i) => !this.buffers.has(i) && !y(i)), e = () => {
|
|
103
|
+
const i = n.shift();
|
|
104
|
+
i !== void 0 && (this.buffer(t, i), setTimeout(e, 0));
|
|
105
|
+
};
|
|
106
|
+
e();
|
|
107
|
+
}
|
|
108
|
+
/** Rendered on first use or by `prerender` (a few ms each), then kept. */
|
|
109
|
+
buffer(t, n) {
|
|
110
|
+
const e = this.buffers.get(n);
|
|
111
|
+
if (e !== void 0) return e;
|
|
112
|
+
const i = u.recipes[n];
|
|
113
|
+
let s = null;
|
|
114
|
+
if (i) {
|
|
115
|
+
const r = R(i);
|
|
116
|
+
s = t.createBuffer(1, r.length, k), s.getChannelData(0).set(r);
|
|
117
|
+
}
|
|
118
|
+
return this.buffers.set(n, s), s;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
const H = new V();
|
|
122
|
+
export {
|
|
123
|
+
V as SoundEngine,
|
|
124
|
+
H as sound
|
|
125
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
function L(c, h) {
|
|
2
|
+
const l = c[0]?.length ?? 0, E = 1 / Math.max(1, c.length), a = new Float32Array(l);
|
|
3
|
+
for (const t of c) for (let n = 0; n < l; n++) a[n] += t[n] * E;
|
|
4
|
+
let s = 0;
|
|
5
|
+
for (let t = 0; t < l; t++) {
|
|
6
|
+
const n = Math.abs(a[t]);
|
|
7
|
+
n > s && (s = n);
|
|
8
|
+
}
|
|
9
|
+
if (s < 5e-3) return null;
|
|
10
|
+
const f = s * 0.01;
|
|
11
|
+
let e = 0;
|
|
12
|
+
for (; e < l && Math.abs(a[e]) < f; ) e++;
|
|
13
|
+
let r = l;
|
|
14
|
+
for (; r > e && Math.abs(a[r - 1]) < f; ) r--;
|
|
15
|
+
if (r <= e) return null;
|
|
16
|
+
e = Math.max(0, e - Math.round(2e-3 * h));
|
|
17
|
+
const o = a.slice(e, r);
|
|
18
|
+
let i = 0;
|
|
19
|
+
for (let t = 0; t < o.length; t++) i += o[t] * o[t];
|
|
20
|
+
const A = Math.sqrt(i / o.length), u = Math.min(0.16 / Math.max(A, 1e-6), 0.95 / s), M = Math.min(o.length, Math.round(0.01 * h));
|
|
21
|
+
for (let t = 0; t < o.length; t++) {
|
|
22
|
+
const n = o.length - t;
|
|
23
|
+
o[t] *= u * (n < M ? n / M : 1);
|
|
24
|
+
}
|
|
25
|
+
return o;
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
L as cleanSamples
|
|
29
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { clamp01 as l } from "./musicVoice.js";
|
|
2
|
+
class m {
|
|
3
|
+
constructor(e) {
|
|
4
|
+
this.el = e;
|
|
5
|
+
}
|
|
6
|
+
el;
|
|
7
|
+
fading = null;
|
|
8
|
+
level() {
|
|
9
|
+
return this.el.volume;
|
|
10
|
+
}
|
|
11
|
+
set(e) {
|
|
12
|
+
this.stopFade(), this.el.volume = l(e);
|
|
13
|
+
}
|
|
14
|
+
fade(e, t, o) {
|
|
15
|
+
this.stopFade();
|
|
16
|
+
const i = this.el.volume, a = performance.now(), s = () => {
|
|
17
|
+
const n = t > 0 ? Math.min(1, (performance.now() - a) / t) : 1;
|
|
18
|
+
this.el.volume = l(i + (e - i) * n), n < 1 ? this.fading = requestAnimationFrame(s) : (this.fading = null, o?.());
|
|
19
|
+
};
|
|
20
|
+
this.fading = requestAnimationFrame(s);
|
|
21
|
+
}
|
|
22
|
+
get busy() {
|
|
23
|
+
return this.fading !== null;
|
|
24
|
+
}
|
|
25
|
+
dispose() {
|
|
26
|
+
this.stopFade(), this.el.pause(), this.el.removeAttribute("src"), this.el.load();
|
|
27
|
+
}
|
|
28
|
+
stopFade() {
|
|
29
|
+
this.fading !== null && cancelAnimationFrame(this.fading), this.fading = null;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
m as ElementVoice
|
|
34
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { clamp01 as a } from "./musicVoice.js";
|
|
2
|
+
class h {
|
|
3
|
+
constructor(t, e) {
|
|
4
|
+
this.el = t, this.graph = e, this.source = e.createMediaElementSource(t), this.gain = e.createGain(), this.gain.gain.value = 0, this.source.connect(this.gain).connect(e.destination);
|
|
5
|
+
}
|
|
6
|
+
el;
|
|
7
|
+
graph;
|
|
8
|
+
gain;
|
|
9
|
+
source;
|
|
10
|
+
timer = null;
|
|
11
|
+
level() {
|
|
12
|
+
return this.gain.gain.value;
|
|
13
|
+
}
|
|
14
|
+
set(t) {
|
|
15
|
+
this.stopFade();
|
|
16
|
+
const e = this.gain.gain;
|
|
17
|
+
e.cancelScheduledValues(this.graph.currentTime), e.setValueAtTime(a(t), this.graph.currentTime);
|
|
18
|
+
}
|
|
19
|
+
fade(t, e, n) {
|
|
20
|
+
this.stopFade();
|
|
21
|
+
const i = this.gain.gain, s = this.graph.currentTime;
|
|
22
|
+
i.cancelScheduledValues(s), i.setValueAtTime(i.value, s), i.linearRampToValueAtTime(a(t), s + e / 1e3), this.timer = setTimeout(() => {
|
|
23
|
+
this.timer = null, n?.();
|
|
24
|
+
}, e);
|
|
25
|
+
}
|
|
26
|
+
get busy() {
|
|
27
|
+
return this.timer !== null;
|
|
28
|
+
}
|
|
29
|
+
dispose() {
|
|
30
|
+
this.stopFade(), this.el.pause(), this.source.disconnect(), this.gain.disconnect();
|
|
31
|
+
}
|
|
32
|
+
stopFade() {
|
|
33
|
+
this.timer && clearTimeout(this.timer), this.timer = null;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
h as GraphVoice
|
|
38
|
+
};
|