laymur 0.17.0 → 0.17.1
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/{src/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.ts → dist/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.d.ts} +2 -3
- package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.d.ts +22 -0
- package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.js +41 -0
- package/dist/core/constraints/UIConstraint.d.ts +12 -0
- package/dist/core/constraints/UIConstraint.js +11 -0
- package/dist/core/constraints/UICustomConstraint.d.ts +28 -0
- package/dist/core/constraints/UICustomConstraint.js +37 -0
- package/{src/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.ts → dist/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.d.ts} +2 -3
- package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.d.ts +20 -0
- package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.js +34 -0
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.d.ts +11 -0
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.js +3 -0
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.d.ts +36 -0
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.js +100 -0
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.d.ts +14 -0
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.js +4 -0
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.d.ts +44 -0
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.js +136 -0
- package/{src/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.ts → dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.d.ts} +2 -3
- package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.d.ts +22 -0
- package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.js +40 -0
- package/{src/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.ts → dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.d.ts} +8 -9
- package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.d.ts +43 -0
- package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.js +71 -0
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.d.ts +11 -0
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.js +3 -0
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.d.ts +32 -0
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.js +100 -0
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.d.ts +14 -0
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.js +4 -0
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.d.ts +44 -0
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.js +136 -0
- package/{src/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.ts → dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.d.ts} +2 -3
- package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.d.ts +22 -0
- package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.js +40 -0
- package/{src/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.ts → dist/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.d.ts} +2 -3
- package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.d.ts +20 -0
- package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.js +34 -0
- package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.d.ts +64 -0
- package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.js +19 -0
- package/dist/core/constraints/builders/UIConstraint2DBuilder.d.ts +46 -0
- package/dist/core/constraints/builders/UIConstraint2DBuilder.js +138 -0
- package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.d.ts +13 -0
- package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.js +3 -0
- package/dist/core/constraints/builders/UICoverConstraintBuilder.d.ts +29 -0
- package/dist/core/constraints/builders/UICoverConstraintBuilder.js +63 -0
- package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.d.ts +13 -0
- package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.js +3 -0
- package/dist/core/constraints/builders/UIFitConstraintBuilder.d.ts +29 -0
- package/dist/core/constraints/builders/UIFitConstraintBuilder.js +63 -0
- package/dist/core/elements/UIAnchor/UIAnchor.Internal.d.ts +12 -0
- package/dist/core/elements/UIAnchor/UIAnchor.Internal.js +5 -0
- package/dist/core/elements/UIAnchor/UIAnchor.d.ts +32 -0
- package/dist/core/elements/UIAnchor/UIAnchor.js +49 -0
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.d.ts +27 -0
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.js +15 -0
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.d.ts +77 -0
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.js +259 -0
- package/dist/core/elements/UIDummy/UIDummy.Internal.d.ts +30 -0
- package/dist/core/elements/UIDummy/UIDummy.Internal.js +8 -0
- package/dist/core/elements/UIDummy/UIDummy.d.ts +82 -0
- package/dist/core/elements/UIDummy/UIDummy.js +173 -0
- package/{src/core/elements/UIElement/UIElement.Internal.ts → dist/core/elements/UIElement/UIElement.Internal.d.ts} +5 -7
- package/dist/core/elements/UIElement/UIElement.Internal.js +5 -0
- package/dist/core/elements/UIElement/UIElement.d.ts +38 -0
- package/dist/core/elements/UIElement/UIElement.js +74 -0
- package/{src/core/elements/UIGraphics/UIGraphics.Internal.ts → dist/core/elements/UIGraphics/UIGraphics.Internal.d.ts} +5 -7
- package/dist/core/elements/UIGraphics/UIGraphics.Internal.js +7 -0
- package/dist/core/elements/UIGraphics/UIGraphics.d.ts +51 -0
- package/dist/core/elements/UIGraphics/UIGraphics.js +126 -0
- package/{src/core/elements/UIImage/UIImage.Internal.ts → dist/core/elements/UIImage/UIImage.Internal.d.ts} +2 -3
- package/dist/core/elements/UIImage/UIImage.d.ts +32 -0
- package/dist/core/elements/UIImage/UIImage.js +85 -0
- package/dist/core/elements/UINineSlice/UINineSlice.Internal.d.ts +23 -0
- package/dist/core/elements/UINineSlice/UINineSlice.Internal.js +12 -0
- package/dist/core/elements/UINineSlice/UINineSlice.d.ts +60 -0
- package/dist/core/elements/UINineSlice/UINineSlice.js +188 -0
- package/dist/core/elements/UIProgress/UIProgress.Internal.d.ts +14 -0
- package/dist/core/elements/UIProgress/UIProgress.Internal.js +3 -0
- package/dist/core/elements/UIProgress/UIProgress.d.ts +45 -0
- package/dist/core/elements/UIProgress/UIProgress.js +165 -0
- package/dist/core/elements/UIScene/UIScene.Internal.d.ts +43 -0
- package/dist/core/elements/UIScene/UIScene.Internal.js +27 -0
- package/dist/core/elements/UIScene/UIScene.d.ts +59 -0
- package/dist/core/elements/UIScene/UIScene.js +157 -0
- package/{src/core/elements/UIText/UIText.Interfaces.ts → dist/core/elements/UIText/UIText.Interfaces.d.ts} +16 -21
- package/dist/core/elements/UIText/UIText.Internal.d.ts +26 -0
- package/dist/core/elements/UIText/UIText.Internal.js +12 -0
- package/dist/core/elements/UIText/UIText.Measuring.d.ts +50 -0
- package/dist/core/elements/UIText/UIText.Measuring.js +153 -0
- package/dist/core/elements/UIText/UIText.Rendering.d.ts +20 -0
- package/dist/core/elements/UIText/UIText.Rendering.js +61 -0
- package/dist/core/elements/UIText/UIText.d.ts +71 -0
- package/dist/core/elements/UIText/UIText.js +265 -0
- package/{src/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.ts → dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.d.ts} +11 -14
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.js +5 -0
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.d.ts +63 -0
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.js +147 -0
- package/{src/core/layers/UILayer/UILayer.Internal.ts → dist/core/layers/UILayer/UILayer.Internal.d.ts} +11 -15
- package/dist/core/layers/UILayer/UILayer.Internal.js +7 -0
- package/dist/core/layers/UILayer/UILayer.d.ts +49 -0
- package/dist/core/layers/UILayer/UILayer.js +113 -0
- package/dist/core/miscellaneous/UIExpression.d.ts +69 -0
- package/dist/core/miscellaneous/UIExpression.js +128 -0
- package/dist/core/miscellaneous/UIMode.d.ts +23 -0
- package/dist/core/miscellaneous/UIMode.js +30 -0
- package/dist/core/miscellaneous/UIOrientation.d.ts +15 -0
- package/dist/core/miscellaneous/UIOrientation.js +20 -0
- package/dist/core/miscellaneous/UIPriority.d.ts +32 -0
- package/dist/core/miscellaneous/UIPriority.js +63 -0
- package/dist/core/miscellaneous/UIRelation.d.ts +23 -0
- package/dist/core/miscellaneous/UIRelation.js +40 -0
- package/dist/core/miscellaneous/UITransparencyMode.d.ts +9 -0
- package/dist/core/miscellaneous/UITransparencyMode.js +12 -0
- package/dist/core/miscellaneous/area/UIArea.d.ts +3 -0
- package/dist/core/miscellaneous/area/UIArea.js +5 -0
- package/dist/core/miscellaneous/area/UIAreaCircle.d.ts +15 -0
- package/dist/core/miscellaneous/area/UIAreaCircle.js +32 -0
- package/dist/core/miscellaneous/area/UIAreaPolygon.d.ts +12 -0
- package/dist/core/miscellaneous/area/UIAreaPolygon.js +40 -0
- package/dist/core/miscellaneous/area/UIAreaRectangle.d.ts +17 -0
- package/dist/core/miscellaneous/area/UIAreaRectangle.js +36 -0
- package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.d.ts +21 -0
- package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.js +72 -0
- package/dist/core/miscellaneous/asserts.d.ts +43 -0
- package/dist/core/miscellaneous/asserts.js +163 -0
- package/dist/core/miscellaneous/canvas.d.ts +31 -0
- package/dist/core/miscellaneous/canvas.js +37 -0
- package/dist/core/miscellaneous/color/UIColor.Internal.d.ts +7 -0
- package/dist/core/miscellaneous/color/UIColor.Internal.js +42 -0
- package/dist/core/miscellaneous/color/UIColor.d.ts +234 -0
- package/dist/core/miscellaneous/color/UIColor.js +636 -0
- package/dist/core/miscellaneous/computeTransform.d.ts +18 -0
- package/dist/core/miscellaneous/computeTransform.js +82 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.d.ts +19 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.js +168 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.d.ts +1 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.js +349 -0
- package/{src/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.ts → dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.d.ts} +8 -10
- package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.d.ts +1 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.js +357 -0
- package/dist/core/miscellaneous/generic-plane/shared.d.ts +38 -0
- package/dist/core/miscellaneous/generic-plane/shared.js +228 -0
- package/dist/core/miscellaneous/insets/UIInsets.Internal.d.ts +11 -0
- package/dist/core/miscellaneous/insets/UIInsets.Internal.js +3 -0
- package/dist/core/miscellaneous/insets/UIInsets.d.ts +48 -0
- package/dist/core/miscellaneous/insets/UIInsets.js +224 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.d.ts +9 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.js +19 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.d.ts +21 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.js +51 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.d.ts +16 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.js +48 -0
- package/dist/core/miscellaneous/math.d.ts +7 -0
- package/dist/core/miscellaneous/math.js +11 -0
- package/dist/core/miscellaneous/micro/UIMicro.Internal.d.ts +31 -0
- package/dist/core/miscellaneous/micro/UIMicro.Internal.js +15 -0
- package/dist/core/miscellaneous/micro/UIMicro.d.ts +59 -0
- package/dist/core/miscellaneous/micro/UIMicro.js +181 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicy.d.ts +3 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicy.js +9 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.d.ts +22 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.js +50 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.d.ts +22 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.js +52 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.d.ts +22 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.js +52 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.d.ts +22 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.js +50 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.d.ts +22 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.js +52 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.d.ts +22 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.js +52 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.d.ts +5 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.js +13 -0
- package/dist/core/miscellaneous/shared.d.ts +46 -0
- package/dist/core/miscellaneous/shared.js +37 -0
- package/{src/core/miscellaneous/text-span/UITextSpan.Internal.ts → dist/core/miscellaneous/text-span/UITextSpan.Internal.d.ts} +4 -5
- package/dist/core/miscellaneous/text-span/UITextSpan.d.ts +14 -0
- package/dist/core/miscellaneous/text-span/UITextSpan.js +36 -0
- package/dist/core/miscellaneous/text-style/UITextStyle.Internal.d.ts +48 -0
- package/dist/core/miscellaneous/text-style/UITextStyle.Internal.js +17 -0
- package/dist/core/miscellaneous/text-style/UITextStyle.d.ts +85 -0
- package/dist/core/miscellaneous/text-style/UITextStyle.js +372 -0
- package/dist/core/miscellaneous/texture/UITextureView.Internal.d.ts +49 -0
- package/dist/core/miscellaneous/texture/UITextureView.Internal.js +6 -0
- package/dist/core/miscellaneous/texture/UITextureView.d.ts +67 -0
- package/dist/core/miscellaneous/texture/UITextureView.js +234 -0
- package/dist/core/miscellaneous/webglCapabilities.d.ts +2 -0
- package/dist/core/miscellaneous/webglCapabilities.js +103 -0
- package/dist/core/shaders/UIImage.glsl.js +3 -0
- package/dist/core/shaders/UINineSlice.glsl.js +3 -0
- package/dist/core/shaders/UIProgress.glsl.js +3 -0
- package/dist/core/shaders/UIProgressMaskFunctionCircular.glsl.js +3 -0
- package/dist/core/shaders/UIProgressMaskFunctionDirectional.glsl.js +3 -0
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.d.ts +17 -0
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.d.ts +13 -0
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.js +108 -0
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.d.ts +13 -0
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.d.ts +20 -0
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.js +75 -0
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.d.ts +49 -0
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.d.ts +215 -0
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.js +505 -0
- package/dist/index.js +51 -0
- package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.d.ts +21 -0
- package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.js +47 -0
- package/dist/particles/behaviorModules/UIBehaviorModule.d.ts +14 -0
- package/dist/particles/behaviorModules/UIBehaviorModule.js +9 -0
- package/dist/particles/behaviorModules/UIBehaviorPointGravity.d.ts +39 -0
- package/dist/particles/behaviorModules/UIBehaviorPointGravity.js +110 -0
- package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.d.ts +22 -0
- package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.js +66 -0
- package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.d.ts +20 -0
- package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.js +48 -0
- package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.d.ts +26 -0
- package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.js +66 -0
- package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.d.ts +20 -0
- package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.js +49 -0
- package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.d.ts +26 -0
- package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.js +70 -0
- package/dist/particles/elements/UIEmitter.Internal.d.ts +15 -0
- package/dist/particles/elements/UIEmitter.Internal.js +11 -0
- package/dist/particles/elements/UIEmitter.d.ts +68 -0
- package/dist/particles/elements/UIEmitter.js +203 -0
- package/dist/particles/index.js +18 -0
- package/dist/particles/instancedParticle/UIInstancedParticle.Internal.d.ts +13 -0
- package/dist/particles/instancedParticle/UIInstancedParticle.Internal.js +211 -0
- package/dist/particles/instancedParticle/UIInstancedParticle.d.ts +17 -0
- package/dist/particles/instancedParticle/UIInstancedParticle.js +93 -0
- package/dist/particles/miscellaneous/miscellaneous.d.ts +32 -0
- package/dist/particles/miscellaneous/miscellaneous.js +67 -0
- package/dist/particles/renderingModules/UIRenderingColorOverLife.d.ts +14 -0
- package/dist/particles/renderingModules/UIRenderingColorOverLife.js +32 -0
- package/dist/particles/renderingModules/UIRenderingColorOverVelocity.d.ts +15 -0
- package/dist/particles/renderingModules/UIRenderingColorOverVelocity.js +37 -0
- package/dist/particles/renderingModules/UIRenderingModule.d.ts +8 -0
- package/dist/particles/renderingModules/UIRenderingModule.js +9 -0
- package/dist/particles/renderingModules/UIRenderingTexture.d.ts +14 -0
- package/dist/particles/renderingModules/UIRenderingTexture.js +26 -0
- package/dist/particles/shaders/UIRenderingColorOverLife.glsl.js +3 -0
- package/dist/particles/shaders/UIRenderingColorOverVelocity.glsl.js +3 -0
- package/dist/particles/shaders/UIRenderingTexture.glsl.js +3 -0
- package/dist/particles/spawnModules/UISpawnModule.d.ts +9 -0
- package/dist/particles/spawnModules/UISpawnModule.js +9 -0
- package/dist/particles/spawnModules/UISpawnOffset.d.ts +21 -0
- package/dist/particles/spawnModules/UISpawnOffset.js +46 -0
- package/dist/particles/spawnModules/UISpawnRandomLifetime.d.ts +20 -0
- package/dist/particles/spawnModules/UISpawnRandomLifetime.js +47 -0
- package/dist/particles/spawnModules/UISpawnRandomRotation.d.ts +20 -0
- package/dist/particles/spawnModules/UISpawnRandomRotation.js +45 -0
- package/dist/particles/spawnModules/UISpawnRandomScale.d.ts +26 -0
- package/dist/particles/spawnModules/UISpawnRandomScale.js +60 -0
- package/dist/particles/spawnModules/UISpawnRandomTorque.d.ts +20 -0
- package/dist/particles/spawnModules/UISpawnRandomTorque.js +45 -0
- package/dist/particles/spawnModules/UISpawnRandomVelocity.d.ts +26 -0
- package/dist/particles/spawnModules/UISpawnRandomVelocity.js +64 -0
- package/dist/particles/spawnModules/UISpawnRectangle.d.ts +27 -0
- package/dist/particles/spawnModules/UISpawnRectangle.js +62 -0
- package/package.json +8 -1
- package/.claude/settings.local.json +0 -9
- package/.editorconfig +0 -14
- package/CLAUDE.md +0 -181
- package/assets/logotype.png +0 -0
- package/eslint.config.js +0 -111
- package/rollup.config.js +0 -52
- package/src/core/constraints/UIAspectConstraint/UIAspectConstraint.ts +0 -60
- package/src/core/constraints/UIConstraint.ts +0 -20
- package/src/core/constraints/UICustomConstraint.ts +0 -62
- package/src/core/constraints/UIHeightConstraint/UIHeightConstraint.ts +0 -52
- package/src/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.ts +0 -13
- package/src/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.ts +0 -139
- package/src/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.ts +0 -16
- package/src/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.ts +0 -189
- package/src/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.ts +0 -68
- package/src/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.ts +0 -94
- package/src/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.ts +0 -13
- package/src/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.ts +0 -135
- package/src/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.ts +0 -16
- package/src/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.ts +0 -189
- package/src/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.ts +0 -68
- package/src/core/constraints/UIWidthConstraint/UIWidthConstraint.ts +0 -52
- package/src/core/constraints/builders/UIConstraint2DBuilder.Internal.ts +0 -84
- package/src/core/constraints/builders/UIConstraint2DBuilder.ts +0 -168
- package/src/core/constraints/builders/UICoverConstraintBuilder.Internal.ts +0 -15
- package/src/core/constraints/builders/UICoverConstraintBuilder.ts +0 -84
- package/src/core/constraints/builders/UIFitConstraintBuilder.Internal.ts +0 -15
- package/src/core/constraints/builders/UIFitConstraintBuilder.ts +0 -84
- package/src/core/elements/UIAnchor/UIAnchor.Internal.ts +0 -13
- package/src/core/elements/UIAnchor/UIAnchor.ts +0 -70
- package/src/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.ts +0 -30
- package/src/core/elements/UIAnimatedImage/UIAnimatedImage.ts +0 -355
- package/src/core/elements/UIDummy/UIDummy.Internal.ts +0 -33
- package/src/core/elements/UIDummy/UIDummy.ts +0 -244
- package/src/core/elements/UIElement/UIElement.ts +0 -127
- package/src/core/elements/UIGraphics/UIGraphics.ts +0 -168
- package/src/core/elements/UIImage/UIImage.ts +0 -138
- package/src/core/elements/UINineSlice/UINineSlice.Internal.ts +0 -26
- package/src/core/elements/UINineSlice/UINineSlice.ts +0 -296
- package/src/core/elements/UIProgress/UIProgress.Internal.ts +0 -24
- package/src/core/elements/UIProgress/UIProgress.ts +0 -259
- package/src/core/elements/UIScene/UIScene.Internal.ts +0 -46
- package/src/core/elements/UIScene/UIScene.ts +0 -259
- package/src/core/elements/UIText/UIText.Internal.ts +0 -29
- package/src/core/elements/UIText/UIText.Measuring.ts +0 -183
- package/src/core/elements/UIText/UIText.Rendering.ts +0 -83
- package/src/core/elements/UIText/UIText.ts +0 -376
- package/src/core/layers/UIFullscreenLayer/UIFullscreenLayer.ts +0 -233
- package/src/core/layers/UILayer/UILayer.ts +0 -156
- package/src/core/miscellaneous/UIExpression.ts +0 -142
- package/src/core/miscellaneous/UIMode.ts +0 -29
- package/src/core/miscellaneous/UIOrientation.ts +0 -18
- package/src/core/miscellaneous/UIPriority.ts +0 -63
- package/src/core/miscellaneous/UIRelation.ts +0 -39
- package/src/core/miscellaneous/UITransparencyMode.ts +0 -9
- package/src/core/miscellaneous/area/UIArea.ts +0 -5
- package/src/core/miscellaneous/area/UIAreaCircle.ts +0 -32
- package/src/core/miscellaneous/area/UIAreaPolygon.ts +0 -50
- package/src/core/miscellaneous/area/UIAreaRectangle.ts +0 -38
- package/src/core/miscellaneous/area/UIAreaRoundedRectangle.ts +0 -78
- package/src/core/miscellaneous/asserts.ts +0 -187
- package/src/core/miscellaneous/canvas.ts +0 -73
- package/src/core/miscellaneous/color/UIColor.Internal.ts +0 -89
- package/src/core/miscellaneous/color/UIColor.ts +0 -844
- package/src/core/miscellaneous/computeTransform.ts +0 -127
- package/src/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.ts +0 -235
- package/src/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.ts +0 -524
- package/src/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.ts +0 -448
- package/src/core/miscellaneous/generic-plane/shared.ts +0 -323
- package/src/core/miscellaneous/insets/UIInsets.Internal.ts +0 -9
- package/src/core/miscellaneous/insets/UIInsets.ts +0 -248
- package/src/core/miscellaneous/mask-function/UIProgressMaskFunction.ts +0 -24
- package/src/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.ts +0 -58
- package/src/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.ts +0 -52
- package/src/core/miscellaneous/math.ts +0 -16
- package/src/core/miscellaneous/micro/UIMicro.Internal.ts +0 -33
- package/src/core/miscellaneous/micro/UIMicro.ts +0 -222
- package/src/core/miscellaneous/resize-policy/UIResizePolicy.ts +0 -8
- package/src/core/miscellaneous/resize-policy/UIResizePolicyCover.ts +0 -57
- package/src/core/miscellaneous/resize-policy/UIResizePolicyCross.ts +0 -65
- package/src/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.ts +0 -65
- package/src/core/miscellaneous/resize-policy/UIResizePolicyFit.ts +0 -57
- package/src/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.ts +0 -65
- package/src/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.ts +0 -65
- package/src/core/miscellaneous/resize-policy/UIResizePolicyNone.ts +0 -11
- package/src/core/miscellaneous/shared.ts +0 -73
- package/src/core/miscellaneous/text-span/UITextSpan.ts +0 -43
- package/src/core/miscellaneous/text-style/UITextStyle.Internal.ts +0 -52
- package/src/core/miscellaneous/text-style/UITextStyle.ts +0 -479
- package/src/core/miscellaneous/texture/UITextureView.Internal.ts +0 -55
- package/src/core/miscellaneous/texture/UITextureView.ts +0 -308
- package/src/core/miscellaneous/webglCapabilities.ts +0 -129
- package/src/core/shaders/UIImage.glsl +0 -10
- package/src/core/shaders/UINineSlice.glsl +0 -53
- package/src/core/shaders/UIProgress.glsl +0 -15
- package/src/core/shaders/UIProgressMaskFunctionCircular.glsl +0 -13
- package/src/core/shaders/UIProgressMaskFunctionDirectional.glsl +0 -12
- package/src/core/shaders/glsl.d.ts +0 -27
- package/src/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.ts +0 -23
- package/src/core/wrappers/UIInputWrapper/UIInputWrapper.ts +0 -124
- package/src/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.ts +0 -22
- package/src/core/wrappers/UISceneWrapper/UISceneWrapper.ts +0 -101
- package/src/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.ts +0 -58
- package/src/core/wrappers/UISolverWrapper/UISolverWrapper.ts +0 -605
- package/src/particles/behaviorModules/UIBehaviorDirectionalGravity.ts +0 -70
- package/src/particles/behaviorModules/UIBehaviorModule.ts +0 -20
- package/src/particles/behaviorModules/UIBehaviorPointGravity.ts +0 -173
- package/src/particles/behaviorModules/UIBehaviorScaleOverLife.ts +0 -104
- package/src/particles/behaviorModules/UIBehaviorTorqueDamping.ts +0 -75
- package/src/particles/behaviorModules/UIBehaviorTorqueNoise.ts +0 -115
- package/src/particles/behaviorModules/UIBehaviorVelocityDamping.ts +0 -77
- package/src/particles/behaviorModules/UIBehaviorVelocityNoise.ts +0 -118
- package/src/particles/elements/UIEmitter.Internal.ts +0 -22
- package/src/particles/elements/UIEmitter.ts +0 -313
- package/src/particles/instancedParticle/UIInstancedParticle.Internal.ts +0 -263
- package/src/particles/instancedParticle/UIInstancedParticle.ts +0 -138
- package/src/particles/miscellaneous/miscellaneous.ts +0 -115
- package/src/particles/renderingModules/UIRenderingColorOverLife.ts +0 -39
- package/src/particles/renderingModules/UIRenderingColorOverVelocity.ts +0 -49
- package/src/particles/renderingModules/UIRenderingModule.ts +0 -17
- package/src/particles/renderingModules/UIRenderingTexture.ts +0 -30
- package/src/particles/shaders/UIRenderingColorOverLife.glsl +0 -4
- package/src/particles/shaders/UIRenderingColorOverVelocity.glsl +0 -6
- package/src/particles/shaders/UIRenderingTexture.glsl +0 -4
- package/src/particles/spawnModules/UISpawnModule.ts +0 -22
- package/src/particles/spawnModules/UISpawnOffset.ts +0 -62
- package/src/particles/spawnModules/UISpawnRandomLifetime.ts +0 -68
- package/src/particles/spawnModules/UISpawnRandomRotation.ts +0 -60
- package/src/particles/spawnModules/UISpawnRandomScale.ts +0 -81
- package/src/particles/spawnModules/UISpawnRandomTorque.ts +0 -62
- package/src/particles/spawnModules/UISpawnRandomVelocity.ts +0 -92
- package/src/particles/spawnModules/UISpawnRectangle.ts +0 -81
- package/tsconfig.json +0 -29
- /package/{src/core/index.ts → dist/core/index.d.ts} +0 -0
- /package/{src/particles/index.ts → dist/particles/index.d.ts} +0 -0
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import type { FerrsignView2, FerrsignView3 } from "ferrsign";
|
|
2
|
-
import { Ferrsign2, Ferrsign3 } from "ferrsign";
|
|
3
|
-
import type { WebGLRenderer } from "three";
|
|
4
|
-
import type { UIPlaneElement } from "../../miscellaneous/shared";
|
|
5
|
-
|
|
6
|
-
import { assertValidPositiveNumber } from "../../miscellaneous/asserts";
|
|
7
|
-
import { isUIModeVisible } from "../../miscellaneous/UIMode";
|
|
8
|
-
import { UIOrientation } from "../../miscellaneous/UIOrientation";
|
|
9
|
-
import { UIPriority } from "../../miscellaneous/UIPriority";
|
|
10
|
-
import { UIInputWrapper } from "../../wrappers/UIInputWrapper/UIInputWrapper";
|
|
11
|
-
import type { UIInputWrapperView } from "../../wrappers/UIInputWrapper/UIInputWrapper.Internal";
|
|
12
|
-
import { UISceneWrapper } from "../../wrappers/UISceneWrapper/UISceneWrapper";
|
|
13
|
-
import type { UISceneWrapperView } from "../../wrappers/UISceneWrapper/UISceneWrapper.Internal";
|
|
14
|
-
import { UISolverWrapper } from "../../wrappers/UISolverWrapper/UISolverWrapper";
|
|
15
|
-
import type { UISolverWrapperView } from "../../wrappers/UISolverWrapper/UISolverWrapper.Internal";
|
|
16
|
-
import type { UILayerMode, UILayerOptions, UILayerOrientation } from "./UILayer.Internal";
|
|
17
|
-
import { LAYER_DEFAULT_MODE, LAYER_DEFAULT_NAME, LAYER_DEFAULT_SIZE } from "./UILayer.Internal";
|
|
18
|
-
|
|
19
|
-
/** Base layer for UI rendering and layout management */
|
|
20
|
-
export abstract class UILayer implements UIPlaneElement {
|
|
21
|
-
/** Optional layer name */
|
|
22
|
-
public name = "";
|
|
23
|
-
/** Solver variable for x coordinate */
|
|
24
|
-
public readonly xVariable: number;
|
|
25
|
-
/** Solver variable for y coordinate */
|
|
26
|
-
public readonly yVariable: number;
|
|
27
|
-
/** Solver variable for width */
|
|
28
|
-
public readonly wVariable: number;
|
|
29
|
-
/** Solver variable for height */
|
|
30
|
-
public readonly hVariable: number;
|
|
31
|
-
|
|
32
|
-
protected readonly inputWrapperInternal = new UIInputWrapper();
|
|
33
|
-
private readonly solverWrapperInternal = new UISolverWrapper();
|
|
34
|
-
private readonly sceneWrapperInternal: UISceneWrapper;
|
|
35
|
-
|
|
36
|
-
private modeInternal: UILayerMode;
|
|
37
|
-
private orientationInternal: UILayerOrientation;
|
|
38
|
-
|
|
39
|
-
private readonly signalOrientationChangedInternal = new Ferrsign2<UILayerOrientation, UILayer>();
|
|
40
|
-
private readonly signalModeChangedInternal = new Ferrsign2<UILayerMode, UILayer>();
|
|
41
|
-
private readonly signalRenderingInternal = new Ferrsign3<WebGLRenderer, number, UILayer>();
|
|
42
|
-
|
|
43
|
-
constructor(options: Partial<UILayerOptions>) {
|
|
44
|
-
if (options.width !== undefined) {
|
|
45
|
-
assertValidPositiveNumber(options.width, "UILayer.constructor.options.width");
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
if (options.height !== undefined) {
|
|
49
|
-
assertValidPositiveNumber(options.height, "UILayer.constructor.options.height");
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const width = options.width ?? LAYER_DEFAULT_SIZE;
|
|
53
|
-
const height = options.height ?? LAYER_DEFAULT_SIZE;
|
|
54
|
-
|
|
55
|
-
this.sceneWrapperInternal = new UISceneWrapper(width, height);
|
|
56
|
-
this.name = options.name ?? LAYER_DEFAULT_NAME;
|
|
57
|
-
this.modeInternal = options.mode ?? LAYER_DEFAULT_MODE;
|
|
58
|
-
this.orientationInternal = width > height ? UIOrientation.HORIZONTAL : UIOrientation.VERTICAL;
|
|
59
|
-
|
|
60
|
-
this.xVariable = this.solverWrapperInternal.createVariable(0, UIPriority.P0);
|
|
61
|
-
this.yVariable = this.solverWrapperInternal.createVariable(0, UIPriority.P0);
|
|
62
|
-
this.wVariable = this.solverWrapperInternal.createVariable(width, UIPriority.P0);
|
|
63
|
-
this.hVariable = this.solverWrapperInternal.createVariable(height, UIPriority.P0);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/** @internal */
|
|
67
|
-
public get sceneWrapper(): UISceneWrapperView {
|
|
68
|
-
return this.sceneWrapperInternal;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/** @internal */
|
|
72
|
-
public get solverWrapper(): UISolverWrapperView {
|
|
73
|
-
return this.solverWrapperInternal;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/** @internal */
|
|
77
|
-
public get inputWrapper(): UIInputWrapperView {
|
|
78
|
-
return this.inputWrapperInternal;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/** X coordinate in world units (always 0 for layers) */
|
|
82
|
-
public get x(): number {
|
|
83
|
-
return this.solverWrapperInternal.readVariableValue(this.xVariable);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/** Y coordinate in world units (always 0 for layers) */
|
|
87
|
-
public get y(): number {
|
|
88
|
-
return this.solverWrapperInternal.readVariableValue(this.yVariable);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/** Layer width in world units */
|
|
92
|
-
public get width(): number {
|
|
93
|
-
return this.solverWrapperInternal.readVariableValue(this.wVariable);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/** Layer height in world units */
|
|
97
|
-
public get height(): number {
|
|
98
|
-
return this.solverWrapperInternal.readVariableValue(this.hVariable);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/** Current visibility and interactivity mode */
|
|
102
|
-
public get mode(): UILayerMode {
|
|
103
|
-
return this.modeInternal;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/** Current orientation based on aspect ratio */
|
|
107
|
-
public get orientation(): UILayerOrientation {
|
|
108
|
-
return this.orientationInternal;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/** Signal fired when orientation changes */
|
|
112
|
-
public get signalOrientationChanged(): FerrsignView2<UILayerOrientation, UILayer> {
|
|
113
|
-
return this.signalOrientationChangedInternal;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/** Signal fired when mode changes */
|
|
117
|
-
public get signalModeChanged(): FerrsignView2<UILayerMode, UILayer> {
|
|
118
|
-
return this.signalModeChangedInternal;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/** Signal fired during rendering */
|
|
122
|
-
public get signalRendering(): FerrsignView3<WebGLRenderer, number, UILayer> {
|
|
123
|
-
return this.signalRenderingInternal;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/** Updates visibility and interactivity mode */
|
|
127
|
-
public set mode(value: UILayerMode) {
|
|
128
|
-
if (value !== this.modeInternal) {
|
|
129
|
-
this.modeInternal = value;
|
|
130
|
-
this.signalModeChangedInternal.emit(this.modeInternal, this);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
protected resizeInternal(width: number, height: number): void {
|
|
135
|
-
this.solverWrapperInternal.suggestVariableValue(this.wVariable, width);
|
|
136
|
-
this.solverWrapperInternal.suggestVariableValue(this.hVariable, height);
|
|
137
|
-
this.sceneWrapperInternal.resize(width, height);
|
|
138
|
-
|
|
139
|
-
const orientation = width > height ? UIOrientation.HORIZONTAL : UIOrientation.VERTICAL;
|
|
140
|
-
|
|
141
|
-
if (orientation !== this.orientationInternal) {
|
|
142
|
-
this.orientationInternal = orientation;
|
|
143
|
-
this.signalOrientationChangedInternal.emit(this.orientationInternal, this);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
protected renderInternal(renderer: WebGLRenderer, deltaTime: number): void {
|
|
148
|
-
if (isUIModeVisible(this.mode)) {
|
|
149
|
-
this.signalRenderingInternal.emit(renderer, deltaTime, this);
|
|
150
|
-
this.sceneWrapperInternal.render(renderer);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
this.solverWrapperInternal.dirty = false;
|
|
154
|
-
this.inputWrapperInternal.dirty = false;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import { assertValidNumber } from "./asserts";
|
|
2
|
-
|
|
3
|
-
/** Linear expression for constraint equations */
|
|
4
|
-
export class UIExpression {
|
|
5
|
-
/** Constant term */
|
|
6
|
-
public constant: number;
|
|
7
|
-
/** Variable coefficients */
|
|
8
|
-
private readonly terms: Map<number, number>;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @param constant Constant term
|
|
12
|
-
* @param terms Variable-coefficient pairs
|
|
13
|
-
*/
|
|
14
|
-
constructor(constant = 0, terms?: [number, number][]) {
|
|
15
|
-
assertValidNumber(constant, "UIExpression.constructor.constant");
|
|
16
|
-
this.constant = constant;
|
|
17
|
-
this.terms = terms ? new Map(terms) : new Map();
|
|
18
|
-
|
|
19
|
-
if (terms) {
|
|
20
|
-
for (let i = 0; i < terms.length; i++) {
|
|
21
|
-
assertValidNumber(terms[i][1], `UIExpression.constructor.terms[${i}][1]`);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Creates expression representing a + b.
|
|
28
|
-
* @param a First expression
|
|
29
|
-
* @param b Second expression
|
|
30
|
-
* @returns Sum of expressions
|
|
31
|
-
*/
|
|
32
|
-
public static plus(a: UIExpression, b: UIExpression): UIExpression {
|
|
33
|
-
const result = new UIExpression(a.constant + b.constant, Array.from(a.terms.entries()));
|
|
34
|
-
for (const [variableIndex, coefficient] of b.terms) {
|
|
35
|
-
result.plus(variableIndex, coefficient);
|
|
36
|
-
}
|
|
37
|
-
return result;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Creates expression representing a - b.
|
|
42
|
-
* @param a First expression
|
|
43
|
-
* @param b Second expression
|
|
44
|
-
* @returns Difference of expressions
|
|
45
|
-
*/
|
|
46
|
-
public static minus(a: UIExpression, b: UIExpression): UIExpression {
|
|
47
|
-
const result = new UIExpression(a.constant - b.constant, Array.from(a.terms.entries()));
|
|
48
|
-
for (const [variableIndex, coefficient] of b.terms) {
|
|
49
|
-
result.minus(variableIndex, coefficient);
|
|
50
|
-
}
|
|
51
|
-
return result;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Adds variable term to expression.
|
|
56
|
-
* @param variableIndex Variable descriptor
|
|
57
|
-
* @param coefficient Coefficient to add
|
|
58
|
-
* @returns This instance for chaining
|
|
59
|
-
*/
|
|
60
|
-
public plus(variableIndex: number, coefficient: number): this {
|
|
61
|
-
assertValidNumber(coefficient, "UIExpression.plus.coefficient");
|
|
62
|
-
this.terms.set(variableIndex, (this.terms.get(variableIndex) ?? 0) + coefficient);
|
|
63
|
-
return this;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Subtracts variable term from expression.
|
|
68
|
-
* @param variableIndex Variable descriptor
|
|
69
|
-
* @param coefficient Coefficient to subtract
|
|
70
|
-
* @returns This instance for chaining
|
|
71
|
-
*/
|
|
72
|
-
public minus(variableIndex: number, coefficient: number): this {
|
|
73
|
-
return this.plus(variableIndex, -coefficient);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Multiplies all terms by scalar.
|
|
78
|
-
* @param value Scalar multiplier
|
|
79
|
-
* @returns This instance for chaining
|
|
80
|
-
*/
|
|
81
|
-
public multiply(value: number): this {
|
|
82
|
-
assertValidNumber(value, "UIExpression.multiply.value");
|
|
83
|
-
this.constant *= value;
|
|
84
|
-
for (const [variableIndex, coefficient] of this.terms) {
|
|
85
|
-
this.terms.set(variableIndex, coefficient * value);
|
|
86
|
-
}
|
|
87
|
-
return this;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Divides all terms by scalar.
|
|
92
|
-
* @param value Scalar divisor
|
|
93
|
-
* @returns This instance for chaining
|
|
94
|
-
*/
|
|
95
|
-
public divide(value: number): this {
|
|
96
|
-
assertValidNumber(value, "UIExpression.divide.value");
|
|
97
|
-
if (value === 0) {
|
|
98
|
-
throw new Error("UIExpression.divide.value: cannot divide by zero");
|
|
99
|
-
}
|
|
100
|
-
return this.multiply(1 / value);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Checks if expression contains variable term.
|
|
105
|
-
* @param variableIndex Variable descriptor
|
|
106
|
-
* @returns True if variable has term
|
|
107
|
-
*/
|
|
108
|
-
public hasTerm(variableIndex: number): boolean {
|
|
109
|
-
return this.terms.has(variableIndex);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Copies from another expression.
|
|
114
|
-
* @param expression Source expression
|
|
115
|
-
* @returns This instance for chaining
|
|
116
|
-
*/
|
|
117
|
-
public copy(expression: UIExpression): this {
|
|
118
|
-
this.constant = expression.constant;
|
|
119
|
-
this.terms.clear();
|
|
120
|
-
for (const [variableIndex, coefficient] of expression.terms) {
|
|
121
|
-
this.terms.set(variableIndex, coefficient);
|
|
122
|
-
}
|
|
123
|
-
return this;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Creates independent copy.
|
|
128
|
-
* @returns New expression with same content
|
|
129
|
-
*/
|
|
130
|
-
public clone(): UIExpression {
|
|
131
|
-
return new UIExpression(this.constant, Array.from(this.terms.entries()));
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Prepares terms for solver.
|
|
136
|
-
* @returns Variable-coefficient pairs
|
|
137
|
-
* @internal
|
|
138
|
-
*/
|
|
139
|
-
public prepareTerms(): [number, number][] {
|
|
140
|
-
return Array.from(this.terms.entries());
|
|
141
|
-
}
|
|
142
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/** Visibility and interactivity state */
|
|
2
|
-
export enum UIMode {
|
|
3
|
-
/** Not rendered, no input */
|
|
4
|
-
HIDDEN = 0,
|
|
5
|
-
/** Rendered, no input */
|
|
6
|
-
VISIBLE = 1,
|
|
7
|
-
/** Rendered, receives input, blocks input to elements behind */
|
|
8
|
-
INTERACTIVE = 2,
|
|
9
|
-
/** Rendered, receives input, passes input to elements behind */
|
|
10
|
-
INTERACTIVE_TRANSPARENT = 3,
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Checks if mode allows input events.
|
|
15
|
-
* @param mode Mode to check
|
|
16
|
-
* @returns True if interactive
|
|
17
|
-
*/
|
|
18
|
-
export function isUIModeInteractive(mode: UIMode): boolean {
|
|
19
|
-
return mode === UIMode.INTERACTIVE || mode === UIMode.INTERACTIVE_TRANSPARENT;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Checks if mode is rendered.
|
|
24
|
-
* @param mode Mode to check
|
|
25
|
-
* @returns True if visible
|
|
26
|
-
*/
|
|
27
|
-
export function isUIModeVisible(mode: UIMode): boolean {
|
|
28
|
-
return mode !== UIMode.HIDDEN;
|
|
29
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/** Screen orientation for conditional constraints */
|
|
2
|
-
export enum UIOrientation {
|
|
3
|
-
/** Landscape (width > height) */
|
|
4
|
-
HORIZONTAL = 0,
|
|
5
|
-
/** Portrait (height > width) */
|
|
6
|
-
VERTICAL = 1,
|
|
7
|
-
/** Active in any orientation */
|
|
8
|
-
ALWAYS = 2,
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Resolves optional orientation.
|
|
13
|
-
* @param orientation Orientation to resolve
|
|
14
|
-
* @returns Orientation or ALWAYS if undefined
|
|
15
|
-
*/
|
|
16
|
-
export function resolveOrientation(orientation?: UIOrientation): UIOrientation {
|
|
17
|
-
return orientation ?? UIOrientation.ALWAYS;
|
|
18
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { Strength } from "@lume/kiwi";
|
|
2
|
-
|
|
3
|
-
const HIGH_PRIORITY = 1000;
|
|
4
|
-
const MEDIUM_PRIORITY = 100;
|
|
5
|
-
const LOW_PRIORITY = 10;
|
|
6
|
-
|
|
7
|
-
/** Constraint solver priority levels */
|
|
8
|
-
export enum UIPriority {
|
|
9
|
-
/** Highest priority */
|
|
10
|
-
P0 = 0,
|
|
11
|
-
/** High priority */
|
|
12
|
-
P1 = 1,
|
|
13
|
-
/** Medium-high priority */
|
|
14
|
-
P2 = 2,
|
|
15
|
-
/** Medium priority */
|
|
16
|
-
P3 = 3,
|
|
17
|
-
/** Medium-low priority */
|
|
18
|
-
P4 = 4,
|
|
19
|
-
/** Low priority */
|
|
20
|
-
P5 = 5,
|
|
21
|
-
/** Very low priority */
|
|
22
|
-
P6 = 6,
|
|
23
|
-
/** Lowest priority */
|
|
24
|
-
P7 = 7,
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Converts priority to solver strength.
|
|
29
|
-
* @param priority Priority level
|
|
30
|
-
* @returns Solver strength value
|
|
31
|
-
* @throws If priority is invalid
|
|
32
|
-
*/
|
|
33
|
-
export function convertPriority(priority: UIPriority): number {
|
|
34
|
-
switch (priority) {
|
|
35
|
-
case UIPriority.P0:
|
|
36
|
-
return Strength.create(HIGH_PRIORITY, HIGH_PRIORITY, HIGH_PRIORITY);
|
|
37
|
-
case UIPriority.P1:
|
|
38
|
-
return Strength.create(MEDIUM_PRIORITY, 0, 0);
|
|
39
|
-
case UIPriority.P2:
|
|
40
|
-
return Strength.create(LOW_PRIORITY, 0, 0);
|
|
41
|
-
case UIPriority.P3:
|
|
42
|
-
return Strength.create(0, MEDIUM_PRIORITY, 0);
|
|
43
|
-
case UIPriority.P4:
|
|
44
|
-
return Strength.create(0, LOW_PRIORITY, 0);
|
|
45
|
-
case UIPriority.P5:
|
|
46
|
-
return Strength.create(0, 0, MEDIUM_PRIORITY);
|
|
47
|
-
case UIPriority.P6:
|
|
48
|
-
return Strength.create(0, 0, LOW_PRIORITY);
|
|
49
|
-
case UIPriority.P7:
|
|
50
|
-
return Strength.create(0, 0, 1);
|
|
51
|
-
default:
|
|
52
|
-
throw new Error(`convertPriority.priority: invalid priority`);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Resolves optional priority.
|
|
58
|
-
* @param priority Priority to resolve
|
|
59
|
-
* @returns Priority or P0 if undefined
|
|
60
|
-
*/
|
|
61
|
-
export function resolvePriority(priority?: UIPriority): UIPriority {
|
|
62
|
-
return priority ?? UIPriority.P0;
|
|
63
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { Operator } from "@lume/kiwi";
|
|
2
|
-
|
|
3
|
-
/** Relational operators for constraints */
|
|
4
|
-
export enum UIRelation {
|
|
5
|
-
/** Equality: LHS = RHS */
|
|
6
|
-
EQUAL = 0,
|
|
7
|
-
/** Less than or equal: LHS ≤ RHS */
|
|
8
|
-
LESS_THAN = 1,
|
|
9
|
-
/** Greater than or equal: LHS ≥ RHS */
|
|
10
|
-
GREATER_THAN = 2,
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Converts relation to solver operator.
|
|
15
|
-
* @param relation Relation type
|
|
16
|
-
* @returns Solver operator
|
|
17
|
-
* @throws If relation is invalid
|
|
18
|
-
*/
|
|
19
|
-
export function convertRelation(relation: UIRelation): Operator {
|
|
20
|
-
switch (relation) {
|
|
21
|
-
case UIRelation.EQUAL:
|
|
22
|
-
return Operator.Eq;
|
|
23
|
-
case UIRelation.LESS_THAN:
|
|
24
|
-
return Operator.Le;
|
|
25
|
-
case UIRelation.GREATER_THAN:
|
|
26
|
-
return Operator.Ge;
|
|
27
|
-
default:
|
|
28
|
-
throw new Error(`convertRelation.relation: invalid relation`);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Resolves optional relation.
|
|
34
|
-
* @param relation Relation to resolve
|
|
35
|
-
* @returns Relation or EQUAL if undefined
|
|
36
|
-
*/
|
|
37
|
-
export function resolveRelation(relation?: UIRelation): UIRelation {
|
|
38
|
-
return relation ?? UIRelation.EQUAL;
|
|
39
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/** Transparency rendering modes */
|
|
2
|
-
export enum UITransparencyMode {
|
|
3
|
-
/** Binary transparency. Best performance. */
|
|
4
|
-
CLIP = 0,
|
|
5
|
-
/** Dithered transparency. Good performance. */
|
|
6
|
-
HASH = 1,
|
|
7
|
-
/** Alpha blending. Best quality, requires depth sorting. */
|
|
8
|
-
BLEND = 2,
|
|
9
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { assertValidNonNegativeNumber, assertValidNumber } from "../asserts";
|
|
2
|
-
import { UIArea } from "./UIArea";
|
|
3
|
-
|
|
4
|
-
/** Circular interaction area */
|
|
5
|
-
export class UIAreaCircle extends UIArea {
|
|
6
|
-
/**
|
|
7
|
-
* Creates circular area.
|
|
8
|
-
*
|
|
9
|
-
* @param centerX - Center X in normalized coordinates (0 to 1)
|
|
10
|
-
* @param centerY - Center Y in normalized coordinates (0 to 1)
|
|
11
|
-
* @param radius - Radius in normalized coordinates (0 to 1)
|
|
12
|
-
*/
|
|
13
|
-
constructor(
|
|
14
|
-
public centerX: number,
|
|
15
|
-
public centerY: number,
|
|
16
|
-
public radius: number,
|
|
17
|
-
) {
|
|
18
|
-
super();
|
|
19
|
-
assertValidNonNegativeNumber(centerX, "UIAreaCircle.constructor.centerX");
|
|
20
|
-
assertValidNonNegativeNumber(centerY, "UIAreaCircle.constructor.centerY");
|
|
21
|
-
assertValidNonNegativeNumber(radius, "UIAreaCircle.constructor.radius");
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/** @internal */
|
|
25
|
-
public contains(pointX: number, pointY: number): boolean {
|
|
26
|
-
assertValidNumber(pointX, "UIAreaCircle.contains.pointX");
|
|
27
|
-
assertValidNumber(pointY, "UIAreaCircle.contains.pointY");
|
|
28
|
-
const deltaX = pointX - this.centerX;
|
|
29
|
-
const deltaY = pointY - this.centerY;
|
|
30
|
-
return deltaX * deltaX + deltaY * deltaY <= this.radius * this.radius;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { assertValidNumber } from "../asserts";
|
|
2
|
-
import type { Vector2Like } from "../math";
|
|
3
|
-
import { UIArea } from "./UIArea";
|
|
4
|
-
|
|
5
|
-
/** Polygonal interaction area using ray casting */
|
|
6
|
-
export class UIAreaPolygon extends UIArea {
|
|
7
|
-
/**
|
|
8
|
-
* Creates polygonal area.
|
|
9
|
-
*
|
|
10
|
-
* @param vertices - Vertices in normalized coordinates (0 to 1)
|
|
11
|
-
*/
|
|
12
|
-
constructor(public vertices: Vector2Like[]) {
|
|
13
|
-
super();
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/** @internal */
|
|
17
|
-
public contains(pointX: number, pointY: number): boolean {
|
|
18
|
-
assertValidNumber(pointX, "UIAreaPolygon.contains.pointX");
|
|
19
|
-
assertValidNumber(pointY, "UIAreaPolygon.contains.pointY");
|
|
20
|
-
const vertexCount = this.vertices.length;
|
|
21
|
-
if (vertexCount < 3) {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
let inside = false;
|
|
26
|
-
|
|
27
|
-
for (
|
|
28
|
-
let index = 0, previousIndex = vertexCount - 1;
|
|
29
|
-
index < vertexCount;
|
|
30
|
-
previousIndex = index++
|
|
31
|
-
) {
|
|
32
|
-
const currentVertex = this.vertices[index];
|
|
33
|
-
const previousVertex = this.vertices[previousIndex];
|
|
34
|
-
|
|
35
|
-
const currentX = currentVertex.x;
|
|
36
|
-
const currentY = currentVertex.y;
|
|
37
|
-
const previousX = previousVertex.x;
|
|
38
|
-
const previousY = previousVertex.y;
|
|
39
|
-
|
|
40
|
-
if (
|
|
41
|
-
currentY > pointY !== previousY > pointY &&
|
|
42
|
-
pointX < ((previousX - currentX) * (pointY - currentY)) / (previousY - currentY) + currentX
|
|
43
|
-
) {
|
|
44
|
-
inside = !inside;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return inside;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { assertValidNonNegativeNumber, assertValidNumber } from "../asserts";
|
|
2
|
-
import { UIArea } from "./UIArea";
|
|
3
|
-
|
|
4
|
-
/** Rectangular interaction area */
|
|
5
|
-
export class UIAreaRectangle extends UIArea {
|
|
6
|
-
/**
|
|
7
|
-
* Creates rectangular area.
|
|
8
|
-
*
|
|
9
|
-
* @param x - X position in normalized coordinates (0 to 1)
|
|
10
|
-
* @param y - Y position in normalized coordinates (0 to 1)
|
|
11
|
-
* @param width - Width in normalized coordinates (0 to 1)
|
|
12
|
-
* @param height - Height in normalized coordinates (0 to 1)
|
|
13
|
-
*/
|
|
14
|
-
constructor(
|
|
15
|
-
public x: number,
|
|
16
|
-
public y: number,
|
|
17
|
-
public width: number,
|
|
18
|
-
public height: number,
|
|
19
|
-
) {
|
|
20
|
-
super();
|
|
21
|
-
assertValidNonNegativeNumber(x, "UIAreaRectangle.constructor.x");
|
|
22
|
-
assertValidNonNegativeNumber(y, "UIAreaRectangle.constructor.y");
|
|
23
|
-
assertValidNonNegativeNumber(width, "UIAreaRectangle.constructor.width");
|
|
24
|
-
assertValidNonNegativeNumber(height, "UIAreaRectangle.constructor.height");
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/** @internal */
|
|
28
|
-
public contains(pointX: number, pointY: number): boolean {
|
|
29
|
-
assertValidNumber(pointX, "UIAreaRectangle.contains.pointX");
|
|
30
|
-
assertValidNumber(pointY, "UIAreaRectangle.contains.pointY");
|
|
31
|
-
return (
|
|
32
|
-
pointX >= this.x &&
|
|
33
|
-
pointX <= this.x + this.width &&
|
|
34
|
-
pointY >= this.y &&
|
|
35
|
-
pointY <= this.y + this.height
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { assertValidNonNegativeNumber, assertValidNumber } from "../asserts";
|
|
2
|
-
import { UIArea } from "./UIArea";
|
|
3
|
-
|
|
4
|
-
/** Rectangular interaction area with rounded corners */
|
|
5
|
-
export class UIAreaRoundedRectangle extends UIArea {
|
|
6
|
-
/**
|
|
7
|
-
* Creates rounded rectangular area.
|
|
8
|
-
*
|
|
9
|
-
* Radius clamped to half of smallest dimension.
|
|
10
|
-
*
|
|
11
|
-
* @param x - X position in normalized coordinates (0 to 1)
|
|
12
|
-
* @param y - Y position in normalized coordinates (0 to 1)
|
|
13
|
-
* @param width - Width in normalized coordinates (0 to 1)
|
|
14
|
-
* @param height - Height in normalized coordinates (0 to 1)
|
|
15
|
-
* @param radius - Corner radius in normalized coordinates (0 to 1)
|
|
16
|
-
*/
|
|
17
|
-
constructor(
|
|
18
|
-
public x: number,
|
|
19
|
-
public y: number,
|
|
20
|
-
public width: number,
|
|
21
|
-
public height: number,
|
|
22
|
-
public radius: number,
|
|
23
|
-
) {
|
|
24
|
-
super();
|
|
25
|
-
assertValidNonNegativeNumber(x, "UIAreaRoundedRectangle.constructor.x");
|
|
26
|
-
assertValidNonNegativeNumber(y, "UIAreaRoundedRectangle.constructor.y");
|
|
27
|
-
assertValidNonNegativeNumber(width, "UIAreaRoundedRectangle.constructor.width");
|
|
28
|
-
assertValidNonNegativeNumber(height, "UIAreaRoundedRectangle.constructor.height");
|
|
29
|
-
assertValidNonNegativeNumber(radius, "UIAreaRoundedRectangle.constructor.radius");
|
|
30
|
-
this.radius = Math.min(radius, Math.min(width, height) / 2);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/** @internal */
|
|
34
|
-
public contains(pointX: number, pointY: number): boolean {
|
|
35
|
-
assertValidNumber(pointX, "UIAreaRoundedRectangle.contains.pointX");
|
|
36
|
-
assertValidNumber(pointY, "UIAreaRoundedRectangle.contains.pointY");
|
|
37
|
-
const left = this.x;
|
|
38
|
-
const right = this.x + this.width;
|
|
39
|
-
const top = this.y;
|
|
40
|
-
const bottom = this.y + this.height;
|
|
41
|
-
|
|
42
|
-
if (pointX < left || pointX > right || pointY < top || pointY > bottom) {
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const cornerLeft = left + this.radius;
|
|
47
|
-
const cornerRight = right - this.radius;
|
|
48
|
-
const cornerTop = top + this.radius;
|
|
49
|
-
const cornerBottom = bottom - this.radius;
|
|
50
|
-
|
|
51
|
-
if (pointX >= cornerLeft && pointX <= cornerRight) {
|
|
52
|
-
return true;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (pointY >= cornerTop && pointY <= cornerBottom) {
|
|
56
|
-
return true;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
let centerX: number;
|
|
60
|
-
let centerY: number;
|
|
61
|
-
|
|
62
|
-
if (pointX < cornerLeft) {
|
|
63
|
-
centerX = cornerLeft;
|
|
64
|
-
} else {
|
|
65
|
-
centerX = cornerRight;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (pointY < cornerTop) {
|
|
69
|
-
centerY = cornerTop;
|
|
70
|
-
} else {
|
|
71
|
-
centerY = cornerBottom;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const deltaX = pointX - centerX;
|
|
75
|
-
const deltaY = pointY - centerY;
|
|
76
|
-
return deltaX * deltaX + deltaY * deltaY <= this.radius * this.radius;
|
|
77
|
-
}
|
|
78
|
-
}
|