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,13 +1,13 @@
|
|
|
1
|
-
import type { UILayer } from "../../layers/UILayer/UILayer";
|
|
2
|
-
import { UIColor } from "../../miscellaneous/color/UIColor";
|
|
3
|
-
import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
|
|
4
|
-
import { UIInsets } from "../../miscellaneous/insets/UIInsets";
|
|
5
|
-
import type { UIInsetsConfig } from "../../miscellaneous/insets/UIInsets.Internal";
|
|
6
|
-
import { UITextureView } from "../../miscellaneous/texture/UITextureView";
|
|
7
|
-
import type { UITextureConfig } from "../../miscellaneous/texture/UITextureView.Internal";
|
|
8
|
-
import { UIElement } from "../UIElement/UIElement";
|
|
9
|
-
import type { UINineSliceOptions } from "./UINineSlice.Internal";
|
|
10
|
-
import { UINineSliceRegionMode } from "./UINineSlice.Internal";
|
|
1
|
+
import type { UILayer } from "../../layers/UILayer/UILayer.js";
|
|
2
|
+
import { UIColor } from "../../miscellaneous/color/UIColor.js";
|
|
3
|
+
import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal.js";
|
|
4
|
+
import { UIInsets } from "../../miscellaneous/insets/UIInsets.js";
|
|
5
|
+
import type { UIInsetsConfig } from "../../miscellaneous/insets/UIInsets.Internal.js";
|
|
6
|
+
import { UITextureView } from "../../miscellaneous/texture/UITextureView.js";
|
|
7
|
+
import type { UITextureConfig } from "../../miscellaneous/texture/UITextureView.Internal.js";
|
|
8
|
+
import { UIElement } from "../UIElement/UIElement.js";
|
|
9
|
+
import type { UINineSliceOptions } from "./UINineSlice.Internal.js";
|
|
10
|
+
import { UINineSliceRegionMode } from "./UINineSlice.Internal.js";
|
|
11
11
|
/** Scalable textured image preserving border regions */
|
|
12
12
|
export declare class UINineSlice extends UIElement {
|
|
13
13
|
/** Texture displayed by this element */
|
|
@@ -49,8 +49,8 @@ export declare class UINineSlice extends UIElement {
|
|
|
49
49
|
set sliceBorders(value: UIInsetsConfig);
|
|
50
50
|
/** Region size. Interpretation depends on regionMode. */
|
|
51
51
|
set sliceRegions(value: UIInsetsConfig);
|
|
52
|
-
/**
|
|
53
|
-
|
|
52
|
+
/** Frees resources of the nine slice */
|
|
53
|
+
protected destroyInternal(): void;
|
|
54
54
|
protected setPlaneTransform(): void;
|
|
55
55
|
private calculateSliceBordersForShader;
|
|
56
56
|
private calculateSliceRegionsForShader;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { Vector4 } from
|
|
2
|
-
import { UIColor } from
|
|
3
|
-
import { computeTrimmedTransformMatrix } from
|
|
4
|
-
import { UIInsets } from
|
|
5
|
-
import { UITextureView } from
|
|
6
|
-
import source from
|
|
7
|
-
import { UIElement } from
|
|
8
|
-
import { NINE_SLICE_DEFAULT_BORDER, NINE_SLICE_DEFAULT_REGION_MODE, UINineSliceRegionMode } from
|
|
9
|
-
|
|
1
|
+
import { Vector4 } from "three";
|
|
2
|
+
import { UIColor } from "../../miscellaneous/color/UIColor.js";
|
|
3
|
+
import { computeTrimmedTransformMatrix } from "../../miscellaneous/computeTransform.js";
|
|
4
|
+
import { UIInsets } from "../../miscellaneous/insets/UIInsets.js";
|
|
5
|
+
import { UITextureView } from "../../miscellaneous/texture/UITextureView.js";
|
|
6
|
+
import source from "../../shaders/UINineSlice.js";
|
|
7
|
+
import { UIElement } from "../UIElement/UIElement.js";
|
|
8
|
+
import { NINE_SLICE_DEFAULT_BORDER, NINE_SLICE_DEFAULT_REGION_MODE, UINineSliceRegionMode, } from "./UINineSlice.Internal.js";
|
|
10
9
|
/** Scalable textured image preserving border regions */
|
|
11
|
-
class UINineSlice extends UIElement {
|
|
10
|
+
export class UINineSlice extends UIElement {
|
|
12
11
|
/**
|
|
13
12
|
* Creates a new UINineSlice instance.
|
|
14
13
|
*
|
|
@@ -36,88 +35,89 @@ class UINineSlice extends UIElement {
|
|
|
36
35
|
sliceBorders: sliceBordersVector,
|
|
37
36
|
sliceRegions: sliceRegionsVector,
|
|
38
37
|
}, options);
|
|
39
|
-
this.
|
|
40
|
-
this.
|
|
41
|
-
this.
|
|
42
|
-
this.
|
|
43
|
-
this.
|
|
44
|
-
this.
|
|
38
|
+
this.regionModeDirty = true;
|
|
39
|
+
this.sliceBordersVector = new Vector4();
|
|
40
|
+
this.sliceRegionsVector = new Vector4();
|
|
41
|
+
this.textureDimensionsDirty = true;
|
|
42
|
+
this.onTextureDimensionsChanged = () => {
|
|
43
|
+
this.textureDimensionsDirty = true;
|
|
45
44
|
};
|
|
46
45
|
this.texture = textureView;
|
|
47
|
-
this.
|
|
48
|
-
this.
|
|
49
|
-
this.
|
|
50
|
-
this.
|
|
51
|
-
this.
|
|
52
|
-
this.
|
|
53
|
-
this.
|
|
54
|
-
this.
|
|
55
|
-
this.
|
|
56
|
-
this.texture.signalDimensionsChanged.on(this.
|
|
46
|
+
this.textureTransform = textureTransform;
|
|
47
|
+
this.colorInternal = color;
|
|
48
|
+
this.sliceBordersInternal = sliceBorders;
|
|
49
|
+
this.sliceRegionsInternal = sliceRegions;
|
|
50
|
+
this.regionModeInternal = regionMode;
|
|
51
|
+
this.sliceBordersVector = sliceBordersVector;
|
|
52
|
+
this.sliceRegionsVector = sliceRegionsVector;
|
|
53
|
+
this.lastElementWidth = this.width;
|
|
54
|
+
this.lastElementHeight = this.height;
|
|
55
|
+
this.texture.signalDimensionsChanged.on(this.onTextureDimensionsChanged);
|
|
57
56
|
}
|
|
58
57
|
/** Multiplicative tint. Alpha channel controls opacity. */
|
|
59
58
|
get color() {
|
|
60
|
-
return this.
|
|
59
|
+
return this.colorInternal;
|
|
61
60
|
}
|
|
62
61
|
/** Controls how sliceRegions values are interpreted */
|
|
63
62
|
get regionMode() {
|
|
64
|
-
return this.
|
|
63
|
+
return this.regionModeInternal;
|
|
65
64
|
}
|
|
66
65
|
/** Border size in normalized texture coordinates (0 to 1) */
|
|
67
66
|
get sliceBorders() {
|
|
68
|
-
return this.
|
|
67
|
+
return this.sliceBordersInternal;
|
|
69
68
|
}
|
|
70
69
|
/** Region size. Interpretation depends on regionMode. */
|
|
71
70
|
get sliceRegions() {
|
|
72
|
-
return this.
|
|
71
|
+
return this.sliceRegionsInternal;
|
|
73
72
|
}
|
|
74
73
|
/** Multiplicative tint. Alpha channel controls opacity. */
|
|
75
74
|
set color(value) {
|
|
76
|
-
this.
|
|
75
|
+
this.colorInternal.set(value);
|
|
77
76
|
}
|
|
78
77
|
/** Controls how sliceRegions values are interpreted */
|
|
79
78
|
set regionMode(value) {
|
|
80
|
-
if (this.
|
|
81
|
-
this.
|
|
82
|
-
this.
|
|
79
|
+
if (this.regionModeInternal !== value) {
|
|
80
|
+
this.regionModeInternal = value;
|
|
81
|
+
this.regionModeDirty = true;
|
|
83
82
|
}
|
|
84
83
|
}
|
|
85
84
|
/** Border size in normalized texture coordinates (0 to 1) */
|
|
86
85
|
set sliceBorders(value) {
|
|
87
|
-
this.
|
|
86
|
+
this.sliceBordersInternal.set(value);
|
|
88
87
|
}
|
|
89
88
|
/** Region size. Interpretation depends on regionMode. */
|
|
90
89
|
set sliceRegions(value) {
|
|
91
|
-
this.
|
|
90
|
+
this.sliceRegionsInternal.set(value);
|
|
92
91
|
}
|
|
93
|
-
/**
|
|
94
|
-
|
|
95
|
-
this.texture.signalDimensionsChanged.off(this.
|
|
96
|
-
super.
|
|
92
|
+
/** Frees resources of the nine slice */
|
|
93
|
+
destroyInternal() {
|
|
94
|
+
this.texture.signalDimensionsChanged.off(this.onTextureDimensionsChanged);
|
|
95
|
+
super.destroyInternal();
|
|
97
96
|
}
|
|
98
97
|
setPlaneTransform() {
|
|
99
98
|
let properties;
|
|
100
|
-
const sliceBordersDirty = this.
|
|
99
|
+
const sliceBordersDirty = this.textureDimensionsDirty || this.sliceBordersInternal.dirty || this.texture.trimDirty;
|
|
101
100
|
if (sliceBordersDirty) {
|
|
102
101
|
properties ?? (properties = {});
|
|
103
|
-
properties["sliceBorders"] = this.
|
|
104
|
-
this.
|
|
105
|
-
this.
|
|
102
|
+
properties["sliceBorders"] = this.calculateSliceBordersForShader(this.sliceBordersVector);
|
|
103
|
+
this.sliceBordersInternal.setDirtyFalse();
|
|
104
|
+
this.textureDimensionsDirty = false;
|
|
106
105
|
}
|
|
107
|
-
const sliceRegionsDirty = this.
|
|
108
|
-
|
|
109
|
-
|
|
106
|
+
const sliceRegionsDirty = this.sliceRegionsInternal.dirty ||
|
|
107
|
+
this.regionModeDirty ||
|
|
108
|
+
(this.regionModeInternal === UINineSliceRegionMode.WORLD &&
|
|
109
|
+
this.checkElementDimensionsDirty());
|
|
110
110
|
if (sliceRegionsDirty) {
|
|
111
111
|
properties ?? (properties = {});
|
|
112
|
-
properties["sliceRegions"] = this.
|
|
113
|
-
this.
|
|
114
|
-
this.
|
|
115
|
-
this.
|
|
112
|
+
properties["sliceRegions"] = this.calculateSliceRegionsForShader(this.sliceRegionsVector);
|
|
113
|
+
this.sliceRegionsInternal.setDirtyFalse();
|
|
114
|
+
this.regionModeDirty = false;
|
|
115
|
+
this.setElementDimensionsDirtyFalse();
|
|
116
116
|
}
|
|
117
|
-
if (this.
|
|
117
|
+
if (this.colorInternal.dirty) {
|
|
118
118
|
properties ?? (properties = {});
|
|
119
|
-
properties["color"] = this.
|
|
120
|
-
this.
|
|
119
|
+
properties["color"] = this.colorInternal;
|
|
120
|
+
this.colorInternal.setDirtyFalse();
|
|
121
121
|
}
|
|
122
122
|
if (this.texture.textureDirty) {
|
|
123
123
|
properties ?? (properties = {});
|
|
@@ -126,7 +126,7 @@ class UINineSlice extends UIElement {
|
|
|
126
126
|
}
|
|
127
127
|
if (this.texture.uvTransformDirty) {
|
|
128
128
|
properties ?? (properties = {});
|
|
129
|
-
properties["textureTransform"] = this.texture.calculateUVTransform(this.
|
|
129
|
+
properties["textureTransform"] = this.texture.calculateUVTransform(this.textureTransform);
|
|
130
130
|
this.texture.setUVTransformDirtyFalse();
|
|
131
131
|
}
|
|
132
132
|
if (properties) {
|
|
@@ -139,12 +139,12 @@ class UINineSlice extends UIElement {
|
|
|
139
139
|
if (isTransformDirty) {
|
|
140
140
|
const micro = this.micro;
|
|
141
141
|
const textureTrim = this.texture.trim;
|
|
142
|
-
this.sceneWrapper.setTransform(this.planeHandler, computeTrimmedTransformMatrix(this.x, this.y, this.width, this.height, this.
|
|
142
|
+
this.sceneWrapper.setTransform(this.planeHandler, computeTrimmedTransformMatrix(this.x, this.y, this.width, this.height, this.renderDepth, micro.x, micro.y, micro.anchorX, micro.anchorY, micro.scaleX, micro.scaleY, micro.rotation, micro.anchorMode, textureTrim.left, textureTrim.right, textureTrim.top, textureTrim.bottom));
|
|
143
143
|
this.micro.setDirtyFalse();
|
|
144
144
|
this.texture.setTrimDirtyFalse();
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
|
-
|
|
147
|
+
calculateSliceBordersForShader(result) {
|
|
148
148
|
const sourceWidth = this.texture.width;
|
|
149
149
|
const sourceHeight = this.texture.height;
|
|
150
150
|
const trim = this.texture.trim;
|
|
@@ -156,33 +156,31 @@ class UINineSlice extends UIElement {
|
|
|
156
156
|
const trimNBottom = trim.bottom / sourceHeight;
|
|
157
157
|
const trimmedWidthNorm = trimmedWidth / sourceWidth;
|
|
158
158
|
const trimmedHeightNorm = trimmedHeight / sourceHeight;
|
|
159
|
-
const srcLeft = this.
|
|
160
|
-
const srcRight = this.
|
|
161
|
-
const srcTop = this.
|
|
162
|
-
const srcBottom = this.
|
|
159
|
+
const srcLeft = this.sliceBordersInternal.left;
|
|
160
|
+
const srcRight = this.sliceBordersInternal.right;
|
|
161
|
+
const srcTop = this.sliceBordersInternal.top;
|
|
162
|
+
const srcBottom = this.sliceBordersInternal.bottom;
|
|
163
163
|
const left = Math.max(0, srcLeft - trimNLeft) / trimmedWidthNorm;
|
|
164
164
|
const right = Math.max(0, srcRight - trimNRight) / trimmedWidthNorm;
|
|
165
165
|
const top = Math.max(0, srcTop - trimNTop) / trimmedHeightNorm;
|
|
166
166
|
const bottom = Math.max(0, srcBottom - trimNBottom) / trimmedHeightNorm;
|
|
167
167
|
return result.set(Math.min(1, left), Math.min(1, right), Math.min(1, top), Math.min(1, bottom));
|
|
168
168
|
}
|
|
169
|
-
|
|
170
|
-
if (this.
|
|
171
|
-
return result.set(this.
|
|
169
|
+
calculateSliceRegionsForShader(result) {
|
|
170
|
+
if (this.regionModeInternal === UINineSliceRegionMode.NORMALIZED) {
|
|
171
|
+
return result.set(this.sliceRegionsInternal.left, this.sliceRegionsInternal.right, this.sliceRegionsInternal.top, this.sliceRegionsInternal.bottom);
|
|
172
172
|
}
|
|
173
173
|
const width = this.width;
|
|
174
174
|
const height = this.height;
|
|
175
|
-
return result.set(this.
|
|
175
|
+
return result.set(this.sliceRegionsInternal.left / width, this.sliceRegionsInternal.right / width, this.sliceRegionsInternal.top / height, this.sliceRegionsInternal.bottom / height);
|
|
176
176
|
}
|
|
177
|
-
|
|
177
|
+
checkElementDimensionsDirty() {
|
|
178
178
|
return (this.solverWrapper.dirty &&
|
|
179
|
-
(this.
|
|
180
|
-
this.
|
|
179
|
+
(this.lastElementWidth !== Math.round(this.width) ||
|
|
180
|
+
this.lastElementHeight !== Math.round(this.height)));
|
|
181
181
|
}
|
|
182
|
-
|
|
183
|
-
this.
|
|
184
|
-
this.
|
|
182
|
+
setElementDimensionsDirtyFalse() {
|
|
183
|
+
this.lastElementWidth = Math.round(this.width);
|
|
184
|
+
this.lastElementHeight = Math.round(this.height);
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
|
-
|
|
188
|
-
export { UINineSlice };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
|
|
2
|
-
import type { UIProgressMaskFunction } from "../../miscellaneous/mask-function/UIProgressMaskFunction";
|
|
3
|
-
import type { UIElementOptions } from "../UIElement/UIElement.Internal";
|
|
1
|
+
import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal.js";
|
|
2
|
+
import type { UIProgressMaskFunction } from "../../miscellaneous/mask-function/UIProgressMaskFunction.js";
|
|
3
|
+
import type { UIElementOptions } from "../UIElement/UIElement.Internal.js";
|
|
4
4
|
/** Configuration options for UIProgress */
|
|
5
5
|
export interface UIProgressOptions extends UIElementOptions {
|
|
6
6
|
/** Multiplicative tint */
|
|
@@ -11,4 +11,3 @@ export interface UIProgressOptions extends UIElementOptions {
|
|
|
11
11
|
progress: number;
|
|
12
12
|
}
|
|
13
13
|
export declare const PROGRESS_DEFAULT_VALUE = 1;
|
|
14
|
-
export declare function simplifyGLSLSource(source: string): string;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { UILayer } from "../../layers/UILayer/UILayer";
|
|
2
|
-
import { UIColor } from "../../miscellaneous/color/UIColor";
|
|
3
|
-
import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
|
|
4
|
-
import type { UIProgressMaskFunction } from "../../miscellaneous/mask-function/UIProgressMaskFunction";
|
|
5
|
-
import { UITextureView } from "../../miscellaneous/texture/UITextureView";
|
|
6
|
-
import type { UITextureConfig } from "../../miscellaneous/texture/UITextureView.Internal";
|
|
7
|
-
import { UIElement } from "../UIElement/UIElement";
|
|
8
|
-
import type { UIProgressOptions } from "./UIProgress.Internal";
|
|
1
|
+
import type { UILayer } from "../../layers/UILayer/UILayer.js";
|
|
2
|
+
import { UIColor } from "../../miscellaneous/color/UIColor.js";
|
|
3
|
+
import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal.js";
|
|
4
|
+
import type { UIProgressMaskFunction } from "../../miscellaneous/mask-function/UIProgressMaskFunction.js";
|
|
5
|
+
import { UITextureView } from "../../miscellaneous/texture/UITextureView.js";
|
|
6
|
+
import type { UITextureConfig } from "../../miscellaneous/texture/UITextureView.Internal.js";
|
|
7
|
+
import { UIElement } from "../UIElement/UIElement.js";
|
|
8
|
+
import type { UIProgressOptions } from "./UIProgress.Internal.js";
|
|
9
9
|
/** Progress bar with customizable fill direction */
|
|
10
10
|
export declare class UIProgress extends UIElement {
|
|
11
11
|
/** Texture displayed by this element */
|
|
@@ -39,8 +39,8 @@ export declare class UIProgress extends UIElement {
|
|
|
39
39
|
set maskFunction(value: UIProgressMaskFunction);
|
|
40
40
|
/** Progress from 0 (empty) to 1 (full). Clamped. */
|
|
41
41
|
set progress(value: number);
|
|
42
|
-
/**
|
|
43
|
-
|
|
42
|
+
/** Frees resources of the progress bar */
|
|
43
|
+
protected destroyInternal(): void;
|
|
44
44
|
protected setPlaneTransform(): void;
|
|
45
45
|
private readonly onTextureDimensionsChanged;
|
|
46
46
|
private rebuildPlane;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { MathUtils } from
|
|
2
|
-
import { assertValidNumber } from
|
|
3
|
-
import { UIColor } from
|
|
4
|
-
import { computeTrimmedTransformMatrix } from
|
|
5
|
-
import { UIProgressMaskFunctionDirectional } from
|
|
6
|
-
import { UITextureView } from
|
|
7
|
-
import { isUIModeVisible } from
|
|
8
|
-
import source from
|
|
9
|
-
import { UIElement } from
|
|
10
|
-
import { blendModeToFactor, packHSL } from
|
|
11
|
-
import { PROGRESS_DEFAULT_VALUE } from
|
|
12
|
-
|
|
1
|
+
import { MathUtils } from "three";
|
|
2
|
+
import { assertValidNumber } from "../../miscellaneous/asserts.js";
|
|
3
|
+
import { UIColor } from "../../miscellaneous/color/UIColor.js";
|
|
4
|
+
import { computeTrimmedTransformMatrix } from "../../miscellaneous/computeTransform.js";
|
|
5
|
+
import { UIProgressMaskFunctionDirectional } from "../../miscellaneous/mask-function/UIProgressMaskFunctionDirectional.js";
|
|
6
|
+
import { UITextureView } from "../../miscellaneous/texture/UITextureView.js";
|
|
7
|
+
import { isUIModeVisible } from "../../miscellaneous/UIMode.js";
|
|
8
|
+
import source from "../../shaders/UIProgress.js";
|
|
9
|
+
import { UIElement } from "../UIElement/UIElement.js";
|
|
10
|
+
import { blendModeToFactor, packHSL } from "../UIElement/UIElement.Internal.js";
|
|
11
|
+
import { PROGRESS_DEFAULT_VALUE } from "./UIProgress.Internal.js";
|
|
13
12
|
/** Progress bar with customizable fill direction */
|
|
14
|
-
class UIProgress extends UIElement {
|
|
13
|
+
export class UIProgress extends UIElement {
|
|
15
14
|
/**
|
|
16
15
|
* Creates a new UIProgress instance.
|
|
17
16
|
*
|
|
@@ -41,66 +40,66 @@ class UIProgress extends UIElement {
|
|
|
41
40
|
progress,
|
|
42
41
|
...maskFunction.enumerateProperties(),
|
|
43
42
|
}, options);
|
|
44
|
-
this.
|
|
45
|
-
this.
|
|
46
|
-
this.
|
|
43
|
+
this.progressDirty = false;
|
|
44
|
+
this.textureResolutionDirty = false;
|
|
45
|
+
this.onTextureDimensionsChanged = (width, height) => {
|
|
47
46
|
if (this.width !== width || this.height !== height) {
|
|
48
47
|
this.width = width;
|
|
49
48
|
this.height = height;
|
|
50
|
-
this.
|
|
49
|
+
this.textureResolutionDirty = true;
|
|
51
50
|
}
|
|
52
51
|
};
|
|
53
52
|
this.texture = textureView;
|
|
54
|
-
this.
|
|
55
|
-
this.
|
|
56
|
-
this.
|
|
57
|
-
this.
|
|
58
|
-
this.
|
|
59
|
-
this.texture.signalDimensionsChanged.on(this.
|
|
53
|
+
this.textureTransform = textureTransform;
|
|
54
|
+
this.textureResolution = textureResolution;
|
|
55
|
+
this.colorInternal = color;
|
|
56
|
+
this.progressInternal = progress;
|
|
57
|
+
this.maskFunctionInternal = maskFunction;
|
|
58
|
+
this.texture.signalDimensionsChanged.on(this.onTextureDimensionsChanged);
|
|
60
59
|
}
|
|
61
60
|
/** Multiplicative tint. Alpha channel controls opacity. */
|
|
62
61
|
get color() {
|
|
63
|
-
return this.
|
|
62
|
+
return this.colorInternal;
|
|
64
63
|
}
|
|
65
64
|
/** Function controlling fill direction and shape */
|
|
66
65
|
get maskFunction() {
|
|
67
|
-
return this.
|
|
66
|
+
return this.maskFunctionInternal;
|
|
68
67
|
}
|
|
69
68
|
/** Progress from 0 (empty) to 1 (full) */
|
|
70
69
|
get progress() {
|
|
71
|
-
return this.
|
|
70
|
+
return this.progressInternal;
|
|
72
71
|
}
|
|
73
72
|
/** Multiplicative tint. Alpha channel controls opacity. */
|
|
74
73
|
set color(value) {
|
|
75
|
-
this.
|
|
74
|
+
this.colorInternal.set(value);
|
|
76
75
|
}
|
|
77
76
|
/** Function controlling fill direction and shape */
|
|
78
77
|
set maskFunction(value) {
|
|
79
|
-
if (this.
|
|
80
|
-
this.
|
|
81
|
-
this.
|
|
78
|
+
if (this.maskFunctionInternal !== value) {
|
|
79
|
+
this.maskFunctionInternal = value;
|
|
80
|
+
this.rebuildPlane();
|
|
82
81
|
}
|
|
83
82
|
}
|
|
84
83
|
/** Progress from 0 (empty) to 1 (full). Clamped. */
|
|
85
84
|
set progress(value) {
|
|
86
85
|
assertValidNumber(value, "UIProgress.progress");
|
|
87
86
|
value = MathUtils.clamp(value, 0, 1);
|
|
88
|
-
if (this.
|
|
89
|
-
this.
|
|
90
|
-
this.
|
|
87
|
+
if (this.progressInternal !== value) {
|
|
88
|
+
this.progressInternal = value;
|
|
89
|
+
this.progressDirty = true;
|
|
91
90
|
}
|
|
92
91
|
}
|
|
93
|
-
/**
|
|
94
|
-
|
|
95
|
-
this.texture.signalDimensionsChanged.off(this.
|
|
96
|
-
super.
|
|
92
|
+
/** Frees resources of the progress bar */
|
|
93
|
+
destroyInternal() {
|
|
94
|
+
this.texture.signalDimensionsChanged.off(this.onTextureDimensionsChanged);
|
|
95
|
+
super.destroyInternal();
|
|
97
96
|
}
|
|
98
97
|
setPlaneTransform() {
|
|
99
98
|
let properties;
|
|
100
|
-
if (this.
|
|
99
|
+
if (this.colorInternal.dirty) {
|
|
101
100
|
properties ?? (properties = {});
|
|
102
|
-
properties["color"] = this.
|
|
103
|
-
this.
|
|
101
|
+
properties["color"] = this.colorInternal;
|
|
102
|
+
this.colorInternal.setDirtyFalse();
|
|
104
103
|
}
|
|
105
104
|
if (this.texture.textureDirty) {
|
|
106
105
|
properties ?? (properties = {});
|
|
@@ -109,18 +108,18 @@ class UIProgress extends UIElement {
|
|
|
109
108
|
}
|
|
110
109
|
if (this.texture.uvTransformDirty) {
|
|
111
110
|
properties ?? (properties = {});
|
|
112
|
-
properties["textureTransform"] = this.texture.calculateUVTransform(this.
|
|
111
|
+
properties["textureTransform"] = this.texture.calculateUVTransform(this.textureTransform);
|
|
113
112
|
this.texture.setUVTransformDirtyFalse();
|
|
114
113
|
}
|
|
115
|
-
if (this.
|
|
114
|
+
if (this.progressDirty) {
|
|
116
115
|
properties ?? (properties = {});
|
|
117
|
-
properties["progress"] = this.
|
|
118
|
-
this.
|
|
116
|
+
properties["progress"] = this.progressInternal;
|
|
117
|
+
this.progressDirty = false;
|
|
119
118
|
}
|
|
120
|
-
if (this.
|
|
119
|
+
if (this.textureResolutionDirty) {
|
|
121
120
|
properties ?? (properties = {});
|
|
122
|
-
properties["textureResolution"] = this.texture.getResolution(this.
|
|
123
|
-
this.
|
|
121
|
+
properties["textureResolution"] = this.texture.getResolution(this.textureResolution);
|
|
122
|
+
this.textureResolutionDirty = false;
|
|
124
123
|
}
|
|
125
124
|
if (this.maskFunction.dirty) {
|
|
126
125
|
properties ?? (properties = {});
|
|
@@ -140,32 +139,30 @@ class UIProgress extends UIElement {
|
|
|
140
139
|
if (isTransformDirty) {
|
|
141
140
|
const micro = this.micro;
|
|
142
141
|
const textureTrim = this.texture.trim;
|
|
143
|
-
this.sceneWrapper.setTransform(this.planeHandler, computeTrimmedTransformMatrix(this.x, this.y, this.width, this.height, this.
|
|
142
|
+
this.sceneWrapper.setTransform(this.planeHandler, computeTrimmedTransformMatrix(this.x, this.y, this.width, this.height, this.renderDepth, micro.x, micro.y, micro.anchorX, micro.anchorY, micro.scaleX, micro.scaleY, micro.rotation, micro.anchorMode, textureTrim.left, textureTrim.right, textureTrim.top, textureTrim.bottom));
|
|
144
143
|
this.micro.setDirtyFalse();
|
|
145
144
|
this.texture.setTrimDirtyFalse();
|
|
146
145
|
}
|
|
147
146
|
}
|
|
148
|
-
|
|
147
|
+
rebuildPlane() {
|
|
149
148
|
this.sceneWrapper.destroyPlane(this.planeHandler);
|
|
150
149
|
const micro = this.micro;
|
|
151
150
|
const textureTrim = this.texture.trim;
|
|
152
|
-
this.planeHandler = this.sceneWrapper.createPlane(this.
|
|
151
|
+
this.planeHandler = this.sceneWrapper.createPlane(this.maskFunctionInternal.source + source, {
|
|
153
152
|
texture: this.texture.texture,
|
|
154
|
-
textureTransform: this.texture.calculateUVTransform(this.
|
|
155
|
-
textureResolution: this.texture.getResolution(this.
|
|
156
|
-
color: this.
|
|
157
|
-
progress: this.
|
|
158
|
-
...this.
|
|
159
|
-
}, computeTrimmedTransformMatrix(this.x, this.y, this.width, this.height, this.
|
|
160
|
-
this.
|
|
153
|
+
textureTransform: this.texture.calculateUVTransform(this.textureTransform),
|
|
154
|
+
textureResolution: this.texture.getResolution(this.textureResolution),
|
|
155
|
+
color: this.colorInternal,
|
|
156
|
+
progress: this.progressInternal,
|
|
157
|
+
...this.maskFunctionInternal.enumerateProperties(),
|
|
158
|
+
}, computeTrimmedTransformMatrix(this.x, this.y, this.width, this.height, this.renderDepth, micro.x, micro.y, micro.anchorX, micro.anchorY, micro.scaleX, micro.scaleY, micro.rotation, micro.anchorMode, textureTrim.left, textureTrim.right, textureTrim.top, textureTrim.bottom), isUIModeVisible(this.mode), this.transparencyMode, blendModeToFactor(this.blendMode), packHSL({ h: 0, s: 0, l: 0 }, this.hue, this.saturation, this.lightness));
|
|
159
|
+
this.colorInternal.setDirtyFalse();
|
|
161
160
|
this.texture.setTextureDirtyFalse();
|
|
162
161
|
this.texture.setUVTransformDirtyFalse();
|
|
163
162
|
this.texture.setTrimDirtyFalse();
|
|
164
|
-
this.
|
|
165
|
-
this.
|
|
166
|
-
this.
|
|
163
|
+
this.progressDirty = false;
|
|
164
|
+
this.textureResolutionDirty = false;
|
|
165
|
+
this.maskFunctionInternal.setDirtyFalse();
|
|
167
166
|
this.micro.setDirtyFalse();
|
|
168
167
|
}
|
|
169
168
|
}
|
|
170
|
-
|
|
171
|
-
export { UIProgress };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Camera, Scene } from "three";
|
|
2
|
-
import { UIColor } from "../../miscellaneous/color/UIColor";
|
|
3
|
-
import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
|
|
4
|
-
import type { UIElementOptions } from "../UIElement/UIElement.Internal";
|
|
2
|
+
import { UIColor } from "../../miscellaneous/color/UIColor.js";
|
|
3
|
+
import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal.js";
|
|
4
|
+
import type { UIElementOptions } from "../UIElement/UIElement.Internal.js";
|
|
5
5
|
/** Controls when scene re-renders */
|
|
6
6
|
export declare enum UISceneUpdateMode {
|
|
7
7
|
/** Re-render every frame */
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { UIColor } from
|
|
2
|
-
|
|
1
|
+
import { UIColor } from "../../miscellaneous/color/UIColor.js";
|
|
3
2
|
/** Controls when scene re-renders */
|
|
4
|
-
var UISceneUpdateMode;
|
|
3
|
+
export var UISceneUpdateMode;
|
|
5
4
|
(function (UISceneUpdateMode) {
|
|
6
5
|
/** Re-render every frame */
|
|
7
6
|
UISceneUpdateMode[UISceneUpdateMode["EVERY_FRAME"] = 1] = "EVERY_FRAME";
|
|
@@ -14,14 +13,12 @@ var UISceneUpdateMode;
|
|
|
14
13
|
/** Re-render only via requestUpdate() */
|
|
15
14
|
UISceneUpdateMode[UISceneUpdateMode["MANUAL"] = 5] = "MANUAL";
|
|
16
15
|
})(UISceneUpdateMode || (UISceneUpdateMode = {}));
|
|
17
|
-
const SCENE_DEFAULT_RESOLUTION_FACTOR = 0.5;
|
|
18
|
-
const SCENE_MIN_RESOLUTION_FACTOR = 0.1;
|
|
19
|
-
const SCENE_MAX_RESOLUTION_FACTOR = 2;
|
|
20
|
-
const SCENE_DEFAULT_CAMERA_FOV = 60;
|
|
21
|
-
const SCENE_DEFAULT_CAMERA_NEAR = 0.1;
|
|
22
|
-
const SCENE_DEFAULT_CAMERA_FAR = 100;
|
|
23
|
-
const SCENE_DEFAULT_UPDATE_MODE = UISceneUpdateMode.ON_PROPERTIES_CHANGE;
|
|
24
|
-
const SCENE_DEFAULT_CLEAR_COLOR = new UIColor(0, 0, 0, 1);
|
|
25
|
-
const SCENE_DEFAULT_USE_DEPTH = true;
|
|
26
|
-
|
|
27
|
-
export { SCENE_DEFAULT_CAMERA_FAR, SCENE_DEFAULT_CAMERA_FOV, SCENE_DEFAULT_CAMERA_NEAR, SCENE_DEFAULT_CLEAR_COLOR, SCENE_DEFAULT_RESOLUTION_FACTOR, SCENE_DEFAULT_UPDATE_MODE, SCENE_DEFAULT_USE_DEPTH, SCENE_MAX_RESOLUTION_FACTOR, SCENE_MIN_RESOLUTION_FACTOR, UISceneUpdateMode };
|
|
16
|
+
export const SCENE_DEFAULT_RESOLUTION_FACTOR = 0.5;
|
|
17
|
+
export const SCENE_MIN_RESOLUTION_FACTOR = 0.1;
|
|
18
|
+
export const SCENE_MAX_RESOLUTION_FACTOR = 2;
|
|
19
|
+
export const SCENE_DEFAULT_CAMERA_FOV = 60;
|
|
20
|
+
export const SCENE_DEFAULT_CAMERA_NEAR = 0.1;
|
|
21
|
+
export const SCENE_DEFAULT_CAMERA_FAR = 100;
|
|
22
|
+
export const SCENE_DEFAULT_UPDATE_MODE = UISceneUpdateMode.ON_PROPERTIES_CHANGE;
|
|
23
|
+
export const SCENE_DEFAULT_CLEAR_COLOR = new UIColor(0, 0, 0, 1);
|
|
24
|
+
export const SCENE_DEFAULT_USE_DEPTH = true;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Camera, WebGLRenderer } from "three";
|
|
2
2
|
import { Scene } from "three";
|
|
3
|
-
import type { UILayer } from "../../layers/UILayer/UILayer";
|
|
4
|
-
import { UIColor } from "../../miscellaneous/color/UIColor";
|
|
5
|
-
import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
|
|
6
|
-
import { UIElement } from "../UIElement/UIElement";
|
|
7
|
-
import type { UISceneOptions } from "./UIScene.Internal";
|
|
8
|
-
import { UISceneUpdateMode } from "./UIScene.Internal";
|
|
3
|
+
import type { UILayer } from "../../layers/UILayer/UILayer.js";
|
|
4
|
+
import { UIColor } from "../../miscellaneous/color/UIColor.js";
|
|
5
|
+
import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal.js";
|
|
6
|
+
import { UIElement } from "../UIElement/UIElement.js";
|
|
7
|
+
import type { UISceneOptions } from "./UIScene.Internal.js";
|
|
8
|
+
import { UISceneUpdateMode } from "./UIScene.Internal.js";
|
|
9
9
|
/** Renders Three.js scene to texture */
|
|
10
10
|
export declare class UIScene extends UIElement {
|
|
11
11
|
private readonly colorInternal;
|
|
@@ -51,9 +51,9 @@ export declare class UIScene extends UIElement {
|
|
|
51
51
|
set scene(value: Scene);
|
|
52
52
|
/** Controls when scene re-renders */
|
|
53
53
|
set updateMode(value: UISceneUpdateMode);
|
|
54
|
-
/** Removes element and frees resources */
|
|
55
|
-
destroy(): void;
|
|
56
54
|
/** Triggers re-render on next frame. Useful in MANUAL mode. */
|
|
57
55
|
requestUpdate(): void;
|
|
56
|
+
/** Frees resources of the scene */
|
|
57
|
+
protected destroyInternal(): void;
|
|
58
58
|
protected onWillRender(renderer: WebGLRenderer, deltaTime: number): void;
|
|
59
59
|
}
|