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,75 @@
|
|
|
1
|
+
import { circlePolygon as _, polygonPolygon as W } from "./collidePolygon.js";
|
|
2
|
+
import { FACE_RIGHT as m, FACE_LEFT as C, FACE_BOTTOM as E, FACE_TOP as O } from "./types.js";
|
|
3
|
+
function L() {
|
|
4
|
+
return { nx: 0, ny: 0, depth: 0, count: 0, px: [0, 0], py: [0, 0], pd: [0, 0], id: [0, 0] };
|
|
5
|
+
}
|
|
6
|
+
function R(n, s, t, r) {
|
|
7
|
+
const i = n.shape, e = s.shape;
|
|
8
|
+
return i.kind === "circle" && e.kind === "circle" ? v(n, i, s, e, t, r) ? (X(r, n.x + r.nx * (i.radius - r.depth / 2), n.y + r.ny * (i.radius - r.depth / 2)), !0) : !1 : i.kind === "circle" ? s.axisAligned ? I(n, i, s, e, t, r) ? (r.nx = -r.nx, r.ny = -r.ny, X(r, n.x + r.nx * (i.radius - r.depth / 2), n.y + r.ny * (i.radius - r.depth / 2)), !0) : !1 : _(n, i.radius, s, t, !0, r) : e.kind === "circle" ? n.axisAligned ? I(s, e, n, i, t, r) ? (X(r, s.x - r.nx * (e.radius - r.depth / 2), s.y - r.ny * (e.radius - r.depth / 2)), !0) : !1 : _(s, e.radius, n, t, !1, r) : n.axisAligned && s.axisAligned && n.invInertia === 0 && s.invInertia === 0 ? q(n, i, s, e, t, r) ? (X(r, (Math.max(n.minX, s.minX) + Math.min(n.maxX, s.maxX)) / 2, (Math.max(n.minY, s.minY) + Math.min(n.maxY, s.maxY)) / 2), !0) : !1 : W(n, s, t, r);
|
|
9
|
+
}
|
|
10
|
+
function X(n, s, t) {
|
|
11
|
+
n.count = 1, n.px[0] = s, n.py[0] = t, n.pd[0] = n.depth, n.id[0] = 0;
|
|
12
|
+
}
|
|
13
|
+
function w(n, s, t) {
|
|
14
|
+
return t > 0 ? !(n.internalFaces & m) && !(s.internalFaces & C) : !(n.internalFaces & C) && !(s.internalFaces & m);
|
|
15
|
+
}
|
|
16
|
+
function B(n, s, t) {
|
|
17
|
+
return t > 0 ? !(n.internalFaces & E) && !(s.internalFaces & O) : !(n.internalFaces & O) && !(s.internalFaces & E);
|
|
18
|
+
}
|
|
19
|
+
function q(n, s, t, r, i, e) {
|
|
20
|
+
const d = t.x - n.x, h = t.y - n.y, c = s.halfWidth + r.halfWidth - Math.abs(d), f = s.halfHeight + r.halfHeight - Math.abs(h);
|
|
21
|
+
if (c <= -i || f <= -i || c < 0 && f < 0) return !1;
|
|
22
|
+
const a = d < 0 ? -1 : 1, M = h < 0 ? -1 : 1;
|
|
23
|
+
let x;
|
|
24
|
+
if (c < 0) x = !0;
|
|
25
|
+
else if (f < 0) x = !1;
|
|
26
|
+
else {
|
|
27
|
+
const p = w(n, t, a), y = B(n, t, M);
|
|
28
|
+
x = p && y ? c < f : p ? !0 : y ? !1 : c < f;
|
|
29
|
+
}
|
|
30
|
+
if (x) {
|
|
31
|
+
if (c < 0 && !w(n, t, a)) return !1;
|
|
32
|
+
e.nx = a, e.ny = 0, e.depth = c;
|
|
33
|
+
} else {
|
|
34
|
+
if (f < 0 && !B(n, t, M)) return !1;
|
|
35
|
+
e.nx = 0, e.ny = M, e.depth = f;
|
|
36
|
+
}
|
|
37
|
+
return !0;
|
|
38
|
+
}
|
|
39
|
+
function v(n, s, t, r, i, e) {
|
|
40
|
+
const d = t.x - n.x, h = t.y - n.y, c = s.radius + r.radius, f = d * d + h * h;
|
|
41
|
+
if (f >= (c + i) * (c + i)) return !1;
|
|
42
|
+
const a = Math.sqrt(f);
|
|
43
|
+
return a > 1e-9 ? (e.nx = d / a, e.ny = h / a) : (e.nx = 0, e.ny = 1), e.depth = c - a, !0;
|
|
44
|
+
}
|
|
45
|
+
function I(n, s, t, r, i, e) {
|
|
46
|
+
const d = r.halfWidth, h = r.halfHeight, c = s.radius, f = n.x - t.x, a = n.y - t.y, M = t.internalFaces, x = f < 0 ? -1 : 1, p = a < 0 ? -1 : 1, y = !(M & (x > 0 ? m : C)), u = !(M & (p > 0 ? E : O)), T = Math.abs(f) <= d, H = Math.abs(a) <= h;
|
|
47
|
+
if (T && H) {
|
|
48
|
+
const l = d - Math.abs(f) + c, Y = h - Math.abs(a) + c, k = y && u ? l < Y : y ? !0 : u ? !1 : l < Y;
|
|
49
|
+
return e.nx = k ? x : 0, e.ny = k ? 0 : p, e.depth = k ? l : Y, !0;
|
|
50
|
+
}
|
|
51
|
+
if (H) {
|
|
52
|
+
if (!y) return !1;
|
|
53
|
+
const l = Math.abs(f) - d;
|
|
54
|
+
return l >= c + i ? !1 : (e.nx = x, e.ny = 0, e.depth = c - l, !0);
|
|
55
|
+
}
|
|
56
|
+
if (T) {
|
|
57
|
+
if (!u) return !1;
|
|
58
|
+
const l = Math.abs(a) - h;
|
|
59
|
+
return l >= c + i ? !1 : (e.nx = 0, e.ny = p, e.depth = c - l, !0);
|
|
60
|
+
}
|
|
61
|
+
const o = f - x * d, A = a - p * h;
|
|
62
|
+
if (!y && !u) return !1;
|
|
63
|
+
if (!y || !u) {
|
|
64
|
+
const l = Math.abs(y ? o : A);
|
|
65
|
+
return l >= c + i ? !1 : (e.nx = y ? x : 0, e.ny = y ? 0 : p, e.depth = c - l, !0);
|
|
66
|
+
}
|
|
67
|
+
const P = o * o + A * A;
|
|
68
|
+
if (P >= (c + i) * (c + i)) return !1;
|
|
69
|
+
const F = Math.sqrt(P);
|
|
70
|
+
return e.nx = F > 1e-9 ? o / F : x, e.ny = F > 1e-9 ? A / F : 0, e.depth = c - F, !0;
|
|
71
|
+
}
|
|
72
|
+
export {
|
|
73
|
+
R as collide,
|
|
74
|
+
L as emptyManifold
|
|
75
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { FACE_TOP as D, FACE_RIGHT as G, FACE_BOTTOM as H, FACE_LEFT as N } from "./types.js";
|
|
2
|
+
const Y = [D, G, H, N], L = 0.05;
|
|
3
|
+
function M(t, e, c) {
|
|
4
|
+
if (!t.internalFaces || !t.axisAligned) return !1;
|
|
5
|
+
for (let n = 0; n < 4; n++)
|
|
6
|
+
if (t.internalFaces & Y[n] && t.wnx[n] * e + t.wny[n] * c > 0.999) return !0;
|
|
7
|
+
return !1;
|
|
8
|
+
}
|
|
9
|
+
function S(t, e, c, n) {
|
|
10
|
+
return !M(t, c, n) && !M(e, -c, -n);
|
|
11
|
+
}
|
|
12
|
+
function X(t, e, c) {
|
|
13
|
+
const n = t.wnx[e], r = t.wny[e], o = t.wx[e], s = t.wy[e];
|
|
14
|
+
let i = 1 / 0;
|
|
15
|
+
for (let f = 0; f < c.corners; f++) {
|
|
16
|
+
const l = (c.wx[f] - o) * n + (c.wy[f] - s) * r;
|
|
17
|
+
l < i && (i = l);
|
|
18
|
+
}
|
|
19
|
+
return i;
|
|
20
|
+
}
|
|
21
|
+
function g(t, e, c, n) {
|
|
22
|
+
let r = -1 / 0;
|
|
23
|
+
n.sep = -1 / 0, n.face = -1;
|
|
24
|
+
for (let o = 0; o < t.corners; o++) {
|
|
25
|
+
const s = X(t, o, e);
|
|
26
|
+
s > r && (r = s);
|
|
27
|
+
const i = c ? t.wnx[o] : -t.wnx[o], f = c ? t.wny[o] : -t.wny[o];
|
|
28
|
+
(c ? S(t, e, i, f) : S(e, t, i, f)) && s > n.sep && (n.sep = s, n.face = o);
|
|
29
|
+
}
|
|
30
|
+
return r;
|
|
31
|
+
}
|
|
32
|
+
const h = { sep: 0, face: -1 }, m = { sep: 0, face: -1 }, p = [0, 0], u = [0, 0], k = [0, 0];
|
|
33
|
+
function z(t, e, c, n) {
|
|
34
|
+
const r = g(t, e, !0, h);
|
|
35
|
+
if (r > c) return !1;
|
|
36
|
+
const o = g(e, t, !1, m);
|
|
37
|
+
if (o > c) return !1;
|
|
38
|
+
let s;
|
|
39
|
+
h.face < 0 && m.face < 0 ? (s = o > r + L, s ? m.face = j(e, t, o) : h.face = j(t, e, r)) : h.face < 0 ? s = !0 : m.face < 0 ? s = !1 : s = m.sep > h.sep + L;
|
|
40
|
+
const i = s ? e : t, f = s ? t : e, l = s ? m.face : h.face, d = i.wnx[l], F = i.wny[l];
|
|
41
|
+
let A = 0, B = 1 / 0;
|
|
42
|
+
for (let x = 0; x < f.corners; x++) {
|
|
43
|
+
const w = f.wnx[x] * d + f.wny[x] * F;
|
|
44
|
+
w < B && (B = w, A = x);
|
|
45
|
+
}
|
|
46
|
+
const E = (A + 1) % f.corners;
|
|
47
|
+
p[0] = f.wx[A], u[0] = f.wy[A], k[0] = A, p[1] = f.wx[E], u[1] = f.wy[E], k[1] = E;
|
|
48
|
+
const a = (l + 1) % i.corners, y = i.wx[l], v = i.wy[l], T = i.wx[a], _ = i.wy[a], C = Math.hypot(T - y, _ - v), O = (T - y) / C, I = (_ - v) / C;
|
|
49
|
+
if (!R(-O, -I, -(O * y + I * v), 16) || !R(O, I, O * T + I * _, 17)) return !1;
|
|
50
|
+
n.nx = s ? -d : d, n.ny = s ? -F : F, n.count = 0, n.depth = -1 / 0;
|
|
51
|
+
for (let x = 0; x < 2; x++) {
|
|
52
|
+
const w = (p[x] - y) * d + (u[x] - v) * F;
|
|
53
|
+
if (w > c) continue;
|
|
54
|
+
const P = n.count++;
|
|
55
|
+
n.px[P] = p[x] - d * w * 0.5, n.py[P] = u[x] - F * w * 0.5, n.pd[P] = -w, n.id[P] = (s ? 1 : 0) << 12 | l << 6 | k[x], -w > n.depth && (n.depth = -w);
|
|
56
|
+
}
|
|
57
|
+
return n.count > 0;
|
|
58
|
+
}
|
|
59
|
+
function j(t, e, c) {
|
|
60
|
+
for (let n = 0; n < t.corners; n++) if (X(t, n, e) === c) return n;
|
|
61
|
+
return 0;
|
|
62
|
+
}
|
|
63
|
+
function R(t, e, c, n) {
|
|
64
|
+
const r = t * p[0] + e * u[0] - c, o = t * p[1] + e * u[1] - c;
|
|
65
|
+
if (r > 0 && o > 0) return !1;
|
|
66
|
+
if (r <= 0 && o <= 0) return !0;
|
|
67
|
+
const s = r / (r - o), i = p[0] + (p[1] - p[0]) * s, f = u[0] + (u[1] - u[0]) * s;
|
|
68
|
+
return r > 0 ? (p[0] = i, u[0] = f, k[0] = n) : (p[1] = i, u[1] = f, k[1] = n), !0;
|
|
69
|
+
}
|
|
70
|
+
function J(t, e, c, n, r, o) {
|
|
71
|
+
const s = t.x, i = t.y;
|
|
72
|
+
let f = 0, l = -1 / 0;
|
|
73
|
+
for (let a = 0; a < c.corners; a++) {
|
|
74
|
+
const y = (s - c.wx[a]) * c.wnx[a] + (i - c.wy[a]) * c.wny[a];
|
|
75
|
+
y > l && (l = y, f = a);
|
|
76
|
+
}
|
|
77
|
+
if (l > e + n) return !1;
|
|
78
|
+
let d = c.wnx[f], F = c.wny[f], A = l, B = f;
|
|
79
|
+
if (l > 0) {
|
|
80
|
+
const a = (f + 1) % c.corners, y = c.wx[f], v = c.wy[f], T = c.wx[a], _ = c.wy[a], C = (s - y) * (T - y) + (i - v) * (_ - v), O = (s - T) * (y - T) + (i - _) * (v - _);
|
|
81
|
+
if (C <= 0 || O <= 0) {
|
|
82
|
+
const I = C <= 0 ? y : T, x = C <= 0 ? v : _, w = Math.hypot(s - I, i - x);
|
|
83
|
+
if (w > e + n) return !1;
|
|
84
|
+
w > 1e-9 && (d = (s - I) / w, F = (i - x) / w), A = w, B = 32 + (C <= 0 ? f : a);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
const E = e - A;
|
|
88
|
+
return o.nx = r ? -d : d, o.ny = r ? -F : F, o.depth = E, o.count = 1, o.px[0] = s - d * (e - E / 2), o.py[0] = i - F * (e - E / 2), o.pd[0] = E, o.id[0] = B, !0;
|
|
89
|
+
}
|
|
90
|
+
export {
|
|
91
|
+
J as circlePolygon,
|
|
92
|
+
z as polygonPolygon
|
|
93
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
function u(n, e, r) {
|
|
2
|
+
if (n.grounded) return;
|
|
3
|
+
n.grounded = !0, n.ground = e;
|
|
4
|
+
const t = n === r.b ? 1 : -1;
|
|
5
|
+
n.groundNx = r.nx * t, n.groundNy = r.ny * t;
|
|
6
|
+
}
|
|
7
|
+
function o(n) {
|
|
8
|
+
return { a: n.a, b: n.b, nx: n.nx, ny: n.ny, depth: n.depth, sensor: n.sensor, points: n.points };
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
o as info,
|
|
12
|
+
u as setGround
|
|
13
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const a = {
|
|
2
|
+
static: 4259680,
|
|
3
|
+
kinematic: 4251903,
|
|
4
|
+
grounded: 16777056,
|
|
5
|
+
airborne: 16736352,
|
|
6
|
+
sleeping: 8421504,
|
|
7
|
+
sensor: 16736480
|
|
8
|
+
};
|
|
9
|
+
function m(e, n, c = {}, d, o) {
|
|
10
|
+
const u = { ...a, ...c };
|
|
11
|
+
for (const r of e.bodies) {
|
|
12
|
+
const s = d?.(r) ?? f(r, u);
|
|
13
|
+
if (o && r.corners > 0 && !r.axisAligned) {
|
|
14
|
+
for (let i = 0; i < r.corners; i++) {
|
|
15
|
+
const t = (i + 1) % r.corners;
|
|
16
|
+
o(r.wx[i], r.wy[i], r.wx[t], r.wy[t], s);
|
|
17
|
+
}
|
|
18
|
+
continue;
|
|
19
|
+
}
|
|
20
|
+
n(r.minX, r.minY, r.maxX - r.minX, r.maxY - r.minY, s), o && r.shape.kind === "circle" && r.rotates && o(r.x, r.y, r.x + r.cos * r.shape.radius, r.y + r.sin * r.shape.radius, s);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function f(e, n = a) {
|
|
24
|
+
return e.sensor ? n.sensor : e.type === "static" ? n.static : e.type === "kinematic" ? n.kinematic : e.awake ? e.grounded ? n.grounded : n.airborne : n.sleeping;
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
a as COLLIDER_COLORS,
|
|
28
|
+
f as colliderColor,
|
|
29
|
+
m as drawColliders
|
|
30
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
const O = 16;
|
|
2
|
+
function M(s) {
|
|
3
|
+
let t = 0;
|
|
4
|
+
for (let n = 0; n < s.length; n++) {
|
|
5
|
+
const o = s[n], r = s[(n + 1) % s.length];
|
|
6
|
+
t += o.x * r.y - r.x * o.y;
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
}
|
|
10
|
+
function d(s) {
|
|
11
|
+
const t = E(s);
|
|
12
|
+
let n = 0, o = 0, r = 0;
|
|
13
|
+
for (let c = 0; c < t.length; c++) {
|
|
14
|
+
const e = t[c], l = t[(c + 1) % t.length], y = e.x * l.y - l.x * e.y;
|
|
15
|
+
r += y, n += (e.x + l.x) * y, o += (e.y + l.y) * y;
|
|
16
|
+
}
|
|
17
|
+
if (Math.abs(r) < 1e-9) throw new Error("polygonShape: the points enclose no area");
|
|
18
|
+
return { x: n / (3 * r), y: o / (3 * r) };
|
|
19
|
+
}
|
|
20
|
+
function m(s) {
|
|
21
|
+
const t = E(s);
|
|
22
|
+
if (t.length < 3) throw new Error("polygonShape: needs at least three points not on one line");
|
|
23
|
+
if (t.length > 16) throw new Error(`polygonShape: at most 16 corners, got ${t.length}`);
|
|
24
|
+
const n = d(t);
|
|
25
|
+
return { kind: "polygon", vertices: t.map((o) => ({ x: o.x - n.x, y: o.y - n.y })) };
|
|
26
|
+
}
|
|
27
|
+
function S(s, t) {
|
|
28
|
+
const n = Math.max(3, Math.min(16, Math.round(s))), o = [];
|
|
29
|
+
for (let r = 0; r < n; r++) {
|
|
30
|
+
const c = -Math.PI / 2 + r * 2 * Math.PI / n;
|
|
31
|
+
o.push({ x: Math.cos(c) * t, y: Math.sin(c) * t });
|
|
32
|
+
}
|
|
33
|
+
return m(o);
|
|
34
|
+
}
|
|
35
|
+
function E(s) {
|
|
36
|
+
const t = s.map((e) => ({ x: e.x, y: e.y })).sort((e, l) => e.x - l.x || e.y - l.y);
|
|
37
|
+
if (t.length < 3) return t;
|
|
38
|
+
const n = (e, l, y) => (l.x - e.x) * (y.y - e.y) - (l.y - e.y) * (y.x - e.x), o = [];
|
|
39
|
+
for (const e of t) {
|
|
40
|
+
for (; o.length >= 2 && n(o[o.length - 2], o[o.length - 1], e) <= 1e-9; ) o.pop();
|
|
41
|
+
o.push(e);
|
|
42
|
+
}
|
|
43
|
+
const r = [];
|
|
44
|
+
for (let e = t.length - 1; e >= 0; e--) {
|
|
45
|
+
const l = t[e];
|
|
46
|
+
for (; r.length >= 2 && n(r[r.length - 2], r[r.length - 1], l) <= 1e-9; ) r.pop();
|
|
47
|
+
r.push(l);
|
|
48
|
+
}
|
|
49
|
+
const c = o.slice(0, -1).concat(r.slice(0, -1));
|
|
50
|
+
return M(c) < 0 ? c.reverse() : c;
|
|
51
|
+
}
|
|
52
|
+
const w = /* @__PURE__ */ new WeakMap();
|
|
53
|
+
function _(s) {
|
|
54
|
+
let t = w.get(s);
|
|
55
|
+
if (t) return t;
|
|
56
|
+
const n = s.vertices;
|
|
57
|
+
if (n.length < 3 || n.length > 16) throw new Error(`Body: a polygon needs 3–16 corners, got ${n.length}`);
|
|
58
|
+
if (M(n) <= 0) throw new Error("Body: polygon corners must run clockwise on screen (make the shape with polygonShape)");
|
|
59
|
+
const o = [];
|
|
60
|
+
let r = 0, c = 0, e = 0, l = 1 / 0;
|
|
61
|
+
for (let y = 0; y < n.length; y++) {
|
|
62
|
+
const h = n[y], a = n[(y + 1) % n.length], p = a.x - h.x, g = a.y - h.y, x = Math.hypot(p, g);
|
|
63
|
+
if (x < 1e-9) throw new Error("Body: a polygon has two corners in one place");
|
|
64
|
+
const i = { x: g / x, y: -p / x };
|
|
65
|
+
o.push(i);
|
|
66
|
+
const u = n[(y + 2) % n.length];
|
|
67
|
+
if ((u.x - h.x) * i.x + (u.y - h.y) * i.y > 1e-6) throw new Error("Body: a polygon must be convex (make the shape with polygonShape)");
|
|
68
|
+
const f = h.x * a.y - a.x * h.y;
|
|
69
|
+
c += f / 2, r += f * (h.x * h.x + h.x * a.x + a.x * a.x + h.y * h.y + h.y * a.y + a.y * a.y) / 12, e = Math.max(e, Math.hypot(h.x, h.y)), l = Math.min(l, h.x * i.x + h.y * i.y);
|
|
70
|
+
}
|
|
71
|
+
return t = { vertices: n, normals: o, inertiaPerMass: r / c, radius: e, inradius: l }, w.set(s, t), t;
|
|
72
|
+
}
|
|
73
|
+
export {
|
|
74
|
+
O as MAX_POLYGON_VERTICES,
|
|
75
|
+
d as polygonCentroid,
|
|
76
|
+
_ as polygonData,
|
|
77
|
+
m as polygonShape,
|
|
78
|
+
S as regularPolygon
|
|
79
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
const p = { t: 0, nx: 0, ny: 0 };
|
|
2
|
+
function L(t, r, a, u, m, x, i) {
|
|
3
|
+
const o = t.shape;
|
|
4
|
+
if (o.kind === "circle") {
|
|
5
|
+
const n = r - t.x, e = a - t.y, l = u * u + m * m, X = n * n + e * e - o.radius * o.radius;
|
|
6
|
+
if (X <= 0 || l === 0) return !1;
|
|
7
|
+
const M = n * u + e * m, Y = M * M - l * X;
|
|
8
|
+
if (Y < 0 || M > 0) return !1;
|
|
9
|
+
const w = (-M - Math.sqrt(Y)) / l;
|
|
10
|
+
return w < 0 || w > x ? !1 : (i.t = w, i.nx = (n + u * w) / o.radius, i.ny = (e + m * w) / o.radius, !0);
|
|
11
|
+
}
|
|
12
|
+
if (!t.axisAligned) return P(t, r, a, u, m, x, i);
|
|
13
|
+
if (r > t.minX && r < t.maxX && a > t.minY && a < t.maxY) return !1;
|
|
14
|
+
let c = -1 / 0, s = 1 / 0, h = 0, f = 0;
|
|
15
|
+
if (u !== 0) {
|
|
16
|
+
const n = (t.minX - r) / u, e = (t.maxX - r) / u, l = Math.min(n, e);
|
|
17
|
+
l > c && (c = l, h = u > 0 ? -1 : 1, f = 0), s = Math.min(s, Math.max(n, e));
|
|
18
|
+
} else if (r < t.minX || r > t.maxX) return !1;
|
|
19
|
+
if (m !== 0) {
|
|
20
|
+
const n = (t.minY - a) / m, e = (t.maxY - a) / m, l = Math.min(n, e);
|
|
21
|
+
l > c && (c = l, h = 0, f = m > 0 ? -1 : 1), s = Math.min(s, Math.max(n, e));
|
|
22
|
+
} else if (a < t.minY || a > t.maxY) return !1;
|
|
23
|
+
return c > s || c < 0 || c > x ? !1 : (i.t = c, i.nx = h, i.ny = f, !0);
|
|
24
|
+
}
|
|
25
|
+
function P(t, r, a, u, m, x, i) {
|
|
26
|
+
let o = 0, c = x, s = -1, h = !0;
|
|
27
|
+
for (let f = 0; f < t.corners; f++) {
|
|
28
|
+
const n = t.wnx[f], e = t.wny[f], l = (r - t.wx[f]) * n + (a - t.wy[f]) * e, X = u * n + m * e;
|
|
29
|
+
if (l > 0 && (h = !1), X === 0) {
|
|
30
|
+
if (l > 0) return !1;
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
const M = -l / X;
|
|
34
|
+
if (X < 0 ? M > o && (o = M, s = f) : M < c && (c = M), o > c) return !1;
|
|
35
|
+
}
|
|
36
|
+
return h || s < 0 ? !1 : (i.t = o, i.nx = t.wnx[s], i.ny = t.wny[s], !0);
|
|
37
|
+
}
|
|
38
|
+
let R = 0;
|
|
39
|
+
function v(t, r, a, u, m, x = {}) {
|
|
40
|
+
const i = t[0];
|
|
41
|
+
if (!i) return null;
|
|
42
|
+
const o = x.mask ?? 4294967295, c = ++R, s = u - r, h = m - a, f = i.cellSize;
|
|
43
|
+
let n = i.cellOf(r), e = i.cellOf(a);
|
|
44
|
+
const l = i.cellOf(u), X = i.cellOf(m), M = s > 0 ? 1 : s < 0 ? -1 : 0, Y = h > 0 ? 1 : h < 0 ? -1 : 0, w = M !== 0 ? f / Math.abs(s) : 1 / 0, q = Y !== 0 ? f / Math.abs(h) : 1 / 0;
|
|
45
|
+
let O = M > 0 ? ((n + 1) * f - r) / s : M < 0 ? (n * f - r) / s : 1 / 0, g = Y > 0 ? ((e + 1) * f - a) / h : Y < 0 ? (e * f - a) / h : 1 / 0, S = null, I = 1, z = 0, D = 0, A = Math.abs(l - n) + Math.abs(X - e) + 1;
|
|
46
|
+
for (; ; ) {
|
|
47
|
+
for (const C of t) {
|
|
48
|
+
const N = C.at(n, e);
|
|
49
|
+
if (N)
|
|
50
|
+
for (const k of N)
|
|
51
|
+
k.rayStamp !== c && (k.rayStamp = c, k.layer & o && (k.sensor && !x.includeSensors || x.filter && !x.filter(k) || L(k, r, a, s, h, I, p) && (!S || p.t < I) && (S = k, I = p.t, z = p.nx, D = p.ny)));
|
|
52
|
+
}
|
|
53
|
+
if (--A <= 0 || Math.min(O, g) > I) break;
|
|
54
|
+
O < g ? (n += M, O += w) : (e += Y, g += q);
|
|
55
|
+
}
|
|
56
|
+
return S ? { body: S, x: r + s * I, y: a + h * I, nx: z, ny: D, fraction: I } : null;
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
v as castRay,
|
|
60
|
+
L as rayShape
|
|
61
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
function s(l, n, c, a = 0, e = 0, g = !1) {
|
|
2
|
+
let r = n.prevX + (n.x - n.prevX) * c, M = n.prevY + (n.y - n.prevY) * c;
|
|
3
|
+
if (n.rotates || n.angle !== 0) {
|
|
4
|
+
let t = n.angle - n.prevAngle;
|
|
5
|
+
(t > Math.PI || t < -Math.PI) && (t -= Math.round(t / (2 * Math.PI)) * 2 * Math.PI);
|
|
6
|
+
const h = n.prevAngle + t * c;
|
|
7
|
+
if (a !== 0 || e !== 0) {
|
|
8
|
+
const p = Math.cos(h), i = Math.sin(h);
|
|
9
|
+
r += p * a - i * e, M += i * a + p * e;
|
|
10
|
+
}
|
|
11
|
+
l.rotation = h;
|
|
12
|
+
} else
|
|
13
|
+
r += a, M += e;
|
|
14
|
+
l.x = g ? Math.round(r) : r, l.y = g ? Math.round(M) : M;
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
s as syncToBody
|
|
18
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Body as m } from "./Body.js";
|
|
2
|
+
import { FACE_TOP as d, FACE_BOTTOM as w, FACE_LEFT as F, FACE_RIGHT as T } from "./types.js";
|
|
3
|
+
function p(n, f, i) {
|
|
4
|
+
const s = [];
|
|
5
|
+
let t = /* @__PURE__ */ new Map();
|
|
6
|
+
for (let o = 0; o < f; o++) {
|
|
7
|
+
const l = /* @__PURE__ */ new Map();
|
|
8
|
+
let c = 0;
|
|
9
|
+
for (; c < n; ) {
|
|
10
|
+
if (!i(c, o)) {
|
|
11
|
+
c++;
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
const e = c;
|
|
15
|
+
for (; c < n && i(c, o); ) c++;
|
|
16
|
+
const u = c - 1, r = e * 1048576 + u, a = t.get(r);
|
|
17
|
+
a ? (a.y1 = o, t.delete(r), l.set(r, a)) : l.set(r, { x0: e, y0: o, x1: u, y1: o });
|
|
18
|
+
}
|
|
19
|
+
for (const e of t.values()) s.push(e);
|
|
20
|
+
t = l;
|
|
21
|
+
}
|
|
22
|
+
for (const o of t.values()) s.push(o);
|
|
23
|
+
return s;
|
|
24
|
+
}
|
|
25
|
+
function E(n, f, i, s, t = {}) {
|
|
26
|
+
const o = (e, u) => e >= 0 && u >= 0 && e < n && u < f && s(e, u), l = t.originX ?? 0, c = t.originY ?? 0;
|
|
27
|
+
return p(n, f, o).map((e) => {
|
|
28
|
+
const u = (e.x1 - e.x0 + 1) * i, r = (e.y1 - e.y0 + 1) * i, a = new m({
|
|
29
|
+
type: "static",
|
|
30
|
+
shape: { kind: "box", halfWidth: u / 2, halfHeight: r / 2 },
|
|
31
|
+
x: l + e.x0 * i + u / 2,
|
|
32
|
+
y: c + e.y0 * i + r / 2,
|
|
33
|
+
friction: t.friction,
|
|
34
|
+
restitution: t.restitution,
|
|
35
|
+
layer: t.layer,
|
|
36
|
+
mask: t.mask,
|
|
37
|
+
userData: t.userData
|
|
38
|
+
});
|
|
39
|
+
let y = 0;
|
|
40
|
+
return x(o, e.x0, e.x1, e.y0 - 1) && (y |= d), x(o, e.x0, e.x1, e.y1 + 1) && (y |= w), h(o, e.x0 - 1, e.y0, e.y1) && (y |= F), h(o, e.x1 + 1, e.y0, e.y1) && (y |= T), a.internalFaces = y, a;
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function B(n, f = {}) {
|
|
44
|
+
return E(n.width, n.height, n.tileSize, (i, s) => n.solid[s * n.width + i] === 1, f);
|
|
45
|
+
}
|
|
46
|
+
function x(n, f, i, s) {
|
|
47
|
+
for (let t = f; t <= i; t++) if (!n(t, s)) return !1;
|
|
48
|
+
return !0;
|
|
49
|
+
}
|
|
50
|
+
function h(n, f, i, s) {
|
|
51
|
+
for (let t = i; t <= s; t++) if (!n(f, t)) return !1;
|
|
52
|
+
return !0;
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
p as mergeTileRects,
|
|
56
|
+
E as tileBodies,
|
|
57
|
+
B as tileBodiesFromGrid
|
|
58
|
+
};
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { Sprite as y, Texture as v, RenderTexture as E, Container as x } from "pixi.js";
|
|
2
|
+
import { liveLights as _, lightRadius as k } from "./lights.js";
|
|
3
|
+
import { isTouchUi as R } from "../platform/touch.js";
|
|
4
|
+
const D = 66, K = 33, p = 8, W = (h) => Math.min(1, Math.pow(Math.max(0, 1 - h * h), 1.5) * 1.15), z = (h) => Math.pow(Math.max(0, 1 - h), 2), P = 4, G = 3, U = 0.3, S = 0.85, $ = 16761466, Y = [0, 8, 2, 10, 12, 4, 14, 6, 3, 11, 1, 9, 15, 7, 13, 5].map((h) => (h + 0.5) / 16), I = (h) => h <= 24 ? Math.max(2, Math.round(h / 2) * 2) : Math.round(h / 8) * 8, B = [...new Set(Array.from({ length: 160 }, (h, t) => I(t + 1)))], F = 33, C = /* @__PURE__ */ new Map();
|
|
5
|
+
let H = !1;
|
|
6
|
+
function N() {
|
|
7
|
+
if (H) return;
|
|
8
|
+
H = !0;
|
|
9
|
+
const h = B.flatMap((s) => [["hole", s], ["wash", s]]), t = () => {
|
|
10
|
+
const s = h.shift();
|
|
11
|
+
s && (g(s[0], s[1]), setTimeout(t, 0));
|
|
12
|
+
};
|
|
13
|
+
setTimeout(t, 0);
|
|
14
|
+
}
|
|
15
|
+
function g(h, t) {
|
|
16
|
+
const s = `${h}${t}`, i = C.get(s);
|
|
17
|
+
if (i) return i;
|
|
18
|
+
const e = t * 2, a = Math.max(2, Math.round(t * 2 * S)), r = h === "hole" ? P : G, w = h === "hole" ? W : z, o = document.createElement("canvas");
|
|
19
|
+
o.width = e, o.height = a;
|
|
20
|
+
const c = o.getContext("2d");
|
|
21
|
+
if (!c) return v.EMPTY;
|
|
22
|
+
const u = c.createImageData(e, a);
|
|
23
|
+
for (let f = 0; f < a; f++)
|
|
24
|
+
for (let l = 0; l < e; l++) {
|
|
25
|
+
const L = Math.hypot((l + 0.5 - e / 2) / t, (f + 0.5 - a / 2) / (t * S));
|
|
26
|
+
if (L >= 1) continue;
|
|
27
|
+
const A = Math.min(r, Math.floor(w(L) * r + Y[f % 4 * 4 + l % 4])) / r, d = (f * e + l) * 4;
|
|
28
|
+
u.data[d] = u.data[d + 1] = u.data[d + 2] = 255, u.data[d + 3] = Math.round(A * 255);
|
|
29
|
+
}
|
|
30
|
+
c.putImageData(u, 0, 0);
|
|
31
|
+
const M = v.from(o);
|
|
32
|
+
return M.source.scaleMode = "nearest", C.set(s, M), M;
|
|
33
|
+
}
|
|
34
|
+
class q {
|
|
35
|
+
constructor(t, s, i, e = {}) {
|
|
36
|
+
this.stage = t, this.color = s, this.alpha = i, this.carriedLight = e.carriedLight ?? V, this.sheet = new y({ texture: v.WHITE }), this.scratch.addChild(this.sheet, this.holes, this.washes), this.carried = this.light(16773340), this.rt = E.create({ width: 1, height: 1 }), this.view = new y({ texture: this.rt }), this.layer.addChild(this.view), t.screen.addChild(this.layer), t.cameras.main.follow(this.layer), this.unsubscribeResize = t.onResize(() => this.dirty = !0), N();
|
|
37
|
+
}
|
|
38
|
+
stage;
|
|
39
|
+
color;
|
|
40
|
+
alpha;
|
|
41
|
+
scratch = new x();
|
|
42
|
+
sheet;
|
|
43
|
+
/** Every hole is erased before any colour is laid, or a later hole would wipe an earlier light's colour away. */
|
|
44
|
+
holes = new x();
|
|
45
|
+
washes = new x();
|
|
46
|
+
lamps = [];
|
|
47
|
+
/** The transient lights (`lights.ts`), reused frame to frame. */
|
|
48
|
+
flashes = [];
|
|
49
|
+
rt;
|
|
50
|
+
/**
|
|
51
|
+
* On the screen layer, laid over the world with its exact transform by the camera (`Camera.follow`), shake included:
|
|
52
|
+
* the night is drawn in world pixels round the unshaken camera and only this layer moves with a shake, so a shaking
|
|
53
|
+
* screen does not redraw the night every frame.
|
|
54
|
+
*/
|
|
55
|
+
layer = new x();
|
|
56
|
+
view;
|
|
57
|
+
/** The light the player carries: the only one that follows them, and the last one they lose. */
|
|
58
|
+
carried;
|
|
59
|
+
unsubscribeResize;
|
|
60
|
+
/** Lamps that flicker: while one does (or the player carries a light) every frame differs. */
|
|
61
|
+
flickering = 0;
|
|
62
|
+
/** Something other than the camera changed what the night looks like (a lamp added, dimmed, the window resized). */
|
|
63
|
+
dirty = !0;
|
|
64
|
+
/** What the last drawn frame was drawn from: the texture, the camera's texel and the shade. */
|
|
65
|
+
drawn = "";
|
|
66
|
+
/** The carried light's place at the last redraw (it follows the body). */
|
|
67
|
+
carriedAt = "";
|
|
68
|
+
/** When the sheet was last redrawn. */
|
|
69
|
+
drawnAt = -1 / 0;
|
|
70
|
+
/** The world pixel the night's top-left texel stands on. */
|
|
71
|
+
ox = 0;
|
|
72
|
+
oy = 0;
|
|
73
|
+
/** The night texture's size in world pixels, and the zoom it was made for. */
|
|
74
|
+
rtKey = "";
|
|
75
|
+
/** The lamps' colour turned down (`setLampsDimmed`). */
|
|
76
|
+
dimLamps = !1;
|
|
77
|
+
/** A phone redraws the night at most `PHONE_MS` apart, whatever moves (`isTouchUi`). */
|
|
78
|
+
phone = R();
|
|
79
|
+
/** The radius `update` uses when it is given none (`DarknessOptions.carriedLight`). */
|
|
80
|
+
carriedLight;
|
|
81
|
+
/** A hole and its colour, added to the night's layers. */
|
|
82
|
+
light(t) {
|
|
83
|
+
const s = new y({ texture: g("hole", 8) });
|
|
84
|
+
s.blendMode = "erase", this.holes.addChild(s);
|
|
85
|
+
const i = new y({ texture: g("wash", 8) });
|
|
86
|
+
return i.tint = t, this.washes.addChild(i), { hole: s, wash: i };
|
|
87
|
+
}
|
|
88
|
+
/** A lamp fixed in the world: a torch on a wall, the seep in its chamber, a crystal in a seam, in its own colour. */
|
|
89
|
+
addLamp(t, s, i, e = 0, a = $) {
|
|
90
|
+
this.lamps.push({ sprites: this.light(a), x: t, y: s, r: i, flicker: e }), e && this.flickering++, this.dirty = !0;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Changes how dark and what colour the sheet is (the outdoor night, `NightShade`, deepens and lifts with the
|
|
94
|
+
* world clock). A sheet with no alpha left is neither drawn nor redrawn, so a map at noon pays nothing for its night.
|
|
95
|
+
*/
|
|
96
|
+
setShade(t, s) {
|
|
97
|
+
this.color = t, this.alpha = s, this.layer.visible = s > 4e-3;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Dimmed lamps lay only `LAMP_DIM` of their colour on the dark (a "fewer ambient lights" setting). The holes they
|
|
101
|
+
* cut stay as wide, so a dark place is still seen by them.
|
|
102
|
+
*/
|
|
103
|
+
setLampsDimmed(t) {
|
|
104
|
+
t !== this.dimLamps && (this.dimLamps = t, this.dirty = !0);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The night's own texture, one texel a world pixel and `MARGIN` to spare on each side (a shake, or a camera that
|
|
108
|
+
* moved while a phone waits for its next redraw, never shows its edge), remade when the window or the zoom changes:
|
|
109
|
+
* at zoom 2 or 3 it is a quarter or a ninth of the screen's pixels. True when it was remade.
|
|
110
|
+
*/
|
|
111
|
+
fit(t, s, i) {
|
|
112
|
+
const e = Math.ceil(t / i) + p * 2, a = Math.ceil(s / i) + p * 2, r = `${e},${a},${i}`;
|
|
113
|
+
return r === this.rtKey ? !1 : (this.rtKey = r, this.rt.destroy(!0), this.rt = E.create({ width: e, height: a }), this.rt.source.scaleMode = "nearest", this.view.texture = this.rt, !0);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Redraws the night with this frame's holes in it, when anything in it changed. `px`/`py` is where the player stands;
|
|
117
|
+
* `carriedRadius` is the light they carry (default the `carriedLight` option, 0 for none).
|
|
118
|
+
*/
|
|
119
|
+
update(t, s, i, e = this.carriedLight) {
|
|
120
|
+
if (!this.layer.visible) return;
|
|
121
|
+
const a = this.stage.cameras.main, r = a.zoom || 1, w = this.fit(this.stage.width, this.stage.height, r), o = Math.floor(a.scrollX) - p, c = Math.floor(a.scrollY) - p, u = `${o},${c},${this.rtKey},${this.color},${this.alpha}`, M = _(t), f = e > 0 ? `${Math.round(s)},${Math.round(i)},${Math.round(e)}` : "", l = t - this.drawnAt;
|
|
122
|
+
if (!(this.dirty || u !== this.drawn || f !== this.carriedAt || M.length > 0 && l >= F || (e > 0 || this.flickering > 0) && l >= D)) return;
|
|
123
|
+
const A = Math.abs(o - this.ox) >= p - 1 || Math.abs(c - this.oy) >= p - 1;
|
|
124
|
+
if (this.phone && l < K && !w && !A) return;
|
|
125
|
+
this.dirty = !1, this.drawn = u, this.carriedAt = f, this.drawnAt = t, this.ox = o, this.oy = c, this.view.position.set(o, c), this.sheet.width = this.rt.width, this.sheet.height = this.rt.height, this.sheet.position.set(0, 0), this.sheet.tint = this.color, this.sheet.alpha = this.alpha;
|
|
126
|
+
const d = U * Math.min(1, this.alpha * 1.4);
|
|
127
|
+
e <= 0 ? this.hide(this.carried) : this.place(this.carried, s, i - 6, e * (1 + Math.sin(t / 260) * 0.03 + Math.sin(t / 90) * 0.015), d * 0.5);
|
|
128
|
+
const T = this.dimLamps ? d * O : d;
|
|
129
|
+
for (const n of this.lamps) {
|
|
130
|
+
const m = n.flicker ? 1 + Math.sin(t / 190 + n.flicker) * 0.05 + Math.sin(t / 71 + n.flicker) * 0.03 : 1;
|
|
131
|
+
this.place(n.sprites, n.x, n.y, n.r * m, T * (n.flicker ? 0.9 + (m - 1) * 2 : 1));
|
|
132
|
+
}
|
|
133
|
+
for (; this.flashes.length < M.length; ) this.flashes.push(this.light($));
|
|
134
|
+
for (let n = 0; n < this.flashes.length; n++) {
|
|
135
|
+
const m = M[n], b = this.flashes[n];
|
|
136
|
+
if (!m) {
|
|
137
|
+
this.hide(b);
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
b.wash.tint = m.color, this.place(b, m.x, m.y, k(m, t), Math.min(0.6, d * 1.6));
|
|
141
|
+
}
|
|
142
|
+
this.stage.app.renderer.render({ container: this.scratch, target: this.rt, clear: !0 });
|
|
143
|
+
}
|
|
144
|
+
hide(t) {
|
|
145
|
+
t.hole.visible = !1, t.wash.visible = !1;
|
|
146
|
+
}
|
|
147
|
+
/** Lays light `l` at world (wx, wy), `r` px across its radius, in the night's world-pixel grid. */
|
|
148
|
+
place(t, s, i, e, a) {
|
|
149
|
+
const r = I(e), w = Math.round(s) - this.ox, o = Math.round(i) - this.oy;
|
|
150
|
+
if (e < 1 || w < -r || o < -r || w > this.rt.width + r || o > this.rt.height + r) {
|
|
151
|
+
this.hide(t);
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
t.hole.texture = g("hole", r), t.wash.texture = g("wash", r);
|
|
155
|
+
for (const c of [t.hole, t.wash])
|
|
156
|
+
c.visible = !0, c.position.set(w - r, o - Math.round(r * S));
|
|
157
|
+
t.wash.alpha = a, t.wash.visible = a > 0.01;
|
|
158
|
+
}
|
|
159
|
+
destroy() {
|
|
160
|
+
this.unsubscribeResize(), this.stage.cameras.main.unfollow(this.layer), this.layer.destroy({ children: !0 }), this.rt.destroy(!0), this.scratch.destroy({ children: !0, context: !0 });
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
const O = 0.35, V = 80;
|
|
164
|
+
export {
|
|
165
|
+
V as CARRIED_LIGHT,
|
|
166
|
+
q as Darkness,
|
|
167
|
+
O as LAMP_DIM,
|
|
168
|
+
$ as WARM_LIGHT
|
|
169
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Sprite as x, Texture as g } from "pixi.js";
|
|
2
|
+
import { vignetteMask as M } from "./vignetteMask.js";
|
|
3
|
+
const o = /* @__PURE__ */ new Map(), k = 12;
|
|
4
|
+
function w(d, t, e = 1, h = 0.55) {
|
|
5
|
+
const i = Math.max(1, Math.ceil(d)), s = Math.max(1, Math.ceil(t)), m = `${i}x${s}|${e.toFixed(2)}|${h}`, l = o.get(m);
|
|
6
|
+
if (l) return l;
|
|
7
|
+
const r = document.createElement("canvas");
|
|
8
|
+
r.width = i, r.height = s;
|
|
9
|
+
const n = r.getContext("2d");
|
|
10
|
+
if (!n) return g.EMPTY;
|
|
11
|
+
const f = M(i, s, e, h), u = n.createImageData(i, s);
|
|
12
|
+
for (let a = 0; a < f.length; a++) f[a] && u.data.fill(255, a * 4, a * 4 + 4);
|
|
13
|
+
n.putImageData(u, 0, 0);
|
|
14
|
+
const c = g.from(r);
|
|
15
|
+
if (c.source.scaleMode = "nearest", o.size >= k) {
|
|
16
|
+
for (const a of o.values()) a.destroy(!0);
|
|
17
|
+
o.clear();
|
|
18
|
+
}
|
|
19
|
+
return o.set(m, c), c;
|
|
20
|
+
}
|
|
21
|
+
class y {
|
|
22
|
+
constructor(t, e = {}) {
|
|
23
|
+
this.stage = t, this.from = e.from ?? 0.55, this.edge.tint = e.color ?? 0, this.edge.visible = !1, t.screen.addChild(this.edge), this.making = setTimeout(() => {
|
|
24
|
+
this.making = null, this.make();
|
|
25
|
+
}, 0);
|
|
26
|
+
}
|
|
27
|
+
stage;
|
|
28
|
+
edge = new x();
|
|
29
|
+
madeFor = "";
|
|
30
|
+
making = null;
|
|
31
|
+
from;
|
|
32
|
+
setColor(t) {
|
|
33
|
+
this.edge.tint = t;
|
|
34
|
+
}
|
|
35
|
+
make() {
|
|
36
|
+
if (this.edge.destroyed) return;
|
|
37
|
+
const t = Math.max(1, this.stage.cameras.main.zoom), e = this.stage.width / t, h = this.stage.height / t, i = `${Math.ceil(e)}x${Math.ceil(h)}`;
|
|
38
|
+
if (i === this.madeFor) return;
|
|
39
|
+
const s = w(e, h, 1, this.from);
|
|
40
|
+
this.edge.texture = s, s !== g.EMPTY && (this.madeFor = i);
|
|
41
|
+
}
|
|
42
|
+
/** Shows the edge at `alpha` (0..1); call each frame it shows. */
|
|
43
|
+
show(t) {
|
|
44
|
+
this.edge.visible = t > 0, this.edge.visible && (this.make(), this.edge.alpha = t, this.edge.width = this.stage.width, this.edge.height = this.stage.height);
|
|
45
|
+
}
|
|
46
|
+
hide() {
|
|
47
|
+
this.edge.visible = !1;
|
|
48
|
+
}
|
|
49
|
+
destroy() {
|
|
50
|
+
this.making && clearTimeout(this.making), this.edge.destroy();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
export {
|
|
54
|
+
y as DitherVignette,
|
|
55
|
+
w as ditherVignette
|
|
56
|
+
};
|