laymur 0.23.0 → 0.25.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/README.md +1 -1
- package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.js +1 -0
- package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.d.ts +3 -3
- package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.js +14 -16
- package/dist/core/constraints/UIConstraint.d.ts +22 -2
- package/dist/core/constraints/UIConstraint.js +26 -3
- package/dist/core/constraints/UICustomConstraint.d.ts +4 -4
- package/dist/core/constraints/UICustomConstraint.js +15 -15
- package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.js +1 -0
- package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.d.ts +3 -3
- package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.js +11 -13
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.js +1 -3
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.d.ts +3 -3
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.js +30 -30
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.js +2 -4
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.d.ts +3 -3
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.js +40 -39
- package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.js +1 -0
- package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.d.ts +3 -3
- package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.js +13 -15
- package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.d.ts +3 -3
- package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.js +1 -0
- package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.d.ts +13 -7
- package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.js +37 -30
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.js +1 -3
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.d.ts +3 -3
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.js +30 -30
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.js +2 -4
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.d.ts +3 -3
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.js +40 -39
- package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.js +1 -0
- package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.d.ts +3 -3
- package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.js +13 -15
- package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.js +1 -0
- package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.d.ts +3 -3
- package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.js +11 -13
- package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.d.ts +3 -3
- package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.js +1 -3
- package/dist/core/constraints/builders/UIConstraint2DBuilder.d.ts +11 -11
- package/dist/core/constraints/builders/UIConstraint2DBuilder.js +10 -13
- package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.d.ts +1 -1
- package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.js +1 -3
- package/dist/core/constraints/builders/UICoverConstraintBuilder.d.ts +7 -7
- package/dist/core/constraints/builders/UICoverConstraintBuilder.js +10 -13
- package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.d.ts +1 -1
- package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.js +1 -3
- package/dist/core/constraints/builders/UIFitConstraintBuilder.d.ts +7 -7
- package/dist/core/constraints/builders/UIFitConstraintBuilder.js +10 -13
- package/dist/core/elements/UIAnchor/UIAnchor.Internal.js +3 -5
- package/dist/core/elements/UIAnchor/UIAnchor.d.ts +23 -5
- package/dist/core/elements/UIAnchor/UIAnchor.js +42 -8
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.d.ts +2 -2
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.js +4 -6
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.d.ts +10 -10
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.js +108 -111
- package/dist/core/elements/UIDummy/UIDummy.Internal.d.ts +4 -4
- package/dist/core/elements/UIDummy/UIDummy.Internal.js +5 -8
- package/dist/core/elements/UIDummy/UIDummy.d.ts +19 -11
- package/dist/core/elements/UIDummy/UIDummy.js +59 -42
- package/dist/core/elements/UIElement/UIElement.Internal.d.ts +5 -5
- package/dist/core/elements/UIElement/UIElement.Internal.js +9 -12
- package/dist/core/elements/UIElement/UIElement.d.ts +11 -11
- package/dist/core/elements/UIElement/UIElement.js +57 -60
- package/dist/core/elements/UIGraphics/UIGraphics.Internal.d.ts +3 -3
- package/dist/core/elements/UIGraphics/UIGraphics.Internal.js +4 -7
- package/dist/core/elements/UIGraphics/UIGraphics.d.ts +7 -7
- package/dist/core/elements/UIGraphics/UIGraphics.js +44 -47
- package/dist/core/elements/UIImage/UIImage.Internal.d.ts +2 -2
- package/dist/core/elements/UIImage/UIImage.Internal.js +1 -0
- package/dist/core/elements/UIImage/UIImage.d.ts +9 -9
- package/dist/core/elements/UIImage/UIImage.js +21 -24
- package/dist/core/elements/UINineSlice/UINineSlice.Internal.d.ts +3 -3
- package/dist/core/elements/UINineSlice/UINineSlice.Internal.js +3 -5
- package/dist/core/elements/UINineSlice/UINineSlice.d.ts +12 -12
- package/dist/core/elements/UINineSlice/UINineSlice.js +71 -73
- package/dist/core/elements/UIProgress/UIProgress.Internal.d.ts +3 -4
- package/dist/core/elements/UIProgress/UIProgress.Internal.js +1 -3
- package/dist/core/elements/UIProgress/UIProgress.d.ts +10 -10
- package/dist/core/elements/UIProgress/UIProgress.js +59 -62
- package/dist/core/elements/UIScene/UIScene.Internal.d.ts +3 -3
- package/dist/core/elements/UIScene/UIScene.Internal.js +11 -14
- package/dist/core/elements/UIScene/UIScene.d.ts +8 -8
- package/dist/core/elements/UIScene/UIScene.js +68 -69
- package/dist/core/elements/UIText/UIText.Bidi.d.ts +2 -2
- package/dist/core/elements/UIText/UIText.Bidi.js +3 -5
- package/dist/core/elements/UIText/UIText.Interfaces.d.ts +6 -2
- package/dist/core/elements/UIText/UIText.Interfaces.js +1 -0
- package/dist/core/elements/UIText/UIText.Internal.d.ts +4 -4
- package/dist/core/elements/UIText/UIText.Internal.js +5 -7
- package/dist/core/elements/UIText/UIText.Measuring.d.ts +14 -7
- package/dist/core/elements/UIText/UIText.Measuring.js +115 -55
- package/dist/core/elements/UIText/UIText.Rendering.d.ts +3 -3
- package/dist/core/elements/UIText/UIText.Rendering.js +6 -9
- package/dist/core/elements/UIText/UIText.d.ts +28 -14
- package/dist/core/elements/UIText/UIText.js +181 -141
- package/dist/core/index.d.ts +55 -54
- package/dist/core/index.js +53 -0
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.d.ts +4 -4
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.js +2 -5
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.d.ts +4 -4
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.js +43 -42
- package/dist/core/layers/UILayer/UILayer.Internal.d.ts +2 -2
- package/dist/core/layers/UILayer/UILayer.Internal.js +4 -7
- package/dist/core/layers/UILayer/UILayer.d.ts +19 -4
- package/dist/core/layers/UILayer/UILayer.js +125 -62
- package/dist/core/miscellaneous/UIBlendMode.js +1 -3
- package/dist/core/miscellaneous/UIExpression.js +16 -19
- package/dist/core/miscellaneous/UIMode.js +3 -5
- package/dist/core/miscellaneous/UIOrientation.js +2 -4
- package/dist/core/miscellaneous/UIPriority.js +5 -8
- package/dist/core/miscellaneous/UIRelation.js +5 -8
- package/dist/core/miscellaneous/UITransparencyMode.js +1 -3
- package/dist/core/miscellaneous/area/UIArea.js +1 -3
- package/dist/core/miscellaneous/area/UIAreaCircle.d.ts +1 -1
- package/dist/core/miscellaneous/area/UIAreaCircle.js +3 -6
- package/dist/core/miscellaneous/area/UIAreaPolygon.d.ts +2 -2
- package/dist/core/miscellaneous/area/UIAreaPolygon.js +3 -6
- package/dist/core/miscellaneous/area/UIAreaRectangle.d.ts +1 -1
- package/dist/core/miscellaneous/area/UIAreaRectangle.js +3 -6
- package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.d.ts +1 -1
- package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.js +3 -6
- package/dist/core/miscellaneous/asserts.d.ts +30 -1
- package/dist/core/miscellaneous/asserts.js +87 -19
- package/dist/core/miscellaneous/canvas.js +13 -7
- package/dist/core/miscellaneous/color/UIColor.Internal.d.ts +1 -1
- package/dist/core/miscellaneous/color/UIColor.Internal.js +1 -3
- package/dist/core/miscellaneous/color/UIColor.d.ts +1 -1
- package/dist/core/miscellaneous/color/UIColor.js +202 -205
- package/dist/core/miscellaneous/computeTransform.d.ts +1 -1
- package/dist/core/miscellaneous/computeTransform.js +4 -7
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.d.ts +10 -5
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.js +63 -58
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Layout.d.ts +52 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Layout.js +110 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.js +181 -261
- package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.d.ts +3 -3
- package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.js +1 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.js +209 -115
- package/dist/core/miscellaneous/generic-plane/shared.d.ts +12 -12
- package/dist/core/miscellaneous/generic-plane/shared.js +28 -23
- package/dist/core/miscellaneous/insets/UIInsets.Internal.js +1 -3
- package/dist/core/miscellaneous/insets/UIInsets.d.ts +1 -1
- package/dist/core/miscellaneous/insets/UIInsets.js +96 -99
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.js +1 -3
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.d.ts +1 -1
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.js +14 -17
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.d.ts +2 -2
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.js +13 -16
- package/dist/core/miscellaneous/math.js +3 -5
- package/dist/core/miscellaneous/micro/UIMicro.Internal.js +6 -8
- package/dist/core/miscellaneous/micro/UIMicro.d.ts +1 -1
- package/dist/core/miscellaneous/micro/UIMicro.js +91 -94
- package/dist/core/miscellaneous/resize-policy/UIResizePolicy.js +1 -3
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.js +12 -15
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.js +13 -16
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.js +13 -16
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.js +12 -15
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.js +13 -16
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.js +13 -16
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.js +3 -6
- package/dist/core/miscellaneous/shared.d.ts +1 -1
- package/dist/core/miscellaneous/shared.js +4 -7
- package/dist/core/miscellaneous/text-span/UITextSpan.Internal.d.ts +1 -1
- package/dist/core/miscellaneous/text-span/UITextSpan.Internal.js +1 -0
- package/dist/core/miscellaneous/text-span/UITextSpan.d.ts +2 -2
- package/dist/core/miscellaneous/text-span/UITextSpan.js +10 -13
- package/dist/core/miscellaneous/text-style/UITextStyle.Internal.js +15 -17
- package/dist/core/miscellaneous/text-style/UITextStyle.d.ts +13 -2
- package/dist/core/miscellaneous/text-style/UITextStyle.js +222 -207
- package/dist/core/miscellaneous/texture/UITextureView.Internal.d.ts +7 -0
- package/dist/core/miscellaneous/texture/UITextureView.Internal.js +16 -6
- package/dist/core/miscellaneous/texture/UITextureView.d.ts +1 -1
- package/dist/core/miscellaneous/texture/UITextureView.js +113 -117
- package/dist/core/miscellaneous/webglCapabilities.js +3 -4
- package/dist/core/shaders/UIImage.d.ts +9 -0
- package/dist/core/shaders/UIImage.js +14 -0
- package/dist/core/shaders/UINineSlice.d.ts +11 -0
- package/dist/core/shaders/UINineSlice.js +57 -0
- package/dist/core/shaders/UIProgress.d.ts +14 -0
- package/dist/core/shaders/UIProgress.js +21 -0
- package/dist/core/shaders/UIProgressMaskFunctionCircular.d.ts +2 -0
- package/dist/core/shaders/UIProgressMaskFunctionCircular.js +16 -0
- package/dist/core/shaders/UIProgressMaskFunctionDirectional.d.ts +2 -0
- package/dist/core/shaders/UIProgressMaskFunctionDirectional.js +15 -0
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.d.ts +4 -0
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.js +1 -0
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.d.ts +7 -1
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.js +50 -47
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.d.ts +5 -2
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.js +1 -0
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.d.ts +11 -3
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.js +42 -26
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.d.ts +5 -3
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.js +1 -0
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.d.ts +20 -4
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.js +138 -117
- package/dist/debug/UIAspectDebug.d.ts +3 -3
- package/dist/debug/UIAspectDebug.js +64 -68
- package/dist/debug/UIConstraintDebug.d.ts +1 -1
- package/dist/debug/UIConstraintDebug.js +1 -0
- package/dist/debug/UIHeightDebug.d.ts +3 -3
- package/dist/debug/UIHeightDebug.js +63 -67
- package/dist/debug/UIHorizontalDistanceDebug.d.ts +3 -3
- package/dist/debug/UIHorizontalDistanceDebug.js +76 -81
- package/dist/debug/UIHorizontalInterpolationDebug.d.ts +3 -3
- package/dist/debug/UIHorizontalInterpolationDebug.js +74 -78
- package/dist/debug/UILayerDebug.d.ts +1 -1
- package/dist/debug/UILayerDebug.js +55 -64
- package/dist/debug/UIVerticalDistanceDebug.d.ts +3 -3
- package/dist/debug/UIVerticalDistanceDebug.js +76 -81
- package/dist/debug/UIVerticalInterpolationDebug.d.ts +3 -3
- package/dist/debug/UIVerticalInterpolationDebug.js +74 -78
- package/dist/debug/UIWidthDebug.d.ts +3 -3
- package/dist/debug/UIWidthDebug.js +63 -67
- package/dist/debug/index.d.ts +8 -8
- package/dist/debug/index.js +8 -8
- package/dist/debug/miscellaneous.js +8 -11
- package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.d.ts +3 -3
- package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.js +13 -16
- package/dist/particles/behaviorModules/UIBehaviorModule.d.ts +1 -1
- package/dist/particles/behaviorModules/UIBehaviorModule.js +1 -3
- package/dist/particles/behaviorModules/UIBehaviorPointGravity.d.ts +3 -3
- package/dist/particles/behaviorModules/UIBehaviorPointGravity.js +37 -40
- package/dist/particles/behaviorModules/UIBehaviorScaleOscillation.d.ts +41 -0
- package/dist/particles/behaviorModules/UIBehaviorScaleOscillation.js +87 -0
- package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.d.ts +2 -2
- package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.js +17 -20
- package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.d.ts +2 -2
- package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.js +13 -16
- package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.d.ts +2 -2
- package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.js +21 -24
- package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.d.ts +2 -2
- package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.js +13 -16
- package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.d.ts +2 -2
- package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.js +21 -24
- package/dist/particles/elements/UIEmitter.Internal.d.ts +2 -2
- package/dist/particles/elements/UIEmitter.Internal.js +6 -9
- package/dist/particles/elements/UIEmitter.d.ts +17 -11
- package/dist/particles/elements/UIEmitter.js +100 -88
- package/dist/particles/index.d.ts +20 -18
- package/dist/particles/index.js +19 -18
- package/dist/particles/instancedParticle/UIInstancedParticle.Internal.d.ts +1 -1
- package/dist/particles/instancedParticle/UIInstancedParticle.Internal.js +14 -15
- package/dist/particles/instancedParticle/UIInstancedParticle.d.ts +4 -1
- package/dist/particles/instancedParticle/UIInstancedParticle.js +40 -32
- package/dist/particles/miscellaneous/miscellaneous.d.ts +3 -3
- package/dist/particles/miscellaneous/miscellaneous.js +26 -27
- package/dist/particles/renderingModules/UIRenderingColorOverLife.d.ts +2 -2
- package/dist/particles/renderingModules/UIRenderingColorOverLife.js +5 -8
- package/dist/particles/renderingModules/UIRenderingColorOverVelocity.d.ts +2 -2
- package/dist/particles/renderingModules/UIRenderingColorOverVelocity.js +6 -9
- package/dist/particles/renderingModules/UIRenderingModule.js +1 -3
- package/dist/particles/renderingModules/UIRenderingTexture.d.ts +2 -2
- package/dist/particles/renderingModules/UIRenderingTexture.js +4 -7
- package/dist/particles/shaders/UIRenderingColorOverLife.d.ts +2 -0
- package/dist/particles/shaders/UIRenderingColorOverLife.js +7 -0
- package/dist/particles/shaders/UIRenderingColorOverVelocity.d.ts +9 -0
- package/dist/particles/shaders/UIRenderingColorOverVelocity.js +16 -0
- package/dist/particles/shaders/UIRenderingTexture.d.ts +2 -0
- package/dist/particles/shaders/UIRenderingTexture.js +7 -0
- package/dist/particles/spawnModules/UISpawnModule.d.ts +1 -1
- package/dist/particles/spawnModules/UISpawnModule.js +1 -3
- package/dist/particles/spawnModules/UISpawnOffset.d.ts +3 -3
- package/dist/particles/spawnModules/UISpawnOffset.js +12 -15
- package/dist/particles/spawnModules/UISpawnRandomLifetime.d.ts +2 -2
- package/dist/particles/spawnModules/UISpawnRandomLifetime.js +13 -16
- package/dist/particles/spawnModules/UISpawnRandomRotation.d.ts +2 -2
- package/dist/particles/spawnModules/UISpawnRandomRotation.js +13 -16
- package/dist/particles/spawnModules/UISpawnRandomScale.d.ts +2 -2
- package/dist/particles/spawnModules/UISpawnRandomScale.js +19 -22
- package/dist/particles/spawnModules/UISpawnRandomTorque.d.ts +2 -2
- package/dist/particles/spawnModules/UISpawnRandomTorque.js +13 -16
- package/dist/particles/spawnModules/UISpawnRandomVelocity.d.ts +2 -2
- package/dist/particles/spawnModules/UISpawnRandomVelocity.js +21 -24
- package/dist/particles/spawnModules/UISpawnRectangle.d.ts +3 -3
- package/dist/particles/spawnModules/UISpawnRectangle.js +21 -24
- package/package.json +13 -17
- package/dist/_virtual/2d.js +0 -3
- package/dist/_virtual/3d.js +0 -3
- package/dist/_virtual/4d.js +0 -3
- package/dist/_virtual/mod.js +0 -5
- package/dist/_virtual/mod2.js +0 -3
- package/dist/core/shaders/UIImage.glsl.js +0 -3
- package/dist/core/shaders/UINineSlice.glsl.js +0 -3
- package/dist/core/shaders/UIProgress.glsl.js +0 -3
- package/dist/core/shaders/UIProgressMaskFunctionCircular.glsl.js +0 -3
- package/dist/core/shaders/UIProgressMaskFunctionDirectional.glsl.js +0 -3
- package/dist/index.js +0 -52
- package/dist/node_modules/fast-simplex-noise/lib/2d.js +0 -93
- package/dist/node_modules/fast-simplex-noise/lib/3d.js +0 -142
- package/dist/node_modules/fast-simplex-noise/lib/4d.js +0 -196
- package/dist/node_modules/fast-simplex-noise/lib/mod.js +0 -24
- package/dist/node_modules/three/examples/jsm/lines/Line2.js +0 -56
- package/dist/node_modules/three/examples/jsm/lines/LineGeometry.js +0 -157
- package/dist/node_modules/three/examples/jsm/lines/LineMaterial.js +0 -691
- package/dist/node_modules/three/examples/jsm/lines/LineSegments2.js +0 -415
- package/dist/node_modules/three/examples/jsm/lines/LineSegmentsGeometry.js +0 -289
- package/dist/particles/shaders/UIRenderingColorOverLife.glsl.js +0 -3
- package/dist/particles/shaders/UIRenderingColorOverVelocity.glsl.js +0 -3
- package/dist/particles/shaders/UIRenderingTexture.glsl.js +0 -3
|
@@ -1,43 +1,49 @@
|
|
|
1
|
-
import { Texture, Vector2, Vector3, Vector4
|
|
2
|
-
import { UIColor } from
|
|
3
|
-
import { checkSRGBSupport } from
|
|
4
|
-
|
|
1
|
+
import { Matrix3, Matrix4, Texture, Vector2, Vector3, Vector4 } from "three";
|
|
2
|
+
import { UIColor } from "../color/UIColor.js";
|
|
3
|
+
import { checkSRGBSupport } from "../webglCapabilities.js";
|
|
5
4
|
const GLSL_TYPE_INFO_FLOAT = Object.freeze({
|
|
6
5
|
glslTypeName: "float",
|
|
7
6
|
bufferSize: 1,
|
|
7
|
+
columnCount: 1,
|
|
8
8
|
instantiable: true,
|
|
9
9
|
});
|
|
10
10
|
const GLSL_TYPE_INFO_SAMPLER2D = Object.freeze({
|
|
11
11
|
glslTypeName: "sampler2D",
|
|
12
12
|
bufferSize: -1,
|
|
13
|
+
columnCount: 0,
|
|
13
14
|
instantiable: false,
|
|
14
15
|
});
|
|
15
16
|
const GLSL_TYPE_INFO_VEC2 = Object.freeze({
|
|
16
17
|
glslTypeName: "vec2",
|
|
17
18
|
bufferSize: 2,
|
|
19
|
+
columnCount: 1,
|
|
18
20
|
instantiable: true,
|
|
19
21
|
});
|
|
20
22
|
const GLSL_TYPE_INFO_VEC3 = Object.freeze({
|
|
21
23
|
glslTypeName: "vec3",
|
|
22
24
|
bufferSize: 3,
|
|
25
|
+
columnCount: 1,
|
|
23
26
|
instantiable: true,
|
|
24
27
|
});
|
|
25
28
|
const GLSL_TYPE_INFO_VEC4 = Object.freeze({
|
|
26
29
|
glslTypeName: "vec4",
|
|
27
30
|
bufferSize: 4,
|
|
31
|
+
columnCount: 1,
|
|
28
32
|
instantiable: true,
|
|
29
33
|
});
|
|
30
34
|
const GLSL_TYPE_INFO_MAT3 = Object.freeze({
|
|
31
35
|
glslTypeName: "mat3",
|
|
32
36
|
bufferSize: 9,
|
|
37
|
+
columnCount: 3,
|
|
33
38
|
instantiable: true,
|
|
34
39
|
});
|
|
35
40
|
const GLSL_TYPE_INFO_MAT4 = Object.freeze({
|
|
36
41
|
glslTypeName: "mat4",
|
|
37
42
|
bufferSize: 16,
|
|
43
|
+
columnCount: 4,
|
|
38
44
|
instantiable: true,
|
|
39
45
|
});
|
|
40
|
-
function resolveGLSLTypeInfo(value) {
|
|
46
|
+
export function resolveGLSLTypeInfo(value) {
|
|
41
47
|
if (typeof value === "string") {
|
|
42
48
|
switch (value) {
|
|
43
49
|
case "number":
|
|
@@ -57,7 +63,7 @@ function resolveGLSLTypeInfo(value) {
|
|
|
57
63
|
case "Matrix4":
|
|
58
64
|
return GLSL_TYPE_INFO_MAT4;
|
|
59
65
|
default:
|
|
60
|
-
throw new Error(`resolveGLSLTypeInfo.value: unsupported property type name`);
|
|
66
|
+
throw new Error(`resolveGLSLTypeInfo.value: unsupported property type name "${value}"`);
|
|
61
67
|
}
|
|
62
68
|
}
|
|
63
69
|
if (typeof value === "function") {
|
|
@@ -85,7 +91,7 @@ function resolveGLSLTypeInfo(value) {
|
|
|
85
91
|
if (value === Matrix4) {
|
|
86
92
|
return GLSL_TYPE_INFO_MAT4;
|
|
87
93
|
}
|
|
88
|
-
throw new Error(`resolveGLSLTypeInfo.value: unsupported property type constructor`);
|
|
94
|
+
throw new Error(`resolveGLSLTypeInfo.value: unsupported property type constructor ${value.name}`);
|
|
89
95
|
}
|
|
90
96
|
if (typeof value === "number") {
|
|
91
97
|
return GLSL_TYPE_INFO_FLOAT;
|
|
@@ -113,14 +119,14 @@ function resolveGLSLTypeInfo(value) {
|
|
|
113
119
|
}
|
|
114
120
|
throw new Error(`resolveGLSLTypeInfo.value: unsupported property type`);
|
|
115
121
|
}
|
|
116
|
-
function resolvePropertyUniform(name, material) {
|
|
122
|
+
export function resolvePropertyUniform(name, material) {
|
|
117
123
|
const uniform = material.uniforms[`p_${name}`];
|
|
118
124
|
if (uniform === undefined) {
|
|
119
|
-
throw new Error(`resolvePropertyUniform.name: unknown uniform`);
|
|
125
|
+
throw new Error(`resolvePropertyUniform.name: unknown uniform "p_${name}"`);
|
|
120
126
|
}
|
|
121
127
|
return uniform;
|
|
122
128
|
}
|
|
123
|
-
function arePropertiesPartiallyCompatible(full, partial) {
|
|
129
|
+
export function arePropertiesPartiallyCompatible(full, partial) {
|
|
124
130
|
for (const key in partial) {
|
|
125
131
|
if (!(key in full)) {
|
|
126
132
|
return false;
|
|
@@ -136,7 +142,7 @@ function arePropertiesPartiallyCompatible(full, partial) {
|
|
|
136
142
|
}
|
|
137
143
|
return true;
|
|
138
144
|
}
|
|
139
|
-
function convertUIPropertiesToGLProperties(uiProperties) {
|
|
145
|
+
export function convertUIPropertiesToGLProperties(uiProperties) {
|
|
140
146
|
const glProperties = {};
|
|
141
147
|
for (const name in uiProperties) {
|
|
142
148
|
const value = uiProperties[name];
|
|
@@ -144,20 +150,20 @@ function convertUIPropertiesToGLProperties(uiProperties) {
|
|
|
144
150
|
}
|
|
145
151
|
return glProperties;
|
|
146
152
|
}
|
|
147
|
-
function cloneProperty(property) {
|
|
153
|
+
export function cloneProperty(property) {
|
|
148
154
|
if (typeof property === "number" || property instanceof Texture) {
|
|
149
155
|
return property;
|
|
150
156
|
}
|
|
151
157
|
return property.clone();
|
|
152
158
|
}
|
|
153
|
-
function cloneProperties(properties) {
|
|
159
|
+
export function cloneProperties(properties) {
|
|
154
160
|
const result = {};
|
|
155
161
|
for (const name in properties) {
|
|
156
162
|
result[name] = cloneProperty(properties[name]);
|
|
157
163
|
}
|
|
158
164
|
return result;
|
|
159
165
|
}
|
|
160
|
-
function cloneGLProperties(properties) {
|
|
166
|
+
export function cloneGLProperties(properties) {
|
|
161
167
|
const result = {};
|
|
162
168
|
for (const name in properties) {
|
|
163
169
|
const prop = properties[name];
|
|
@@ -168,15 +174,16 @@ function cloneGLProperties(properties) {
|
|
|
168
174
|
}
|
|
169
175
|
return result;
|
|
170
176
|
}
|
|
177
|
+
/**
|
|
178
|
+
* Index of the zIndex in Matrix4.elements: the zIndex is carried in translation z rather than as a
|
|
179
|
+
* separate field.
|
|
180
|
+
*/
|
|
181
|
+
export const TRANSFORM_ZINDEX_OFFSET = 14;
|
|
171
182
|
/** Extracts zIndex from transform matrix (translation.z component) */
|
|
172
|
-
function extractZIndex(transform) {
|
|
173
|
-
return transform.elements[
|
|
174
|
-
}
|
|
175
|
-
/** Extracts zIndex from transform buffer at given instance index */
|
|
176
|
-
function extractZIndexFromBuffer(buffer, instanceIndex) {
|
|
177
|
-
return buffer[instanceIndex * 16 + 14];
|
|
183
|
+
export function extractZIndex(transform) {
|
|
184
|
+
return transform.elements[TRANSFORM_ZINDEX_OFFSET];
|
|
178
185
|
}
|
|
179
|
-
function buildGenericPlaneFragmentShader(uniformDeclarations, varyingDeclarations, source, alphaTestValue, usePremultipliedAlpha) {
|
|
186
|
+
export function buildGenericPlaneFragmentShader(uniformDeclarations, varyingDeclarations, source, alphaTestValue, usePremultipliedAlpha) {
|
|
180
187
|
return `
|
|
181
188
|
// Defines
|
|
182
189
|
#define PI 3.14159265359
|
|
@@ -287,5 +294,3 @@ function buildGenericPlaneFragmentShader(uniformDeclarations, varyingDeclaration
|
|
|
287
294
|
}
|
|
288
295
|
`;
|
|
289
296
|
}
|
|
290
|
-
|
|
291
|
-
export { arePropertiesPartiallyCompatible, buildGenericPlaneFragmentShader, cloneGLProperties, cloneProperties, cloneProperty, convertUIPropertiesToGLProperties, extractZIndex, extractZIndexFromBuffer, resolveGLSLTypeInfo, resolvePropertyUniform };
|
|
@@ -1,124 +1,123 @@
|
|
|
1
|
-
import { Vector4 } from
|
|
2
|
-
import { assertValidNonNegativeNumber } from
|
|
3
|
-
import { INSETS_DEFAULT_VALUE } from
|
|
4
|
-
|
|
1
|
+
import { Vector4 } from "three";
|
|
2
|
+
import { assertValidNonNegativeNumber } from "../asserts.js";
|
|
3
|
+
import { INSETS_DEFAULT_VALUE } from "./UIInsets.Internal.js";
|
|
5
4
|
/** Insets values for four sides */
|
|
6
|
-
class UIInsets {
|
|
5
|
+
export class UIInsets {
|
|
7
6
|
/**
|
|
8
7
|
* Creates UIInsets instance.
|
|
9
8
|
*
|
|
10
9
|
* @param config - Insets configuration
|
|
11
10
|
*/
|
|
12
11
|
constructor(config) {
|
|
13
|
-
this.
|
|
14
|
-
this.
|
|
15
|
-
this.
|
|
16
|
-
this.
|
|
17
|
-
this.
|
|
12
|
+
this.lInternal = INSETS_DEFAULT_VALUE;
|
|
13
|
+
this.rInternal = INSETS_DEFAULT_VALUE;
|
|
14
|
+
this.tInternal = INSETS_DEFAULT_VALUE;
|
|
15
|
+
this.bInternal = INSETS_DEFAULT_VALUE;
|
|
16
|
+
this.dirtyInternal = false;
|
|
18
17
|
this.set(config);
|
|
19
18
|
}
|
|
20
19
|
/** Left inset */
|
|
21
20
|
get left() {
|
|
22
|
-
return this.
|
|
21
|
+
return this.lInternal;
|
|
23
22
|
}
|
|
24
23
|
/** Right inset */
|
|
25
24
|
get right() {
|
|
26
|
-
return this.
|
|
25
|
+
return this.rInternal;
|
|
27
26
|
}
|
|
28
27
|
/** Top inset */
|
|
29
28
|
get top() {
|
|
30
|
-
return this.
|
|
29
|
+
return this.tInternal;
|
|
31
30
|
}
|
|
32
31
|
/** Bottom inset */
|
|
33
32
|
get bottom() {
|
|
34
|
-
return this.
|
|
33
|
+
return this.bInternal;
|
|
35
34
|
}
|
|
36
35
|
/** @internal */
|
|
37
36
|
get dirty() {
|
|
38
|
-
return this.
|
|
37
|
+
return this.dirtyInternal;
|
|
39
38
|
}
|
|
40
39
|
/** Left inset */
|
|
41
40
|
set left(value) {
|
|
42
41
|
assertValidNonNegativeNumber(value, "UIInsets.left");
|
|
43
|
-
if (this.
|
|
44
|
-
this.
|
|
45
|
-
this.
|
|
42
|
+
if (this.lInternal !== value) {
|
|
43
|
+
this.lInternal = value;
|
|
44
|
+
this.dirtyInternal = true;
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
47
|
/** Right inset */
|
|
49
48
|
set right(value) {
|
|
50
49
|
assertValidNonNegativeNumber(value, "UIInsets.right");
|
|
51
|
-
if (this.
|
|
52
|
-
this.
|
|
53
|
-
this.
|
|
50
|
+
if (this.rInternal !== value) {
|
|
51
|
+
this.rInternal = value;
|
|
52
|
+
this.dirtyInternal = true;
|
|
54
53
|
}
|
|
55
54
|
}
|
|
56
55
|
/** Top inset */
|
|
57
56
|
set top(value) {
|
|
58
57
|
assertValidNonNegativeNumber(value, "UIInsets.top");
|
|
59
|
-
if (this.
|
|
60
|
-
this.
|
|
61
|
-
this.
|
|
58
|
+
if (this.tInternal !== value) {
|
|
59
|
+
this.tInternal = value;
|
|
60
|
+
this.dirtyInternal = true;
|
|
62
61
|
}
|
|
63
62
|
}
|
|
64
63
|
/** Bottom inset */
|
|
65
64
|
set bottom(value) {
|
|
66
65
|
assertValidNonNegativeNumber(value, "UIInsets.bottom");
|
|
67
|
-
if (this.
|
|
68
|
-
this.
|
|
69
|
-
this.
|
|
66
|
+
if (this.bInternal !== value) {
|
|
67
|
+
this.bInternal = value;
|
|
68
|
+
this.dirtyInternal = true;
|
|
70
69
|
}
|
|
71
70
|
}
|
|
72
71
|
/** Sets left and right to same value */
|
|
73
72
|
setHorizontal(value) {
|
|
74
73
|
assertValidNonNegativeNumber(value, "UIInsets.setHorizontal.value");
|
|
75
|
-
if (this.
|
|
76
|
-
this.
|
|
77
|
-
this.
|
|
78
|
-
this.
|
|
74
|
+
if (this.lInternal !== value || this.rInternal !== value) {
|
|
75
|
+
this.lInternal = value;
|
|
76
|
+
this.rInternal = value;
|
|
77
|
+
this.dirtyInternal = true;
|
|
79
78
|
}
|
|
80
79
|
}
|
|
81
80
|
/** Sets top and bottom to same value */
|
|
82
81
|
setVertical(value) {
|
|
83
82
|
assertValidNonNegativeNumber(value, "UIInsets.setVertical.value");
|
|
84
|
-
if (this.
|
|
85
|
-
this.
|
|
86
|
-
this.
|
|
87
|
-
this.
|
|
83
|
+
if (this.tInternal !== value || this.bInternal !== value) {
|
|
84
|
+
this.tInternal = value;
|
|
85
|
+
this.bInternal = value;
|
|
86
|
+
this.dirtyInternal = true;
|
|
88
87
|
}
|
|
89
88
|
}
|
|
90
89
|
/** Sets all sides to same value */
|
|
91
90
|
setUnified(value) {
|
|
92
91
|
assertValidNonNegativeNumber(value, "UIInsets.setUnified.value");
|
|
93
|
-
if (this.
|
|
94
|
-
this.
|
|
95
|
-
this.
|
|
96
|
-
this.
|
|
97
|
-
this.
|
|
98
|
-
this.
|
|
99
|
-
this.
|
|
100
|
-
this.
|
|
101
|
-
this.
|
|
92
|
+
if (this.lInternal !== value ||
|
|
93
|
+
this.rInternal !== value ||
|
|
94
|
+
this.tInternal !== value ||
|
|
95
|
+
this.bInternal !== value) {
|
|
96
|
+
this.lInternal = value;
|
|
97
|
+
this.rInternal = value;
|
|
98
|
+
this.tInternal = value;
|
|
99
|
+
this.bInternal = value;
|
|
100
|
+
this.dirtyInternal = true;
|
|
102
101
|
}
|
|
103
102
|
}
|
|
104
103
|
/** Sets insets */
|
|
105
104
|
set(config) {
|
|
106
|
-
const lOld = this.
|
|
107
|
-
const rOld = this.
|
|
108
|
-
const tOld = this.
|
|
109
|
-
const bOld = this.
|
|
105
|
+
const lOld = this.lInternal;
|
|
106
|
+
const rOld = this.rInternal;
|
|
107
|
+
const tOld = this.tInternal;
|
|
108
|
+
const bOld = this.bInternal;
|
|
110
109
|
if (config === undefined) {
|
|
111
|
-
this.
|
|
112
|
-
this.
|
|
113
|
-
this.
|
|
114
|
-
this.
|
|
110
|
+
this.lInternal = INSETS_DEFAULT_VALUE;
|
|
111
|
+
this.rInternal = INSETS_DEFAULT_VALUE;
|
|
112
|
+
this.tInternal = INSETS_DEFAULT_VALUE;
|
|
113
|
+
this.bInternal = INSETS_DEFAULT_VALUE;
|
|
115
114
|
}
|
|
116
115
|
else if (typeof config === "number") {
|
|
117
116
|
assertValidNonNegativeNumber(config, "UIInsets.set.config");
|
|
118
|
-
this.
|
|
119
|
-
this.
|
|
120
|
-
this.
|
|
121
|
-
this.
|
|
117
|
+
this.lInternal = config;
|
|
118
|
+
this.rInternal = config;
|
|
119
|
+
this.tInternal = config;
|
|
120
|
+
this.bInternal = config;
|
|
122
121
|
}
|
|
123
122
|
else if (Array.isArray(config)) {
|
|
124
123
|
if (config.length === 2) {
|
|
@@ -126,10 +125,10 @@ class UIInsets {
|
|
|
126
125
|
const vertical = config[1];
|
|
127
126
|
assertValidNonNegativeNumber(horizontal, "UIInsets.set.config[0]");
|
|
128
127
|
assertValidNonNegativeNumber(vertical, "UIInsets.set.config[1]");
|
|
129
|
-
this.
|
|
130
|
-
this.
|
|
131
|
-
this.
|
|
132
|
-
this.
|
|
128
|
+
this.lInternal = horizontal;
|
|
129
|
+
this.rInternal = horizontal;
|
|
130
|
+
this.tInternal = vertical;
|
|
131
|
+
this.bInternal = vertical;
|
|
133
132
|
}
|
|
134
133
|
else {
|
|
135
134
|
const left = config[0];
|
|
@@ -140,10 +139,10 @@ class UIInsets {
|
|
|
140
139
|
assertValidNonNegativeNumber(right, "UIInsets.set.config[1]");
|
|
141
140
|
assertValidNonNegativeNumber(top, "UIInsets.set.config[2]");
|
|
142
141
|
assertValidNonNegativeNumber(bottom, "UIInsets.set.config[3]");
|
|
143
|
-
this.
|
|
144
|
-
this.
|
|
145
|
-
this.
|
|
146
|
-
this.
|
|
142
|
+
this.lInternal = left;
|
|
143
|
+
this.rInternal = right;
|
|
144
|
+
this.tInternal = top;
|
|
145
|
+
this.bInternal = bottom;
|
|
147
146
|
}
|
|
148
147
|
}
|
|
149
148
|
else if ("left" in config) {
|
|
@@ -155,26 +154,26 @@ class UIInsets {
|
|
|
155
154
|
assertValidNonNegativeNumber(right, "UIInsets.set.config.right");
|
|
156
155
|
assertValidNonNegativeNumber(top, "UIInsets.set.config.top");
|
|
157
156
|
assertValidNonNegativeNumber(bottom, "UIInsets.set.config.bottom");
|
|
158
|
-
this.
|
|
159
|
-
this.
|
|
160
|
-
this.
|
|
161
|
-
this.
|
|
157
|
+
this.lInternal = left;
|
|
158
|
+
this.rInternal = right;
|
|
159
|
+
this.tInternal = top;
|
|
160
|
+
this.bInternal = bottom;
|
|
162
161
|
}
|
|
163
162
|
else {
|
|
164
163
|
const horizontal = config.horizontal;
|
|
165
164
|
const vertical = config.vertical;
|
|
166
165
|
assertValidNonNegativeNumber(horizontal, "UIInsets.set.config.horizontal");
|
|
167
166
|
assertValidNonNegativeNumber(vertical, "UIInsets.set.config.vertical");
|
|
168
|
-
this.
|
|
169
|
-
this.
|
|
170
|
-
this.
|
|
171
|
-
this.
|
|
167
|
+
this.lInternal = horizontal;
|
|
168
|
+
this.rInternal = horizontal;
|
|
169
|
+
this.tInternal = vertical;
|
|
170
|
+
this.bInternal = vertical;
|
|
172
171
|
}
|
|
173
|
-
if (this.
|
|
174
|
-
this.
|
|
175
|
-
this.
|
|
176
|
-
this.
|
|
177
|
-
this.
|
|
172
|
+
if (this.lInternal !== lOld ||
|
|
173
|
+
this.rInternal !== rOld ||
|
|
174
|
+
this.tInternal !== tOld ||
|
|
175
|
+
this.bInternal !== bOld) {
|
|
176
|
+
this.dirtyInternal = true;
|
|
178
177
|
}
|
|
179
178
|
}
|
|
180
179
|
/** Sets from Vector4 (x=left, y=right, z=top, w=bottom) */
|
|
@@ -183,20 +182,20 @@ class UIInsets {
|
|
|
183
182
|
assertValidNonNegativeNumber(vector.y, "UIInsets.setVector4.vector.y");
|
|
184
183
|
assertValidNonNegativeNumber(vector.z, "UIInsets.setVector4.vector.z");
|
|
185
184
|
assertValidNonNegativeNumber(vector.w, "UIInsets.setVector4.vector.w");
|
|
186
|
-
if (this.
|
|
187
|
-
this.
|
|
188
|
-
this.
|
|
189
|
-
this.
|
|
190
|
-
this.
|
|
191
|
-
this.
|
|
192
|
-
this.
|
|
193
|
-
this.
|
|
194
|
-
this.
|
|
185
|
+
if (this.lInternal !== vector.x ||
|
|
186
|
+
this.rInternal !== vector.y ||
|
|
187
|
+
this.tInternal !== vector.z ||
|
|
188
|
+
this.bInternal !== vector.w) {
|
|
189
|
+
this.lInternal = vector.x;
|
|
190
|
+
this.rInternal = vector.y;
|
|
191
|
+
this.tInternal = vector.z;
|
|
192
|
+
this.bInternal = vector.w;
|
|
193
|
+
this.dirtyInternal = true;
|
|
195
194
|
}
|
|
196
195
|
}
|
|
197
196
|
/** Converts to Vector4 (left, right, top, bottom) */
|
|
198
197
|
toVector4(result = new Vector4()) {
|
|
199
|
-
return result.set(this.
|
|
198
|
+
return result.set(this.lInternal, this.rInternal, this.tInternal, this.bInternal);
|
|
200
199
|
}
|
|
201
200
|
/** Resets all sides to 0 */
|
|
202
201
|
reset() {
|
|
@@ -204,21 +203,19 @@ class UIInsets {
|
|
|
204
203
|
}
|
|
205
204
|
/** Copies from another instance */
|
|
206
205
|
copy(other) {
|
|
207
|
-
if (this.
|
|
208
|
-
this.
|
|
209
|
-
this.
|
|
210
|
-
this.
|
|
211
|
-
this.
|
|
212
|
-
this.
|
|
213
|
-
this.
|
|
214
|
-
this.
|
|
215
|
-
this.
|
|
206
|
+
if (this.lInternal !== other.lInternal ||
|
|
207
|
+
this.rInternal !== other.rInternal ||
|
|
208
|
+
this.tInternal !== other.tInternal ||
|
|
209
|
+
this.bInternal !== other.bInternal) {
|
|
210
|
+
this.lInternal = other.lInternal;
|
|
211
|
+
this.rInternal = other.rInternal;
|
|
212
|
+
this.tInternal = other.tInternal;
|
|
213
|
+
this.bInternal = other.bInternal;
|
|
214
|
+
this.dirtyInternal = true;
|
|
216
215
|
}
|
|
217
216
|
}
|
|
218
217
|
/** @internal */
|
|
219
218
|
setDirtyFalse() {
|
|
220
|
-
this.
|
|
219
|
+
this.dirtyInternal = false;
|
|
221
220
|
}
|
|
222
221
|
}
|
|
223
|
-
|
|
224
|
-
export { UIInsets };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Base class for progress bar fill functions */
|
|
2
|
-
class UIProgressMaskFunction {
|
|
2
|
+
export class UIProgressMaskFunction {
|
|
3
3
|
constructor(
|
|
4
4
|
/** GLSL shader source code defining fill behavior */
|
|
5
5
|
source) {
|
|
@@ -15,5 +15,3 @@ class UIProgressMaskFunction {
|
|
|
15
15
|
this.dirtyInternal = false;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
export { UIProgressMaskFunction };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UIProgressMaskFunction } from "./UIProgressMaskFunction";
|
|
1
|
+
import { UIProgressMaskFunction } from "./UIProgressMaskFunction.js";
|
|
2
2
|
/** Circular radial progress fill */
|
|
3
3
|
export declare class UIProgressMaskFunctionCircular extends UIProgressMaskFunction {
|
|
4
4
|
private startAngleInternal;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import source from
|
|
2
|
-
import { assertValidNumber } from
|
|
3
|
-
import { UIProgressMaskFunction } from
|
|
4
|
-
|
|
1
|
+
import source from "../../shaders/UIProgressMaskFunctionCircular.js";
|
|
2
|
+
import { assertValidNumber } from "../asserts.js";
|
|
3
|
+
import { UIProgressMaskFunction } from "./UIProgressMaskFunction.js";
|
|
5
4
|
/** Circular radial progress fill */
|
|
6
|
-
class UIProgressMaskFunctionCircular extends UIProgressMaskFunction {
|
|
5
|
+
export class UIProgressMaskFunctionCircular extends UIProgressMaskFunction {
|
|
7
6
|
/**
|
|
8
7
|
* Creates circular mask function.
|
|
9
8
|
*
|
|
@@ -13,39 +12,37 @@ class UIProgressMaskFunctionCircular extends UIProgressMaskFunction {
|
|
|
13
12
|
constructor(startAngle = 0, inverseDirection = false) {
|
|
14
13
|
assertValidNumber(startAngle, "UIProgressMaskFunctionCircular.constructor.startAngle");
|
|
15
14
|
super(source);
|
|
16
|
-
this.
|
|
17
|
-
this.
|
|
15
|
+
this.startAngleInternal = startAngle;
|
|
16
|
+
this.inverseDirectionInternal = inverseDirection;
|
|
18
17
|
}
|
|
19
18
|
/** Starting angle in radians */
|
|
20
19
|
get startAngle() {
|
|
21
|
-
return this.
|
|
20
|
+
return this.startAngleInternal;
|
|
22
21
|
}
|
|
23
22
|
/** Whether fill is counter-clockwise */
|
|
24
23
|
get inverseDirection() {
|
|
25
|
-
return this.
|
|
24
|
+
return this.inverseDirectionInternal;
|
|
26
25
|
}
|
|
27
26
|
/** Starting angle in radians */
|
|
28
27
|
set startAngle(value) {
|
|
29
28
|
assertValidNumber(value, "UIProgressMaskFunctionCircular.startAngle");
|
|
30
|
-
if (this.
|
|
31
|
-
this.
|
|
29
|
+
if (this.startAngleInternal !== value) {
|
|
30
|
+
this.startAngleInternal = value;
|
|
32
31
|
this.dirtyInternal = true;
|
|
33
32
|
}
|
|
34
33
|
}
|
|
35
34
|
/** Whether fill is counter-clockwise */
|
|
36
35
|
set inverseDirection(value) {
|
|
37
|
-
if (this.
|
|
38
|
-
this.
|
|
36
|
+
if (this.inverseDirectionInternal !== value) {
|
|
37
|
+
this.inverseDirectionInternal = value;
|
|
39
38
|
this.dirtyInternal = true;
|
|
40
39
|
}
|
|
41
40
|
}
|
|
42
41
|
/** @internal */
|
|
43
42
|
enumerateProperties() {
|
|
44
43
|
return {
|
|
45
|
-
direction: this.
|
|
46
|
-
startAngle: this.
|
|
44
|
+
direction: this.inverseDirectionInternal ? -1 : 1,
|
|
45
|
+
startAngle: this.startAngleInternal,
|
|
47
46
|
};
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
|
-
|
|
51
|
-
export { UIProgressMaskFunctionCircular };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Vector2 } from "three";
|
|
2
|
-
import type { Vector2Like } from "../math";
|
|
3
|
-
import { UIProgressMaskFunction } from "./UIProgressMaskFunction";
|
|
2
|
+
import type { Vector2Like } from "../math.js";
|
|
3
|
+
import { UIProgressMaskFunction } from "./UIProgressMaskFunction.js";
|
|
4
4
|
/** Linear directional progress fill */
|
|
5
5
|
export declare class UIProgressMaskFunctionDirectional extends UIProgressMaskFunction {
|
|
6
6
|
/** Fill direction as normalized vector */
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { Vector2 } from
|
|
2
|
-
import source from
|
|
3
|
-
import { EPSILON } from
|
|
4
|
-
import { UIProgressMaskFunction } from
|
|
5
|
-
|
|
1
|
+
import { Vector2 } from "three";
|
|
2
|
+
import source from "../../shaders/UIProgressMaskFunctionDirectional.js";
|
|
3
|
+
import { EPSILON } from "../math.js";
|
|
4
|
+
import { UIProgressMaskFunction } from "./UIProgressMaskFunction.js";
|
|
6
5
|
/** Linear directional progress fill */
|
|
7
|
-
class UIProgressMaskFunctionDirectional extends UIProgressMaskFunction {
|
|
6
|
+
export class UIProgressMaskFunctionDirectional extends UIProgressMaskFunction {
|
|
8
7
|
/**
|
|
9
8
|
* Creates directional mask function.
|
|
10
9
|
*
|
|
@@ -14,27 +13,27 @@ class UIProgressMaskFunctionDirectional extends UIProgressMaskFunction {
|
|
|
14
13
|
super(source);
|
|
15
14
|
/** Fill direction as normalized vector */
|
|
16
15
|
this.direction = new Vector2();
|
|
17
|
-
this.
|
|
16
|
+
this.cachedDirection = new Vector2();
|
|
18
17
|
this.direction.set(direction.x, direction.y).normalize();
|
|
19
|
-
this.
|
|
18
|
+
this.cachedDirection.copy(this.direction);
|
|
20
19
|
}
|
|
21
20
|
/** @internal */
|
|
22
21
|
get dirty() {
|
|
23
|
-
this.
|
|
24
|
-
return this.dirtyInternal || !this.
|
|
22
|
+
this.ensureDirectionNormalized();
|
|
23
|
+
return this.dirtyInternal || !this.cachedDirection.equals(this.direction);
|
|
25
24
|
}
|
|
26
25
|
/** @internal */
|
|
27
26
|
setDirtyFalse() {
|
|
28
|
-
this.
|
|
29
|
-
this.
|
|
27
|
+
this.ensureDirectionNormalized();
|
|
28
|
+
this.cachedDirection.copy(this.direction);
|
|
30
29
|
super.setDirtyFalse();
|
|
31
30
|
}
|
|
32
31
|
/** @internal */
|
|
33
32
|
enumerateProperties() {
|
|
34
|
-
this.
|
|
33
|
+
this.ensureDirectionNormalized();
|
|
35
34
|
return { direction: this.direction };
|
|
36
35
|
}
|
|
37
|
-
|
|
36
|
+
ensureDirectionNormalized() {
|
|
38
37
|
const squaredLength = this.direction.lengthSq();
|
|
39
38
|
if (Math.abs(squaredLength) <= EPSILON) {
|
|
40
39
|
this.direction.set(1, 0);
|
|
@@ -44,5 +43,3 @@ class UIProgressMaskFunctionDirectional extends UIProgressMaskFunction {
|
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
45
|
}
|
|
47
|
-
|
|
48
|
-
export { UIProgressMaskFunctionDirectional };
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
const EPSILON = 1e-6;
|
|
2
|
-
function srgbToLinear(color) {
|
|
1
|
+
export const EPSILON = 1e-6;
|
|
2
|
+
export function srgbToLinear(color) {
|
|
3
3
|
return color < 0.04045
|
|
4
4
|
? color * 0.0773993808
|
|
5
5
|
: Math.pow(color * 0.9478672986 + 0.0521327014, 2.4);
|
|
6
6
|
}
|
|
7
|
-
function linearToSRGB(color) {
|
|
7
|
+
export function linearToSRGB(color) {
|
|
8
8
|
return color < 0.0031308 ? color * 12.92 : 1.055 * Math.pow(color, 0.41666) - 0.055;
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
export { EPSILON, linearToSRGB, srgbToLinear };
|