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,306 @@
|
|
|
1
|
+
import { SparseSet as k } from "./SparseSet.js";
|
|
2
|
+
import { isFields as A, growColumns as x } from "./fields.js";
|
|
3
|
+
let y = 0;
|
|
4
|
+
const p = [];
|
|
5
|
+
function O(f) {
|
|
6
|
+
const t = { id: y++, name: f };
|
|
7
|
+
return p[t.id] = t, t;
|
|
8
|
+
}
|
|
9
|
+
function U(f, t) {
|
|
10
|
+
const s = { id: y++, name: f, fields: t };
|
|
11
|
+
return p[s.id] = s, s;
|
|
12
|
+
}
|
|
13
|
+
function b(f, t, s) {
|
|
14
|
+
return { name: f, phase: t, run: s };
|
|
15
|
+
}
|
|
16
|
+
const E = 22, u = (1 << E) - 1, v = 2 ** 31, h = (f) => f & u;
|
|
17
|
+
class z {
|
|
18
|
+
/** Current generation per slot; an id is alive when its generation matches and the slot is in use. */
|
|
19
|
+
generations = [];
|
|
20
|
+
inUse = [];
|
|
21
|
+
free = [];
|
|
22
|
+
live = 0;
|
|
23
|
+
stores = [];
|
|
24
|
+
/** Typed-array columns of the field components, by component id. */
|
|
25
|
+
cols = [];
|
|
26
|
+
systems = [];
|
|
27
|
+
pending = [];
|
|
28
|
+
/** `slots` results by the component ids asked for, rebuilt only when one of those sets changed membership. */
|
|
29
|
+
slotCache = /* @__PURE__ */ new Map();
|
|
30
|
+
/** Walks (`query`, `each`, system runs) in progress: structure changes wait until it is 0. */
|
|
31
|
+
walking = 0;
|
|
32
|
+
/** A new entity with no components. */
|
|
33
|
+
create() {
|
|
34
|
+
let t;
|
|
35
|
+
if (this.free.length)
|
|
36
|
+
t = this.free.pop();
|
|
37
|
+
else {
|
|
38
|
+
if (t = this.generations.length, t > u) throw new Error("World: too many live entities");
|
|
39
|
+
this.generations.push(0), this.inUse.push(!1);
|
|
40
|
+
}
|
|
41
|
+
return this.inUse[t] = !0, this.live++, this.generations[t] * (u + 1) + t;
|
|
42
|
+
}
|
|
43
|
+
/** A new entity with these components. */
|
|
44
|
+
spawn(...t) {
|
|
45
|
+
const s = this.create();
|
|
46
|
+
for (const [i, e] of t) this.add(s, i, e);
|
|
47
|
+
return s;
|
|
48
|
+
}
|
|
49
|
+
isAlive(t) {
|
|
50
|
+
const s = h(t);
|
|
51
|
+
return this.inUse[s] === !0 && this.generations[s] === Math.floor(t / (u + 1));
|
|
52
|
+
}
|
|
53
|
+
/** Every live entity, for tools (a debugger, a save); allocates, so not for a per-frame path. */
|
|
54
|
+
entities() {
|
|
55
|
+
const t = [];
|
|
56
|
+
for (let s = 0; s < this.inUse.length; s++) this.inUse[s] && t.push(this.generations[s] * (u + 1) + s);
|
|
57
|
+
return t;
|
|
58
|
+
}
|
|
59
|
+
/** The component types `e` holds, for tools; allocates. */
|
|
60
|
+
componentsOf(t) {
|
|
61
|
+
if (!this.isAlive(t)) return [];
|
|
62
|
+
const s = h(t), i = [];
|
|
63
|
+
return this.stores.forEach((e, n) => {
|
|
64
|
+
e?.has(s) && i.push(p[n]);
|
|
65
|
+
}), i;
|
|
66
|
+
}
|
|
67
|
+
/** Live entities. */
|
|
68
|
+
get size() {
|
|
69
|
+
return this.live;
|
|
70
|
+
}
|
|
71
|
+
/** Removes an entity and every component it had (deferred while a walk is in progress). */
|
|
72
|
+
destroy(t) {
|
|
73
|
+
if (!this.isAlive(t)) return;
|
|
74
|
+
if (this.walking > 0) {
|
|
75
|
+
this.pending.push({ kind: "destroy", e: t });
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const s = h(t);
|
|
79
|
+
for (const i of this.stores) i?.delete(s, h);
|
|
80
|
+
this.inUse[s] = !1, this.generations[s] = (this.generations[s] + 1) % v, this.free.push(s), this.live--;
|
|
81
|
+
}
|
|
82
|
+
add(t, s, i) {
|
|
83
|
+
if (!this.isAlive(t)) throw new Error(`World.add: entity ${t} is not alive`);
|
|
84
|
+
const e = h(t);
|
|
85
|
+
if (A(s)) {
|
|
86
|
+
const n = this.columnsOf(s, e + 1), l = i ?? {};
|
|
87
|
+
for (const r of Object.keys(s.fields)) n[r][e] = l[r] ?? 0;
|
|
88
|
+
return this.store(s).set(e, t, e), e;
|
|
89
|
+
}
|
|
90
|
+
return this.store(s).set(e, t, i), i;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* The typed-array columns of a field component, indexed by slot. Fetch them per system run: adding entities may
|
|
94
|
+
* grow them into new arrays.
|
|
95
|
+
*/
|
|
96
|
+
columns(t) {
|
|
97
|
+
return this.columnsOf(t, this.generations.length);
|
|
98
|
+
}
|
|
99
|
+
get(t, s) {
|
|
100
|
+
if (this.isAlive(t))
|
|
101
|
+
return this.stores[s.id]?.get(h(t));
|
|
102
|
+
}
|
|
103
|
+
/** The component, or an error naming what is missing: for code that knows the entity has it. */
|
|
104
|
+
require(t, s) {
|
|
105
|
+
const i = this.stores[s.id];
|
|
106
|
+
if (!this.isAlive(t) || !i?.has(h(t))) throw new Error(`World.require: entity ${t} has no ${s.name}`);
|
|
107
|
+
return i.get(h(t));
|
|
108
|
+
}
|
|
109
|
+
has(t, s) {
|
|
110
|
+
return this.isAlive(t) && (this.stores[s.id]?.has(h(t)) ?? !1);
|
|
111
|
+
}
|
|
112
|
+
/** Takes one component off an entity (deferred while a walk is in progress). */
|
|
113
|
+
remove(t, s) {
|
|
114
|
+
if (this.isAlive(t)) {
|
|
115
|
+
if (this.walking > 0) {
|
|
116
|
+
this.pending.push({ kind: "remove", e: t, type: s });
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
this.stores[s.id]?.delete(h(t), h);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
/** How many entities hold `type`. */
|
|
123
|
+
count(t) {
|
|
124
|
+
return this.stores[t.id]?.size ?? 0;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Calls `fn(entity, ...components)` for every live entity holding all of `types`. Allocates nothing per entity:
|
|
128
|
+
* the form for systems that walk thousands of bodies every step.
|
|
129
|
+
*/
|
|
130
|
+
each(...t) {
|
|
131
|
+
const s = t[t.length - 1], i = t.slice(0, -1), e = this.setsFor(i);
|
|
132
|
+
if (!e) return;
|
|
133
|
+
const n = m(e), l = n.entities.length;
|
|
134
|
+
this.walking++;
|
|
135
|
+
try {
|
|
136
|
+
if (e.length === 1)
|
|
137
|
+
for (let r = l - 1; r >= 0; r--) s(n.entities[r], n.values[r]);
|
|
138
|
+
else if (e.length === 2) {
|
|
139
|
+
const [r, o] = e;
|
|
140
|
+
for (let a = l - 1; a >= 0; a--) {
|
|
141
|
+
const d = n.entities[a], c = h(d);
|
|
142
|
+
!r.has(c) || !o.has(c) || s(d, r.get(c), o.get(c));
|
|
143
|
+
}
|
|
144
|
+
} else {
|
|
145
|
+
const r = new Array(e.length);
|
|
146
|
+
for (let o = l - 1; o >= 0; o--) {
|
|
147
|
+
const a = n.entities[o], d = h(a);
|
|
148
|
+
let c = !0;
|
|
149
|
+
for (let g = 0; g < e.length; g++) {
|
|
150
|
+
const w = e[g];
|
|
151
|
+
if (!w.has(d)) {
|
|
152
|
+
c = !1;
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
r[g] = w.get(d);
|
|
156
|
+
}
|
|
157
|
+
c && s(a, ...r);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
} finally {
|
|
161
|
+
this.endWalk();
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* The slot index of every entity holding all of `types`, as a typed array: the fastest walk there is, made for
|
|
166
|
+
* field components (`defineFields`), whose columns are indexed by slot.
|
|
167
|
+
*
|
|
168
|
+
* ```ts
|
|
169
|
+
* const p = world.columns(Position), v = world.columns(Velocity);
|
|
170
|
+
* const slots = world.slots(Position, Velocity);
|
|
171
|
+
* for (let k = 0; k < slots.length; k++) { const i = slots[k]!; p.x[i]! += v.x[i]! * dt; }
|
|
172
|
+
* ```
|
|
173
|
+
*
|
|
174
|
+
* The result is cached and rebuilt only when an entity joins or leaves one of those components, so asking every
|
|
175
|
+
* step is cheap. It is a view the world owns: read it, don't keep it past the step, and fetch it again after
|
|
176
|
+
* adding or removing components.
|
|
177
|
+
*/
|
|
178
|
+
slots(...t) {
|
|
179
|
+
const s = t.map((o) => o.id).join(","), i = this.setsFor(t);
|
|
180
|
+
if (!i) return S;
|
|
181
|
+
let e = this.slotCache.get(s);
|
|
182
|
+
if (e && e.versions.every((o, a) => o === i[a].version)) return e.view;
|
|
183
|
+
const n = m(i), l = e && e.slots.length >= n.size ? e.slots : new Int32Array(Math.max(16, n.size));
|
|
184
|
+
let r = 0;
|
|
185
|
+
for (let o = 0; o < n.entities.length; o++) {
|
|
186
|
+
const a = h(n.entities[o]);
|
|
187
|
+
let d = !0;
|
|
188
|
+
for (const c of i)
|
|
189
|
+
if (c !== n && !c.has(a)) {
|
|
190
|
+
d = !1;
|
|
191
|
+
break;
|
|
192
|
+
}
|
|
193
|
+
d && (l[r++] = a);
|
|
194
|
+
}
|
|
195
|
+
return e = { versions: i.map((o) => o.version), slots: l, view: l.subarray(0, r) }, this.slotCache.set(s, e), e.view;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Every live entity holding all of `types`, with those components in the same order. Yields a fresh row per
|
|
199
|
+
* entity: convenient, but `each` is the form for hot loops.
|
|
200
|
+
*/
|
|
201
|
+
*query(...t) {
|
|
202
|
+
const s = this.setsFor(t);
|
|
203
|
+
if (!s) return;
|
|
204
|
+
const i = m(s);
|
|
205
|
+
this.walking++;
|
|
206
|
+
try {
|
|
207
|
+
for (let e = i.entities.length - 1; e >= 0; e--) {
|
|
208
|
+
const n = i.entities[e], l = h(n), r = [n];
|
|
209
|
+
let o = !0;
|
|
210
|
+
for (const a of s) {
|
|
211
|
+
if (!a.has(l)) {
|
|
212
|
+
o = !1;
|
|
213
|
+
break;
|
|
214
|
+
}
|
|
215
|
+
r.push(a.get(l));
|
|
216
|
+
}
|
|
217
|
+
o && (yield r);
|
|
218
|
+
}
|
|
219
|
+
} finally {
|
|
220
|
+
this.endWalk();
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
/** The first entity matching the query, or undefined: for singletons (the player, the camera target). */
|
|
224
|
+
first(...t) {
|
|
225
|
+
for (const s of this.query(...t)) return s;
|
|
226
|
+
}
|
|
227
|
+
addSystem(t) {
|
|
228
|
+
if (this.systems.some((s) => s.name === t.name)) throw new Error(`World.addSystem: a system named "${t.name}" is already added`);
|
|
229
|
+
return this.systems.push(t), this;
|
|
230
|
+
}
|
|
231
|
+
removeSystem(t) {
|
|
232
|
+
const s = this.systems.findIndex((e) => e.name === t);
|
|
233
|
+
if (s < 0) return;
|
|
234
|
+
const [i] = this.systems.splice(s, 1);
|
|
235
|
+
i.dispose?.();
|
|
236
|
+
}
|
|
237
|
+
/** Runs every system of `phase` in the order added. A system that throws is reported and the rest still run. */
|
|
238
|
+
run(t, s, i) {
|
|
239
|
+
const e = { dt: s.dt, now: s.now, alpha: s.alpha, world: this };
|
|
240
|
+
this.walking++;
|
|
241
|
+
try {
|
|
242
|
+
for (const n of this.systems)
|
|
243
|
+
if (n.phase === t)
|
|
244
|
+
try {
|
|
245
|
+
n.run(e);
|
|
246
|
+
} catch (l) {
|
|
247
|
+
if (i) i(n, l);
|
|
248
|
+
else throw l;
|
|
249
|
+
}
|
|
250
|
+
} finally {
|
|
251
|
+
this.endWalk();
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
/** Every entity, component and system gone. */
|
|
255
|
+
clear() {
|
|
256
|
+
for (const t of this.systems.splice(0)) t.dispose?.();
|
|
257
|
+
for (const t of this.stores) t?.clear();
|
|
258
|
+
this.generations = this.generations.map((t) => (t + 1) % v), this.inUse.fill(!1), this.free.length = 0;
|
|
259
|
+
for (let t = this.generations.length - 1; t >= 0; t--) this.free.push(t);
|
|
260
|
+
this.live = 0, this.pending.length = 0, this.slotCache.clear();
|
|
261
|
+
}
|
|
262
|
+
columnsOf(t, s) {
|
|
263
|
+
let i = this.cols[t.id];
|
|
264
|
+
const e = i ? Object.values(i)[0]?.length ?? 0 : 0;
|
|
265
|
+
if (!i || e < s) {
|
|
266
|
+
let n = Math.max(64, e);
|
|
267
|
+
for (; n < s; ) n *= 2;
|
|
268
|
+
i = x(t.fields, n, i), this.cols[t.id] = i;
|
|
269
|
+
}
|
|
270
|
+
return i;
|
|
271
|
+
}
|
|
272
|
+
store(t) {
|
|
273
|
+
let s = this.stores[t.id];
|
|
274
|
+
return s || (s = new k(), this.stores[t.id] = s), s;
|
|
275
|
+
}
|
|
276
|
+
/** The stores for `types`, or null when one has never been used (so nothing can match). */
|
|
277
|
+
setsFor(t) {
|
|
278
|
+
if (t.length === 0) return null;
|
|
279
|
+
const s = [];
|
|
280
|
+
for (const i of t) {
|
|
281
|
+
const e = this.stores[i.id];
|
|
282
|
+
if (!e || e.size === 0) return null;
|
|
283
|
+
s.push(e);
|
|
284
|
+
}
|
|
285
|
+
return s;
|
|
286
|
+
}
|
|
287
|
+
endWalk() {
|
|
288
|
+
if (this.walking--, this.walking > 0 || this.pending.length === 0) return;
|
|
289
|
+
const t = this.pending.splice(0);
|
|
290
|
+
for (const s of t)
|
|
291
|
+
s.kind === "destroy" ? this.destroy(s.e) : this.remove(s.e, s.type);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
const S = new Int32Array(0);
|
|
295
|
+
function m(f) {
|
|
296
|
+
let t = f[0];
|
|
297
|
+
for (const s of f) s.size < t.size && (t = s);
|
|
298
|
+
return t;
|
|
299
|
+
}
|
|
300
|
+
export {
|
|
301
|
+
z as World,
|
|
302
|
+
O as defineComponent,
|
|
303
|
+
U as defineFields,
|
|
304
|
+
h as entityIndex,
|
|
305
|
+
b as system
|
|
306
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const c = {
|
|
2
|
+
f32: Float32Array,
|
|
3
|
+
f64: Float64Array,
|
|
4
|
+
i8: Int8Array,
|
|
5
|
+
i16: Int16Array,
|
|
6
|
+
i32: Int32Array,
|
|
7
|
+
u8: Uint8Array,
|
|
8
|
+
u16: Uint16Array,
|
|
9
|
+
u32: Uint32Array
|
|
10
|
+
};
|
|
11
|
+
function u(r) {
|
|
12
|
+
return r.fields !== void 0;
|
|
13
|
+
}
|
|
14
|
+
function f(r, e, a) {
|
|
15
|
+
const n = {};
|
|
16
|
+
for (const [t, s] of Object.entries(r)) {
|
|
17
|
+
const o = new c[s](e), i = a?.[t];
|
|
18
|
+
i && o.set(i), n[t] = o;
|
|
19
|
+
}
|
|
20
|
+
return n;
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
f as growColumns,
|
|
24
|
+
u as isFields
|
|
25
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { TextureSource as d, Application as p } from "pixi.js";
|
|
2
|
+
import { Stage as o } from "../core/Stage.js";
|
|
3
|
+
import { TextureRegistry as l } from "../core/TextureRegistry.js";
|
|
4
|
+
import { patchPixi as m } from "../core/pixiPatches.js";
|
|
5
|
+
import { EventBus as f } from "../events/EventBus.js";
|
|
6
|
+
import { followReducedMotion as g } from "../platform/reducedMotion.js";
|
|
7
|
+
import { FixedLoop as w } from "./FixedLoop.js";
|
|
8
|
+
import { HiddenPause as k } from "./HiddenPause.js";
|
|
9
|
+
import { SceneManager as v } from "./SceneManager.js";
|
|
10
|
+
class x extends o {
|
|
11
|
+
constructor(e, t, r) {
|
|
12
|
+
super(e, t), this.tick = r;
|
|
13
|
+
}
|
|
14
|
+
tick;
|
|
15
|
+
update(e, t) {
|
|
16
|
+
this.tick(e, t);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
class u {
|
|
20
|
+
constructor(e, t, r) {
|
|
21
|
+
this.app = e, this.loop = new w(r.hz === void 0 ? {} : { hz: r.hz }), this.stage = new x(e, t, (i, n) => this.tick(i, n));
|
|
22
|
+
const s = this.stage.cameras.main;
|
|
23
|
+
s.setZoom(r.zoom ?? 1), s.defaultZoom = s.zoom, s.roundPixels = r.pixelPerfect === !0, s.resolution = e.renderer.resolution, this.scenes = new v(this), o.onCaught = (i, n) => this.events.emit("error", { where: i, error: n }), e.ticker.add(this.onTick), r.pauseWhenHidden === !0 && this.unwatch.push(this.hiddenPause.watch()), r.followReducedMotion === !0 && this.unwatch.push(g());
|
|
24
|
+
}
|
|
25
|
+
app;
|
|
26
|
+
stage;
|
|
27
|
+
loop;
|
|
28
|
+
scenes;
|
|
29
|
+
events = new f();
|
|
30
|
+
running = !0;
|
|
31
|
+
destroyed = !1;
|
|
32
|
+
/** Pauses through the loop's own switch, so a hidden tab never counts as the game's own pause (`forget`). */
|
|
33
|
+
hiddenPause = this.makeHiddenPause();
|
|
34
|
+
unwatch = [];
|
|
35
|
+
onTick = (e) => this.stage.frame(e.deltaMS);
|
|
36
|
+
static async create(e) {
|
|
37
|
+
const t = e.pixelPerfect === !0;
|
|
38
|
+
d.defaultOptions.scaleMode = t ? "nearest" : "linear";
|
|
39
|
+
const r = t ? 1 : e.resolution ?? Math.min(2, typeof devicePixelRatio == "number" ? devicePixelRatio : 1);
|
|
40
|
+
m();
|
|
41
|
+
const s = new p(), i = e.width === void 0 && e.height === void 0;
|
|
42
|
+
return await s.init({
|
|
43
|
+
...i ? { resizeTo: e.parent } : { width: e.width ?? 800, height: e.height ?? 600 },
|
|
44
|
+
background: e.background ?? "#000000",
|
|
45
|
+
antialias: !t,
|
|
46
|
+
resolution: r,
|
|
47
|
+
autoDensity: !0,
|
|
48
|
+
preference: e.preference ?? "webgl"
|
|
49
|
+
}), e.parent.appendChild(s.canvas), new u(s, e.textures ?? new l(), e);
|
|
50
|
+
}
|
|
51
|
+
/** The scene that updates now, if any. */
|
|
52
|
+
get scene() {
|
|
53
|
+
return this.scenes.current;
|
|
54
|
+
}
|
|
55
|
+
/** Stops simulating and drawing; the canvas keeps its last frame. */
|
|
56
|
+
pause() {
|
|
57
|
+
this.hiddenPause.forget(), this.pauseLoop();
|
|
58
|
+
}
|
|
59
|
+
resume() {
|
|
60
|
+
this.hiddenPause.forget(), this.resumeLoop();
|
|
61
|
+
}
|
|
62
|
+
makeHiddenPause() {
|
|
63
|
+
const e = this;
|
|
64
|
+
return new k({
|
|
65
|
+
get paused() {
|
|
66
|
+
return !e.running;
|
|
67
|
+
},
|
|
68
|
+
pause: () => e.pauseLoop(),
|
|
69
|
+
resume: () => e.resumeLoop()
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
pauseLoop() {
|
|
73
|
+
this.running && (this.running = !1, this.app.ticker.stop());
|
|
74
|
+
}
|
|
75
|
+
resumeLoop() {
|
|
76
|
+
this.running || this.destroyed || (this.running = !0, this.loop.reset(), this.app.ticker.start());
|
|
77
|
+
}
|
|
78
|
+
get paused() {
|
|
79
|
+
return !this.running;
|
|
80
|
+
}
|
|
81
|
+
/** Reports a fault to `events.error` (and the console when nobody listens). */
|
|
82
|
+
reportError(e, t) {
|
|
83
|
+
this.events.listenerCount("error") === 0 && console.error(`[engine] ${e}`, t), this.events.emit("error", { where: e, error: t });
|
|
84
|
+
}
|
|
85
|
+
/** Leaves every scene, removes the canvas and frees the renderer. */
|
|
86
|
+
async destroy() {
|
|
87
|
+
if (!this.destroyed) {
|
|
88
|
+
this.destroyed = !0;
|
|
89
|
+
for (const e of this.unwatch.splice(0)) e();
|
|
90
|
+
await this.scenes.clear(), this.app.ticker.remove(this.onTick), o.onCaught && (o.onCaught = null), this.stage.destroy(), this.events.clear(), this.app.destroy({ removeView: !0 }, { children: !0 });
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
tick(e, t) {
|
|
94
|
+
const r = this.scenes.current;
|
|
95
|
+
if (r) {
|
|
96
|
+
const s = (h, c) => this.reportError(`system ${h.name}`, c), i = this.loop.stepSeconds, n = this.loop.advance(t, () => {
|
|
97
|
+
r.world.run("fixed", { dt: i, now: e, alpha: 0 }, s), r.fixedUpdate(i);
|
|
98
|
+
}), a = t / 1e3;
|
|
99
|
+
r.world.run("frame", { dt: a, now: e, alpha: n }, s), r.update(a, n);
|
|
100
|
+
}
|
|
101
|
+
this.events.emit("frame", { now: e, dt: t / 1e3 });
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
export {
|
|
105
|
+
u as Engine
|
|
106
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
class i {
|
|
2
|
+
stepMs;
|
|
3
|
+
stepSeconds;
|
|
4
|
+
maxSteps;
|
|
5
|
+
carry = 0;
|
|
6
|
+
/** Steps taken since the loop started. */
|
|
7
|
+
tick = 0;
|
|
8
|
+
constructor(s = {}) {
|
|
9
|
+
const t = s.hz ?? 60;
|
|
10
|
+
if (!(t > 0)) throw new Error(`FixedLoop: hz must be positive, got ${t}`);
|
|
11
|
+
this.stepMs = 1e3 / t, this.stepSeconds = 1 / t, this.maxSteps = Math.max(1, s.maxStepsPerFrame ?? 8);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Feeds one frame of `deltaMs` and runs `step` as many times as it owes. Returns the share of a step left over
|
|
15
|
+
* (0–1), for interpolating what is drawn between the last two steps.
|
|
16
|
+
*/
|
|
17
|
+
advance(s, t) {
|
|
18
|
+
s > 0 && Number.isFinite(s) && (this.carry += s);
|
|
19
|
+
let e = 0;
|
|
20
|
+
for (; this.carry >= this.stepMs; ) {
|
|
21
|
+
if (e === this.maxSteps) {
|
|
22
|
+
this.carry %= this.stepMs;
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
this.carry -= this.stepMs, e++, t(this.tick++);
|
|
26
|
+
}
|
|
27
|
+
return this.carry / this.stepMs;
|
|
28
|
+
}
|
|
29
|
+
/** Forgets any debt, e.g. after a scene change or a long load. */
|
|
30
|
+
reset() {
|
|
31
|
+
this.carry = 0;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
i as FixedLoop
|
|
36
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
class s {
|
|
2
|
+
constructor(e) {
|
|
3
|
+
this.target = e;
|
|
4
|
+
}
|
|
5
|
+
target;
|
|
6
|
+
pausedByUs = !1;
|
|
7
|
+
hidden() {
|
|
8
|
+
this.target.paused || (this.target.pause(), this.pausedByUs = !0);
|
|
9
|
+
}
|
|
10
|
+
shown() {
|
|
11
|
+
this.pausedByUs && (this.pausedByUs = !1, this.target.paused && this.target.resume());
|
|
12
|
+
}
|
|
13
|
+
/** The game paused or resumed it itself: whatever happens next is its choice, not ours to undo. */
|
|
14
|
+
forget() {
|
|
15
|
+
this.pausedByUs = !1;
|
|
16
|
+
}
|
|
17
|
+
/** Listens to `visibilitychange` on `doc`; returns the unsubscribe. A no-op without a document. */
|
|
18
|
+
watch(e = typeof document > "u" ? null : document) {
|
|
19
|
+
if (!e) return () => {
|
|
20
|
+
};
|
|
21
|
+
const t = () => e.visibilityState === "hidden" ? this.hidden() : this.shown();
|
|
22
|
+
return e.addEventListener("visibilitychange", t), e.visibilityState === "hidden" && this.hidden(), () => e.removeEventListener("visibilitychange", t);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
s as HiddenPause
|
|
27
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Container as o } from "pixi.js";
|
|
2
|
+
import { World as s } from "../ecs/World.js";
|
|
3
|
+
class u {
|
|
4
|
+
world = new s();
|
|
5
|
+
/** Everything the scene draws in the world goes under this (the camera moves it). */
|
|
6
|
+
root = new o({ sortableChildren: !0 });
|
|
7
|
+
/** Everything the scene draws on the screen (HUD) goes under this. */
|
|
8
|
+
hud = new o();
|
|
9
|
+
bound = null;
|
|
10
|
+
timers = /* @__PURE__ */ new Set();
|
|
11
|
+
inputs = [];
|
|
12
|
+
/** The engine running this scene; only valid between `enter` and `exit`. */
|
|
13
|
+
get engine() {
|
|
14
|
+
if (!this.bound) throw new Error(`${this.constructor.name}: not running in an engine`);
|
|
15
|
+
return this.bound;
|
|
16
|
+
}
|
|
17
|
+
/** Called once when the scene becomes active. May be async: the scene starts updating when it resolves. */
|
|
18
|
+
onEnter() {
|
|
19
|
+
}
|
|
20
|
+
/** Called when the scene is removed. The world and containers are cleared after it returns. */
|
|
21
|
+
onExit() {
|
|
22
|
+
}
|
|
23
|
+
/** Called when another scene is pushed over this one. */
|
|
24
|
+
onPause() {
|
|
25
|
+
}
|
|
26
|
+
/** Called when the scene over this one is popped. */
|
|
27
|
+
onResume() {
|
|
28
|
+
}
|
|
29
|
+
/** Once per simulation step, `dt` in seconds. */
|
|
30
|
+
fixedUpdate(t) {
|
|
31
|
+
}
|
|
32
|
+
/** Once per rendered frame, `dt` in seconds; `alpha` is the share of a step since the last one (0–1). */
|
|
33
|
+
update(t, e) {
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Calls `fn` after `ms` on the stage's clock, unless the scene has left by then: its timers are cancelled when it
|
|
37
|
+
* exits. Only valid while the scene is running (between `enter` and `exit`).
|
|
38
|
+
*/
|
|
39
|
+
delay(t, e) {
|
|
40
|
+
const n = this.engine.stage.time.delayedCall(t, () => {
|
|
41
|
+
this.timers.delete(r), e();
|
|
42
|
+
}), r = {
|
|
43
|
+
remove: () => {
|
|
44
|
+
this.timers.delete(r), n.remove();
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
return this.timers.add(r), r;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Registers input the scene reads (an `Actions`) and returns it, so a field can be written in one line:
|
|
51
|
+
* `private readonly input = this.useInput(new Actions(keyboard, bindings));`. When a scene pushed over this one
|
|
52
|
+
* pops, every registered input is flushed before `onResume`, so a key pressed in the menu is not a press here.
|
|
53
|
+
*/
|
|
54
|
+
useInput(t) {
|
|
55
|
+
return this.inputs.push(t), t;
|
|
56
|
+
}
|
|
57
|
+
/** @internal Called by the scene manager before `onResume`. */
|
|
58
|
+
flushInput() {
|
|
59
|
+
for (const t of this.inputs) t.flush();
|
|
60
|
+
}
|
|
61
|
+
/** @internal Engine-side wiring; games call `engine.scenes`. */
|
|
62
|
+
attach(t) {
|
|
63
|
+
this.bound = t, t.stage.world.addChild(this.root), t.stage.screen.addChild(this.hud);
|
|
64
|
+
}
|
|
65
|
+
/** @internal Clears what the scene made but keeps its containers, so the same scene may be entered again. */
|
|
66
|
+
detach() {
|
|
67
|
+
for (const t of [...this.timers]) t.remove();
|
|
68
|
+
this.world.clear();
|
|
69
|
+
for (const t of [this.root, this.hud]) {
|
|
70
|
+
for (const e of t.removeChildren()) e.destroy({ children: !0 });
|
|
71
|
+
t.removeFromParent();
|
|
72
|
+
}
|
|
73
|
+
this.bound = null;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
export {
|
|
77
|
+
u as Scene
|
|
78
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
class i {
|
|
2
|
+
constructor(t) {
|
|
3
|
+
this.engine = t;
|
|
4
|
+
}
|
|
5
|
+
engine;
|
|
6
|
+
stack = [];
|
|
7
|
+
queue = Promise.resolve();
|
|
8
|
+
/** True while an async `onEnter` is running: nothing updates until it is done. */
|
|
9
|
+
entering = !1;
|
|
10
|
+
/** The scene that updates, if any. */
|
|
11
|
+
get current() {
|
|
12
|
+
return this.entering ? void 0 : this.stack[this.stack.length - 1];
|
|
13
|
+
}
|
|
14
|
+
/** Every scene on the stack, bottom first. */
|
|
15
|
+
get all() {
|
|
16
|
+
return this.stack;
|
|
17
|
+
}
|
|
18
|
+
/** Removes every scene and enters `scene`. */
|
|
19
|
+
replace(t) {
|
|
20
|
+
return this.enqueue(async () => {
|
|
21
|
+
for (; this.stack.length; ) this.exitTop();
|
|
22
|
+
this.engine.stage.cameras.main.reset(), await this.enter(t);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/** Pauses the current scene and enters `scene` over it. */
|
|
26
|
+
push(t) {
|
|
27
|
+
return this.enqueue(async () => {
|
|
28
|
+
this.stack[this.stack.length - 1]?.onPause(), await this.enter(t);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/** Leaves the current scene and resumes the one under it. */
|
|
32
|
+
pop() {
|
|
33
|
+
return this.enqueue(async () => {
|
|
34
|
+
if (!this.stack.length) return;
|
|
35
|
+
this.exitTop();
|
|
36
|
+
const t = this.stack[this.stack.length - 1];
|
|
37
|
+
t && (t.flushInput(), t.onResume());
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/** Leaves every scene (the engine is shutting down). */
|
|
41
|
+
clear() {
|
|
42
|
+
return this.enqueue(async () => {
|
|
43
|
+
for (; this.stack.length; ) this.exitTop();
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
async enter(t) {
|
|
47
|
+
if (this.stack.includes(t)) throw new Error(`${t.constructor.name} is already on the scene stack`);
|
|
48
|
+
t.attach(this.engine), this.stack.push(t), this.entering = !0;
|
|
49
|
+
try {
|
|
50
|
+
await t.onEnter();
|
|
51
|
+
} finally {
|
|
52
|
+
this.entering = !1;
|
|
53
|
+
}
|
|
54
|
+
this.engine.loop.reset();
|
|
55
|
+
}
|
|
56
|
+
exitTop() {
|
|
57
|
+
const t = this.stack.pop();
|
|
58
|
+
if (t)
|
|
59
|
+
try {
|
|
60
|
+
t.onExit();
|
|
61
|
+
} finally {
|
|
62
|
+
t.detach();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
enqueue(t) {
|
|
66
|
+
const e = this.queue.then(t);
|
|
67
|
+
return this.queue = e.catch((s) => this.engine.reportError("scene", s)), e;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
export {
|
|
71
|
+
i as SceneManager
|
|
72
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
class o {
|
|
2
|
+
constructor(e = (t, s) => console.error(`[events] ${String(t)} listener failed`, s)) {
|
|
3
|
+
this.onError = e;
|
|
4
|
+
}
|
|
5
|
+
onError;
|
|
6
|
+
listeners = /* @__PURE__ */ new Map();
|
|
7
|
+
/** Subscribes to `type`; returns the unsubscribe function. */
|
|
8
|
+
on(e, t) {
|
|
9
|
+
return this.listeners.set(e, [...this.listeners.get(e) ?? [], t]), () => this.off(e, t);
|
|
10
|
+
}
|
|
11
|
+
/** Subscribes for the next `type` only. */
|
|
12
|
+
once(e, t) {
|
|
13
|
+
const s = this.on(e, (r) => {
|
|
14
|
+
s(), t(r);
|
|
15
|
+
});
|
|
16
|
+
return s;
|
|
17
|
+
}
|
|
18
|
+
off(e, t) {
|
|
19
|
+
const s = this.listeners.get(e);
|
|
20
|
+
if (!s) return;
|
|
21
|
+
const r = s.filter((n) => n !== t);
|
|
22
|
+
r.length ? this.listeners.set(e, r) : this.listeners.delete(e);
|
|
23
|
+
}
|
|
24
|
+
emit(e, t) {
|
|
25
|
+
for (const s of this.listeners.get(e) ?? [])
|
|
26
|
+
try {
|
|
27
|
+
s(t);
|
|
28
|
+
} catch (r) {
|
|
29
|
+
this.onError(e, r);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
listenerCount(e) {
|
|
33
|
+
return this.listeners.get(e)?.length ?? 0;
|
|
34
|
+
}
|
|
35
|
+
clear() {
|
|
36
|
+
this.listeners.clear();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
o as EventBus
|
|
41
|
+
};
|