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
package/dist/ui/Label.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { BitmapLabel as x } from "../core/BitmapLabel.js";
|
|
2
|
+
import { Text as m } from "../core/Text.js";
|
|
3
|
+
import { Widget as c } from "./Widget.js";
|
|
4
|
+
class i extends c {
|
|
5
|
+
constructor(t) {
|
|
6
|
+
super(), this.text = t, t.anchor.set(0, 0), t.position.set(0, 0), this.addChild(t), this.last = t.text, this.measure();
|
|
7
|
+
}
|
|
8
|
+
text;
|
|
9
|
+
last = "";
|
|
10
|
+
/** A label printed with a canvas `Text`. */
|
|
11
|
+
static text(t, s) {
|
|
12
|
+
return new i(new m(0, 0, t, s));
|
|
13
|
+
}
|
|
14
|
+
/** A label printed from a bitmap font (see `installLabelFont`; `glyphs` beyond ASCII it will print). */
|
|
15
|
+
static bitmap(t, s, e, h, r = "#000000", o = 0, a = 1, n = "") {
|
|
16
|
+
return new i(new x(0, 0, t, s, e, h, r, o, a, n));
|
|
17
|
+
}
|
|
18
|
+
get value() {
|
|
19
|
+
return this.last;
|
|
20
|
+
}
|
|
21
|
+
/** Changes the text; the same string again costs nothing (a HUD may set it every frame). */
|
|
22
|
+
setText(t) {
|
|
23
|
+
return t === this.last ? this : (this.last = t, this.text.text = t, this.measure(), this);
|
|
24
|
+
}
|
|
25
|
+
measure() {
|
|
26
|
+
const t = this.boxW, s = this.boxH;
|
|
27
|
+
this.boxW = Math.ceil(this.text.width), this.boxH = Math.ceil(this.text.height), (this.boxW !== t || this.boxH !== s) && this.notifyResized();
|
|
28
|
+
}
|
|
29
|
+
redraw() {
|
|
30
|
+
this.alpha = this.enabled ? 1 : 0.5;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
i as Label
|
|
35
|
+
};
|
package/dist/ui/List.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { stackLayout as n } from "./layout/stack.js";
|
|
2
|
+
import { ScrollView as c } from "./ScrollView.js";
|
|
3
|
+
import { sizeOf as a, Widget as l } from "./Widget.js";
|
|
4
|
+
class m extends c {
|
|
5
|
+
constructor(t) {
|
|
6
|
+
super(t), this.listOptions = t;
|
|
7
|
+
}
|
|
8
|
+
listOptions;
|
|
9
|
+
rows = [];
|
|
10
|
+
get items() {
|
|
11
|
+
return this.rows;
|
|
12
|
+
}
|
|
13
|
+
add(...t) {
|
|
14
|
+
for (const s of t)
|
|
15
|
+
this.rows.push(s), this.content.addChild(s);
|
|
16
|
+
return this.relayout();
|
|
17
|
+
}
|
|
18
|
+
remove(t, s = !1) {
|
|
19
|
+
const e = this.rows.indexOf(t);
|
|
20
|
+
return e >= 0 && this.rows.splice(e, 1), t.parent === this.content && this.content.removeChild(t), s && t.destroy({ children: !0 }), this.relayout();
|
|
21
|
+
}
|
|
22
|
+
clear(t = !0) {
|
|
23
|
+
for (const s of this.rows.splice(0))
|
|
24
|
+
this.content.removeChild(s), t && s.destroy({ children: !0 });
|
|
25
|
+
return this.relayout();
|
|
26
|
+
}
|
|
27
|
+
/** Lays the rows out again (after a row changed size). */
|
|
28
|
+
relayout() {
|
|
29
|
+
const t = this.listOptions.padding ?? 0, s = this.listOptions.stretch ?? !0, e = this.host?.pixelPerfect ?? !1, r = n(this.rows.map(a), {
|
|
30
|
+
gap: this.listOptions.gap ?? 0,
|
|
31
|
+
padding: t,
|
|
32
|
+
align: s ? "stretch" : "start",
|
|
33
|
+
crossSize: this.boxWidth - 2 * t,
|
|
34
|
+
snap: e
|
|
35
|
+
});
|
|
36
|
+
return this.rows.forEach((i, h) => {
|
|
37
|
+
const o = r.items[h];
|
|
38
|
+
i.position.set(o.x, o.y), s && i instanceof l && i.boxWidth !== o.width && i.resize(o.width, i.boxHeight);
|
|
39
|
+
}), this.setContentHeight(r.height), this.host?.invalidateFocus(), this;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
m as List
|
|
44
|
+
};
|
package/dist/ui/Panel.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { NineSliceSprite as a, Graphics as n, Rectangle as c } from "pixi.js";
|
|
2
|
+
import { Widget as f } from "./Widget.js";
|
|
3
|
+
class x extends f {
|
|
4
|
+
constructor(i, e, l, s = {}) {
|
|
5
|
+
if (super(), this.skin = i, "texture" in i) {
|
|
6
|
+
const { left: t, top: h, right: o, bottom: r } = i.insets;
|
|
7
|
+
this.slice = new a({ texture: i.texture, leftWidth: t, topHeight: h, rightWidth: o, bottomHeight: r }), this.addChild(this.slice);
|
|
8
|
+
} else
|
|
9
|
+
this.box = new n(), this.addChild(this.box);
|
|
10
|
+
(s.blocksPointer ?? !0) && (this.makeInteractive(), this.hitArea = new c(0, 0, 0, 0)), this.resize(e, l);
|
|
11
|
+
}
|
|
12
|
+
skin;
|
|
13
|
+
slice = null;
|
|
14
|
+
box = null;
|
|
15
|
+
redraw() {
|
|
16
|
+
const i = this.boxW, e = this.boxH;
|
|
17
|
+
if (this.hitArea instanceof c && (this.hitArea.width = i, this.hitArea.height = e), this.slice) {
|
|
18
|
+
this.slice.roundPixels = this.host?.pixelPerfect ?? !1, this.slice.width = i, this.slice.height = e;
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const l = this.skin, s = this.box;
|
|
22
|
+
s.clear();
|
|
23
|
+
const t = l.border ?? 0, h = l.fillAlpha ?? l.alpha ?? 1, o = l.borderAlpha ?? l.alpha ?? 1;
|
|
24
|
+
if (!(i <= 0 || e <= 0))
|
|
25
|
+
if (t > 0) {
|
|
26
|
+
const r = { color: l.borderColor ?? 16777215, alpha: o };
|
|
27
|
+
if (i <= 2 * t || e <= 2 * t) {
|
|
28
|
+
s.rect(0, 0, i, e).fill(r);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
s.rect(0, 0, i, t).fill(r), s.rect(0, e - t, i, t).fill(r), s.rect(0, t, t, e - 2 * t).fill(r), s.rect(i - t, t, t, e - 2 * t).fill(r), h > 0 && s.rect(t, t, i - 2 * t, e - 2 * t).fill({ color: l.color, alpha: h });
|
|
32
|
+
} else h > 0 && s.rect(0, 0, i, e).fill({ color: l.color, alpha: h });
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
x as Panel
|
|
37
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { Sprite as a, Texture as l, Rectangle as r, Container as c, Graphics as f } from "pixi.js";
|
|
2
|
+
import { clampScroll as p, scrollIntoView as d, stepFling as g, maxScroll as u } from "./layout/scroll.js";
|
|
3
|
+
import { Widget as n } from "./Widget.js";
|
|
4
|
+
class w extends n {
|
|
5
|
+
constructor(t) {
|
|
6
|
+
super(), this.options = t, this.addChild(this.content, this.clip), this.content.mask = this.clip;
|
|
7
|
+
const s = t.barColor === void 0 ? 16777215 : t.barColor;
|
|
8
|
+
this.bar = s === null ? null : new a(l.WHITE), this.bar && (this.bar.tint = s, this.bar.alpha = 0.4, this.addChild(this.bar)), this.makeInteractive(), this.hitArea = new r(0, 0, 0, 0), this.on("wheel", (i) => {
|
|
9
|
+
const o = t.wheelStep ?? 48, e = Math.max(-o, Math.min(o, i.deltaY));
|
|
10
|
+
this.scrollTo(this.offset + e) && i.stopPropagation();
|
|
11
|
+
}), this.on("pointerdown", (i) => this.dragStart(i)), this.resize(t.width, t.height);
|
|
12
|
+
}
|
|
13
|
+
options;
|
|
14
|
+
content = new c();
|
|
15
|
+
/** True from the moment a press became a drag until the next press: buttons inside ignore that tap. */
|
|
16
|
+
suppressesTaps = !1;
|
|
17
|
+
clip = new f();
|
|
18
|
+
bar;
|
|
19
|
+
offset = 0;
|
|
20
|
+
contentH = 0;
|
|
21
|
+
velocity = 0;
|
|
22
|
+
ticking = !1;
|
|
23
|
+
clipW = -1;
|
|
24
|
+
clipH = -1;
|
|
25
|
+
dragFrom = 0;
|
|
26
|
+
dragOffset = 0;
|
|
27
|
+
lastY = 0;
|
|
28
|
+
lastT = 0;
|
|
29
|
+
onMove = (t) => this.dragMove(t);
|
|
30
|
+
onUp = () => this.dragEnd();
|
|
31
|
+
get scrollY() {
|
|
32
|
+
return this.offset;
|
|
33
|
+
}
|
|
34
|
+
get contentHeight() {
|
|
35
|
+
return this.contentH;
|
|
36
|
+
}
|
|
37
|
+
/** Sets how tall the content is (default: measured from it by `measure`). */
|
|
38
|
+
setContentHeight(t) {
|
|
39
|
+
return this.contentH = Math.max(0, t), this.scrollTo(this.offset), this.redraw(), this;
|
|
40
|
+
}
|
|
41
|
+
/** Measures the content's drawn height; call after filling it. */
|
|
42
|
+
measure() {
|
|
43
|
+
const t = this.content.getLocalBounds();
|
|
44
|
+
return this.setContentHeight(t.maxY);
|
|
45
|
+
}
|
|
46
|
+
/** Scrolls to `y`, kept in range; true when it moved. */
|
|
47
|
+
scrollTo(t) {
|
|
48
|
+
const s = p(t, this.contentH, this.boxH);
|
|
49
|
+
return s === this.offset ? !1 : (this.offset = s, this.redraw(), !0);
|
|
50
|
+
}
|
|
51
|
+
/** Brings a child into view (the focus manager calls it when a widget inside is focused). */
|
|
52
|
+
reveal(t) {
|
|
53
|
+
const s = this.content.toLocal(t.getGlobalPosition()).y, i = t instanceof n ? t.boxHeight : t.getLocalBounds().maxY;
|
|
54
|
+
this.velocity = 0, this.scrollTo(d(this.offset, s, i, this.boxH, this.contentH));
|
|
55
|
+
}
|
|
56
|
+
tick(t) {
|
|
57
|
+
if (this.destroyed || this.velocity === 0) return this.ticking = !1;
|
|
58
|
+
const s = this.scrollTo(this.offset + this.velocity * t / 1e3);
|
|
59
|
+
return this.velocity = s ? g(this.velocity, t) : 0, this.ticking = this.velocity !== 0, this.ticking;
|
|
60
|
+
}
|
|
61
|
+
destroy() {
|
|
62
|
+
this.dragEnd(), super.destroy({ children: !0 });
|
|
63
|
+
}
|
|
64
|
+
dragStart(t) {
|
|
65
|
+
this.suppressesTaps = !1, this.velocity = 0, this.dragFrom = t.global.y, this.dragOffset = this.offset, this.lastY = t.global.y, this.lastT = performance.now(), this.on("globalpointermove", this.onMove), this.on("pointerup", this.onUp), this.on("pointerupoutside", this.onUp);
|
|
66
|
+
}
|
|
67
|
+
dragMove(t) {
|
|
68
|
+
const s = t.global.y;
|
|
69
|
+
if (!this.suppressesTaps && Math.abs(s - this.dragFrom) < (this.options.dragSlop ?? 6)) return;
|
|
70
|
+
this.suppressesTaps = !0;
|
|
71
|
+
const i = performance.now(), o = i - this.lastT;
|
|
72
|
+
o > 0 && (this.velocity = (this.lastY - s) / o * 1e3), this.lastY = s, this.lastT = i, this.scrollTo(this.dragOffset + (this.dragFrom - s));
|
|
73
|
+
}
|
|
74
|
+
dragEnd() {
|
|
75
|
+
if (this.off("globalpointermove", this.onMove), this.off("pointerup", this.onUp), this.off("pointerupoutside", this.onUp), performance.now() - this.lastT > 80 && (this.velocity = 0), this.velocity !== 0 && !this.ticking) {
|
|
76
|
+
const t = this.host;
|
|
77
|
+
t ? (this.ticking = !0, t.animate(this)) : this.velocity = 0;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
redraw() {
|
|
81
|
+
const t = this.boxW, s = this.boxH;
|
|
82
|
+
(t !== this.clipW || s !== this.clipH) && (this.clipW = t, this.clipH = s, this.clip.clear().rect(0, 0, t, s).fill(16777215)), this.hitArea instanceof r && (this.hitArea.width = t, this.hitArea.height = s);
|
|
83
|
+
const i = this.host?.pixelPerfect ?? !1;
|
|
84
|
+
if (this.content.y = i ? -Math.round(this.offset) : -this.offset, this.bar) {
|
|
85
|
+
const o = u(this.contentH, s);
|
|
86
|
+
if (this.bar.visible = o > 0, o > 0) {
|
|
87
|
+
const e = this.options.barWidth ?? 2, h = Math.max(8, Math.round(s * s / this.contentH));
|
|
88
|
+
this.bar.setSize(e, h), this.bar.position.set(t - e, Math.round(this.offset / o * (s - h)));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
export {
|
|
94
|
+
w as ScrollView
|
|
95
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Rectangle as r } from "pixi.js";
|
|
2
|
+
import { quantize as n, sliderValueAt as a, sliderFraction as o } from "./layout/slider.js";
|
|
3
|
+
import { Panel as s } from "./Panel.js";
|
|
4
|
+
import { Widget as l } from "./Widget.js";
|
|
5
|
+
class b extends l {
|
|
6
|
+
constructor(t) {
|
|
7
|
+
super(), this.options = t, this.focusable = !0, this.min = t.min ?? 0, this.max = t.max ?? 1, this.current = n(t.value ?? this.min, this.min, this.max, t.step), this.onChange = t.onChange ?? null, this.track = new s(t.track, t.width, t.height, { blocksPointer: !1 }), this.fill = t.fill ? new s(t.fill, 0, t.height, { blocksPointer: !1 }) : null, this.knob = new s(t.knob, t.knobWidth ?? t.height, t.height, { blocksPointer: !1 }), this.focusFace = t.focus ? new s(t.focus, t.width, t.height, { blocksPointer: !1 }) : null, this.addChild(this.track), this.fill && this.addChild(this.fill), this.focusFace && this.addChild(this.focusFace), this.addChild(this.knob), this.makeInteractive(), this.cursor = "pointer", this.hitArea = new r(0, 0, 0, 0), this.on("pointerdown", (i) => {
|
|
8
|
+
this.enabled && (this.on("globalpointermove", this.onMove), this.on("pointerup", this.onUp), this.on("pointerupoutside", this.onUp), this.dragTo(i));
|
|
9
|
+
}), this.resize(t.width, t.height);
|
|
10
|
+
}
|
|
11
|
+
options;
|
|
12
|
+
onChange;
|
|
13
|
+
min;
|
|
14
|
+
max;
|
|
15
|
+
current;
|
|
16
|
+
track;
|
|
17
|
+
fill;
|
|
18
|
+
knob;
|
|
19
|
+
focusFace;
|
|
20
|
+
onMove = (t) => this.dragTo(t);
|
|
21
|
+
onUp = () => this.endDrag();
|
|
22
|
+
get value() {
|
|
23
|
+
return this.current;
|
|
24
|
+
}
|
|
25
|
+
/** Sets it; `silent` skips `onChange`. */
|
|
26
|
+
setValue(t, i = !1) {
|
|
27
|
+
const e = n(t, this.min, this.max, this.options.step);
|
|
28
|
+
return e === this.current ? this : (this.current = e, this.redraw(), i || this.onChange?.(e), this);
|
|
29
|
+
}
|
|
30
|
+
navigate(t) {
|
|
31
|
+
if (t !== "left" && t !== "right") return !1;
|
|
32
|
+
const i = this.options.navStep ?? (this.options.step || (this.max - this.min) / 10);
|
|
33
|
+
return this.setValue(this.current + (t === "right" ? i : -i)), !0;
|
|
34
|
+
}
|
|
35
|
+
destroy() {
|
|
36
|
+
this.endDrag(), super.destroy({ children: !0 });
|
|
37
|
+
}
|
|
38
|
+
dragTo(t) {
|
|
39
|
+
const i = this.toLocal(t.global), e = this.knob.boxWidth;
|
|
40
|
+
this.setValue(a(i.x, e / 2, this.boxW - e, this.min, this.max, this.options.step));
|
|
41
|
+
}
|
|
42
|
+
endDrag() {
|
|
43
|
+
this.off("globalpointermove", this.onMove), this.off("pointerup", this.onUp), this.off("pointerupoutside", this.onUp);
|
|
44
|
+
}
|
|
45
|
+
redraw() {
|
|
46
|
+
const t = this.boxW, i = this.boxH;
|
|
47
|
+
this.track.resize(t, i), this.focusFace?.resize(t, i), this.focusFace && (this.focusFace.visible = this.focused && this.enabled), this.hitArea instanceof r && (this.hitArea.width = t, this.hitArea.height = i);
|
|
48
|
+
const e = this.knob.boxWidth, h = Math.round(o(this.current, this.min, this.max) * (t - e));
|
|
49
|
+
this.knob.place(h, 0), this.fill?.resize(h + Math.round(e / 2), i), this.alpha = this.enabled ? 1 : 0.5;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
b as Slider
|
|
54
|
+
};
|
package/dist/ui/Stack.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { stackLayout as n } from "./layout/stack.js";
|
|
2
|
+
import { Widget as h, sizeOf as a } from "./Widget.js";
|
|
3
|
+
class f extends h {
|
|
4
|
+
constructor(t = {}) {
|
|
5
|
+
super(), this.options = t;
|
|
6
|
+
}
|
|
7
|
+
options;
|
|
8
|
+
add(...t) {
|
|
9
|
+
for (const o of t) this.addChild(o);
|
|
10
|
+
return this.layout(), this.host?.invalidateFocus(), this;
|
|
11
|
+
}
|
|
12
|
+
remove(t, o = !1) {
|
|
13
|
+
return t.parent === this && this.removeChild(t), o && t.destroy({ children: !0 }), this.layout(), this.host?.invalidateFocus(), this;
|
|
14
|
+
}
|
|
15
|
+
layout() {
|
|
16
|
+
const t = this.children.filter((i) => i.visible), o = this.options.snap ?? this.host?.pixelPerfect ?? !1, e = n(t.map(a), { ...this.options, snap: o });
|
|
17
|
+
return t.forEach((i, r) => {
|
|
18
|
+
const s = e.items[r];
|
|
19
|
+
i.position.set(s.x, s.y), this.options.align === "stretch" && i instanceof h && (i.boxWidth !== s.width || i.boxHeight !== s.height) && i.resize(s.width, s.height);
|
|
20
|
+
}), this.boxW = e.width, this.boxH = e.height, this;
|
|
21
|
+
}
|
|
22
|
+
redraw() {
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
f as Stack
|
|
27
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Sprite as s, Texture as h, Rectangle as r } from "pixi.js";
|
|
2
|
+
import { Panel as i } from "./Panel.js";
|
|
3
|
+
import { Widget as a } from "./Widget.js";
|
|
4
|
+
class o extends a {
|
|
5
|
+
constructor(e) {
|
|
6
|
+
super(), this.options = e, this.focusable = !0, this.checked = e.value ?? !1, this.onChange = e.onChange ?? null, this.box = new i(e.box, e.size, e.size, { blocksPointer: !1 }), this.mark = typeof e.mark == "number" ? new s(h.WHITE) : new s(e.mark), typeof e.mark == "number" && (this.mark.tint = e.mark), this.focusFace = e.focus ? new i(e.focus, e.size, e.size, { blocksPointer: !1 }) : null, this.addChild(this.box, this.mark), this.focusFace && this.addChild(this.focusFace), this.makeInteractive(), this.cursor = "pointer", this.hitArea = new r(0, 0, e.size, e.size), this.on("pointertap", () => this.set(!this.checked)), this.resize(e.size, e.size);
|
|
7
|
+
}
|
|
8
|
+
options;
|
|
9
|
+
onChange;
|
|
10
|
+
checked;
|
|
11
|
+
box;
|
|
12
|
+
mark;
|
|
13
|
+
focusFace;
|
|
14
|
+
get value() {
|
|
15
|
+
return this.checked;
|
|
16
|
+
}
|
|
17
|
+
/** Sets it; `silent` skips `onChange` (mirroring a stored setting into the widget). */
|
|
18
|
+
set(e, t = !1) {
|
|
19
|
+
return e === this.checked || !t && !this.enabled ? this : (this.checked = e, this.redraw(), t || this.onChange?.(e), this);
|
|
20
|
+
}
|
|
21
|
+
activate() {
|
|
22
|
+
this.set(!this.checked);
|
|
23
|
+
}
|
|
24
|
+
redraw() {
|
|
25
|
+
const e = this.boxW;
|
|
26
|
+
if (this.box.resize(e, this.boxH), this.focusFace?.resize(e, this.boxH), this.focusFace && (this.focusFace.visible = this.focused && this.enabled), this.mark.visible = this.checked, typeof this.options.mark == "number") {
|
|
27
|
+
const t = Math.round(e / 4);
|
|
28
|
+
this.mark.setSize(e - 2 * t, this.boxH - 2 * t), this.mark.position.set(t, t);
|
|
29
|
+
} else
|
|
30
|
+
this.mark.position.set(Math.round((e - this.mark.texture.width) / 2), Math.round((this.boxH - this.mark.texture.height) / 2));
|
|
31
|
+
this.alpha = this.enabled ? 1 : 0.5;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
o as Toggle
|
|
36
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Pointer as n } from "../core/Pointer.js";
|
|
2
|
+
const t = /* @__PURE__ */ new WeakSet();
|
|
3
|
+
let i = 0, r = null, s = null;
|
|
4
|
+
const u = {
|
|
5
|
+
/** Marks a native event (a federated event's `nativeEvent`) as taken by the UI. */
|
|
6
|
+
consume(e) {
|
|
7
|
+
e && t.add(e);
|
|
8
|
+
},
|
|
9
|
+
/** Whether the UI took this native event (a game's own canvas listener may ask too). */
|
|
10
|
+
wasConsumed(e) {
|
|
11
|
+
return !!e && t.has(e);
|
|
12
|
+
},
|
|
13
|
+
/** Chains the gate into `Pointer.ignorePress`; counted, so two UI roots install it once. Returns the uninstall. */
|
|
14
|
+
install() {
|
|
15
|
+
i++ === 0 && (r = n.ignorePress, s = (l) => t.has(l) || (r?.(l) ?? !1), n.ignorePress = s);
|
|
16
|
+
let e = !1;
|
|
17
|
+
return () => {
|
|
18
|
+
e || (e = !0, !(--i > 0) && (n.ignorePress === s && (n.ignorePress = r), r = null, s = null));
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
u as UiPointerGate
|
|
24
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { Container as h } from "pixi.js";
|
|
2
|
+
import { Stage as o } from "../core/Stage.js";
|
|
3
|
+
import { FocusManager as r, DEFAULT_NAV as c } from "./FocusManager.js";
|
|
4
|
+
import { anchorPosition as p } from "./layout/anchor.js";
|
|
5
|
+
import { UiPointerGate as a } from "./UiPointerGate.js";
|
|
6
|
+
import { sizeOf as d } from "./Widget.js";
|
|
7
|
+
class y extends h {
|
|
8
|
+
constructor(i, t = {}) {
|
|
9
|
+
super(), this.stage = i, this.pixelPerfect = t.pixelPerfect ?? i.cameras.main.roundPixels, this.focus = new r(this, { ...c, ...t.bindings }), (t.parent ?? i.screen).addChild(this), this.cleanup.push(i.onResize(() => this.layout()), a.install()), this.ticker = i.app.ticker, this.ticker.add(this.onTick);
|
|
10
|
+
}
|
|
11
|
+
stage;
|
|
12
|
+
isUiHost = !0;
|
|
13
|
+
pixelPerfect;
|
|
14
|
+
focus;
|
|
15
|
+
pins = [];
|
|
16
|
+
moving = /* @__PURE__ */ new Set();
|
|
17
|
+
modals = [];
|
|
18
|
+
cleanup = [];
|
|
19
|
+
ticker;
|
|
20
|
+
onTick = (i) => this.guardedUpdate(i.deltaMS);
|
|
21
|
+
/** The screen's size in screen pixels. */
|
|
22
|
+
get viewport() {
|
|
23
|
+
return { width: this.stage.width, height: this.stage.height };
|
|
24
|
+
}
|
|
25
|
+
/** A modal is open or a widget has focus: the game should leave its own actions alone this step. */
|
|
26
|
+
get capturesInput() {
|
|
27
|
+
return this.modals.length > 0 || this.focus.focused !== null;
|
|
28
|
+
}
|
|
29
|
+
/** Adds `child` and keeps it pinned to a screen anchor, `margin` in from the edges, through every resize. */
|
|
30
|
+
pin(i, t, s = 0) {
|
|
31
|
+
i.parent !== this && this.addChild(i);
|
|
32
|
+
const e = this.pins.findIndex((n) => n.child === i);
|
|
33
|
+
return e >= 0 && this.pins.splice(e, 1), this.pins.push({ child: i, anchor: t, margin: s }), this.place(this.pins[this.pins.length - 1]), this.invalidateFocus(), this;
|
|
34
|
+
}
|
|
35
|
+
unpin(i) {
|
|
36
|
+
const t = this.pins.findIndex((s) => s.child === i);
|
|
37
|
+
return t >= 0 && this.pins.splice(t, 1), this;
|
|
38
|
+
}
|
|
39
|
+
/** Places every pinned piece and open modal again (after one changed size; resizes do it by themselves). */
|
|
40
|
+
layout() {
|
|
41
|
+
for (let t = this.pins.length - 1; t >= 0; t--) {
|
|
42
|
+
const s = this.pins[t];
|
|
43
|
+
s.child.destroyed ? this.pins.splice(t, 1) : this.place(s);
|
|
44
|
+
}
|
|
45
|
+
const i = this.viewport;
|
|
46
|
+
for (const t of this.modals) t.layoutFor(i);
|
|
47
|
+
}
|
|
48
|
+
/** Opens a modal over everything: focus is trapped inside it until it closes. */
|
|
49
|
+
openModal(i) {
|
|
50
|
+
this.modals.includes(i) || (this.modals.push(i), this.addChild(i), i.layoutFor(this.viewport), this.focus.pushScope(i, () => i.cancel()));
|
|
51
|
+
}
|
|
52
|
+
closeModal(i) {
|
|
53
|
+
const t = this.modals.indexOf(i);
|
|
54
|
+
t < 0 || (this.modals.splice(t, 1), this.focus.popScope(i), i.parent === this && this.removeChild(i));
|
|
55
|
+
}
|
|
56
|
+
/** Reads one step of navigation input (call between `actions.poll()` and `endStep()`); true when the UI used it. */
|
|
57
|
+
handleInput(i) {
|
|
58
|
+
return this.focus.handle(i);
|
|
59
|
+
}
|
|
60
|
+
invalidateFocus() {
|
|
61
|
+
this.focus.invalidate();
|
|
62
|
+
}
|
|
63
|
+
animate(i) {
|
|
64
|
+
this.moving.add(i);
|
|
65
|
+
}
|
|
66
|
+
/** Ticks what is moving; called by the ticker, or by a game driving the UI itself. */
|
|
67
|
+
update(i) {
|
|
68
|
+
for (const t of this.moving) t.tick(i) || this.moving.delete(t);
|
|
69
|
+
}
|
|
70
|
+
destroy() {
|
|
71
|
+
if (!this.destroyed) {
|
|
72
|
+
this.ticker.remove(this.onTick);
|
|
73
|
+
for (const i of this.cleanup.splice(0)) i();
|
|
74
|
+
this.moving.clear(), this.pins.length = 0, this.modals.length = 0, super.destroy({ children: !0 });
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
place(i) {
|
|
78
|
+
const t = p(i.anchor, d(i.child), this.viewport, i.margin, this.pixelPerfect);
|
|
79
|
+
i.child.position.set(t.x, t.y);
|
|
80
|
+
}
|
|
81
|
+
/** A ticker listener that throws never asks for the next frame: the UI's faults are caught and reported once. */
|
|
82
|
+
guardedUpdate(i) {
|
|
83
|
+
try {
|
|
84
|
+
this.update(i);
|
|
85
|
+
} catch (t) {
|
|
86
|
+
this.moving.clear(), console.error("[ui] update failed", t), o.onCaught?.("[ui] update", t);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
export {
|
|
91
|
+
y as UiRoot
|
|
92
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { Container as o } from "pixi.js";
|
|
2
|
+
import { snapPx as i } from "./layout/geometry.js";
|
|
3
|
+
import { uiHostOf as a } from "./UiHost.js";
|
|
4
|
+
import { UiPointerGate as h } from "./UiPointerGate.js";
|
|
5
|
+
function u(e) {
|
|
6
|
+
h.consume(e.nativeEvent);
|
|
7
|
+
}
|
|
8
|
+
class n extends o {
|
|
9
|
+
/** Whether the focus manager may land on it (buttons, sliders, toggles). */
|
|
10
|
+
focusable = !1;
|
|
11
|
+
boxW = 0;
|
|
12
|
+
boxH = 0;
|
|
13
|
+
isEnabled = !0;
|
|
14
|
+
isFocused = !1;
|
|
15
|
+
get boxWidth() {
|
|
16
|
+
return this.boxW;
|
|
17
|
+
}
|
|
18
|
+
get boxHeight() {
|
|
19
|
+
return this.boxH;
|
|
20
|
+
}
|
|
21
|
+
get enabled() {
|
|
22
|
+
return this.isEnabled;
|
|
23
|
+
}
|
|
24
|
+
set enabled(t) {
|
|
25
|
+
t !== this.isEnabled && (this.isEnabled = t, this.cursor = t && this.focusable ? "pointer" : "default", this.redraw(), this.host?.invalidateFocus());
|
|
26
|
+
}
|
|
27
|
+
get focused() {
|
|
28
|
+
return this.isFocused;
|
|
29
|
+
}
|
|
30
|
+
/** Called by the focus manager. */
|
|
31
|
+
setFocused(t) {
|
|
32
|
+
t !== this.isFocused && (this.isFocused = t, this.redraw());
|
|
33
|
+
}
|
|
34
|
+
/** Resizes the layout box (whole pixels under a pixel-perfect root) and redraws. */
|
|
35
|
+
resize(t, r) {
|
|
36
|
+
const s = this.host?.pixelPerfect ?? !1;
|
|
37
|
+
return this.boxW = Math.max(0, i(t, s)), this.boxH = Math.max(0, i(r, s)), this.redraw(), this;
|
|
38
|
+
}
|
|
39
|
+
/** Moves it, on whole pixels under a pixel-perfect root. */
|
|
40
|
+
place(t, r) {
|
|
41
|
+
const s = this.host?.pixelPerfect ?? !1;
|
|
42
|
+
return this.position.set(i(t, s), i(r, s)), this;
|
|
43
|
+
}
|
|
44
|
+
/** Focusable now: enabled, shown, and every parent shown. */
|
|
45
|
+
canFocus() {
|
|
46
|
+
if (!this.focusable || !this.isEnabled) return !1;
|
|
47
|
+
for (let t = this; t; t = t.parent) if (!t.visible) return !1;
|
|
48
|
+
return !0;
|
|
49
|
+
}
|
|
50
|
+
/** Accept pressed while focused (Enter, the pad's A). */
|
|
51
|
+
activate() {
|
|
52
|
+
}
|
|
53
|
+
/** A direction pressed while focused; true when the widget used it (a slider stepping) so focus stays. */
|
|
54
|
+
navigate(t) {
|
|
55
|
+
return !1;
|
|
56
|
+
}
|
|
57
|
+
/** The root it sits under, looked up when needed: a widget may be built before it is added. */
|
|
58
|
+
get host() {
|
|
59
|
+
return a(this);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Hit-tested by Pixi, and every press on it is kept from the world. A widget whose drawing has gaps (a scroll
|
|
63
|
+
* view, an empty panel) also sets a `hitArea` over its box, so a press between its pieces is not the world's.
|
|
64
|
+
*/
|
|
65
|
+
makeInteractive() {
|
|
66
|
+
this.eventMode = "static", this.on("pointerdown", u);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* A child widget's box changed size by itself (a `Label` given a longer text). A widget that places a child by its
|
|
70
|
+
* size (a `Button` centring its content) lays it out again here; the default does nothing, so a `Stack` still waits
|
|
71
|
+
* for its `layout()` and a change does not ripple up through every container.
|
|
72
|
+
*/
|
|
73
|
+
childResized(t) {
|
|
74
|
+
}
|
|
75
|
+
/** Tells the parent widget this one's box changed size by itself. */
|
|
76
|
+
notifyResized() {
|
|
77
|
+
const t = this.parent;
|
|
78
|
+
t instanceof n && t.childResized(this);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function b(e) {
|
|
82
|
+
if (e instanceof n) return { width: e.boxWidth, height: e.boxHeight };
|
|
83
|
+
const t = e.getLocalBounds();
|
|
84
|
+
return { width: t.maxX, height: t.maxY };
|
|
85
|
+
}
|
|
86
|
+
export {
|
|
87
|
+
n as Widget,
|
|
88
|
+
b as sizeOf
|
|
89
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
class r {
|
|
2
|
+
constructor(t, s = {}) {
|
|
3
|
+
this.canvas = t, this.options = s;
|
|
4
|
+
const e = t.ownerDocument;
|
|
5
|
+
this.root = e.createElement("div"), this.content = e.createElement("div"), s.className && (this.root.className = s.className), Object.assign(this.root.style, { position: "absolute", overflow: "hidden", pointerEvents: "none", zIndex: String(s.zIndex ?? 1) }), Object.assign(this.content.style, { position: "absolute", left: "0", top: "0", transformOrigin: "0 0", pointerEvents: "none" }), this.root.appendChild(this.content), t.insertAdjacentElement("afterend", this.root), this.observer = typeof ResizeObserver == "function" ? new ResizeObserver(this.onWindow) : null, this.observer?.observe(t), window.addEventListener("resize", this.onWindow), this.sync();
|
|
6
|
+
}
|
|
7
|
+
canvas;
|
|
8
|
+
options;
|
|
9
|
+
root;
|
|
10
|
+
/** Where the UI goes: scaled by `scale`. */
|
|
11
|
+
content;
|
|
12
|
+
scaleNow = 1;
|
|
13
|
+
cssW = 0;
|
|
14
|
+
cssH = 0;
|
|
15
|
+
stretch = 1;
|
|
16
|
+
observer;
|
|
17
|
+
onWindow = () => this.sync();
|
|
18
|
+
/** Lets presses on `el` reach it (the overlay's root and content let them through to the canvas). */
|
|
19
|
+
static interactive(t) {
|
|
20
|
+
return t.style.pointerEvents = "auto", t;
|
|
21
|
+
}
|
|
22
|
+
/** The overlay's size in CSS pixels (the canvas's box). */
|
|
23
|
+
get width() {
|
|
24
|
+
return this.cssW;
|
|
25
|
+
}
|
|
26
|
+
get height() {
|
|
27
|
+
return this.cssH;
|
|
28
|
+
}
|
|
29
|
+
/** CSS pixels per screen pixel of the canvas: 1 unless CSS stretches it. */
|
|
30
|
+
get cssScale() {
|
|
31
|
+
return this.stretch;
|
|
32
|
+
}
|
|
33
|
+
get scale() {
|
|
34
|
+
return this.scaleNow;
|
|
35
|
+
}
|
|
36
|
+
/** Draws `content` at `scale` (also published as the CSS variable `--ui-scale`). */
|
|
37
|
+
setScale(t) {
|
|
38
|
+
t === this.scaleNow || !(t > 0) || (this.scaleNow = t, this.applySize());
|
|
39
|
+
}
|
|
40
|
+
/** Lines the overlay up with the canvas again; resizes do it by themselves. */
|
|
41
|
+
sync() {
|
|
42
|
+
const t = this.canvas, s = t.clientWidth, e = t.clientHeight, i = this.root.style;
|
|
43
|
+
if (i.left = `${t.offsetLeft + t.clientLeft}px`, i.top = `${t.offsetTop + t.clientTop}px`, s === this.cssW && e === this.cssH) return;
|
|
44
|
+
this.cssW = s, this.cssH = e, i.width = `${s}px`, i.height = `${e}px`;
|
|
45
|
+
const o = this.options.logicalSize?.();
|
|
46
|
+
this.stretch = o && o.width > 0 ? s / o.width : 1, this.applySize();
|
|
47
|
+
}
|
|
48
|
+
destroy() {
|
|
49
|
+
this.observer?.disconnect(), window.removeEventListener("resize", this.onWindow), this.root.remove();
|
|
50
|
+
}
|
|
51
|
+
applySize() {
|
|
52
|
+
const t = this.scaleNow, s = this.content.style;
|
|
53
|
+
s.width = `${this.cssW / t}px`, s.height = `${this.cssH / t}px`, s.transform = t === 1 ? "" : `scale(${t})`, this.root.style.setProperty("--ui-scale", String(t));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
export {
|
|
57
|
+
r as DomOverlay
|
|
58
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { UPDATE_PRIORITY as h } from "pixi.js";
|
|
2
|
+
import { worldToScreen as l, onScreen as c } from "./worldToScreen.js";
|
|
3
|
+
const i = { x: 0, y: 0 };
|
|
4
|
+
class m {
|
|
5
|
+
constructor(s, o) {
|
|
6
|
+
this.overlay = s, this.layer = o;
|
|
7
|
+
}
|
|
8
|
+
overlay;
|
|
9
|
+
layer;
|
|
10
|
+
anchors = [];
|
|
11
|
+
ticker = null;
|
|
12
|
+
onTick = () => this.update();
|
|
13
|
+
/** Places `el` (put inside the overlay's content if it is not already there) on `target`. Returns the remover. */
|
|
14
|
+
add(s, o, a = {}) {
|
|
15
|
+
s.parentElement || this.overlay.content.appendChild(s), s.style.position = "absolute", s.style.left = "0", s.style.top = "0";
|
|
16
|
+
const t = (a.alignX ?? 0.5) * 100, e = (a.alignY ?? 1) * 100, n = {
|
|
17
|
+
el: s,
|
|
18
|
+
target: o,
|
|
19
|
+
ox: a.offsetX ?? 0,
|
|
20
|
+
oy: a.offsetY ?? 0,
|
|
21
|
+
align: t === 0 && e === 0 ? "" : ` translate(${-t}%, ${-e}%)`,
|
|
22
|
+
margin: a.margin ?? 64,
|
|
23
|
+
lastX: NaN,
|
|
24
|
+
lastY: NaN,
|
|
25
|
+
shown: !0
|
|
26
|
+
};
|
|
27
|
+
return this.anchors.push(n), () => this.remove(s);
|
|
28
|
+
}
|
|
29
|
+
remove(s) {
|
|
30
|
+
const o = this.anchors.findIndex((a) => a.el === s);
|
|
31
|
+
o >= 0 && this.anchors.splice(o, 1);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Runs `update` on `ticker` after Pixi renders (`UTILITY` priority), so it reads the camera as this frame drew it,
|
|
35
|
+
* shake included. The returned function stops it.
|
|
36
|
+
*/
|
|
37
|
+
attach(s) {
|
|
38
|
+
return this.detach(), this.ticker = s, s.add(this.onTick, void 0, h.UTILITY), () => this.detach();
|
|
39
|
+
}
|
|
40
|
+
detach() {
|
|
41
|
+
this.ticker?.remove(this.onTick), this.ticker = null;
|
|
42
|
+
}
|
|
43
|
+
/** Places every element for this frame. */
|
|
44
|
+
update() {
|
|
45
|
+
const s = this.overlay.cssScale / this.overlay.scale, o = this.overlay.width / this.overlay.scale, a = this.overlay.height / this.overlay.scale;
|
|
46
|
+
for (const t of this.anchors) {
|
|
47
|
+
l(this.layer, t.target.x, t.target.y, i, s);
|
|
48
|
+
const e = Math.round(i.x + t.ox), n = Math.round(i.y + t.oy), r = c(e, n, o, a, t.margin);
|
|
49
|
+
r !== t.shown && (t.shown = r, t.el.style.display = r ? "" : "none"), !(!r || e === t.lastX && n === t.lastY) && (t.lastX = e, t.lastY = n, t.el.style.transform = `translate3d(${e}px, ${n}px, 0)${t.align}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
destroy() {
|
|
53
|
+
this.detach(), this.anchors.length = 0;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
export {
|
|
57
|
+
m as DomWorldAnchors
|
|
58
|
+
};
|