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,41 @@
|
|
|
1
|
+
import { type Container } from 'pixi.js';
|
|
2
|
+
import type { Stage } from '../core/Stage.js';
|
|
3
|
+
import { type GradeState } from './grade.js';
|
|
4
|
+
/** Where the sheet goes among its parent's children. */
|
|
5
|
+
export type GradePlacement = 'top' | 'bottom';
|
|
6
|
+
export interface ColorGradeOptions {
|
|
7
|
+
/** How often (ms) the grade is read again: the hour moves slowly, so not every frame (default 500). */
|
|
8
|
+
readEveryMs?: number;
|
|
9
|
+
/** The container the sheet is added to (default the stage's screen layer). */
|
|
10
|
+
parent?: Container;
|
|
11
|
+
/**
|
|
12
|
+
* `'top'` (the default) adds the sheet over everything already in `parent`, so it tints a HUD made before it and
|
|
13
|
+
* not one made after. `'bottom'` puts it under every child `parent` has or will have: on the screen layer that is
|
|
14
|
+
* over the world and under every HUD, whatever order they were made in — usually what a grade wants.
|
|
15
|
+
*/
|
|
16
|
+
placement?: GradePlacement;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A colour laid over the whole screen in **multiply**, so it tints the world (a marsh mossy, a peak ember, a dead
|
|
20
|
+
* land pale) without washing the art toward white the way a normal-blend sheet would. One white quad, tinted: no
|
|
21
|
+
* filter pass, which is what a phone can spare every frame.
|
|
22
|
+
*
|
|
23
|
+
* `read` returns the grade now (`gradeAt` from a place's `Grade` and `DayClock`'s night, say); it is asked a few
|
|
24
|
+
* times a second, and a grade that comes to white is not drawn at all. Give `placement: 'bottom'` to keep it off the
|
|
25
|
+
* HUD (see `ColorGradeOptions.placement`).
|
|
26
|
+
*/
|
|
27
|
+
export declare class ColorGrade {
|
|
28
|
+
private readonly stage;
|
|
29
|
+
private readonly read;
|
|
30
|
+
private readonly sheet;
|
|
31
|
+
private readAt;
|
|
32
|
+
private blank;
|
|
33
|
+
private readonly every;
|
|
34
|
+
constructor(stage: Stage, read: () => GradeState | null, options?: ColorGradeOptions);
|
|
35
|
+
/** Reads the grade again on the next update (the place changed). */
|
|
36
|
+
invalidate(): void;
|
|
37
|
+
/** `enabled`: the game's setting, and off under a battery saver — a full-screen blend is a cost on a phone. */
|
|
38
|
+
update(now: number, enabled?: boolean): void;
|
|
39
|
+
destroy(): void;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=ColorGrade.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorGrade.d.ts","sourceRoot":"","sources":["../../../src/ambient/ColorGrade.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAEtD,wDAAwD;AACxD,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,QAAQ,CAAC;AAE9C,MAAM,WAAW,iBAAiB;IAChC,uGAAuG;IACvG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;CAC5B;AAED;;;;;;;;GAQG;AACH,qBAAa,UAAU;IAOnB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,IAAI;IAPvB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA0C;IAChE,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;gBAGZ,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,MAAM,UAAU,GAAG,IAAI,EAC9C,OAAO,GAAE,iBAAsB;IAUjC,oEAAoE;IACpE,UAAU,IAAI,IAAI;IAIlB,+GAA+G;IAC/G,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,UAAO,GAAG,IAAI;IAoBzC,OAAO,IAAI,IAAI;CAGhB"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A time of day read off a wall clock, so every client that agrees on the time (`serverNow`) stands in the same dusk
|
|
3
|
+
* without a packet between them. Pure: no Pixi, no clock of its own — the caller hands in the time, and what draws
|
|
4
|
+
* the night (a `LightLayer`, the pixel `NightShade`) or a HUD badge reads what this returns.
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* const clock = new DayClock({
|
|
8
|
+
* periodMs: 2 * 3600_000, // a game day every two real hours
|
|
9
|
+
* keys: [
|
|
10
|
+
* { at: 0, color: 0x0a1030, alpha: 0.52 },
|
|
11
|
+
* { at: 0.3, color: 0xfff0d8, alpha: 0 },
|
|
12
|
+
* { at: 0.7, color: 0xffb070, alpha: 0 },
|
|
13
|
+
* { at: 0.86, color: 0x0a1030, alpha: 0.52 },
|
|
14
|
+
* ],
|
|
15
|
+
* phases: [{ id: 'dawn', from: 0.2 }, { id: 'day', from: 0.3 }, { id: 'dusk', from: 0.7 }, { id: 'night', from: 0.8 }],
|
|
16
|
+
* });
|
|
17
|
+
* const day = clock.at(serverNow()); // { phase, id, color, alpha, night }
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* Phase 0 is midnight and 0.5 noon. Keys are the grade laid over the outdoor world at points of the day, mixed
|
|
21
|
+
* between neighbours; a key at 0 and one at 1 with the same values make midnight seamless.
|
|
22
|
+
*/
|
|
23
|
+
/** The world's grade at one point of the day: its colour (0xRRGGBB) and how strongly it is laid (0 by day). */
|
|
24
|
+
export interface DayKey {
|
|
25
|
+
at: number;
|
|
26
|
+
color: number;
|
|
27
|
+
alpha: number;
|
|
28
|
+
}
|
|
29
|
+
/** A named part of the day starting at `from` (0..1); the last one runs on through midnight. */
|
|
30
|
+
export interface DayPhase<P extends string = string> {
|
|
31
|
+
id: P;
|
|
32
|
+
from: number;
|
|
33
|
+
}
|
|
34
|
+
export interface DayClockOptions<P extends string = string> {
|
|
35
|
+
/** Real milliseconds a whole game day lasts. */
|
|
36
|
+
periodMs: number;
|
|
37
|
+
/** Shifts the day against the wall clock (the same offset on every client keeps them together). */
|
|
38
|
+
offsetMs?: number;
|
|
39
|
+
/** At least one key. */
|
|
40
|
+
keys: readonly DayKey[];
|
|
41
|
+
/** Optional names for parts of the day; without them `id` is ''. */
|
|
42
|
+
phases?: readonly DayPhase<P>[];
|
|
43
|
+
}
|
|
44
|
+
export interface DayState<P extends string = string> {
|
|
45
|
+
/** 0..1 through the game day: 0 midnight, 0.5 noon. */
|
|
46
|
+
phase: number;
|
|
47
|
+
/** The part of the day `phase` falls in. */
|
|
48
|
+
id: P | '';
|
|
49
|
+
/** The grade over the outdoor world, 0xRRGGBB. */
|
|
50
|
+
color: number;
|
|
51
|
+
/** How strongly the grade is laid (0 at full day). */
|
|
52
|
+
alpha: number;
|
|
53
|
+
/** 0 by day, 1 at the darkest key: how much lamps matter. */
|
|
54
|
+
night: number;
|
|
55
|
+
}
|
|
56
|
+
/** `a` taken `t` of the way to `b`, per channel, 0xRRGGBB. */
|
|
57
|
+
export declare function mixRgb(a: number, b: number, t: number): number;
|
|
58
|
+
export declare class DayClock<P extends string = string> {
|
|
59
|
+
private readonly periodMs;
|
|
60
|
+
private readonly offsetMs;
|
|
61
|
+
private readonly keys;
|
|
62
|
+
private readonly phases;
|
|
63
|
+
private readonly maxAlpha;
|
|
64
|
+
/** A phase held still (a debug command, a cut scene at midnight); null follows the clock. */
|
|
65
|
+
private held;
|
|
66
|
+
constructor(options: DayClockOptions<P>);
|
|
67
|
+
/** Holds the day at `phase` (0..1), or lets it run again with null. */
|
|
68
|
+
hold(phase: number | null): void;
|
|
69
|
+
/** Where the day stands at wall time `ms` (0..1). */
|
|
70
|
+
phaseAt(ms: number): number;
|
|
71
|
+
at(ms: number): DayState<P>;
|
|
72
|
+
}
|
|
73
|
+
/** A day's phase as a 24-hour clock, "HH:MM" (phase 0 is midnight). */
|
|
74
|
+
export declare function clockText(phase: number): string;
|
|
75
|
+
/**
|
|
76
|
+
* The night's colour pulled toward a place's own (a marsh mossy, a wood blue) as it deepens: `share` of the way at
|
|
77
|
+
* full night, nothing by day.
|
|
78
|
+
*/
|
|
79
|
+
export declare function tintNight(day: Pick<DayState, 'color' | 'night'>, tint: number | undefined, share?: number): number;
|
|
80
|
+
//# sourceMappingURL=DayClock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DayClock.d.ts","sourceRoot":"","sources":["../../../src/ambient/DayClock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,+GAA+G;AAC/G,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,gGAAgG;AAChG,MAAM,WAAW,QAAQ,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IACjD,EAAE,EAAE,CAAC,CAAC;IACN,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IACxD,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,mGAAmG;IACnG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,wBAAwB;IACxB,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,oEAAoE;IACpE,MAAM,CAAC,EAAE,SAAS,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;CACjC;AAED,MAAM,WAAW,QAAQ,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IACjD,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC;IACX,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAC;CACf;AAED,8DAA8D;AAC9D,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAG9D;AAED,qBAAa,QAAQ,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC7C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAW;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgB;IACvC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,6FAA6F;IAC7F,OAAO,CAAC,IAAI,CAAuB;gBAEvB,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC;IAWvC,uEAAuE;IACvE,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAIhC,qDAAqD;IACrD,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAM3B,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC;CA0B5B;AAED,uEAAuE;AACvE,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAG/C;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,SAAM,GAAG,MAAM,CAE/G"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { ViewRect } from '../core/Camera.js';
|
|
2
|
+
import type { Stage } from '../core/Stage.js';
|
|
3
|
+
import type { WeatherState } from './weather.js';
|
|
4
|
+
/**
|
|
5
|
+
* How one kind of weather moves:
|
|
6
|
+
* - `fall`: streaks falling at a slant onto a ground line somewhere in view, half of them leaving a two-frame splash
|
|
7
|
+
* (rain);
|
|
8
|
+
* - `flake`: bits drifting down and swaying as they fall, each on its own phase (snow, ash, petals);
|
|
9
|
+
* - `bank`: a few wide sprites drifting slowly sideways, laid over the bodies (fog, mist, smoke).
|
|
10
|
+
*/
|
|
11
|
+
export type WeatherMotion = 'fall' | 'flake' | 'bank';
|
|
12
|
+
export interface WeatherLook {
|
|
13
|
+
motion: WeatherMotion;
|
|
14
|
+
/** Particles at full strength; fewer show as the weather thins. Keep it in the low hundreds on a phone. */
|
|
15
|
+
max: number;
|
|
16
|
+
/** Texture keys, handed out in turn (repeat a key to make it commoner). */
|
|
17
|
+
keys: readonly string[];
|
|
18
|
+
/** `fall` only: the splash's two frames. Without them a drop simply vanishes where it lands. */
|
|
19
|
+
splash?: readonly [string, string];
|
|
20
|
+
/** World px a second, [lo, hi] each (defaults suit each motion). */
|
|
21
|
+
vx?: readonly [number, number];
|
|
22
|
+
vy?: readonly [number, number];
|
|
23
|
+
/** `flake` only: how far (px) a flake sways either side as it falls (default 4). */
|
|
24
|
+
sway?: number;
|
|
25
|
+
/** A screen-wide tint the kind lays over everything (fog is mostly tint), at `tintAlpha` × strength. */
|
|
26
|
+
tint?: number;
|
|
27
|
+
tintAlpha?: number;
|
|
28
|
+
}
|
|
29
|
+
export interface WeatherLayerOptions<K extends string> {
|
|
30
|
+
looks: Readonly<Partial<Record<K, WeatherLook>>>;
|
|
31
|
+
/** Depth of falling particles in the world layer: over the bodies, under the names (default 900_001). */
|
|
32
|
+
depth?: number;
|
|
33
|
+
/** Depth of fog banks (default 900_010). */
|
|
34
|
+
bankDepth?: number;
|
|
35
|
+
/** Depth of splashes: with the ground effects, so a body standing in the rain is not splashed over (default 0). */
|
|
36
|
+
splashDepth?: number;
|
|
37
|
+
/** Round positions to whole world pixels (default true): pixel art wants it, smooth art may not. */
|
|
38
|
+
snap?: boolean;
|
|
39
|
+
/** Where randomness comes from (default `Math.random`); the look of a shower need not be shared between clients. */
|
|
40
|
+
random?: () => number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The weather on screen: a capped pool of particles that lives only inside the camera's view, plus a light screen
|
|
44
|
+
* tint for the kinds that change the air. Feed it a `WeatherState` each frame (from `weatherAt`, so it fades in and
|
|
45
|
+
* out exactly when every other client's does); the pool is rebuilt only when the kind changes, and a thinning shower
|
|
46
|
+
* hides particles rather than freeing them.
|
|
47
|
+
*
|
|
48
|
+
* The art is the game's: name texture keys per kind (the pixel module's `paintWeatherArt` paints a set in whole
|
|
49
|
+
* pixels).
|
|
50
|
+
*/
|
|
51
|
+
export declare class WeatherLayer<K extends string> {
|
|
52
|
+
private readonly stage;
|
|
53
|
+
private readonly options;
|
|
54
|
+
private readonly drops;
|
|
55
|
+
private kind;
|
|
56
|
+
private look;
|
|
57
|
+
private readonly tint;
|
|
58
|
+
private readonly depth;
|
|
59
|
+
private readonly bankDepth;
|
|
60
|
+
private readonly splashDepth;
|
|
61
|
+
private readonly snap;
|
|
62
|
+
private readonly random;
|
|
63
|
+
constructor(stage: Stage, options: WeatherLayerOptions<K>);
|
|
64
|
+
/**
|
|
65
|
+
* `now` in ms, `dt` the frame's ms, `view` the camera's world view. `share` (0..1) thins the pool on top of the
|
|
66
|
+
* weather's own strength (a reduced-effects setting keeps half).
|
|
67
|
+
*/
|
|
68
|
+
update(now: number, dt: number, view: ViewRect, weather: WeatherState<K>, share?: number): void;
|
|
69
|
+
private rebuild;
|
|
70
|
+
private between;
|
|
71
|
+
private place;
|
|
72
|
+
private spawn;
|
|
73
|
+
private stepFall;
|
|
74
|
+
private stepFlake;
|
|
75
|
+
private stepBank;
|
|
76
|
+
destroy(): void;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=WeatherLayer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WeatherLayer.d.ts","sourceRoot":"","sources":["../../../src/ambient/WeatherLayer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE9C;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAEtD,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,aAAa,CAAC;IACtB,2GAA2G;IAC3G,GAAG,EAAE,MAAM,CAAC;IACZ,2EAA2E;IAC3E,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,gGAAgG;IAChG,MAAM,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,oEAAoE;IACpE,EAAE,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,EAAE,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,oFAAoF;IACpF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wGAAwG;IACxG,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,MAAM;IACnD,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IACjD,yGAAyG;IACzG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mHAAmH;IACnH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oGAAoG;IACpG,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,oHAAoH;IACpH,MAAM,CAAC,EAAE,MAAM,MAAM,CAAC;CACvB;AAsBD;;;;;;;;GAQG;AACH,qBAAa,YAAY,CAAC,CAAC,SAAS,MAAM;IAYtC,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAZ1B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;IACpC,OAAO,CAAC,IAAI,CAAwB;IACpC,OAAO,CAAC,IAAI,CAA0B;IACtC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA0C;IAC/D,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAU;IAC/B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;gBAGnB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAWlD;;;OAGG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,KAAK,SAAI,GAAG,IAAI;IA2B1F,OAAO,CAAC,OAAO;IAkBf,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,KAAK;IAyBb,OAAO,CAAC,QAAQ;IAuBhB,OAAO,CAAC,SAAS;IAajB,OAAO,CAAC,QAAQ;IAOhB,OAAO,IAAI,IAAI;CAKhB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pure half of a colour grade: how strong a place's colour is laid at a point of the day, and the multiply colour
|
|
3
|
+
* that leaves the same result. `ColorGrade` draws it.
|
|
4
|
+
*/
|
|
5
|
+
/** A place's grade: its colour (0xRRGGBB) and how strongly it is laid by day and by night (0..1). */
|
|
6
|
+
export interface Grade {
|
|
7
|
+
color: number;
|
|
8
|
+
day: number;
|
|
9
|
+
night: number;
|
|
10
|
+
}
|
|
11
|
+
export interface GradeState {
|
|
12
|
+
color: number;
|
|
13
|
+
alpha: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The grade at `night` (0 by day, 1 at full night, `DayClock`'s `night`), never past `max`: a grade is a light
|
|
17
|
+
* tint, and one laid too strong washes every sprite toward one colour.
|
|
18
|
+
*/
|
|
19
|
+
export declare function gradeAt(grade: Grade, night: number, max?: number): GradeState;
|
|
20
|
+
/** `color` taken `share` of the way from white: what a multiply sheet of that colour at that opacity leaves. */
|
|
21
|
+
export declare function mixToWhite(color: number, share: number): number;
|
|
22
|
+
//# sourceMappingURL=grade.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grade.d.ts","sourceRoot":"","sources":["../../../src/ambient/grade.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,qGAAqG;AACrG,MAAM,WAAW,KAAK;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,SAAO,GAAG,UAAU,CAG3E;AAED,gHAAgH;AAChH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAI/D"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Weather rolled from wall time alone, so two players standing in the same place are rained on together without a
|
|
3
|
+
* packet between them. Pure and deterministic: the same key, time and table give the same sky on every machine.
|
|
4
|
+
*
|
|
5
|
+
* Time is cut into slots; each slot rolls one entry of a weighted list from a hash of the key and the slot number,
|
|
6
|
+
* and a change of kind fades out at the end of its slot and in at the start of the next. Places can share one sky:
|
|
7
|
+
* a key listed in a `skies` group takes its kind from the group's roll (so the rain does not stop at a map's edge)
|
|
8
|
+
* and only its strength from its own list. The kind `'clear'` means no weather and has no strength.
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* const TABLE: WeatherTable = {
|
|
12
|
+
* slotMs: 12 * 60_000,
|
|
13
|
+
* fadeMs: 40_000,
|
|
14
|
+
* places: { meadow: [{ kind: 'clear', weight: 4 }, { kind: 'rain', weight: 3, intensity: [0.4, 1] }] },
|
|
15
|
+
* };
|
|
16
|
+
* const w = weatherAt('meadow', serverNow(), TABLE); // { kind: 'rain', intensity: 0.7 }
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export interface WeatherEntry<K extends string = string> {
|
|
20
|
+
kind: K | 'clear';
|
|
21
|
+
weight: number;
|
|
22
|
+
/** The strength range rolled for this kind, [lo, hi] in 0..1 (default [1, 1]). */
|
|
23
|
+
intensity?: readonly [number, number];
|
|
24
|
+
}
|
|
25
|
+
export interface WeatherSky<K extends string = string> {
|
|
26
|
+
/** The place keys under this sky. */
|
|
27
|
+
places: readonly string[];
|
|
28
|
+
entries: readonly WeatherEntry<K>[];
|
|
29
|
+
}
|
|
30
|
+
export interface WeatherTable<K extends string = string> {
|
|
31
|
+
/** How long one roll of the sky lasts. */
|
|
32
|
+
slotMs: number;
|
|
33
|
+
/** How long a change of kind takes to fade out and in. */
|
|
34
|
+
fadeMs: number;
|
|
35
|
+
/** Each place's own list; a place with none (a cave) has no weather, even inside a sky. */
|
|
36
|
+
places: Readonly<Record<string, readonly WeatherEntry<K>[]>>;
|
|
37
|
+
/** Groups of neighbouring places that share one sky, by group id. */
|
|
38
|
+
skies?: Readonly<Record<string, WeatherSky<K>>>;
|
|
39
|
+
}
|
|
40
|
+
export interface WeatherState<K extends string = string> {
|
|
41
|
+
kind: K | 'clear';
|
|
42
|
+
/** 0..1, already faded round a change of kind; 0 when clear. */
|
|
43
|
+
intensity: number;
|
|
44
|
+
}
|
|
45
|
+
/** FNV-1a over the text, then an avalanche: a stable number in [0, 1). */
|
|
46
|
+
export declare function hash01(text: string): number;
|
|
47
|
+
/** The weather over place `key` at wall time `ms`. */
|
|
48
|
+
export declare function weatherAt<K extends string>(key: string, ms: number, table: WeatherTable<K>): WeatherState<K>;
|
|
49
|
+
//# sourceMappingURL=weather.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"weather.d.ts","sourceRoot":"","sources":["../../../src/ambient/weather.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IACrD,IAAI,EAAE,CAAC,GAAG,OAAO,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,kFAAkF;IAClF,SAAS,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC;AAED,MAAM,WAAW,UAAU,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IACnD,qCAAqC;IACrC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,OAAO,EAAE,SAAS,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;CACrC;AAED,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IACrD,0CAA0C;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,MAAM,EAAE,MAAM,CAAC;IACf,2FAA2F;IAC3F,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC7D,qEAAqE;IACrE,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACjD;AAED,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IACrD,IAAI,EAAE,CAAC,GAAG,OAAO,CAAC;IAClB,gEAAgE;IAChE,SAAS,EAAE,MAAM,CAAC;CACnB;AAID,0EAA0E;AAC1E,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAU3C;AAiCD,sDAAsD;AACtD,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAuB5G"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Animator, type AnimationClip } from './Animator.js';
|
|
2
|
+
import type { AnimParams, AnimStateMachineOptions } from './animStateTypes.js';
|
|
3
|
+
/**
|
|
4
|
+
* Chooses which clip an `Animator` plays from named states and the transitions between them, the way an animation
|
|
5
|
+
* graph in a larger engine does: the game sets parameters (a bool, a number, a one-shot trigger) and the machine
|
|
6
|
+
* moves between states when a transition's conditions hold, when a clip has played through, or from any state at
|
|
7
|
+
* all by priority. Frame markers fire events (a footstep on frame 3) for the game to hang sounds and effects on.
|
|
8
|
+
*
|
|
9
|
+
* Pure and driven by `update(dt)`, so it runs under node with a fake clock. The definition is compiled into typed
|
|
10
|
+
* arrays once; an update allocates nothing.
|
|
11
|
+
*
|
|
12
|
+
* ```ts
|
|
13
|
+
* const sm = new AnimStateMachine(sheet.clips, {
|
|
14
|
+
* initial: 'idle',
|
|
15
|
+
* params: { speed: 0, grounded: true, jump: 'trigger' },
|
|
16
|
+
* states: { idle: { clip: 'idle' }, run: { clip: 'run', markers: [{ frame: 2, name: 'step' }] }, jump: { clip: 'jump' } },
|
|
17
|
+
* transitions: [
|
|
18
|
+
* { from: 'idle', to: 'run', when: { speed: ['>', 0] } },
|
|
19
|
+
* { from: 'run', to: 'idle', when: { speed: 0 } },
|
|
20
|
+
* { from: '*', to: 'jump', when: { jump: true, grounded: true }, priority: 10 },
|
|
21
|
+
* ],
|
|
22
|
+
* });
|
|
23
|
+
* sm.onEvent = (name) => name === 'step' && sound.play('step');
|
|
24
|
+
* sm.set('speed', 3);
|
|
25
|
+
* sm.update(dt); // seconds; then show sm.frame
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare class AnimStateMachine<State extends string = string, Clip extends string = string, P extends AnimParams = AnimParams> {
|
|
29
|
+
/** The animator it drives; read `frame` off it (or off the machine). */
|
|
30
|
+
readonly animator: Animator<Clip>;
|
|
31
|
+
/** Fired for every marker playback reaches, the state's first frame's on entering it. */
|
|
32
|
+
onEvent: ((event: string, state: State, frame: number) => void) | null;
|
|
33
|
+
/** Fired after each change of state. */
|
|
34
|
+
onStateChange: ((from: State, to: State) => void) | null;
|
|
35
|
+
private readonly params;
|
|
36
|
+
private readonly states;
|
|
37
|
+
private readonly tr;
|
|
38
|
+
private readonly keepTriggers;
|
|
39
|
+
private stateIndex;
|
|
40
|
+
/** Time played in this state, ms, scaled by speed as the animator scales it. */
|
|
41
|
+
private time;
|
|
42
|
+
constructor(clips: Record<Clip, AnimationClip>, options: AnimStateMachineOptions<State, Clip, P>);
|
|
43
|
+
/** The state playing. */
|
|
44
|
+
get state(): State;
|
|
45
|
+
/** The frame to show now (a sheet frame index or name, as the clip lists it). */
|
|
46
|
+
get frame(): string | number;
|
|
47
|
+
/** How much of this state's clip has played: 0 at entry, 1 after one pass, 2 after two loops. */
|
|
48
|
+
get normalizedTime(): number;
|
|
49
|
+
/** Sets a bool or number parameter. */
|
|
50
|
+
set(name: keyof P & string, value: boolean | number): this;
|
|
51
|
+
/** A parameter's value: bools as booleans, triggers as whether they are set. */
|
|
52
|
+
get(name: keyof P & string): boolean | number;
|
|
53
|
+
/** Fires a trigger: the next update's transitions see it once. */
|
|
54
|
+
trigger(name: keyof P & string): this;
|
|
55
|
+
resetTrigger(name: keyof P & string): this;
|
|
56
|
+
/** Goes to `state` now, whatever the transitions say (a respawn, a cut scene). */
|
|
57
|
+
play(state: State): this;
|
|
58
|
+
/** Back to the initial values of every parameter (triggers cleared). */
|
|
59
|
+
resetParams(): this;
|
|
60
|
+
/**
|
|
61
|
+
* Advances the clip by `dt` seconds, fires the markers it passed, then takes at most one transition (so a chain of
|
|
62
|
+
* them never runs through several states in one frame). `update(0)` only checks the transitions.
|
|
63
|
+
*/
|
|
64
|
+
update(dt: number): void;
|
|
65
|
+
private pick;
|
|
66
|
+
private holds;
|
|
67
|
+
private enter;
|
|
68
|
+
/**
|
|
69
|
+
* Fires the markers of every frame after `from` up to `to`. The animator skips frames on a long step, so they are
|
|
70
|
+
* walked rather than only the one landed on; a step long enough to loop the whole clip fires each frame once.
|
|
71
|
+
*/
|
|
72
|
+
private firePassed;
|
|
73
|
+
private fire;
|
|
74
|
+
private applySpeed;
|
|
75
|
+
private consumeTriggers;
|
|
76
|
+
private clearTriggers;
|
|
77
|
+
private paramIndex;
|
|
78
|
+
private triggerIndex;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=AnimStateMachine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnimStateMachine.d.ts","sourceRoot":"","sources":["../../../src/anim/AnimStateMachine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAiB1D,OAAO,KAAK,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAAa,gBAAgB,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,SAAS,MAAM,GAAG,MAAM,EAAE,CAAC,SAAS,UAAU,GAAG,UAAU;IAC1H,wEAAwE;IACxE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IAClC,yFAAyF;IACzF,OAAO,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,IAAI,CAAQ;IAC9E,wCAAwC;IACxC,aAAa,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,KAAK,IAAI,CAAC,GAAG,IAAI,CAAQ;IAEhE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiB;IACxC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAiB;IACxC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAsB;IACzC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAU;IACvC,OAAO,CAAC,UAAU,CAAS;IAC3B,gFAAgF;IAChF,OAAO,CAAC,IAAI,CAAK;gBAEL,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC,EAAE,OAAO,EAAE,uBAAuB,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAWhG,yBAAyB;IACzB,IAAI,KAAK,IAAI,KAAK,CAEjB;IAED,iFAAiF;IACjF,IAAI,KAAK,IAAI,MAAM,GAAG,MAAM,CAE3B;IAED,iGAAiG;IACjG,IAAI,cAAc,IAAI,MAAM,CAE3B;IAED,uCAAuC;IACvC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI;IAO1D,gFAAgF;IAChF,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM;IAM7C,kEAAkE;IAClE,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,MAAM,GAAG,IAAI;IAKrC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,MAAM,GAAG,IAAI;IAK1C,kFAAkF;IAClF,IAAI,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAOxB,wEAAwE;IACxE,WAAW,IAAI,IAAI;IAKnB;;;OAGG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAqBxB,OAAO,CAAC,IAAI;IAcZ,OAAO,CAAC,KAAK;IAqBb,OAAO,CAAC,KAAK;IAWb;;;OAGG;IACH,OAAO,CAAC,UAAU;IAUlB,OAAO,CAAC,IAAI;IAOZ,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,YAAY;CAKrB"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Frame animation of one sprite: which clip plays, which frame it is on. Pure state, advanced by time; a system copies
|
|
3
|
+
* `frame` onto the sprite (`animationSystem`).
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* const clips = { idle: { frames: [0, 1], fps: 2 }, walk: { frames: [2, 3, 4, 5], fps: 10 }, die: { frames: [6, 7, 8], fps: 8, loop: false } };
|
|
7
|
+
* const a = new Animator(clips, 'idle');
|
|
8
|
+
* a.play('walk'); // switching to the clip already playing keeps its place
|
|
9
|
+
* a.update(dt); // seconds
|
|
10
|
+
* sprite.setFrame(a.frame);
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export interface AnimationClip {
|
|
14
|
+
/** Frame names or indices of the sprite sheet, in order. */
|
|
15
|
+
frames: readonly (string | number)[];
|
|
16
|
+
/** Frames per second (default 10). Pixel art usually wants 8–12. */
|
|
17
|
+
fps?: number;
|
|
18
|
+
/** Start over at the end (default true); otherwise hold the last frame and report it finished. */
|
|
19
|
+
loop?: boolean;
|
|
20
|
+
/** Per-frame lengths in ms, overriding `fps` (a held key pose, a quick smear). */
|
|
21
|
+
durations?: readonly number[];
|
|
22
|
+
}
|
|
23
|
+
export type AnimationClips = Record<string, AnimationClip>;
|
|
24
|
+
export declare class Animator<Name extends string = string> {
|
|
25
|
+
private readonly clips;
|
|
26
|
+
private clip;
|
|
27
|
+
private index;
|
|
28
|
+
private elapsed;
|
|
29
|
+
private ended;
|
|
30
|
+
private name;
|
|
31
|
+
/** Called when a clip that does not loop reaches its last frame. */
|
|
32
|
+
onComplete: ((clip: Name) => void) | null;
|
|
33
|
+
/** Playback speed multiplier (1 normal, 0 paused). */
|
|
34
|
+
speed: number;
|
|
35
|
+
constructor(clips: Record<Name, AnimationClip>, initial: NoInfer<Name>);
|
|
36
|
+
/** The clip playing. */
|
|
37
|
+
get current(): Name;
|
|
38
|
+
/** The frame to show now. */
|
|
39
|
+
get frame(): string | number;
|
|
40
|
+
/** Which frame of the clip (0-based). */
|
|
41
|
+
get frameIndex(): number;
|
|
42
|
+
/** A non-looping clip has reached its last frame. */
|
|
43
|
+
get finished(): boolean;
|
|
44
|
+
/** Plays `name`. The clip already playing keeps its place unless `restart`. */
|
|
45
|
+
play(name: Name, restart?: boolean): this;
|
|
46
|
+
/** Advances by `dt` seconds; returns true when the frame changed. */
|
|
47
|
+
update(dt: number): boolean;
|
|
48
|
+
private lengthOf;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=Animator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Animator.d.ts","sourceRoot":"","sources":["../../../src/anim/Animator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,aAAa;IAC5B,4DAA4D;IAC5D,MAAM,EAAE,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IACrC,oEAAoE;IACpE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kGAAkG;IAClG,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,kFAAkF;IAClF,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC/B;AAED,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAE3D,qBAAa,QAAQ,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM;IAY9C,OAAO,CAAC,QAAQ,CAAC,KAAK;IAXxB,OAAO,CAAC,IAAI,CAAgB;IAC5B,OAAO,CAAC,KAAK,CAAK;IAClB,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,IAAI,CAAO;IACnB,oEAAoE;IACpE,UAAU,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC,GAAG,IAAI,CAAQ;IACjD,sDAAsD;IACtD,KAAK,SAAK;gBAGS,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC,EACnD,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC;IASxB,wBAAwB;IACxB,IAAI,OAAO,IAAI,IAAI,CAElB;IAED,6BAA6B;IAC7B,IAAI,KAAK,IAAI,MAAM,GAAG,MAAM,CAE3B;IAED,yCAAyC;IACzC,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,qDAAqD;IACrD,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,+EAA+E;IAC/E,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,UAAQ,GAAG,IAAI;IAavC,qEAAqE;IACrE,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAqB3B,OAAO,CAAC,QAAQ;CAIjB"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { AnimationClip } from './Animator.js';
|
|
2
|
+
import type { AnimParams, AnimStateMachineOptions } from './animStateTypes.js';
|
|
3
|
+
export declare const PARAM_BOOL = 0;
|
|
4
|
+
export declare const PARAM_NUMBER = 1;
|
|
5
|
+
export declare const PARAM_TRIGGER = 2;
|
|
6
|
+
export declare const OP_EQ = 0;
|
|
7
|
+
export declare const OP_NE = 1;
|
|
8
|
+
export declare const OP_GT = 2;
|
|
9
|
+
export declare const OP_GE = 3;
|
|
10
|
+
export declare const OP_LT = 4;
|
|
11
|
+
export declare const OP_LE = 5;
|
|
12
|
+
export interface CompiledParams {
|
|
13
|
+
names: string[];
|
|
14
|
+
index: Map<string, number>;
|
|
15
|
+
kinds: Uint8Array;
|
|
16
|
+
values: Float64Array;
|
|
17
|
+
initial: Float64Array;
|
|
18
|
+
}
|
|
19
|
+
export interface CompiledStates {
|
|
20
|
+
names: string[];
|
|
21
|
+
index: Map<string, number>;
|
|
22
|
+
clips: string[];
|
|
23
|
+
speeds: Float64Array;
|
|
24
|
+
/** Index of the speed parameter, or -1. */
|
|
25
|
+
speedParams: Int32Array;
|
|
26
|
+
/** Total length of each state's clip in ms, at speed 1. */
|
|
27
|
+
lengths: Float64Array;
|
|
28
|
+
frameCounts: Int32Array;
|
|
29
|
+
/** Per state, per clip frame: the event names fired there (undefined: none). */
|
|
30
|
+
markers: (readonly (readonly string[] | undefined)[])[];
|
|
31
|
+
/** Per state: transition indices to try, best first. */
|
|
32
|
+
candidates: Int32Array[];
|
|
33
|
+
}
|
|
34
|
+
export interface CompiledTransitions {
|
|
35
|
+
to: Int32Array;
|
|
36
|
+
anyState: Uint8Array;
|
|
37
|
+
self: Uint8Array;
|
|
38
|
+
onEnd: Uint8Array;
|
|
39
|
+
/** -1: none. */
|
|
40
|
+
exitTime: Float64Array;
|
|
41
|
+
condStart: Int32Array;
|
|
42
|
+
condEnd: Int32Array;
|
|
43
|
+
condParam: Int32Array;
|
|
44
|
+
condOp: Uint8Array;
|
|
45
|
+
condValue: Float64Array;
|
|
46
|
+
}
|
|
47
|
+
/** The length of a clip in ms, frame by frame exactly as `Animator` times it. */
|
|
48
|
+
export declare function clipLength(clip: AnimationClip): number;
|
|
49
|
+
export declare function compileParams(decl: AnimParams): CompiledParams;
|
|
50
|
+
export declare function compileStates(options: AnimStateMachineOptions<string, string, AnimParams>, clips: Record<string, AnimationClip>, params: CompiledParams): CompiledStates;
|
|
51
|
+
export declare function compileTransitions(options: AnimStateMachineOptions<string, string, AnimParams>, states: CompiledStates, params: CompiledParams): CompiledTransitions;
|
|
52
|
+
//# sourceMappingURL=animStateCompile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animStateCompile.d.ts","sourceRoot":"","sources":["../../../src/anim/animStateCompile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAiB,UAAU,EAAE,uBAAuB,EAAa,MAAM,kBAAkB,CAAC;AAQtG,eAAO,MAAM,UAAU,IAAI,CAAC;AAC5B,eAAO,MAAM,YAAY,IAAI,CAAC;AAC9B,eAAO,MAAM,aAAa,IAAI,CAAC;AAE/B,eAAO,MAAM,KAAK,IAAI,CAAC;AACvB,eAAO,MAAM,KAAK,IAAI,CAAC;AACvB,eAAO,MAAM,KAAK,IAAI,CAAC;AACvB,eAAO,MAAM,KAAK,IAAI,CAAC;AACvB,eAAO,MAAM,KAAK,IAAI,CAAC;AACvB,eAAO,MAAM,KAAK,IAAI,CAAC;AAIvB,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3B,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,EAAE,YAAY,CAAC;CACvB;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,EAAE,YAAY,CAAC;IACrB,2CAA2C;IAC3C,WAAW,EAAE,UAAU,CAAC;IACxB,2DAA2D;IAC3D,OAAO,EAAE,YAAY,CAAC;IACtB,WAAW,EAAE,UAAU,CAAC;IACxB,gFAAgF;IAChF,OAAO,EAAE,CAAC,SAAS,CAAC,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC;IACxD,wDAAwD;IACxD,UAAU,EAAE,UAAU,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,UAAU,CAAC;IACf,QAAQ,EAAE,UAAU,CAAC;IACrB,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,UAAU,CAAC;IAClB,gBAAgB;IAChB,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,UAAU,CAAC;IACtB,OAAO,EAAE,UAAU,CAAC;IACpB,SAAS,EAAE,UAAU,CAAC;IACtB,MAAM,EAAE,UAAU,CAAC;IACnB,SAAS,EAAE,YAAY,CAAC;CACzB;AAED,iFAAiF;AACjF,wBAAgB,UAAU,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAItD;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,cAAc,CAgB9D;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,EAC5D,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,EACpC,MAAM,EAAE,cAAc,GACrB,cAAc,CAiChB;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,EAC5D,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,cAAc,GACrB,mBAAmB,CAmDrB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ComponentType, type System } from '../ecs/World.js';
|
|
2
|
+
import type { AnimStateMachine } from './AnimStateMachine.js';
|
|
3
|
+
/** An entity's animation state machine. Give an entity this instead of `AnimationComponent`: the machine owns its animator. */
|
|
4
|
+
export declare const AnimStateComponent: ComponentType<AnimStateMachine>;
|
|
5
|
+
/**
|
|
6
|
+
* Updates every `AnimStateMachine` each frame and shows its frame on the entity's sprite (only when it changed).
|
|
7
|
+
* Add it after the systems that set the machines' parameters, so a change shows the same frame.
|
|
8
|
+
*/
|
|
9
|
+
export declare function animStateSystem(name?: string): System;
|
|
10
|
+
//# sourceMappingURL=animStateSystem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animStateSystem.d.ts","sourceRoot":"","sources":["../../../src/anim/animStateSystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,aAAa,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAExF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,+HAA+H;AAC/H,eAAO,MAAM,kBAAkB,EAAE,aAAa,CAAC,gBAAgB,CAAkD,CAAC;AAElH;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,SAAe,GAAG,MAAM,CAQ3D"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { ClipMarker } from './asepriteTypes.js';
|
|
2
|
+
/** A parameter's declaration, by its starting value: a bool, a number, or the word 'trigger' (a one-shot flag). */
|
|
3
|
+
export type AnimParamDecl = boolean | number | 'trigger';
|
|
4
|
+
export type AnimParams = Record<string, AnimParamDecl>;
|
|
5
|
+
export type CompareOp = '==' | '!=' | '>' | '>=' | '<' | '<=';
|
|
6
|
+
/**
|
|
7
|
+
* What a transition asks of one parameter: a bool or number to equal, `[op, number]` to compare a number, and for a
|
|
8
|
+
* trigger `true` (it was fired) or `false` (it was not).
|
|
9
|
+
*/
|
|
10
|
+
export type AnimCondition = boolean | number | readonly [CompareOp, number];
|
|
11
|
+
export interface AnimStateDef<Clip extends string> {
|
|
12
|
+
/** The clip this state plays, entered from its first frame. */
|
|
13
|
+
clip: Clip;
|
|
14
|
+
/** Playback speed (default 1). */
|
|
15
|
+
speed?: number;
|
|
16
|
+
/** A number parameter the speed is multiplied by (its size: a run cadence that follows the body's speed). */
|
|
17
|
+
speedParam?: string;
|
|
18
|
+
/** Events fired as playback reaches frames of the clip (positions in the clip, 0-based). */
|
|
19
|
+
markers?: readonly ClipMarker[];
|
|
20
|
+
}
|
|
21
|
+
export interface AnimTransition<State extends string, P extends AnimParams> {
|
|
22
|
+
/** The state it leaves, several, or '*' for any state (an any-state transition). */
|
|
23
|
+
from: State | '*' | readonly State[];
|
|
24
|
+
to: State;
|
|
25
|
+
/** Every condition must hold. Triggers it names are used up when it is taken. */
|
|
26
|
+
when?: {
|
|
27
|
+
readonly [K in keyof P]?: AnimCondition;
|
|
28
|
+
};
|
|
29
|
+
/** Only once the clip has played through once (a non-looping clip has finished, a looping one has looped). */
|
|
30
|
+
onEnd?: boolean;
|
|
31
|
+
/** Only once this share of the clip has played (0.5 is half way; 2 is two loops). */
|
|
32
|
+
exitTime?: number;
|
|
33
|
+
/** Checked before lower ones; ties in the order written. Default 0. */
|
|
34
|
+
priority?: number;
|
|
35
|
+
/** An any-state transition may re-enter the state it is already in (default false: it would restart every update). */
|
|
36
|
+
self?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface AnimStateMachineOptions<State extends string, Clip extends string, P extends AnimParams> {
|
|
39
|
+
initial: NoInfer<State>;
|
|
40
|
+
states: Record<State, AnimStateDef<Clip>>;
|
|
41
|
+
params?: P;
|
|
42
|
+
transitions?: readonly AnimTransition<NoInfer<State>, NoInfer<P>>[];
|
|
43
|
+
/**
|
|
44
|
+
* Keep a trigger no transition used until one does (default false: cleared at the end of every update). Off by
|
|
45
|
+
* default because a press that changed nothing now — a jump pressed in mid-air — should not play out later, on
|
|
46
|
+
* landing.
|
|
47
|
+
*/
|
|
48
|
+
keepTriggers?: boolean;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=animStateTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animStateTypes.d.ts","sourceRoot":"","sources":["../../../src/anim/animStateTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,mHAAmH;AACnH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AACzD,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAEvD,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC;AAE9D;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;AAE5E,MAAM,WAAW,YAAY,CAAC,IAAI,SAAS,MAAM;IAC/C,+DAA+D;IAC/D,IAAI,EAAE,IAAI,CAAC;IACX,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6GAA6G;IAC7G,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4FAA4F;IAC5F,OAAO,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;CACjC;AAED,MAAM,WAAW,cAAc,CAAC,KAAK,SAAS,MAAM,EAAE,CAAC,SAAS,UAAU;IACxE,oFAAoF;IACpF,IAAI,EAAE,KAAK,GAAG,GAAG,GAAG,SAAS,KAAK,EAAE,CAAC;IACrC,EAAE,EAAE,KAAK,CAAC;IACV,iFAAiF;IACjF,IAAI,CAAC,EAAE;QAAE,QAAQ,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,aAAa;KAAE,CAAC;IACnD,8GAA8G;IAC9G,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,qFAAqF;IACrF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sHAAsH;IACtH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,uBAAuB,CAAC,KAAK,SAAS,MAAM,EAAE,IAAI,SAAS,MAAM,EAAE,CAAC,SAAS,UAAU;IACtG,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1C,MAAM,CAAC,EAAE,CAAC,CAAC;IACX,WAAW,CAAC,EAAE,SAAS,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACpE;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Image } from '../core/Image.js';
|
|
2
|
+
import { type ComponentType, type System } from '../ecs/World.js';
|
|
3
|
+
import type { Animator } from './Animator.js';
|
|
4
|
+
/** The engine's sprite component: the `Image` an entity is drawn as. */
|
|
5
|
+
export declare const SpriteComponent: ComponentType<Image>;
|
|
6
|
+
/** The engine's animation component: the `Animator` choosing the sprite's frame. */
|
|
7
|
+
export declare const AnimationComponent: ComponentType<Animator>;
|
|
8
|
+
/**
|
|
9
|
+
* Advances every `Animator` each frame and shows its frame on the entity's sprite (only when it changed, so an idle
|
|
10
|
+
* crowd costs no texture swaps).
|
|
11
|
+
*/
|
|
12
|
+
export declare function animationSystem(name?: string): System;
|
|
13
|
+
//# sourceMappingURL=animationSystem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animationSystem.d.ts","sourceRoot":"","sources":["../../../src/anim/animationSystem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAA2B,KAAK,aAAa,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AACxF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,wEAAwE;AACxE,eAAO,MAAM,eAAe,EAAE,aAAa,CAAC,KAAK,CAAoC,CAAC;AAEtF,oFAAoF;AACpF,eAAO,MAAM,kBAAkB,EAAE,aAAa,CAAC,QAAQ,CAA0C,CAAC;AAElG;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,SAAc,GAAG,MAAM,CAO1D"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { AsepriteSheet, AsepriteSlice, AsepriteSliceKey } from './asepriteTypes.js';
|
|
2
|
+
/** A slice by name, or undefined. */
|
|
3
|
+
export declare function sliceNamed(sheet: AsepriteSheet, name: string): AsepriteSlice | undefined;
|
|
4
|
+
/**
|
|
5
|
+
* The key of `slice` in effect on sprite frame `frame`: Aseprite keys a slice on the frame it changes and holds it
|
|
6
|
+
* until the next key, so the last key at or before the frame. Before the first key the slice is not there (undefined).
|
|
7
|
+
*/
|
|
8
|
+
export declare function sliceAt(slice: AsepriteSlice, frame?: number): AsepriteSliceKey | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* The 9-slice borders of a key with a centre — how far in from each edge the stretchable middle starts — in the shape
|
|
11
|
+
* Pixi's `NineSliceSprite` and `Texture.defaultBorders` take. Undefined for a key with no centre.
|
|
12
|
+
*/
|
|
13
|
+
export declare function sliceBorders(key: AsepriteSliceKey): {
|
|
14
|
+
left: number;
|
|
15
|
+
top: number;
|
|
16
|
+
right: number;
|
|
17
|
+
bottom: number;
|
|
18
|
+
} | undefined;
|
|
19
|
+
//# sourceMappingURL=asepriteSlices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asepriteSlices.d.ts","sourceRoot":"","sources":["../../../src/anim/asepriteSlices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEtF,qCAAqC;AACrC,wBAAgB,UAAU,CAAC,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAExF;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,aAAa,EAAE,KAAK,SAAI,GAAG,gBAAgB,GAAG,SAAS,CAOrF;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,gBAAgB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAI5H"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AsepriteDirection } from './asepriteTypes.js';
|
|
2
|
+
/** Aseprite's direction name, or forward for anything unknown (older files write none). */
|
|
3
|
+
export declare function tagDirection(raw: string | undefined): AsepriteDirection;
|
|
4
|
+
/** Aseprite writes the repeat count as a string; absent, 0 or nonsense is forever. */
|
|
5
|
+
export declare function tagRepeat(raw: string | number | undefined): number;
|
|
6
|
+
/**
|
|
7
|
+
* The sheet frames a tag plays, in playing order, unrolled so the engine's `Animator` (which only ever plays a list
|
|
8
|
+
* forward) shows exactly what Aseprite's own player shows.
|
|
9
|
+
*
|
|
10
|
+
* - forever (`repeat` 0): forward and reverse are one pass, looped; a ping-pong is one round trip without its two
|
|
11
|
+
* ends doubled (a b c d c b, then a again), so a loop never stutters on the turn.
|
|
12
|
+
* - `repeat` n: n passes, played once. A ping-pong counts each pass in one direction as one, as Aseprite does, and two
|
|
13
|
+
* passes share their turning frame (repeat 2 of a b c is a b c b a).
|
|
14
|
+
*/
|
|
15
|
+
export declare function tagFrames(from: number, to: number, direction: AsepriteDirection, repeat: number): number[];
|
|
16
|
+
//# sourceMappingURL=asepriteTags.d.ts.map
|