laymur 0.17.0 → 0.17.2
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/README.md +5 -0
- 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,62 +0,0 @@
|
|
|
1
|
-
import type { UILayer } from "../layers/UILayer/UILayer";
|
|
2
|
-
import type { UIExpression } from "../miscellaneous/UIExpression";
|
|
3
|
-
import { UISingleParameterConstraint } from "./UISingleParameterConstraint/UISingleParameterConstraint";
|
|
4
|
-
import type { UISingleParameterConstraintOptions } from "./UISingleParameterConstraint/UISingleParameterConstraint.Internal";
|
|
5
|
-
|
|
6
|
-
/** Constraint with custom LHS and RHS expressions */
|
|
7
|
-
export class UICustomConstraint extends UISingleParameterConstraint {
|
|
8
|
-
/** Solver constraint descriptor */
|
|
9
|
-
protected override readonly constraint: number;
|
|
10
|
-
/** Left-hand side expression */
|
|
11
|
-
private lhsInternal: UIExpression;
|
|
12
|
-
/** Right-hand side expression */
|
|
13
|
-
private rhsInternal: UIExpression;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @param layer Layer containing this constraint
|
|
17
|
-
* @param lhs Left-hand side expression
|
|
18
|
-
* @param rhs Right-hand side expression
|
|
19
|
-
* @param options Constraint configuration
|
|
20
|
-
*/
|
|
21
|
-
constructor(
|
|
22
|
-
layer: UILayer,
|
|
23
|
-
lhs: UIExpression,
|
|
24
|
-
rhs: UIExpression,
|
|
25
|
-
options: Partial<UISingleParameterConstraintOptions> = {},
|
|
26
|
-
) {
|
|
27
|
-
super(layer, options);
|
|
28
|
-
|
|
29
|
-
this.lhsInternal = lhs;
|
|
30
|
-
this.rhsInternal = rhs;
|
|
31
|
-
|
|
32
|
-
this.constraint = this.solverWrapper.createConstraint(
|
|
33
|
-
this.lhsInternal,
|
|
34
|
-
this.rhsInternal,
|
|
35
|
-
this.relation,
|
|
36
|
-
this.priority,
|
|
37
|
-
this.isConstraintEnabled(),
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/** Left-hand side expression */
|
|
42
|
-
public get lhs(): UIExpression {
|
|
43
|
-
return this.lhsInternal;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/** Right-hand side expression */
|
|
47
|
-
public get rhs(): UIExpression {
|
|
48
|
-
return this.rhsInternal;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/** Updates left-hand side expression */
|
|
52
|
-
public setLHS(value: UIExpression): void {
|
|
53
|
-
this.lhsInternal = value;
|
|
54
|
-
this.solverWrapper.setConstraintLHS(this.constraint, this.lhsInternal);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/** Updates right-hand side expression */
|
|
58
|
-
public setRHS(value: UIExpression): void {
|
|
59
|
-
this.rhsInternal = value;
|
|
60
|
-
this.solverWrapper.setConstraintRHS(this.constraint, this.rhsInternal);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { assertValidPositiveNumber } from "../../miscellaneous/asserts";
|
|
2
|
-
import type { UILayerElement, UIPlaneElement } from "../../miscellaneous/shared";
|
|
3
|
-
import { UIExpression } from "../../miscellaneous/UIExpression";
|
|
4
|
-
import { UISingleParameterConstraint } from "../UISingleParameterConstraint/UISingleParameterConstraint";
|
|
5
|
-
import type { UIHeightConstraintOptions } from "./UIHeightConstraint.Internal";
|
|
6
|
-
|
|
7
|
-
/** Fixes element height to constant value */
|
|
8
|
-
export class UIHeightConstraint extends UISingleParameterConstraint {
|
|
9
|
-
/** Solver constraint descriptor */
|
|
10
|
-
protected override readonly constraint: number;
|
|
11
|
-
|
|
12
|
-
/** Current height value */
|
|
13
|
-
private heightInternal: number;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @param element Element to constrain
|
|
17
|
-
* @param options Height configuration. Defaults to element's current height.
|
|
18
|
-
*/
|
|
19
|
-
constructor(
|
|
20
|
-
private readonly element: UIPlaneElement & UILayerElement,
|
|
21
|
-
options: Partial<UIHeightConstraintOptions> = {},
|
|
22
|
-
) {
|
|
23
|
-
if (options.height !== undefined) {
|
|
24
|
-
assertValidPositiveNumber(options.height, "UIHeightConstraint.constructor.options.height");
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
super(element.layer, options);
|
|
28
|
-
|
|
29
|
-
this.heightInternal = options.height ?? element.height;
|
|
30
|
-
this.constraint = this.solverWrapper.createConstraint(
|
|
31
|
-
new UIExpression(0, [[this.element.hVariable, 1]]),
|
|
32
|
-
new UIExpression(this.heightInternal),
|
|
33
|
-
this.relation,
|
|
34
|
-
this.priority,
|
|
35
|
-
this.isConstraintEnabled(),
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/** Current height in world units */
|
|
40
|
-
public get height(): number {
|
|
41
|
-
return this.heightInternal;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/** Updates height */
|
|
45
|
-
public set height(value: number) {
|
|
46
|
-
assertValidPositiveNumber(value, "UIHeightConstraint.height");
|
|
47
|
-
if (this.heightInternal !== value) {
|
|
48
|
-
this.heightInternal = value;
|
|
49
|
-
this.solverWrapper.setConstraintRHS(this.constraint, new UIExpression(value));
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { UISingleParameterConstraintOptions } from "../UISingleParameterConstraint/UISingleParameterConstraint.Internal";
|
|
2
|
-
|
|
3
|
-
export const DEFAULT_ANCHOR = 0.5;
|
|
4
|
-
|
|
5
|
-
/** Horizontal distance constraint options */
|
|
6
|
-
export interface UIHorizontalDistanceConstraintOptions extends UISingleParameterConstraintOptions {
|
|
7
|
-
/** Anchor on element A (0 = left, 0.5 = center, 1 = right) */
|
|
8
|
-
anchorA: number;
|
|
9
|
-
/** Anchor on element B (0 = left, 0.5 = center, 1 = right) */
|
|
10
|
-
anchorB: number;
|
|
11
|
-
/** Distance in world units */
|
|
12
|
-
distance: number;
|
|
13
|
-
}
|
package/src/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.ts
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import { assertValidConstraintArguments, assertValidNumber } from "../../miscellaneous/asserts";
|
|
2
|
-
import type { UIPlaneElement, UIPointElement } from "../../miscellaneous/shared";
|
|
3
|
-
import { isUIPlaneElement, isUIPointElement } from "../../miscellaneous/shared";
|
|
4
|
-
import { UIExpression } from "../../miscellaneous/UIExpression";
|
|
5
|
-
import { UISingleParameterConstraint } from "../UISingleParameterConstraint/UISingleParameterConstraint";
|
|
6
|
-
import type { UIHorizontalDistanceConstraintOptions } from "./UIHorizontalDistanceConstraint.Internal";
|
|
7
|
-
import { DEFAULT_ANCHOR } from "./UIHorizontalDistanceConstraint.Internal";
|
|
8
|
-
|
|
9
|
-
/** Maintains horizontal distance between elements with configurable anchors */
|
|
10
|
-
export class UIHorizontalDistanceConstraint extends UISingleParameterConstraint {
|
|
11
|
-
/** Solver constraint descriptor */
|
|
12
|
-
protected override readonly constraint: number;
|
|
13
|
-
|
|
14
|
-
/** Anchor on element A */
|
|
15
|
-
private anchorAInternal: number;
|
|
16
|
-
/** Anchor on element B */
|
|
17
|
-
private anchorBInternal: number;
|
|
18
|
-
/** Current distance */
|
|
19
|
-
private distanceInternal: number;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* @param a First element
|
|
23
|
-
* @param b Second element
|
|
24
|
-
* @param options Distance configuration
|
|
25
|
-
*/
|
|
26
|
-
constructor(
|
|
27
|
-
private readonly a: UIPointElement | UIPlaneElement,
|
|
28
|
-
private readonly b: UIPointElement | UIPlaneElement,
|
|
29
|
-
options: Partial<UIHorizontalDistanceConstraintOptions> = {},
|
|
30
|
-
) {
|
|
31
|
-
if (options.anchorA !== undefined) {
|
|
32
|
-
assertValidNumber(
|
|
33
|
-
options.anchorA,
|
|
34
|
-
"UIHorizontalDistanceConstraint.constructor.options.anchorA",
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
if (options.anchorB !== undefined) {
|
|
38
|
-
assertValidNumber(
|
|
39
|
-
options.anchorB,
|
|
40
|
-
"UIHorizontalDistanceConstraint.constructor.options.anchorB",
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
if (options.distance !== undefined) {
|
|
44
|
-
assertValidNumber(
|
|
45
|
-
options.distance,
|
|
46
|
-
"UIHorizontalDistanceConstraint.constructor.options.distance",
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
super(
|
|
51
|
-
assertValidConstraintArguments(a, b, "UIHorizontalDistanceConstraint.constructor"),
|
|
52
|
-
options,
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
this.anchorAInternal = options.anchorA ?? DEFAULT_ANCHOR;
|
|
56
|
-
this.anchorBInternal = options.anchorB ?? DEFAULT_ANCHOR;
|
|
57
|
-
this.distanceInternal = options.distance ?? 0;
|
|
58
|
-
|
|
59
|
-
this.constraint = this.solverWrapper.createConstraint(
|
|
60
|
-
this.buildLHS(),
|
|
61
|
-
new UIExpression(this.distanceInternal),
|
|
62
|
-
this.relation,
|
|
63
|
-
this.priority,
|
|
64
|
-
this.isConstraintEnabled(),
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/** Current distance in world units */
|
|
69
|
-
public get distance(): number {
|
|
70
|
-
return this.distanceInternal;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/** Anchor on element A (0 = left, 0.5 = center, 1 = right) */
|
|
74
|
-
public get anchorA(): number {
|
|
75
|
-
return this.anchorAInternal;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/** Anchor on element B (0 = left, 0.5 = center, 1 = right) */
|
|
79
|
-
public get anchorB(): number {
|
|
80
|
-
return this.anchorBInternal;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/** Updates distance */
|
|
84
|
-
public set distance(value: number) {
|
|
85
|
-
assertValidNumber(value, "UIHorizontalDistanceConstraint.distance");
|
|
86
|
-
if (this.distanceInternal !== value) {
|
|
87
|
-
this.distanceInternal = value;
|
|
88
|
-
this.solverWrapper.setConstraintRHS(this.constraint, new UIExpression(this.distanceInternal));
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/** Updates anchor on element A */
|
|
93
|
-
public set anchorA(value: number) {
|
|
94
|
-
assertValidNumber(value, "UIHorizontalDistanceConstraint.anchorA");
|
|
95
|
-
if (this.anchorAInternal !== value) {
|
|
96
|
-
this.anchorAInternal = value;
|
|
97
|
-
this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/** Updates anchor on element B */
|
|
102
|
-
public set anchorB(value: number) {
|
|
103
|
-
assertValidNumber(value, "UIHorizontalDistanceConstraint.anchorB");
|
|
104
|
-
if (this.anchorBInternal !== value) {
|
|
105
|
-
this.anchorBInternal = value;
|
|
106
|
-
this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/** Builds constraint expression for distance between anchored positions */
|
|
111
|
-
private buildLHS(): UIExpression {
|
|
112
|
-
let aExpression: UIExpression;
|
|
113
|
-
let bExpression: UIExpression;
|
|
114
|
-
|
|
115
|
-
if (isUIPlaneElement(this.a)) {
|
|
116
|
-
aExpression = new UIExpression(0, [
|
|
117
|
-
[this.a.xVariable, 1],
|
|
118
|
-
[this.a.wVariable, this.anchorAInternal],
|
|
119
|
-
]);
|
|
120
|
-
} else if (isUIPointElement(this.a)) {
|
|
121
|
-
aExpression = new UIExpression().plus(this.a.xVariable, 1);
|
|
122
|
-
} else {
|
|
123
|
-
throw new Error("UIHorizontalDistanceConstraint.buildLHS.a: invalid element type");
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
if (isUIPlaneElement(this.b)) {
|
|
127
|
-
bExpression = new UIExpression(0, [
|
|
128
|
-
[this.b.xVariable, 1],
|
|
129
|
-
[this.b.wVariable, this.anchorBInternal],
|
|
130
|
-
]);
|
|
131
|
-
} else if (isUIPointElement(this.b)) {
|
|
132
|
-
bExpression = new UIExpression().plus(this.b.xVariable, 1);
|
|
133
|
-
} else {
|
|
134
|
-
throw new Error("UIHorizontalDistanceConstraint.buildLHS.b: invalid element type");
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
return UIExpression.minus(bExpression, aExpression);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { UISingleParameterConstraintOptions } from "../UISingleParameterConstraint/UISingleParameterConstraint.Internal";
|
|
2
|
-
|
|
3
|
-
export const DEFAULT_ANCHOR = 0.5;
|
|
4
|
-
export const DEFAULT_T = 0.5;
|
|
5
|
-
|
|
6
|
-
/** Horizontal interpolation constraint options */
|
|
7
|
-
export interface UIHorizontalInterpolationConstraintOptions extends UISingleParameterConstraintOptions {
|
|
8
|
-
/** Anchor on element A (0 = left, 0.5 = center, 1 = right) */
|
|
9
|
-
anchorA: number;
|
|
10
|
-
/** Anchor on element B (0 = left, 0.5 = center, 1 = right) */
|
|
11
|
-
anchorB: number;
|
|
12
|
-
/** Anchor on element C (0 = left, 0.5 = center, 1 = right) */
|
|
13
|
-
anchorC: number;
|
|
14
|
-
/** Interpolation factor (0 = A position, 1 = B position) */
|
|
15
|
-
t: number;
|
|
16
|
-
}
|
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
assertValidInterpolationConstraintArguments,
|
|
3
|
-
assertValidNumber,
|
|
4
|
-
} from "../../miscellaneous/asserts";
|
|
5
|
-
import type { UIPlaneElement, UIPointElement } from "../../miscellaneous/shared";
|
|
6
|
-
import { isUIPlaneElement, isUIPointElement } from "../../miscellaneous/shared";
|
|
7
|
-
import { UIExpression } from "../../miscellaneous/UIExpression";
|
|
8
|
-
import { UISingleParameterConstraint } from "../UISingleParameterConstraint/UISingleParameterConstraint";
|
|
9
|
-
import type { UIHorizontalInterpolationConstraintOptions } from "./UIHorizontalInterpolationConstraint.Internal";
|
|
10
|
-
import { DEFAULT_ANCHOR, DEFAULT_T } from "./UIHorizontalInterpolationConstraint.Internal";
|
|
11
|
-
|
|
12
|
-
/** Positions element C horizontally between A and B based on interpolation factor */
|
|
13
|
-
export class UIHorizontalInterpolationConstraint extends UISingleParameterConstraint {
|
|
14
|
-
/** Solver constraint descriptor */
|
|
15
|
-
protected override readonly constraint: number;
|
|
16
|
-
|
|
17
|
-
/** Anchor on element A */
|
|
18
|
-
private anchorAInternal: number;
|
|
19
|
-
/** Anchor on element B */
|
|
20
|
-
private anchorBInternal: number;
|
|
21
|
-
/** Anchor on element C */
|
|
22
|
-
private anchorCInternal: number;
|
|
23
|
-
/** Interpolation factor */
|
|
24
|
-
private tInternal: number;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* @param a First element
|
|
28
|
-
* @param b Second element
|
|
29
|
-
* @param c Element to position between A and B
|
|
30
|
-
* @param options Interpolation configuration
|
|
31
|
-
*/
|
|
32
|
-
constructor(
|
|
33
|
-
private readonly a: UIPointElement | UIPlaneElement,
|
|
34
|
-
private readonly b: UIPointElement | UIPlaneElement,
|
|
35
|
-
private readonly c: UIPointElement | UIPlaneElement,
|
|
36
|
-
options: Partial<UIHorizontalInterpolationConstraintOptions> = {},
|
|
37
|
-
) {
|
|
38
|
-
if (options.anchorA !== undefined) {
|
|
39
|
-
assertValidNumber(
|
|
40
|
-
options.anchorA,
|
|
41
|
-
"UIHorizontalInterpolationConstraint.constructor.options.anchorA",
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
if (options.anchorB !== undefined) {
|
|
45
|
-
assertValidNumber(
|
|
46
|
-
options.anchorB,
|
|
47
|
-
"UIHorizontalInterpolationConstraint.constructor.options.anchorB",
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
if (options.anchorC !== undefined) {
|
|
51
|
-
assertValidNumber(
|
|
52
|
-
options.anchorC,
|
|
53
|
-
"UIHorizontalInterpolationConstraint.constructor.options.anchorC",
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
if (options.t !== undefined) {
|
|
57
|
-
assertValidNumber(options.t, "UIHorizontalInterpolationConstraint.constructor.options.t");
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const anchorA = options.anchorA ?? DEFAULT_ANCHOR;
|
|
61
|
-
const anchorB = options.anchorB ?? DEFAULT_ANCHOR;
|
|
62
|
-
|
|
63
|
-
super(
|
|
64
|
-
assertValidInterpolationConstraintArguments(
|
|
65
|
-
"UIHorizontalInterpolationConstraint.constructor",
|
|
66
|
-
a,
|
|
67
|
-
b,
|
|
68
|
-
c,
|
|
69
|
-
anchorA,
|
|
70
|
-
anchorB,
|
|
71
|
-
),
|
|
72
|
-
options,
|
|
73
|
-
);
|
|
74
|
-
|
|
75
|
-
this.anchorAInternal = anchorA;
|
|
76
|
-
this.anchorBInternal = anchorA;
|
|
77
|
-
this.anchorCInternal = options.anchorC ?? DEFAULT_ANCHOR;
|
|
78
|
-
this.tInternal = options.t ?? DEFAULT_T;
|
|
79
|
-
|
|
80
|
-
this.constraint = this.solverWrapper.createConstraint(
|
|
81
|
-
this.buildLHS(),
|
|
82
|
-
new UIExpression(0),
|
|
83
|
-
this.relation,
|
|
84
|
-
this.priority,
|
|
85
|
-
this.isConstraintEnabled(),
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/** Interpolation factor (0 = A position, 1 = B position) */
|
|
90
|
-
public get t(): number {
|
|
91
|
-
return this.tInternal;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/** Anchor on element A (0 = left, 0.5 = center, 1 = right) */
|
|
95
|
-
public get anchorA(): number {
|
|
96
|
-
return this.anchorAInternal;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/** Anchor on element B (0 = left, 0.5 = center, 1 = right) */
|
|
100
|
-
public get anchorB(): number {
|
|
101
|
-
return this.anchorBInternal;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/** Anchor on element C (0 = left, 0.5 = center, 1 = right) */
|
|
105
|
-
public get anchorC(): number {
|
|
106
|
-
return this.anchorCInternal;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/** Updates interpolation factor */
|
|
110
|
-
public set t(value: number) {
|
|
111
|
-
assertValidNumber(value, "UIHorizontalInterpolationConstraint.t");
|
|
112
|
-
if (this.tInternal !== value) {
|
|
113
|
-
this.tInternal = value;
|
|
114
|
-
this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/** Updates anchor on element A */
|
|
119
|
-
public set anchorA(value: number) {
|
|
120
|
-
assertValidNumber(value, "UIHorizontalInterpolationConstraint.anchorA");
|
|
121
|
-
if (this.anchorAInternal !== value) {
|
|
122
|
-
this.anchorAInternal = value;
|
|
123
|
-
this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/** Updates anchor on element B */
|
|
128
|
-
public set anchorB(value: number) {
|
|
129
|
-
assertValidNumber(value, "UIHorizontalInterpolationConstraint.anchorB");
|
|
130
|
-
if (this.anchorBInternal !== value) {
|
|
131
|
-
this.anchorBInternal = value;
|
|
132
|
-
this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/** Updates anchor on element C */
|
|
137
|
-
public set anchorC(value: number) {
|
|
138
|
-
assertValidNumber(value, "UIHorizontalInterpolationConstraint.anchorC");
|
|
139
|
-
if (this.anchorCInternal !== value) {
|
|
140
|
-
this.anchorCInternal = value;
|
|
141
|
-
this.solverWrapper.setConstraintLHS(this.constraint, this.buildLHS());
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/** Builds constraint expression: C - A*(1-t) - B*t = 0 */
|
|
146
|
-
private buildLHS(): UIExpression {
|
|
147
|
-
let aExpression: UIExpression;
|
|
148
|
-
let bExpression: UIExpression;
|
|
149
|
-
let cExpression: UIExpression;
|
|
150
|
-
|
|
151
|
-
if (isUIPlaneElement(this.a)) {
|
|
152
|
-
aExpression = new UIExpression(0, [
|
|
153
|
-
[this.a.xVariable, 1],
|
|
154
|
-
[this.a.wVariable, this.anchorAInternal],
|
|
155
|
-
]);
|
|
156
|
-
} else if (isUIPointElement(this.a)) {
|
|
157
|
-
aExpression = new UIExpression().plus(this.a.xVariable, 1);
|
|
158
|
-
} else {
|
|
159
|
-
throw new Error("UIHorizontalInterpolationConstraint.buildLHS.a: invalid element type");
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
if (isUIPlaneElement(this.b)) {
|
|
163
|
-
bExpression = new UIExpression(0, [
|
|
164
|
-
[this.b.xVariable, 1],
|
|
165
|
-
[this.b.wVariable, this.anchorBInternal],
|
|
166
|
-
]);
|
|
167
|
-
} else if (isUIPointElement(this.b)) {
|
|
168
|
-
bExpression = new UIExpression().plus(this.b.xVariable, 1);
|
|
169
|
-
} else {
|
|
170
|
-
throw new Error("UIHorizontalInterpolationConstraint.buildLHS.b: invalid element type");
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
if (isUIPlaneElement(this.c)) {
|
|
174
|
-
cExpression = new UIExpression(0, [
|
|
175
|
-
[this.c.xVariable, 1],
|
|
176
|
-
[this.c.wVariable, this.anchorCInternal],
|
|
177
|
-
]);
|
|
178
|
-
} else if (isUIPointElement(this.c)) {
|
|
179
|
-
cExpression = new UIExpression().plus(this.c.xVariable, 1);
|
|
180
|
-
} else {
|
|
181
|
-
throw new Error("UIHorizontalInterpolationConstraint.buildLHS.c: invalid element type");
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
// C - A*(1-t) - B*t = 0
|
|
185
|
-
const aScaled = aExpression.clone().multiply(1 - this.tInternal);
|
|
186
|
-
const bScaled = bExpression.clone().multiply(this.tInternal);
|
|
187
|
-
return UIExpression.minus(UIExpression.minus(cExpression, aScaled), bScaled);
|
|
188
|
-
}
|
|
189
|
-
}
|
package/src/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.ts
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
assertValidConstraintArguments,
|
|
3
|
-
assertValidPositiveNumber,
|
|
4
|
-
} from "../../miscellaneous/asserts";
|
|
5
|
-
import type { UIPlaneElement } from "../../miscellaneous/shared";
|
|
6
|
-
import { UIExpression } from "../../miscellaneous/UIExpression";
|
|
7
|
-
import { UISingleParameterConstraint } from "../UISingleParameterConstraint/UISingleParameterConstraint";
|
|
8
|
-
import type { UIHorizontalProportionConstraintOptions } from "./UIHorizontalProportionConstraint.Internal";
|
|
9
|
-
|
|
10
|
-
/** Maintains proportional width relationship (A.width * proportion = B.width) */
|
|
11
|
-
export class UIHorizontalProportionConstraint extends UISingleParameterConstraint {
|
|
12
|
-
protected override readonly constraint: number;
|
|
13
|
-
private proportionInternal: number;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @param a First element
|
|
17
|
-
* @param b Second element
|
|
18
|
-
* @param options Proportion configuration
|
|
19
|
-
*/
|
|
20
|
-
constructor(
|
|
21
|
-
private readonly a: UIPlaneElement,
|
|
22
|
-
private readonly b: UIPlaneElement,
|
|
23
|
-
options: Partial<UIHorizontalProportionConstraintOptions> = {},
|
|
24
|
-
) {
|
|
25
|
-
if (options.proportion !== undefined) {
|
|
26
|
-
assertValidPositiveNumber(
|
|
27
|
-
options.proportion,
|
|
28
|
-
"UIHorizontalProportionConstraint.constructor.options.proportion",
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
super(
|
|
33
|
-
assertValidConstraintArguments(a, b, "UIHorizontalProportionConstraint.constructor"),
|
|
34
|
-
options,
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
this.proportionInternal = options.proportion ?? 1;
|
|
38
|
-
this.constraint = this.solverWrapper.createConstraint(
|
|
39
|
-
new UIExpression(0),
|
|
40
|
-
this.buildRHS(),
|
|
41
|
-
this.relation,
|
|
42
|
-
this.priority,
|
|
43
|
-
this.isConstraintEnabled(),
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/** Current proportion multiplier */
|
|
48
|
-
public get proportion(): number {
|
|
49
|
-
return this.proportionInternal;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/** Updates proportion multiplier */
|
|
53
|
-
public set proportion(value: number) {
|
|
54
|
-
assertValidPositiveNumber(value, "UIHorizontalProportionConstraint.proportion");
|
|
55
|
-
if (this.proportionInternal !== value) {
|
|
56
|
-
this.proportionInternal = value;
|
|
57
|
-
this.solverWrapper.setConstraintRHS(this.constraint, this.buildRHS());
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/** Builds constraint expression for proportional relationship */
|
|
62
|
-
private buildRHS(): UIExpression {
|
|
63
|
-
return UIExpression.minus(
|
|
64
|
-
new UIExpression(0, [[this.a.wVariable, this.proportionInternal]]),
|
|
65
|
-
new UIExpression(0, [[this.b.wVariable, 1]]),
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import type { UILayer } from "../../layers/UILayer/UILayer";
|
|
2
|
-
import { resolveOrientation, UIOrientation } from "../../miscellaneous/UIOrientation";
|
|
3
|
-
import type { UIPriority } from "../../miscellaneous/UIPriority";
|
|
4
|
-
import { resolvePriority } from "../../miscellaneous/UIPriority";
|
|
5
|
-
import type { UIRelation } from "../../miscellaneous/UIRelation";
|
|
6
|
-
import { resolveRelation } from "../../miscellaneous/UIRelation";
|
|
7
|
-
import { UIConstraint } from "../UIConstraint";
|
|
8
|
-
import type { UISingleParameterConstraintOptions } from "./UISingleParameterConstraint.Internal";
|
|
9
|
-
|
|
10
|
-
/** Base class for constraints with priority, relation, and orientation */
|
|
11
|
-
export abstract class UISingleParameterConstraint extends UIConstraint {
|
|
12
|
-
/** Constraint priority */
|
|
13
|
-
private priorityInternal: UIPriority;
|
|
14
|
-
/** Constraint relation */
|
|
15
|
-
private relationInternal: UIRelation;
|
|
16
|
-
/** Constraint orientation */
|
|
17
|
-
private orientationInternal: UIOrientation;
|
|
18
|
-
|
|
19
|
-
/** Solver constraint descriptor */
|
|
20
|
-
protected abstract readonly constraint: number;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* @param layer Layer containing this constraint
|
|
24
|
-
* @param options Constraint configuration
|
|
25
|
-
*/
|
|
26
|
-
constructor(layer: UILayer, options?: Partial<UISingleParameterConstraintOptions>) {
|
|
27
|
-
super(layer, options?.name);
|
|
28
|
-
this.priorityInternal = resolvePriority(options?.priority);
|
|
29
|
-
this.relationInternal = resolveRelation(options?.relation);
|
|
30
|
-
this.orientationInternal = resolveOrientation(options?.orientation);
|
|
31
|
-
this.layer.signalOrientationChanged.on(this.onOrientationChange);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/** Constraint priority */
|
|
35
|
-
public get priority(): UIPriority {
|
|
36
|
-
return this.priorityInternal;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/** Constraint relation */
|
|
40
|
-
public get relation(): UIRelation {
|
|
41
|
-
return this.relationInternal;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/** When constraint is active */
|
|
45
|
-
public get orientation(): UIOrientation {
|
|
46
|
-
return this.orientationInternal;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/** Updates constraint priority */
|
|
50
|
-
public set priority(value: UIPriority) {
|
|
51
|
-
if (value !== this.priorityInternal) {
|
|
52
|
-
this.priorityInternal = value;
|
|
53
|
-
this.solverWrapper.setConstraintPriority(this.constraint, this.priorityInternal);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/** Updates constraint relation */
|
|
58
|
-
public set relation(value: UIRelation) {
|
|
59
|
-
if (value !== this.relationInternal) {
|
|
60
|
-
this.relationInternal = value;
|
|
61
|
-
this.solverWrapper.setConstraintRelation(this.constraint, this.relationInternal);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/** Updates when constraint is active */
|
|
66
|
-
public set orientation(value: UIOrientation) {
|
|
67
|
-
if (value !== this.orientationInternal) {
|
|
68
|
-
this.orientationInternal = value;
|
|
69
|
-
this.onOrientationChange();
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/** Removes constraint from solver and cleans up listeners */
|
|
74
|
-
public destroy(): void {
|
|
75
|
-
this.layer.signalOrientationChanged.off(this.onOrientationChange);
|
|
76
|
-
this.solverWrapper.removeConstraint(this.constraint);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Checks if constraint should be active for current orientation.
|
|
81
|
-
* @returns True if orientation is ALWAYS or matches layer orientation
|
|
82
|
-
*/
|
|
83
|
-
protected isConstraintEnabled(): boolean {
|
|
84
|
-
return (
|
|
85
|
-
this.orientationInternal === UIOrientation.ALWAYS ||
|
|
86
|
-
this.orientationInternal === this.layer.orientation
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/** Updates constraint enabled state when layer orientation changes */
|
|
91
|
-
private readonly onOrientationChange = (): void => {
|
|
92
|
-
this.solverWrapper.setConstraintEnabled(this.constraint, this.isConstraintEnabled());
|
|
93
|
-
};
|
|
94
|
-
}
|
package/src/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { UISingleParameterConstraintOptions } from "../UISingleParameterConstraint/UISingleParameterConstraint.Internal";
|
|
2
|
-
|
|
3
|
-
export const DEFAULT_ANCHOR = 0.5;
|
|
4
|
-
|
|
5
|
-
/** Vertical distance constraint options */
|
|
6
|
-
export interface UIVerticalDistanceConstraintOptions extends UISingleParameterConstraintOptions {
|
|
7
|
-
/** Anchor on element A (0 = bottom, 0.5 = center, 1 = top) */
|
|
8
|
-
anchorA: number;
|
|
9
|
-
/** Anchor on element B (0 = bottom, 0.5 = center, 1 = top) */
|
|
10
|
-
anchorB: number;
|
|
11
|
-
/** Distance in world units */
|
|
12
|
-
distance: number;
|
|
13
|
-
}
|