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,26 @@
|
|
|
1
|
+
import { isEditable as s, isInside as i, shouldShield as c } from "./shieldDecision.js";
|
|
2
|
+
const n = ["keydown", "keypress", "pointerdown", "mousedown", "touchstart", "click", "dblclick", "wheel", "contextmenu"];
|
|
3
|
+
class a {
|
|
4
|
+
constructor(t, o = {}) {
|
|
5
|
+
this.root = t, this.options = o;
|
|
6
|
+
for (const e of n) t.addEventListener(e, this.handler, { passive: !1 });
|
|
7
|
+
}
|
|
8
|
+
root;
|
|
9
|
+
options;
|
|
10
|
+
handler = (t) => this.check(t);
|
|
11
|
+
/** Whether the player is typing in a field of the UI now (a game may also skip its hotkeys). */
|
|
12
|
+
get typing() {
|
|
13
|
+
const t = this.root.ownerDocument.activeElement;
|
|
14
|
+
return s(t) && i(t, this.root);
|
|
15
|
+
}
|
|
16
|
+
destroy() {
|
|
17
|
+
for (const t of n) this.root.removeEventListener(t, this.handler);
|
|
18
|
+
}
|
|
19
|
+
check(t) {
|
|
20
|
+
const o = t.target, e = t.code, r = { insideUi: i(o, this.root), editable: s(o), ...e === void 0 ? {} : { code: e } };
|
|
21
|
+
c(t.type, r, this.options) && t.stopPropagation();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
a as InputShield
|
|
26
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
function l(f) {
|
|
2
|
+
let t = f, s = [];
|
|
3
|
+
const i = {
|
|
4
|
+
getState: () => t,
|
|
5
|
+
setState(e) {
|
|
6
|
+
const r = typeof e == "function" ? e(t) : e;
|
|
7
|
+
let c = !1;
|
|
8
|
+
for (const o in r)
|
|
9
|
+
if (!Object.is(r[o], t[o])) {
|
|
10
|
+
c = !0;
|
|
11
|
+
break;
|
|
12
|
+
}
|
|
13
|
+
if (!c) return;
|
|
14
|
+
const n = t;
|
|
15
|
+
t = { ...t, ...r };
|
|
16
|
+
for (const o of s) o(t, n);
|
|
17
|
+
},
|
|
18
|
+
subscribe(e) {
|
|
19
|
+
return s = [...s, e], () => {
|
|
20
|
+
s = s.filter((r) => r !== e);
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
select(e, r, c = Object.is) {
|
|
24
|
+
let n = e(t);
|
|
25
|
+
return i.subscribe((o) => {
|
|
26
|
+
const u = e(o);
|
|
27
|
+
if (c(u, n)) return;
|
|
28
|
+
const b = n;
|
|
29
|
+
n = u, r(u, b);
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
reset() {
|
|
33
|
+
const e = t;
|
|
34
|
+
if (t = f, e !== f) for (const r of s) r(t, e);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
return i;
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
l as createStore
|
|
41
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const n = /* @__PURE__ */ new Set(["text", "search", "email", "password", "number", "url", "tel", "date", "time", "datetime-local", "month", "week", ""]);
|
|
2
|
+
function a(t) {
|
|
3
|
+
if (!t) return !1;
|
|
4
|
+
if (t.isContentEditable) return !0;
|
|
5
|
+
const e = t.tagName?.toUpperCase();
|
|
6
|
+
return e === "TEXTAREA" || e === "SELECT" ? !0 : e === "INPUT" && n.has((t.type ?? "").toLowerCase());
|
|
7
|
+
}
|
|
8
|
+
function i(t, e) {
|
|
9
|
+
for (let r = t; r; r = r.parentElement) if (r === e) return !0;
|
|
10
|
+
return !1;
|
|
11
|
+
}
|
|
12
|
+
const s = ["Enter", "NumpadEnter", "Space"];
|
|
13
|
+
function u(t, e, r = {}) {
|
|
14
|
+
if (!e.insideUi) return !1;
|
|
15
|
+
switch (t) {
|
|
16
|
+
case "keydown":
|
|
17
|
+
case "keypress":
|
|
18
|
+
return e.editable ? !0 : e.code !== void 0 && (r.uiKeys ?? s).includes(e.code);
|
|
19
|
+
case "pointerdown":
|
|
20
|
+
case "mousedown":
|
|
21
|
+
case "touchstart":
|
|
22
|
+
case "click":
|
|
23
|
+
case "dblclick":
|
|
24
|
+
case "wheel":
|
|
25
|
+
case "contextmenu":
|
|
26
|
+
return !0;
|
|
27
|
+
default:
|
|
28
|
+
return !1;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
a as isEditable,
|
|
33
|
+
i as isInside,
|
|
34
|
+
u as shouldShield
|
|
35
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
function x(n, o, t, c, e = 1) {
|
|
2
|
+
return c.x = (n.x + o * n.scale.x) * e, c.y = (n.y + t * n.scale.y) * e, c;
|
|
3
|
+
}
|
|
4
|
+
function f(n, o, t, c, e = 0) {
|
|
5
|
+
return n >= -e && o >= -e && n <= t + e && o <= c + e;
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
f as onScreen,
|
|
9
|
+
x as worldToScreen
|
|
10
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { insets as s, snapPx as c } from "./geometry.js";
|
|
2
|
+
const l = {
|
|
3
|
+
"top-left": [0, 0],
|
|
4
|
+
top: [0.5, 0],
|
|
5
|
+
"top-right": [1, 0],
|
|
6
|
+
left: [0, 0.5],
|
|
7
|
+
center: [0.5, 0.5],
|
|
8
|
+
right: [1, 0.5],
|
|
9
|
+
"bottom-left": [0, 1],
|
|
10
|
+
bottom: [0.5, 1],
|
|
11
|
+
"bottom-right": [1, 1]
|
|
12
|
+
};
|
|
13
|
+
function b(e, t, o, g = 0, n = !1) {
|
|
14
|
+
const h = s(g), [i, f] = l[e], r = i === 0 ? h.left : i === 1 ? o.width - h.right - t.width : (o.width - t.width) / 2, m = f === 0 ? h.top : f === 1 ? o.height - h.bottom - t.height : (o.height - t.height) / 2;
|
|
15
|
+
return { x: c(r, n), y: c(m, n) };
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
b as anchorPosition
|
|
19
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
function u(i = 1) {
|
|
2
|
+
return { value: i, trail: i, holdMs: 0 };
|
|
3
|
+
}
|
|
4
|
+
function d(i, l, n = {}) {
|
|
5
|
+
const r = l < 0 ? 0 : l > 1 ? 1 : l;
|
|
6
|
+
r < i.value && (i.holdMs = n.delayMs ?? 400), r > i.trail && (i.trail = r), i.value = r;
|
|
7
|
+
}
|
|
8
|
+
function f(i, l, n = {}) {
|
|
9
|
+
if (i.trail <= i.value) {
|
|
10
|
+
i.trail = i.value;
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
let r = l;
|
|
14
|
+
if (i.holdMs > 0) {
|
|
15
|
+
const o = Math.min(i.holdMs, r);
|
|
16
|
+
i.holdMs -= o, r -= o;
|
|
17
|
+
}
|
|
18
|
+
r <= 0 || (i.trail = Math.max(i.value, i.trail - (n.rate ?? 0.6) * r / 1e3));
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
u as drainState,
|
|
22
|
+
d as setDrainValue,
|
|
23
|
+
f as stepDrain
|
|
24
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { clamp as o, snapPx as w } from "./geometry.js";
|
|
2
|
+
function W(h, a, n = {}) {
|
|
3
|
+
const t = n.margin ?? 8, s = n.scale ?? 1, e = Math.min(n.minScale ?? s, s), c = n.snap ?? !1, d = Math.max(0, a.width - 2 * t), g = Math.max(0, a.height - 2 * t), f = h.width > 0 && h.height > 0 ? Math.min(d / h.width, g / h.height) : s, i = o(f, e, s), m = Math.min(h.width, d / i), l = Math.min(h.height, g / i), x = m * i, M = l * i, y = n.centre || !("x" in h) ? (a.width - x) / 2 : h.x, r = n.centre || !("y" in h) ? (a.height - M) / 2 : h.y, u = o(y, t, Math.max(t, a.width - t - x)), H = o(r, t, Math.max(t, a.height - t - M));
|
|
4
|
+
return {
|
|
5
|
+
x: w(u, c),
|
|
6
|
+
y: w(H, c),
|
|
7
|
+
width: c ? Math.floor(m) : m,
|
|
8
|
+
height: c ? Math.floor(l) : l,
|
|
9
|
+
scale: i,
|
|
10
|
+
scrollX: m < h.width,
|
|
11
|
+
scrollY: l < h.height
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
W as fitToViewport
|
|
16
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
function h(n) {
|
|
2
|
+
return n.x + n.width / 2;
|
|
3
|
+
}
|
|
4
|
+
function a(n) {
|
|
5
|
+
return n.y + n.height / 2;
|
|
6
|
+
}
|
|
7
|
+
function E(n) {
|
|
8
|
+
let t = -1;
|
|
9
|
+
for (let o = 0; o < n.length; o++) {
|
|
10
|
+
const e = n[o], i = t < 0 ? null : n[t];
|
|
11
|
+
(!i || e.y < i.y || e.y === i.y && e.x < i.x) && (t = o);
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
}
|
|
15
|
+
function F(n, t, o, e = !1) {
|
|
16
|
+
if (n.length === 0) return -1;
|
|
17
|
+
const i = n[t];
|
|
18
|
+
if (!i) return E(n);
|
|
19
|
+
const y = h(i), g = a(i), S = o === "left" || o === "right", C = o === "right" || o === "down" ? 1 : -1;
|
|
20
|
+
let r = -1, b = 1 / 0, u = -1, x = 1 / 0;
|
|
21
|
+
for (let f = 0; f < n.length; f++) {
|
|
22
|
+
if (f === t) continue;
|
|
23
|
+
const l = n[f], c = (S ? h(l) - y : a(l) - g) * C, I = Math.abs(S ? a(l) - g : h(l) - y);
|
|
24
|
+
if (c > 0.5) {
|
|
25
|
+
const s = c + 2 * I;
|
|
26
|
+
s < b && (b = s, r = f);
|
|
27
|
+
} else if (e && c < -0.5) {
|
|
28
|
+
const s = c + 2 * I;
|
|
29
|
+
s < x && (x = s, u = f);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return r >= 0 ? r : u >= 0 ? u : t;
|
|
33
|
+
}
|
|
34
|
+
function G(n, t, o) {
|
|
35
|
+
return n === 0 ? -1 : t < 0 || t >= n ? o > 0 ? 0 : n - 1 : (t + o + n) % n;
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
E as firstFocus,
|
|
39
|
+
G as linearFocus,
|
|
40
|
+
F as nextFocus
|
|
41
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
function h(t) {
|
|
2
|
+
return t === void 0 ? { top: 0, right: 0, bottom: 0, left: 0 } : typeof t == "number" ? { top: t, right: t, bottom: t, left: t } : { top: t.top ?? 0, right: t.right ?? 0, bottom: t.bottom ?? 0, left: t.left ?? 0 };
|
|
3
|
+
}
|
|
4
|
+
function i(t, o = !0) {
|
|
5
|
+
return o ? Math.round(t) : t;
|
|
6
|
+
}
|
|
7
|
+
function u(t, o = !0) {
|
|
8
|
+
if (!o) return { x: t.x, y: t.y, width: t.width, height: t.height };
|
|
9
|
+
const n = Math.round(t.x), e = Math.round(t.y);
|
|
10
|
+
return { x: n, y: e, width: Math.round(t.x + t.width) - n, height: Math.round(t.y + t.height) - e };
|
|
11
|
+
}
|
|
12
|
+
function r(t, o, n) {
|
|
13
|
+
return t < o ? o : t > n ? n : t;
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
r as clamp,
|
|
17
|
+
h as insets,
|
|
18
|
+
i as snapPx,
|
|
19
|
+
u as snapRect
|
|
20
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { clamp as m, snapPx as n } from "./geometry.js";
|
|
2
|
+
const r = { below: "above", above: "below", right: "left", left: "right" };
|
|
3
|
+
function f(e, t, s, h, l) {
|
|
4
|
+
switch (e) {
|
|
5
|
+
case "below":
|
|
6
|
+
return s.height - l - (t.y + t.height + h);
|
|
7
|
+
case "above":
|
|
8
|
+
return t.y - h - l;
|
|
9
|
+
case "right":
|
|
10
|
+
return s.width - l - (t.x + t.width + h);
|
|
11
|
+
case "left":
|
|
12
|
+
return t.x - h - l;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function a(e, t, s, h = {}) {
|
|
16
|
+
const l = h.gap ?? 4, i = h.margin ?? 4, g = h.side ?? "below", b = g === "below" || g === "above", y = b ? t.height : t.width;
|
|
17
|
+
let x = g;
|
|
18
|
+
if (f(g, e, s, l, i) < y) {
|
|
19
|
+
const u = r[g], c = f(u, e, s, l, i);
|
|
20
|
+
(c >= y || c > f(g, e, s, l, i)) && (x = u);
|
|
21
|
+
}
|
|
22
|
+
let d, w;
|
|
23
|
+
return b ? (w = x === "below" ? e.y + e.height + l : e.y - l - t.height, d = h.align === "center" ? e.x + (e.width - t.width) / 2 : e.x) : (d = x === "right" ? e.x + e.width + l : e.x - l - t.width, w = h.align === "center" ? e.y + (e.height - t.height) / 2 : e.y), d = m(d, i, Math.max(i, s.width - i - t.width)), w = m(w, i, Math.max(i, s.height - i - t.height)), { x: n(d, h.snap ?? !1), y: n(w, h.snap ?? !1), side: x };
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
a as placeTooltip
|
|
27
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { clamp as r } from "./geometry.js";
|
|
2
|
+
function u(o, n) {
|
|
3
|
+
return Math.max(0, o - n);
|
|
4
|
+
}
|
|
5
|
+
function f(o, n, c) {
|
|
6
|
+
return r(o, 0, u(n, c));
|
|
7
|
+
}
|
|
8
|
+
function a(o, n, c, l, e) {
|
|
9
|
+
let t = o;
|
|
10
|
+
return n < t ? t = n : n + c > t + l && (t = n + c - l), f(t, e, l);
|
|
11
|
+
}
|
|
12
|
+
const i = 8;
|
|
13
|
+
function p(o, n, c = 0.06) {
|
|
14
|
+
const l = o * Math.pow(1 - c, n / 16.666666666666668);
|
|
15
|
+
return Math.abs(l) < i ? 0 : l;
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
i as FLING_STOP,
|
|
19
|
+
f as clampScroll,
|
|
20
|
+
u as maxScroll,
|
|
21
|
+
a as scrollIntoView,
|
|
22
|
+
p as stepFling
|
|
23
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { clamp as n } from "./geometry.js";
|
|
2
|
+
function d(u, r, t, o = 0) {
|
|
3
|
+
const e = n(u, r, t);
|
|
4
|
+
if (o <= 0) return e;
|
|
5
|
+
const c = r + Math.round((e - r) / o) * o;
|
|
6
|
+
return n(Number(c.toFixed(10)), r, t);
|
|
7
|
+
}
|
|
8
|
+
function i(u, r, t) {
|
|
9
|
+
return t > r ? n((u - r) / (t - r), 0, 1) : 0;
|
|
10
|
+
}
|
|
11
|
+
function s(u, r, t, o, e, c = 0) {
|
|
12
|
+
const f = t > 0 ? n((u - r) / t, 0, 1) : 0;
|
|
13
|
+
return d(o + f * (e - o), o, e, c);
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
d as quantize,
|
|
17
|
+
i as sliderFraction,
|
|
18
|
+
s as sliderValueAt
|
|
19
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { insets as k, snapPx as o } from "./geometry.js";
|
|
2
|
+
function M(h, s = {}) {
|
|
3
|
+
const t = (s.direction ?? "vertical") === "vertical", S = s.gap ?? 0, e = k(s.padding), l = s.align ?? "start", c = s.snap ?? !1;
|
|
4
|
+
let i = 0;
|
|
5
|
+
for (const n of h) i = Math.max(i, t ? n.width : n.height);
|
|
6
|
+
s.crossSize !== void 0 && (i = s.crossSize);
|
|
7
|
+
const f = [];
|
|
8
|
+
let g = t ? e.top : e.left;
|
|
9
|
+
const m = t ? e.left : e.top;
|
|
10
|
+
for (let n = 0; n < h.length; n++) {
|
|
11
|
+
const a = h[n], x = t ? a.height : a.width;
|
|
12
|
+
let r = t ? a.width : a.height, d = 0;
|
|
13
|
+
l === "stretch" ? r = i : l === "center" ? d = (i - r) / 2 : l === "end" && (d = i - r);
|
|
14
|
+
const u = o(g, c), v = o(m + d, c), b = o(x, c), y = o(r, c);
|
|
15
|
+
f.push(t ? { x: v, y: u, width: y, height: b } : { x: u, y: v, width: b, height: y }), g += x + (n < h.length - 1 ? S : 0);
|
|
16
|
+
}
|
|
17
|
+
const p = g + (t ? e.bottom : e.right), w = m + i + (t ? e.right : e.bottom);
|
|
18
|
+
return {
|
|
19
|
+
items: f,
|
|
20
|
+
width: o(t ? w : p, c),
|
|
21
|
+
height: o(t ? p : w, c)
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
M as stackLayout
|
|
26
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function p(s, h, u = 0) {
|
|
2
|
+
const n = [];
|
|
3
|
+
let e = [], o = 0;
|
|
4
|
+
for (let t = 0; t < s.length; t++) {
|
|
5
|
+
const l = s[t], r = e.length === 0 ? l : o + u + l;
|
|
6
|
+
e.length > 0 && r > h ? (n.push(e), e = [t], o = l) : (e.push(t), o = r);
|
|
7
|
+
}
|
|
8
|
+
return e.length > 0 && n.push(e), n;
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
p as wrapRow
|
|
12
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Sprite as a } from "pixi.js";
|
|
2
|
+
import { Widget as c } from "../Widget.js";
|
|
3
|
+
import { layoutRichText as d } from "./richLayout.js";
|
|
4
|
+
import { parseRichText as p } from "./richMarkup.js";
|
|
5
|
+
class b extends c {
|
|
6
|
+
source = "";
|
|
7
|
+
last = { width: 0, height: 0, lines: [] };
|
|
8
|
+
runs = [];
|
|
9
|
+
icons = [];
|
|
10
|
+
measure;
|
|
11
|
+
options;
|
|
12
|
+
/** Whether the last layout was on whole pixels. */
|
|
13
|
+
snapped = !1;
|
|
14
|
+
constructor(t, h) {
|
|
15
|
+
super(), this.options = { ...h };
|
|
16
|
+
const s = h.font;
|
|
17
|
+
this.measure = {
|
|
18
|
+
textWidth: (i, o) => s.textWidth(i, o),
|
|
19
|
+
lineHeight: (i) => s.lineHeight(i),
|
|
20
|
+
ascent: (i) => s.ascent?.(i) ?? s.lineHeight(i) * 0.8,
|
|
21
|
+
iconSize: (i, o) => {
|
|
22
|
+
const r = h.textures?.get(i, o);
|
|
23
|
+
return r ? { width: r.orig.width, height: r.orig.height } : { width: 0, height: 0 };
|
|
24
|
+
}
|
|
25
|
+
}, this.source = t, this.relayout(), h.pixelPerfect === void 0 && this.on("added", () => this.pixelPerfect() !== this.snapped && this.relayout());
|
|
26
|
+
}
|
|
27
|
+
/** The markup shown. */
|
|
28
|
+
get markup() {
|
|
29
|
+
return this.source;
|
|
30
|
+
}
|
|
31
|
+
/** Where every line, run and icon was placed, for hit-testing a word or drawing behind one. */
|
|
32
|
+
get layout() {
|
|
33
|
+
return this.last;
|
|
34
|
+
}
|
|
35
|
+
/** Changes the text; the same markup again costs nothing. */
|
|
36
|
+
setText(t) {
|
|
37
|
+
return t === this.source ? this : (this.source = t, this.relayout(), this);
|
|
38
|
+
}
|
|
39
|
+
/** Wraps to a new width (undefined: only at `\n`). */
|
|
40
|
+
setWrapWidth(t) {
|
|
41
|
+
return t === this.options.wrapWidth ? this : (t === void 0 ? delete this.options.wrapWidth : this.options.wrapWidth = t, this.relayout(), this);
|
|
42
|
+
}
|
|
43
|
+
setAlign(t) {
|
|
44
|
+
return t === (this.options.align ?? "left") ? this : (this.options.align = t, this.relayout(), this);
|
|
45
|
+
}
|
|
46
|
+
/** Lays out and draws again: after the font's colours or the icons' textures were swapped under it. */
|
|
47
|
+
relayout() {
|
|
48
|
+
const t = this.snapped = this.pixelPerfect(), h = p(this.source, this.options);
|
|
49
|
+
this.last = d(h, this.measure, { ...this.options, pixelPerfect: t });
|
|
50
|
+
let s = 0, i = 0;
|
|
51
|
+
for (const l of this.last.lines)
|
|
52
|
+
for (const e of l.items) {
|
|
53
|
+
if (e.kind === "text") {
|
|
54
|
+
const u = this.runs[s] ?? this.addRun();
|
|
55
|
+
s++, this.options.font.updateRun(u, e.text, e.style), u.position.set(e.x, e.y), u.visible = !0;
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
if (!this.options.textures || e.width === 0) continue;
|
|
59
|
+
const n = this.icons[i] ?? this.addIcon();
|
|
60
|
+
i++, n.texture = this.options.textures.get(e.key, e.frame), n.position.set(e.x, e.y), n.setSize(e.width, e.height), n.visible = !0;
|
|
61
|
+
}
|
|
62
|
+
for (; s < this.runs.length; s++) this.runs[s].visible = !1;
|
|
63
|
+
for (; i < this.icons.length; i++) this.icons[i].visible = !1;
|
|
64
|
+
const o = this.boxW, r = this.boxH;
|
|
65
|
+
this.boxW = Math.ceil(this.last.width), this.boxH = Math.ceil(this.last.height), (this.boxW !== o || this.boxH !== r) && this.notifyResized();
|
|
66
|
+
}
|
|
67
|
+
destroy(t) {
|
|
68
|
+
super.destroy(typeof t == "object" ? { ...t, children: !0, texture: !1 } : { children: !0 });
|
|
69
|
+
}
|
|
70
|
+
redraw() {
|
|
71
|
+
this.alpha = this.enabled ? 1 : 0.5;
|
|
72
|
+
}
|
|
73
|
+
pixelPerfect() {
|
|
74
|
+
return this.options.pixelPerfect ?? this.host?.pixelPerfect ?? !1;
|
|
75
|
+
}
|
|
76
|
+
addRun() {
|
|
77
|
+
const t = this.options.font.createRun();
|
|
78
|
+
return this.runs.push(t), this.addChild(t), t;
|
|
79
|
+
}
|
|
80
|
+
addIcon() {
|
|
81
|
+
const t = new a();
|
|
82
|
+
return t.roundPixels = !0, this.icons.push(t), this.addChild(t), t;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
export {
|
|
86
|
+
b as RichText
|
|
87
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { BitmapFontManager as l, BitmapText as h, TextStyle as f, CanvasTextMetrics as c, Text as m } from "pixi.js";
|
|
2
|
+
import { installLabelFont as u } from "../../core/BitmapLabel.js";
|
|
3
|
+
function a(o) {
|
|
4
|
+
return `${o.color ?? ""}|${o.bold ? 1 : 0}|${o.italic ? 1 : 0}|${o.size ?? ""}`;
|
|
5
|
+
}
|
|
6
|
+
class x {
|
|
7
|
+
constructor(t) {
|
|
8
|
+
this.options = t;
|
|
9
|
+
}
|
|
10
|
+
options;
|
|
11
|
+
styles = /* @__PURE__ */ new Map();
|
|
12
|
+
metrics = /* @__PURE__ */ new Map();
|
|
13
|
+
textWidth(t, s) {
|
|
14
|
+
return c.measureText(t, this.pixiStyle(s), void 0, !1).width;
|
|
15
|
+
}
|
|
16
|
+
lineHeight(t) {
|
|
17
|
+
return this.metricsOf(t).lineHeight;
|
|
18
|
+
}
|
|
19
|
+
ascent(t) {
|
|
20
|
+
return this.metricsOf(t).ascent;
|
|
21
|
+
}
|
|
22
|
+
createRun() {
|
|
23
|
+
return new m({ text: "", style: this.pixiStyle({ bold: !1, italic: !1 }), resolution: this.options.resolution ?? 1 });
|
|
24
|
+
}
|
|
25
|
+
updateRun(t, s, i) {
|
|
26
|
+
const e = t, n = this.pixiStyle(i);
|
|
27
|
+
e.style !== n && (e.style = n), e.text !== s && (e.text = s);
|
|
28
|
+
}
|
|
29
|
+
metricsOf(t) {
|
|
30
|
+
const s = a(t);
|
|
31
|
+
let i = this.metrics.get(s);
|
|
32
|
+
if (!i) {
|
|
33
|
+
const e = c.measureText("M", this.pixiStyle(t), void 0, !1);
|
|
34
|
+
i = { lineHeight: e.lineHeight, ascent: e.fontProperties.ascent }, this.metrics.set(s, i);
|
|
35
|
+
}
|
|
36
|
+
return i;
|
|
37
|
+
}
|
|
38
|
+
pixiStyle(t) {
|
|
39
|
+
const s = a(t);
|
|
40
|
+
let i = this.styles.get(s);
|
|
41
|
+
if (!i) {
|
|
42
|
+
const e = this.options;
|
|
43
|
+
i = new f({
|
|
44
|
+
fontFamily: e.fontFamily,
|
|
45
|
+
fontSize: t.size ?? e.fontSize,
|
|
46
|
+
fill: t.color ?? e.color ?? "#ffffff",
|
|
47
|
+
fontWeight: t.bold ? "bold" : "normal",
|
|
48
|
+
fontStyle: t.italic ? "italic" : "normal",
|
|
49
|
+
...e.stroke ? { stroke: { color: e.stroke, width: e.strokeWidth ?? 1, join: "round" } } : {}
|
|
50
|
+
}), this.styles.set(s, i);
|
|
51
|
+
}
|
|
52
|
+
return i;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
class d {
|
|
56
|
+
constructor(t) {
|
|
57
|
+
this.options = t;
|
|
58
|
+
}
|
|
59
|
+
options;
|
|
60
|
+
styles = /* @__PURE__ */ new Map();
|
|
61
|
+
metrics = /* @__PURE__ */ new Map();
|
|
62
|
+
textWidth(t, s) {
|
|
63
|
+
const i = l.measureText(t, this.pixiStyle(s), !1);
|
|
64
|
+
return i.width * i.scale;
|
|
65
|
+
}
|
|
66
|
+
lineHeight(t) {
|
|
67
|
+
return this.metricsOf(t).lineHeight;
|
|
68
|
+
}
|
|
69
|
+
ascent(t) {
|
|
70
|
+
return this.metricsOf(t).ascent;
|
|
71
|
+
}
|
|
72
|
+
createRun() {
|
|
73
|
+
return new h({ text: "", style: this.pixiStyle({ bold: !1, italic: !1 }) });
|
|
74
|
+
}
|
|
75
|
+
updateRun(t, s, i) {
|
|
76
|
+
const e = t, n = this.pixiStyle(i);
|
|
77
|
+
e.style !== n && (e.style = n), e.text !== s && (e.text = s);
|
|
78
|
+
}
|
|
79
|
+
metricsOf(t) {
|
|
80
|
+
const s = this.fontKey(t);
|
|
81
|
+
let i = this.metrics.get(s);
|
|
82
|
+
if (!i) {
|
|
83
|
+
const e = this.pixiStyle(t), n = l.getFont("M", e), r = e.fontSize / n.baseMeasurementFontSize;
|
|
84
|
+
i = { lineHeight: n.lineHeight * r, ascent: n.fontMetrics.ascent * r }, this.metrics.set(s, i);
|
|
85
|
+
}
|
|
86
|
+
return i;
|
|
87
|
+
}
|
|
88
|
+
/** Bold and italic do not reach a bitmap font: styles differing only by them share one. */
|
|
89
|
+
fontKey(t) {
|
|
90
|
+
return `${t.color ?? ""}|${t.size ?? ""}`;
|
|
91
|
+
}
|
|
92
|
+
pixiStyle(t) {
|
|
93
|
+
const s = this.fontKey(t);
|
|
94
|
+
let i = this.styles.get(s);
|
|
95
|
+
if (!i) {
|
|
96
|
+
const e = this.options, n = t.size ?? e.fontSize, r = u(e.fontFamily, n, t.color ?? e.color ?? "#ffffff", e.stroke ?? "#000000", e.strokeWidth ?? 0, e.resolution ?? 1, e.glyphs ?? "");
|
|
97
|
+
i = new f({ fontFamily: r, fontSize: n }), this.styles.set(s, i);
|
|
98
|
+
}
|
|
99
|
+
return i;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
export {
|
|
103
|
+
d as BitmapRichFont,
|
|
104
|
+
x as CanvasRichFont
|
|
105
|
+
};
|