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,80 @@
|
|
|
1
|
+
import { isTouchUi as v } from "../platform/touch.js";
|
|
2
|
+
import { isPointerLocked as m, requestPointerLock as d, exitPointerLock as a } from "../platform/pointerLock.js";
|
|
3
|
+
function s(e) {
|
|
4
|
+
return e === 1 ? 4 : e === 2 ? 2 : e === 0 ? 1 : 0;
|
|
5
|
+
}
|
|
6
|
+
class c {
|
|
7
|
+
constructor(o) {
|
|
8
|
+
this.canvas = o;
|
|
9
|
+
const i = v(), n = (t, u, l) => {
|
|
10
|
+
const h = (r) => {
|
|
11
|
+
i && r instanceof PointerEvent && r.pointerType === "touch" || l(r);
|
|
12
|
+
};
|
|
13
|
+
t.addEventListener(u, h), this.cleanup.push(() => t.removeEventListener(u, h));
|
|
14
|
+
};
|
|
15
|
+
n(o, "pointerdown", (t) => {
|
|
16
|
+
this.track(t), !c.ignorePress?.(t) && (this.buttons |= s(t.button));
|
|
17
|
+
}), n(window, "pointermove", (t) => {
|
|
18
|
+
this.locked ? (this.moveX += t.movementX, this.moveY += t.movementY) : this.track(t), t.button >= 0 && (this.buttons = (t.buttons & s(t.button)) !== 0 ? this.buttons | s(t.button) : this.buttons & ~s(t.button));
|
|
19
|
+
}), n(window, "pointerup", (t) => {
|
|
20
|
+
this.buttons &= ~s(t.button);
|
|
21
|
+
}), n(window, "blur", () => {
|
|
22
|
+
this.buttons = 0;
|
|
23
|
+
}), n(o, "contextmenu", (t) => t.preventDefault());
|
|
24
|
+
}
|
|
25
|
+
canvas;
|
|
26
|
+
/**
|
|
27
|
+
* A press this returns true for is not counted as a held button (e.g. Shift + right-click opening a context menu
|
|
28
|
+
* instead of firing what the right button is bound to). Unset, every press counts.
|
|
29
|
+
*/
|
|
30
|
+
static ignorePress = null;
|
|
31
|
+
/** Screen position relative to the canvas, in CSS pixels. */
|
|
32
|
+
x = 0;
|
|
33
|
+
y = 0;
|
|
34
|
+
worldX = 0;
|
|
35
|
+
worldY = 0;
|
|
36
|
+
buttons = 0;
|
|
37
|
+
/** Raw mouse travel (`movementX/Y`) summed since the last `takeMovement`, kept only while the pointer is locked. */
|
|
38
|
+
moveX = 0;
|
|
39
|
+
moveY = 0;
|
|
40
|
+
cleanup = [];
|
|
41
|
+
leftButtonDown() {
|
|
42
|
+
return (this.buttons & 1) !== 0;
|
|
43
|
+
}
|
|
44
|
+
rightButtonDown() {
|
|
45
|
+
return (this.buttons & 2) !== 0;
|
|
46
|
+
}
|
|
47
|
+
/** True while the canvas holds the pointer (`lock`). */
|
|
48
|
+
get locked() {
|
|
49
|
+
return m(this.canvas);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Locks the pointer to the canvas for mouse-look: the cursor hides and `takeMovement` returns how far the mouse went.
|
|
53
|
+
* Call from a press or key handler (browsers allow it only in a gesture); resolves whether the lock holds.
|
|
54
|
+
*/
|
|
55
|
+
lock(o = {}) {
|
|
56
|
+
return this.moveX = this.moveY = 0, d(this.canvas, o);
|
|
57
|
+
}
|
|
58
|
+
unlock() {
|
|
59
|
+
this.locked && a();
|
|
60
|
+
}
|
|
61
|
+
/** The mouse travel (CSS pixels) since the last call while locked, then zeroed; read it once per step. */
|
|
62
|
+
takeMovement() {
|
|
63
|
+
const o = { x: this.moveX, y: this.moveY };
|
|
64
|
+
return this.moveX = this.moveY = 0, o;
|
|
65
|
+
}
|
|
66
|
+
updateWorldPoint(o) {
|
|
67
|
+
this.worldX = o.scrollX + this.x / o.zoom, this.worldY = o.scrollY + this.y / o.zoom;
|
|
68
|
+
}
|
|
69
|
+
destroy() {
|
|
70
|
+
for (const o of this.cleanup) o();
|
|
71
|
+
this.cleanup.length = 0;
|
|
72
|
+
}
|
|
73
|
+
track(o) {
|
|
74
|
+
const i = this.canvas.getBoundingClientRect();
|
|
75
|
+
this.x = o.clientX - i.left, this.y = o.clientY - i.top;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
export {
|
|
79
|
+
c as Pointer
|
|
80
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Graphics as s, Container as e } from "pixi.js";
|
|
2
|
+
import { GameObject as l } from "./gameObject.js";
|
|
3
|
+
class c extends l(e) {
|
|
4
|
+
constructor(t, i, r, h = 1) {
|
|
5
|
+
super(), this.w = t, this.h = i, this.color = r, this.fillAlpha = h, this.addChild(this.g), this.redraw();
|
|
6
|
+
}
|
|
7
|
+
w;
|
|
8
|
+
h;
|
|
9
|
+
color;
|
|
10
|
+
fillAlpha;
|
|
11
|
+
g = new s();
|
|
12
|
+
ox = 0.5;
|
|
13
|
+
oy = 0.5;
|
|
14
|
+
get originX() {
|
|
15
|
+
return this.ox;
|
|
16
|
+
}
|
|
17
|
+
get originY() {
|
|
18
|
+
return this.oy;
|
|
19
|
+
}
|
|
20
|
+
get rectWidth() {
|
|
21
|
+
return this.w;
|
|
22
|
+
}
|
|
23
|
+
get rectHeight() {
|
|
24
|
+
return this.h;
|
|
25
|
+
}
|
|
26
|
+
get fillColor() {
|
|
27
|
+
return this.color;
|
|
28
|
+
}
|
|
29
|
+
get fillOpacity() {
|
|
30
|
+
return this.fillAlpha;
|
|
31
|
+
}
|
|
32
|
+
setOrigin(t = 0.5, i = t) {
|
|
33
|
+
return this.ox = t, this.oy = i, this.redraw();
|
|
34
|
+
}
|
|
35
|
+
setFillStyle(t, i = 1) {
|
|
36
|
+
return this.color = t, this.fillAlpha = i, this.redraw();
|
|
37
|
+
}
|
|
38
|
+
setDisplaySize(t, i) {
|
|
39
|
+
return this.setScale(t / this.w, i / this.h);
|
|
40
|
+
}
|
|
41
|
+
resize(t, i) {
|
|
42
|
+
return this.w = t, this.h = i, this.redraw();
|
|
43
|
+
}
|
|
44
|
+
redraw() {
|
|
45
|
+
return this.g.clear().rect(-this.w * this.ox, -this.h * this.oy, this.w, this.h).fill({ color: this.color, alpha: this.fillAlpha }), this;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
c as Rectangle
|
|
50
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { Container as r } from "pixi.js";
|
|
2
|
+
import { Camera as n } from "./Camera.js";
|
|
3
|
+
import { Clock as a } from "./Clock.js";
|
|
4
|
+
import { ObjectFactory as o } from "./ObjectFactory.js";
|
|
5
|
+
import { Pointer as c } from "./Pointer.js";
|
|
6
|
+
import { Tweener as d } from "./Tweener.js";
|
|
7
|
+
class h {
|
|
8
|
+
constructor(e, t) {
|
|
9
|
+
this.app = e, this.textures = t, e.stage.addChild(this.world, this.screen), this.cameras = { main: new n(this.world, this.screen) }, this.input = { activePointer: new c(e.canvas) }, this.time.onError = (i) => this.caught("timers", i), this.syncSize();
|
|
10
|
+
}
|
|
11
|
+
app;
|
|
12
|
+
textures;
|
|
13
|
+
/** Told of every fault a guarded step caught (error telemetry, if the game sets one). */
|
|
14
|
+
static onCaught = null;
|
|
15
|
+
world = new r({ sortableChildren: !0 });
|
|
16
|
+
screen = new r();
|
|
17
|
+
add = new o(this);
|
|
18
|
+
tweens = new d();
|
|
19
|
+
time = new a();
|
|
20
|
+
cameras;
|
|
21
|
+
input;
|
|
22
|
+
resizeListeners = [];
|
|
23
|
+
lastWidth = 0;
|
|
24
|
+
lastHeight = 0;
|
|
25
|
+
get width() {
|
|
26
|
+
return this.app.screen.width;
|
|
27
|
+
}
|
|
28
|
+
get height() {
|
|
29
|
+
return this.app.screen.height;
|
|
30
|
+
}
|
|
31
|
+
get fps() {
|
|
32
|
+
return this.app.ticker.FPS;
|
|
33
|
+
}
|
|
34
|
+
/** Calls `fn` whenever the window changes size; the returned function stops it (a per-map listener must). */
|
|
35
|
+
onResize(e) {
|
|
36
|
+
return this.resizeListeners.push(e), () => {
|
|
37
|
+
const t = this.resizeListeners.indexOf(e);
|
|
38
|
+
t >= 0 && this.resizeListeners.splice(t, 1);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* One frame: game logic, then tweens and timers, then the camera. Pixi renders after. Each step is guarded: a
|
|
43
|
+
* ticker listener that throws never asks for the next animation frame, so one bad frame used to stop the world for
|
|
44
|
+
* good — the canvas frozen and no input reaching the server (seen on Android).
|
|
45
|
+
*/
|
|
46
|
+
frame(e) {
|
|
47
|
+
const t = performance.now();
|
|
48
|
+
this.guard("resize", () => this.syncSize()), this.guard("update", () => this.update(t, e)), this.guard("tweens", () => this.tweens.update(e)), this.guard("timers", () => this.time.update(t)), this.guard("camera", () => this.cameras.main.apply(t));
|
|
49
|
+
}
|
|
50
|
+
reported = /* @__PURE__ */ new Set();
|
|
51
|
+
/**
|
|
52
|
+
* Runs one step of a frame and swallows what it throws, so the steps after it still run. Subclasses guard the parts
|
|
53
|
+
* of their own `update` too: a fault before the camera follows the player used to leave the view standing on one
|
|
54
|
+
* spot while the world went on.
|
|
55
|
+
*/
|
|
56
|
+
guard(e, t) {
|
|
57
|
+
this.guarded(e, t, void 0);
|
|
58
|
+
}
|
|
59
|
+
/** `guard` for a step that answers something: `fallback` when it threw. */
|
|
60
|
+
guarded(e, t, i) {
|
|
61
|
+
try {
|
|
62
|
+
return t();
|
|
63
|
+
} catch (s) {
|
|
64
|
+
return this.caught(e, s), i;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/** What a guarded step threw: logged once per distinct error, or a fault repeating every frame floods the log at 60 a second. */
|
|
68
|
+
caught(e, t) {
|
|
69
|
+
const i = `${e}|${t instanceof Error ? t.message : String(t)}`;
|
|
70
|
+
this.reported.has(i) || (this.reported.add(i), console.error(`[frame] ${e} failed`, t), h.onCaught?.(`[frame] ${e}`, t));
|
|
71
|
+
}
|
|
72
|
+
destroy() {
|
|
73
|
+
this.tweens.clear(), this.time.clear(), this.input.activePointer.destroy(), this.world.destroy({ children: !0, context: !0 }), this.screen.destroy({ children: !0, context: !0 });
|
|
74
|
+
}
|
|
75
|
+
syncSize() {
|
|
76
|
+
const { width: e, height: t } = this.app.screen, i = this.cameras.main;
|
|
77
|
+
if (i.width = e, i.height = t, !(e === this.lastWidth && t === this.lastHeight)) {
|
|
78
|
+
this.lastWidth = e, this.lastHeight = t;
|
|
79
|
+
for (const s of [...this.resizeListeners]) s();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
export {
|
|
84
|
+
h as Stage
|
|
85
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Text as e } from "pixi.js";
|
|
2
|
+
import { GameObject as f } from "./gameObject.js";
|
|
3
|
+
class d extends f(e) {
|
|
4
|
+
constructor(o, t, n, i) {
|
|
5
|
+
const r = {
|
|
6
|
+
fontFamily: i.fontFamily ?? "monospace",
|
|
7
|
+
fontSize: typeof i.fontSize == "string" ? parseFloat(i.fontSize) : i.fontSize,
|
|
8
|
+
fill: i.color ?? "#ffffff"
|
|
9
|
+
};
|
|
10
|
+
i.stroke && (r.stroke = { color: i.stroke, width: i.strokeThickness ?? 1, join: "round" }), i.align && (r.align = i.align), i.lineSpacing !== void 0 && (r.leading = i.lineSpacing), i.wordWrapWidth !== void 0 && (r.wordWrap = !0, r.wordWrapWidth = i.wordWrapWidth), super({ text: n, resolution: i.resolution ?? 1, style: r }), this.position.set(o, t);
|
|
11
|
+
}
|
|
12
|
+
setOrigin(o = 0.5, t = o) {
|
|
13
|
+
return this.anchor.set(o, t), this;
|
|
14
|
+
}
|
|
15
|
+
setText(o) {
|
|
16
|
+
return this.text = o, this;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
d as Text
|
|
21
|
+
};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { CanvasSource as f, Texture as d, Rectangle as u } from "pixi.js";
|
|
2
|
+
class v {
|
|
3
|
+
constructor(t, s) {
|
|
4
|
+
this.key = t, this.canvas = s, this.source = new f({ resource: s, scaleMode: "nearest" }), this.whole = new d({ source: this.source });
|
|
5
|
+
}
|
|
6
|
+
key;
|
|
7
|
+
canvas;
|
|
8
|
+
frames = /* @__PURE__ */ new Map();
|
|
9
|
+
source;
|
|
10
|
+
whole;
|
|
11
|
+
get width() {
|
|
12
|
+
return this.canvas.width;
|
|
13
|
+
}
|
|
14
|
+
get height() {
|
|
15
|
+
return this.canvas.height;
|
|
16
|
+
}
|
|
17
|
+
get context() {
|
|
18
|
+
return this.canvas.getContext("2d");
|
|
19
|
+
}
|
|
20
|
+
/** Adds a frame cut from the canvas (`_source` kept for the old call shape). */
|
|
21
|
+
add(t, s, e, a, n, i) {
|
|
22
|
+
this.frames.get(t)?.destroy(), this.frames.set(t, new d({ source: this.source, frame: new u(e, a, n, i) }));
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Adds a packed frame cut from `page` (this texture's canvas by default): trimmed frames keep their untrimmed size
|
|
26
|
+
* (`orig`) so they line up when drawn, and frames the packer turned are turned back (Pixi's `rotate: 2`).
|
|
27
|
+
*/
|
|
28
|
+
addPacked(t, s = this) {
|
|
29
|
+
this.frames.get(t.name)?.destroy();
|
|
30
|
+
const e = new d({
|
|
31
|
+
source: s.source,
|
|
32
|
+
frame: new u(t.x, t.y, t.w, t.h),
|
|
33
|
+
orig: new u(0, 0, t.sourceW, t.sourceH),
|
|
34
|
+
...t.trim ? { trim: new u(t.trim.x, t.trim.y, t.trim.w, t.trim.h) } : {},
|
|
35
|
+
rotate: t.rotated ? 2 : 0,
|
|
36
|
+
...t.anchor ? { defaultAnchor: t.anchor } : {}
|
|
37
|
+
});
|
|
38
|
+
this.frames.set(t.name, e);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Registers under this texture a frame that lives on another one (an atlas page after the first), so the frame is
|
|
42
|
+
* found by this texture's key. A texture of its own over the other page's source: each side frees its own.
|
|
43
|
+
*/
|
|
44
|
+
adopt(t, s) {
|
|
45
|
+
const e = s.frames.get(t);
|
|
46
|
+
e && (this.frames.get(t)?.destroy(), this.frames.set(t, new d({ source: s.source, frame: e.frame.clone() })));
|
|
47
|
+
}
|
|
48
|
+
refresh() {
|
|
49
|
+
this.source.update();
|
|
50
|
+
}
|
|
51
|
+
destroy() {
|
|
52
|
+
for (const t of this.frames.values()) t.destroy();
|
|
53
|
+
this.frames.clear(), this.whole.destroy(), this.source.destroy();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
class m {
|
|
57
|
+
textures = /* @__PURE__ */ new Map();
|
|
58
|
+
/** Textures repainted or freed while in use (a rig body, its hand): a copy of one must snapshot it first. */
|
|
59
|
+
live = /* @__PURE__ */ new Set();
|
|
60
|
+
missing = /* @__PURE__ */ new Set();
|
|
61
|
+
snapshots = 0;
|
|
62
|
+
markLive(t) {
|
|
63
|
+
this.live.add(t);
|
|
64
|
+
}
|
|
65
|
+
isLive(t) {
|
|
66
|
+
return this.live.has(t);
|
|
67
|
+
}
|
|
68
|
+
/** A new texture holding frame `frame` of `key` as it is painted right now; returns its key (one frame, '0'). */
|
|
69
|
+
snapshot(t, s) {
|
|
70
|
+
const e = this.get(t, s), { x: a, y: n, width: i, height: r } = e.frame, h = document.createElement("canvas");
|
|
71
|
+
h.width = i, h.height = r;
|
|
72
|
+
const o = this.textures.get(t)?.canvas;
|
|
73
|
+
o && h.getContext("2d").drawImage(o, a, n, i, r, 0, 0, i, r);
|
|
74
|
+
const c = `${t}#still${++this.snapshots}`;
|
|
75
|
+
return this.addCanvas(c, h).add("0", 0, 0, 0, i, r), c;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* `snapshot` into a texture kept for reuse (`into`): its canvas is repainted in place and uploaded again, and only
|
|
79
|
+
* made anew when the frame's size changes. Frame '0' is the copy.
|
|
80
|
+
*/
|
|
81
|
+
snapshotInto(t, s, e) {
|
|
82
|
+
const a = this.get(t, s), { x: n, y: i, width: r, height: h } = a.frame;
|
|
83
|
+
let o = this.textures.get(e);
|
|
84
|
+
if (!o || o.width !== r || o.height !== h) {
|
|
85
|
+
const g = document.createElement("canvas");
|
|
86
|
+
g.width = r, g.height = h, o = this.addCanvas(e, g), o.add("0", 0, 0, 0, r, h);
|
|
87
|
+
}
|
|
88
|
+
const c = o.context;
|
|
89
|
+
c.clearRect(0, 0, r, h);
|
|
90
|
+
const w = this.textures.get(t)?.canvas;
|
|
91
|
+
w && c.drawImage(w, n, i, r, h, 0, 0, r, h), o.refresh();
|
|
92
|
+
}
|
|
93
|
+
exists(t) {
|
|
94
|
+
return this.textures.has(t);
|
|
95
|
+
}
|
|
96
|
+
addCanvas(t, s) {
|
|
97
|
+
this.remove(t);
|
|
98
|
+
const e = new v(t, s);
|
|
99
|
+
return this.textures.set(t, e), e;
|
|
100
|
+
}
|
|
101
|
+
/** A canvas cut into equal frames named 0, 1, 2... left to right, then row by row. */
|
|
102
|
+
addSpriteSheet(t, s, e) {
|
|
103
|
+
const a = this.addCanvas(t, s), n = Math.floor(s.width / e.frameWidth), i = Math.floor(s.height / e.frameHeight);
|
|
104
|
+
for (let r = 0; r < n * i; r++)
|
|
105
|
+
a.add(String(r), 0, r % n * e.frameWidth, Math.floor(r / n) * e.frameHeight, e.frameWidth, e.frameHeight);
|
|
106
|
+
return a;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* A packed atlas (TexturePacker JSON, `AssetLoader.atlas`): the first page under `key`, the others as `key~1`,
|
|
110
|
+
* `key~2`… like `AtlasBuilder`'s pages, and every frame of every page found under `key` by its name.
|
|
111
|
+
*/
|
|
112
|
+
addAtlas(t, s) {
|
|
113
|
+
if (s.length === 0) throw new Error(`TextureRegistry: atlas "${t}" has no pages`);
|
|
114
|
+
for (let a = 1; this.textures.has(`${t}~${a}`); a++)
|
|
115
|
+
this.remove(`${t}~${a}`);
|
|
116
|
+
const e = this.addCanvas(t, s[0].canvas);
|
|
117
|
+
return s.forEach((a, n) => {
|
|
118
|
+
const i = n === 0 ? e : this.addCanvas(`${t}~${n}`, a.canvas);
|
|
119
|
+
for (const r of a.frames)
|
|
120
|
+
i !== e && i.addPacked(r), e.addPacked(r, i);
|
|
121
|
+
}), e;
|
|
122
|
+
}
|
|
123
|
+
createCanvas(t, s, e) {
|
|
124
|
+
const a = document.createElement("canvas");
|
|
125
|
+
return a.width = s, a.height = e, this.addCanvas(t, a);
|
|
126
|
+
}
|
|
127
|
+
remove(t) {
|
|
128
|
+
this.textures.get(t)?.destroy(), this.textures.delete(t), this.live.delete(t);
|
|
129
|
+
}
|
|
130
|
+
get(t, s) {
|
|
131
|
+
const e = this.textures.get(t);
|
|
132
|
+
return e ? s === void 0 || s === "" ? e.whole : e.frames.get(String(s)) ?? this.warn(`${t}/${s}`) : this.warn(t);
|
|
133
|
+
}
|
|
134
|
+
warn(t) {
|
|
135
|
+
return this.missing.has(t) || (this.missing.add(t), console.warn(`[textures] missing ${t}`)), d.EMPTY;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
export {
|
|
139
|
+
v as CanvasTexture,
|
|
140
|
+
m as TextureRegistry
|
|
141
|
+
};
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { TimelineBuilder as p } from "./TimelineBuilder.js";
|
|
2
|
+
class c extends p {
|
|
3
|
+
timeScale;
|
|
4
|
+
repeat;
|
|
5
|
+
yoyo;
|
|
6
|
+
repeatDelay;
|
|
7
|
+
/** A timeline holds no targets of its own for `Tweener.killTweensOf`: stop it with `kill()`. */
|
|
8
|
+
targets = [];
|
|
9
|
+
options;
|
|
10
|
+
time = 0;
|
|
11
|
+
paused;
|
|
12
|
+
reversed = !1;
|
|
13
|
+
done = !1;
|
|
14
|
+
killed = !1;
|
|
15
|
+
/** In its manager's list: set again by anything that brings a finished timeline back to life. */
|
|
16
|
+
listed = !1;
|
|
17
|
+
/** The next render starts the run: a call standing at its first point fires. */
|
|
18
|
+
fresh = !0;
|
|
19
|
+
nestedIn = null;
|
|
20
|
+
resolveFinished = () => {
|
|
21
|
+
};
|
|
22
|
+
finishedPromise;
|
|
23
|
+
settled = !1;
|
|
24
|
+
/** Scratch for `locate`, so moving the playhead allocates nothing. */
|
|
25
|
+
locCycle = 0;
|
|
26
|
+
locLocal = 0;
|
|
27
|
+
constructor(t = {}) {
|
|
28
|
+
super(), this.options = t, this.repeat = t.repeat ?? 0, this.yoyo = t.yoyo ?? !1, this.repeatDelay = Math.max(0, t.repeatDelay ?? 0), this.timeScale = t.timeScale ?? 1, this.paused = t.paused ?? !1, this.finishedPromise = this.newPromise(), this.relist();
|
|
29
|
+
}
|
|
30
|
+
adopt(t) {
|
|
31
|
+
if (!(t instanceof c) || t === this || t.nestedIn) throw new Error("Timeline.add: a timeline is played by one parent at most, never itself");
|
|
32
|
+
if (!Number.isFinite(t.totalDuration)) throw new Error("Timeline.add: a timeline that repeats forever cannot be nested");
|
|
33
|
+
return t.nestedIn = this, t;
|
|
34
|
+
}
|
|
35
|
+
// ── playing ───────────────────────────────────────────────────────────────────────────────────────────────────
|
|
36
|
+
/** Every play and the delays between them, ms; Infinity when it repeats forever. */
|
|
37
|
+
get totalDuration() {
|
|
38
|
+
return this.repeat === -1 ? 1 / 0 : this.duration * (this.repeat + 1) + this.repeatDelay * this.repeat;
|
|
39
|
+
}
|
|
40
|
+
/** Where the playhead stands, ms from the start of the first play. */
|
|
41
|
+
get currentTime() {
|
|
42
|
+
return this.time;
|
|
43
|
+
}
|
|
44
|
+
/** 0–1 over the whole run (over the current play when it repeats forever). */
|
|
45
|
+
get progress() {
|
|
46
|
+
const t = this.totalDuration;
|
|
47
|
+
if (Number.isFinite(t)) return t > 0 ? this.time / t : 1;
|
|
48
|
+
const e = this.duration;
|
|
49
|
+
return e <= 0 ? 1 : (this.locate(this.time, t), this.locLocal / e);
|
|
50
|
+
}
|
|
51
|
+
get isPaused() {
|
|
52
|
+
return this.paused;
|
|
53
|
+
}
|
|
54
|
+
get isReversed() {
|
|
55
|
+
return this.reversed;
|
|
56
|
+
}
|
|
57
|
+
/** Still has somewhere to go: not completed, not killed. */
|
|
58
|
+
get isActive() {
|
|
59
|
+
return !this.done && !this.killed;
|
|
60
|
+
}
|
|
61
|
+
/** Resolves when the timeline completes (or is killed, so nothing awaits it forever). A restart makes a new one. */
|
|
62
|
+
get finished() {
|
|
63
|
+
return this.finishedPromise;
|
|
64
|
+
}
|
|
65
|
+
/** Advances by `dt` ms (× `timeScale`): how a timeline with no manager is played. */
|
|
66
|
+
update(t) {
|
|
67
|
+
this.tick(t);
|
|
68
|
+
}
|
|
69
|
+
/** @internal The manager's step: false once there is nothing left to play. */
|
|
70
|
+
step(t) {
|
|
71
|
+
this.listed = !1;
|
|
72
|
+
const e = this.tick(t);
|
|
73
|
+
return this.listed = e, e;
|
|
74
|
+
}
|
|
75
|
+
pause() {
|
|
76
|
+
return this.paused = !0, this;
|
|
77
|
+
}
|
|
78
|
+
/** Carries on the way it was going. */
|
|
79
|
+
resume() {
|
|
80
|
+
return this.paused = !1, this.wake(), this;
|
|
81
|
+
}
|
|
82
|
+
/** Plays forward from where it stands. */
|
|
83
|
+
play() {
|
|
84
|
+
return this.reversed = !1, this.resume();
|
|
85
|
+
}
|
|
86
|
+
/** Turns round and plays toward the start (or forward again, if it was reversed). */
|
|
87
|
+
reverse() {
|
|
88
|
+
return this.reversed = !this.reversed, this.resume();
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Jumps to `to` (ms or a label) and shows it there. Calls on the way are skipped unless `fireCalls`; the playing
|
|
92
|
+
* state is kept, so a paused timeline stays paused.
|
|
93
|
+
*/
|
|
94
|
+
seek(t, e = !1) {
|
|
95
|
+
const s = this.totalDuration, r = typeof t == "number" ? t : this.labels.get(t);
|
|
96
|
+
if (r === void 0) throw new Error(`Timeline.seek: no label "${t}"`);
|
|
97
|
+
const i = Math.min(s, Math.max(0, r));
|
|
98
|
+
return this.render(this.time, i, e, this.fresh && e), this.time = i, this.fresh = !1, this.wake(), this;
|
|
99
|
+
}
|
|
100
|
+
/** Back to the start, playing forward, with a new `finished` if the old one was settled. */
|
|
101
|
+
restart() {
|
|
102
|
+
return this.render(this.time, 0, !1, !1), this.time = 0, this.reversed = !1, this.paused = !1, this.fresh = !0, this.settled && (this.finishedPromise = this.newPromise()), this.wake(), this;
|
|
103
|
+
}
|
|
104
|
+
/** Stops for good where it stands (nothing is put back) and settles `finished`. */
|
|
105
|
+
kill() {
|
|
106
|
+
this.killed = !0, this.settle();
|
|
107
|
+
}
|
|
108
|
+
/** @internal The manager's name for `kill` (`Tweener.clear`, a stage destroyed). */
|
|
109
|
+
remove() {
|
|
110
|
+
this.kill();
|
|
111
|
+
}
|
|
112
|
+
/** @internal Played by a parent: its own time and calls, as one span. */
|
|
113
|
+
playNested(t, e, s, r) {
|
|
114
|
+
this.render(t, e, s, r), this.time = e, this.options.onUpdate?.(this), e >= this.totalDuration && t < e && this.options.onComplete?.(this);
|
|
115
|
+
}
|
|
116
|
+
// ── inside ────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
117
|
+
tick(t) {
|
|
118
|
+
if (this.killed || this.nestedIn || this.done) return !1;
|
|
119
|
+
if (this.paused) return !0;
|
|
120
|
+
const e = this.totalDuration, s = this.time, r = t * this.timeScale;
|
|
121
|
+
let i = this.reversed ? s - r : s + r;
|
|
122
|
+
return i > e && (i = e), i < 0 && (i = 0), (i !== s || this.fresh) && (this.render(s, i, !0, this.fresh), this.time = i, this.fresh = !1, this.options.onUpdate?.(this)), this.killed ? !1 : (this.reversed ? i <= 0 : i >= e) ? (this.done = !0, this.options.onComplete?.(this), this.settle(), !1) : !0;
|
|
123
|
+
}
|
|
124
|
+
/** Moves the playhead from `from` to `to` (total time), play by play. */
|
|
125
|
+
render(t, e, s, r) {
|
|
126
|
+
const i = this.duration, a = this.totalDuration, h = i + this.repeatDelay;
|
|
127
|
+
if (this.repeat === 0 || h <= 0) {
|
|
128
|
+
this.playCycle(0, Math.min(i, Math.max(0, t)), Math.min(i, Math.max(0, e)), s, r);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
this.locate(t, a);
|
|
132
|
+
const o = this.locCycle, d = this.locLocal;
|
|
133
|
+
this.locate(e, a);
|
|
134
|
+
const n = this.locCycle, u = this.locLocal;
|
|
135
|
+
if (o === n) {
|
|
136
|
+
this.playCycle(o, d, u, s, r);
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
const f = !this.yoyo;
|
|
140
|
+
if (n > o) {
|
|
141
|
+
this.playCycle(o, d, i, s, r);
|
|
142
|
+
for (let l = Math.max(o + 1, n - 1); l <= n; l++) {
|
|
143
|
+
if (this.nextPlay()) return;
|
|
144
|
+
this.playCycle(l, 0, l === n ? u : i, s, f);
|
|
145
|
+
}
|
|
146
|
+
} else {
|
|
147
|
+
this.playCycle(o, d, 0, s, r);
|
|
148
|
+
for (let l = Math.min(o - 1, n + 1); l >= n; l--) {
|
|
149
|
+
if (this.nextPlay()) return;
|
|
150
|
+
this.playCycle(l, i, l === n ? u : 0, s, f);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/** A play boundary: `onRepeat`, and a forever timeline whose every target is gone ends here. Answers "stop". */
|
|
155
|
+
nextPlay() {
|
|
156
|
+
return this.repeat === -1 && this.orphaned() ? (this.kill(), !0) : (this.options.onRepeat?.(this), this.killed);
|
|
157
|
+
}
|
|
158
|
+
playCycle(t, e, s, r, i) {
|
|
159
|
+
if (this.yoyo && t % 2 === 1) {
|
|
160
|
+
const h = this.duration;
|
|
161
|
+
e = h - e, s = h - s;
|
|
162
|
+
}
|
|
163
|
+
const a = this.children;
|
|
164
|
+
if (s >= e) for (let h = 0; h < a.length; h++) a[h].play(e, s, r, i);
|
|
165
|
+
else for (let h = a.length - 1; h >= 0; h--) a[h].play(e, s, r, i);
|
|
166
|
+
}
|
|
167
|
+
/** Total time → play and time within it, into `locCycle` / `locLocal`. */
|
|
168
|
+
locate(t, e) {
|
|
169
|
+
const s = this.duration;
|
|
170
|
+
if (t >= e) {
|
|
171
|
+
this.locCycle = this.repeat, this.locLocal = s;
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
const r = s + this.repeatDelay, i = Math.floor(t / r);
|
|
175
|
+
this.locCycle = i, this.locLocal = Math.min(s, t - i * r);
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Every tween's every target is a destroyed display object. Checked only when a forever timeline turns round, as
|
|
179
|
+
* `Tween` drops a forever tween whose sprites were freed: otherwise it would hold them for good.
|
|
180
|
+
*/
|
|
181
|
+
orphaned() {
|
|
182
|
+
let t = !1;
|
|
183
|
+
for (const e of this.children)
|
|
184
|
+
if (e.kind === "tween")
|
|
185
|
+
for (const s of e.targets) {
|
|
186
|
+
if (s.destroyed !== !0) return !1;
|
|
187
|
+
t = !0;
|
|
188
|
+
}
|
|
189
|
+
return t;
|
|
190
|
+
}
|
|
191
|
+
/** Brought back to life (reversed, sought, restarted, resumed): its manager steps it again. */
|
|
192
|
+
wake() {
|
|
193
|
+
this.killed || (this.done = !1, this.relist());
|
|
194
|
+
}
|
|
195
|
+
relist() {
|
|
196
|
+
const t = this.options.tweens;
|
|
197
|
+
!t || this.listed || this.killed || this.nestedIn || (this.listed = !0, t.run(this));
|
|
198
|
+
}
|
|
199
|
+
settle() {
|
|
200
|
+
this.settled || (this.settled = !0, this.resolveFinished());
|
|
201
|
+
}
|
|
202
|
+
newPromise() {
|
|
203
|
+
return this.settled = !1, new Promise((t) => {
|
|
204
|
+
this.resolveFinished = t;
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
export {
|
|
209
|
+
c as Timeline
|
|
210
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { easeByName as d } from "./eases.js";
|
|
2
|
+
import { placeAt as m } from "./timelinePlace.js";
|
|
3
|
+
import { TimelineChild as i } from "./TimelineChild.js";
|
|
4
|
+
class x {
|
|
5
|
+
/** Sorted by start; equal starts keep the order they were added in. */
|
|
6
|
+
children = [];
|
|
7
|
+
labels = /* @__PURE__ */ new Map();
|
|
8
|
+
/** The longest child's end, kept as children are added rather than summed every frame. */
|
|
9
|
+
length = 0;
|
|
10
|
+
lastStart = 0;
|
|
11
|
+
lastEnd = 0;
|
|
12
|
+
group = null;
|
|
13
|
+
/** One play, ms (the longest child's end). */
|
|
14
|
+
get duration() {
|
|
15
|
+
return this.length;
|
|
16
|
+
}
|
|
17
|
+
/** Tweens the numeric `props` of `targets` (one object or several), after what came before unless `at` says. */
|
|
18
|
+
to(t, e, s = {}) {
|
|
19
|
+
const n = Array.isArray(t) ? [...t] : [t], a = [], l = [], h = [];
|
|
20
|
+
for (const [p, r] of Object.entries(e))
|
|
21
|
+
a.push(p), typeof r == "number" ? (l.push(r), h.push(void 0)) : (l.push(r.to), h.push(r.from));
|
|
22
|
+
const o = typeof s.ease == "function" ? s.ease : d(s.ease), u = Math.max(0, s.duration ?? 1e3), c = this.place(s.at);
|
|
23
|
+
return this.insert(new i("tween", c, u, n, a, l, h, o));
|
|
24
|
+
}
|
|
25
|
+
/** Calls `fn` when the playhead passes `at` (default: the end so far), going either way. */
|
|
26
|
+
call(t, e) {
|
|
27
|
+
return this.insert(new i("call", this.place(e), 0, [], [], [], [], null, t));
|
|
28
|
+
}
|
|
29
|
+
/** `ms` of nothing: the next child starts that much later, and a wait at the end makes the timeline longer. */
|
|
30
|
+
wait(t) {
|
|
31
|
+
return this.insert(new i("gap", this.place(void 0), Math.max(0, t)));
|
|
32
|
+
}
|
|
33
|
+
/** Names a point (default: the end so far), for positions and `seek`. */
|
|
34
|
+
label(t, e) {
|
|
35
|
+
return this.labels.set(t, this.place(e)), this;
|
|
36
|
+
}
|
|
37
|
+
/** Where a label stands, if it is set. */
|
|
38
|
+
labelTime(t) {
|
|
39
|
+
return this.labels.get(t);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Everything `build` adds starts together, at `at` (default: the end so far); a position inside is measured from
|
|
43
|
+
* the group's start. What follows the group starts at its longest child's end.
|
|
44
|
+
*/
|
|
45
|
+
parallel(t, e) {
|
|
46
|
+
const s = this.group, n = this.place(e), a = { start: n, end: n };
|
|
47
|
+
this.group = a;
|
|
48
|
+
try {
|
|
49
|
+
t(this);
|
|
50
|
+
} finally {
|
|
51
|
+
this.group = s, s && (s.end = Math.max(s.end, a.end)), this.lastStart = n, this.lastEnd = a.end;
|
|
52
|
+
}
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
55
|
+
/** Plays another timeline (built, not repeating forever) as one child of this one; it is no longer stepped alone. */
|
|
56
|
+
add(t, e) {
|
|
57
|
+
const s = this.adopt(t), n = this.place(e);
|
|
58
|
+
return this.insert(new i("nested", n, s.totalDuration, [], [], [], [], null, null, s));
|
|
59
|
+
}
|
|
60
|
+
place(t) {
|
|
61
|
+
const e = this.length, s = { fallback: this.group ? this.group.start : e, end: e, lastStart: this.lastStart, lastEnd: this.lastEnd, labels: this.labels };
|
|
62
|
+
return m(t, s);
|
|
63
|
+
}
|
|
64
|
+
insert(t) {
|
|
65
|
+
let e = this.children.length;
|
|
66
|
+
for (; e > 0 && this.children[e - 1].start > t.start; ) e--;
|
|
67
|
+
return this.children.splice(e, 0, t), this.length = Math.max(this.length, t.end), this.lastStart = t.start, this.lastEnd = t.end, this.group && (this.group.end = Math.max(this.group.end, t.end)), this;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
export {
|
|
71
|
+
x as TimelineBuilder
|
|
72
|
+
};
|