laymur 0.22.0 → 0.25.0
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 +25 -17
- package/dist/core/elements/UIElement/UIElement.js +76 -69
- 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 -8
- package/dist/core/elements/UIProgress/UIProgress.js +60 -58
- 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 +20 -1
- package/dist/core/miscellaneous/asserts.js +71 -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 +2 -2
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.js +13 -16
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.js +115 -118
- 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 +208 -114
- package/dist/core/miscellaneous/generic-plane/shared.d.ts +2 -2
- package/dist/core/miscellaneous/generic-plane/shared.js +16 -19
- 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 +14 -17
- 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 +3 -3
- package/dist/core/miscellaneous/texture/UITextureView.js +114 -118
- 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 +27 -4
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.js +162 -123
- 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 +1 -1
- package/dist/particles/instancedParticle/UIInstancedParticle.js +29 -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,11 +1,10 @@
|
|
|
1
|
-
import { UIColor } from
|
|
2
|
-
import { computeTrimmedTransformMatrix } from
|
|
3
|
-
import { UITextureView } from
|
|
4
|
-
import source from
|
|
5
|
-
import { UIElement } from
|
|
6
|
-
|
|
1
|
+
import { UIColor } from "../../miscellaneous/color/UIColor.js";
|
|
2
|
+
import { computeTrimmedTransformMatrix } from "../../miscellaneous/computeTransform.js";
|
|
3
|
+
import { UITextureView } from "../../miscellaneous/texture/UITextureView.js";
|
|
4
|
+
import source from "../../shaders/UIImage.js";
|
|
5
|
+
import { UIElement } from "../UIElement/UIElement.js";
|
|
7
6
|
/** Textured image element */
|
|
8
|
-
class UIImage extends UIElement {
|
|
7
|
+
export class UIImage extends UIElement {
|
|
9
8
|
/**
|
|
10
9
|
* Creates a new UIImage instance.
|
|
11
10
|
*
|
|
@@ -26,34 +25,34 @@ class UIImage extends UIElement {
|
|
|
26
25
|
textureTransform: textureTransform,
|
|
27
26
|
color,
|
|
28
27
|
}, options);
|
|
29
|
-
this.
|
|
28
|
+
this.onTextureDimensionsChanged = (width, height) => {
|
|
30
29
|
this.width = width;
|
|
31
30
|
this.height = height;
|
|
32
31
|
};
|
|
33
32
|
this.texture = textureView;
|
|
34
|
-
this.
|
|
35
|
-
this.
|
|
36
|
-
this.texture.
|
|
33
|
+
this.textureTransform = textureTransform;
|
|
34
|
+
this.colorInternal = color;
|
|
35
|
+
this.texture.signalDimensionsChanged.on(this.onTextureDimensionsChanged);
|
|
37
36
|
}
|
|
38
37
|
/** Multiplicative tint. Alpha channel controls opacity. */
|
|
39
38
|
get color() {
|
|
40
|
-
return this.
|
|
39
|
+
return this.colorInternal;
|
|
41
40
|
}
|
|
42
41
|
/** Multiplicative tint. Alpha channel controls opacity. */
|
|
43
42
|
set color(value) {
|
|
44
|
-
this.
|
|
43
|
+
this.colorInternal.set(value);
|
|
45
44
|
}
|
|
46
|
-
/**
|
|
47
|
-
|
|
48
|
-
this.texture.
|
|
49
|
-
super.
|
|
45
|
+
/** Frees resources of the image */
|
|
46
|
+
destroyInternal() {
|
|
47
|
+
this.texture.signalDimensionsChanged.off(this.onTextureDimensionsChanged);
|
|
48
|
+
super.destroyInternal();
|
|
50
49
|
}
|
|
51
50
|
setPlaneTransform() {
|
|
52
51
|
let properties;
|
|
53
|
-
if (this.
|
|
52
|
+
if (this.colorInternal.dirty) {
|
|
54
53
|
properties ?? (properties = {});
|
|
55
|
-
properties["color"] = this.
|
|
56
|
-
this.
|
|
54
|
+
properties["color"] = this.colorInternal;
|
|
55
|
+
this.colorInternal.setDirtyFalse();
|
|
57
56
|
}
|
|
58
57
|
if (this.texture.textureDirty) {
|
|
59
58
|
properties ?? (properties = {});
|
|
@@ -62,7 +61,7 @@ class UIImage extends UIElement {
|
|
|
62
61
|
}
|
|
63
62
|
if (this.texture.uvTransformDirty) {
|
|
64
63
|
properties ?? (properties = {});
|
|
65
|
-
properties["textureTransform"] = this.texture.calculateUVTransform(this.
|
|
64
|
+
properties["textureTransform"] = this.texture.calculateUVTransform(this.textureTransform);
|
|
66
65
|
this.texture.setUVTransformDirtyFalse();
|
|
67
66
|
}
|
|
68
67
|
if (properties) {
|
|
@@ -75,11 +74,9 @@ class UIImage extends UIElement {
|
|
|
75
74
|
if (isTransformDirty) {
|
|
76
75
|
const micro = this.micro;
|
|
77
76
|
const textureTrim = this.texture.trim;
|
|
78
|
-
this.sceneWrapper.setTransform(this.planeHandler, computeTrimmedTransformMatrix(this.x, this.y, this.width, this.height, this.
|
|
77
|
+
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));
|
|
79
78
|
this.micro.setDirtyFalse();
|
|
80
79
|
this.texture.setTrimDirtyFalse();
|
|
81
80
|
}
|
|
82
81
|
}
|
|
83
82
|
}
|
|
84
|
-
|
|
85
|
-
export { UIImage };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
|
|
2
|
-
import type { UIInsetsConfig } from "../../miscellaneous/insets/UIInsets.Internal";
|
|
3
|
-
import type { UIElementOptions } from "../UIElement/UIElement.Internal";
|
|
1
|
+
import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal.js";
|
|
2
|
+
import type { UIInsetsConfig } from "../../miscellaneous/insets/UIInsets.Internal.js";
|
|
3
|
+
import type { UIElementOptions } from "../UIElement/UIElement.Internal.js";
|
|
4
4
|
/** Controls how sliceRegions values are interpreted */
|
|
5
5
|
export declare enum UINineSliceRegionMode {
|
|
6
6
|
/** sliceRegions in normalized coordinates (0 to 1) */
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
/** Controls how sliceRegions values are interpreted */
|
|
2
|
-
var UINineSliceRegionMode;
|
|
2
|
+
export var UINineSliceRegionMode;
|
|
3
3
|
(function (UINineSliceRegionMode) {
|
|
4
4
|
/** sliceRegions in normalized coordinates (0 to 1) */
|
|
5
5
|
UINineSliceRegionMode[UINineSliceRegionMode["NORMALIZED"] = 0] = "NORMALIZED";
|
|
6
6
|
/** sliceRegions in world units */
|
|
7
7
|
UINineSliceRegionMode[UINineSliceRegionMode["WORLD"] = 1] = "WORLD";
|
|
8
8
|
})(UINineSliceRegionMode || (UINineSliceRegionMode = {}));
|
|
9
|
-
const NINE_SLICE_DEFAULT_BORDER = 0.1;
|
|
10
|
-
const NINE_SLICE_DEFAULT_REGION_MODE = UINineSliceRegionMode.WORLD;
|
|
11
|
-
|
|
12
|
-
export { NINE_SLICE_DEFAULT_BORDER, NINE_SLICE_DEFAULT_REGION_MODE, UINineSliceRegionMode };
|
|
9
|
+
export const NINE_SLICE_DEFAULT_BORDER = 0.1;
|
|
10
|
+
export const NINE_SLICE_DEFAULT_REGION_MODE = UINineSliceRegionMode.WORLD;
|
|
@@ -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.
|
|
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.
|
|
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,6 +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
|
+
/** Frees resources of the progress bar */
|
|
43
|
+
protected destroyInternal(): void;
|
|
42
44
|
protected setPlaneTransform(): void;
|
|
43
45
|
private readonly onTextureDimensionsChanged;
|
|
44
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,61 +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.
|
|
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
|
}
|
|
92
|
+
/** Frees resources of the progress bar */
|
|
93
|
+
destroyInternal() {
|
|
94
|
+
this.texture.signalDimensionsChanged.off(this.onTextureDimensionsChanged);
|
|
95
|
+
super.destroyInternal();
|
|
96
|
+
}
|
|
93
97
|
setPlaneTransform() {
|
|
94
98
|
let properties;
|
|
95
|
-
if (this.
|
|
99
|
+
if (this.colorInternal.dirty) {
|
|
96
100
|
properties ?? (properties = {});
|
|
97
|
-
properties["color"] = this.
|
|
98
|
-
this.
|
|
101
|
+
properties["color"] = this.colorInternal;
|
|
102
|
+
this.colorInternal.setDirtyFalse();
|
|
99
103
|
}
|
|
100
104
|
if (this.texture.textureDirty) {
|
|
101
105
|
properties ?? (properties = {});
|
|
@@ -104,18 +108,18 @@ class UIProgress extends UIElement {
|
|
|
104
108
|
}
|
|
105
109
|
if (this.texture.uvTransformDirty) {
|
|
106
110
|
properties ?? (properties = {});
|
|
107
|
-
properties["textureTransform"] = this.texture.calculateUVTransform(this.
|
|
111
|
+
properties["textureTransform"] = this.texture.calculateUVTransform(this.textureTransform);
|
|
108
112
|
this.texture.setUVTransformDirtyFalse();
|
|
109
113
|
}
|
|
110
|
-
if (this.
|
|
114
|
+
if (this.progressDirty) {
|
|
111
115
|
properties ?? (properties = {});
|
|
112
|
-
properties["progress"] = this.
|
|
113
|
-
this.
|
|
116
|
+
properties["progress"] = this.progressInternal;
|
|
117
|
+
this.progressDirty = false;
|
|
114
118
|
}
|
|
115
|
-
if (this.
|
|
119
|
+
if (this.textureResolutionDirty) {
|
|
116
120
|
properties ?? (properties = {});
|
|
117
|
-
properties["textureResolution"] = this.texture.getResolution(this.
|
|
118
|
-
this.
|
|
121
|
+
properties["textureResolution"] = this.texture.getResolution(this.textureResolution);
|
|
122
|
+
this.textureResolutionDirty = false;
|
|
119
123
|
}
|
|
120
124
|
if (this.maskFunction.dirty) {
|
|
121
125
|
properties ?? (properties = {});
|
|
@@ -135,32 +139,30 @@ class UIProgress extends UIElement {
|
|
|
135
139
|
if (isTransformDirty) {
|
|
136
140
|
const micro = this.micro;
|
|
137
141
|
const textureTrim = this.texture.trim;
|
|
138
|
-
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));
|
|
139
143
|
this.micro.setDirtyFalse();
|
|
140
144
|
this.texture.setTrimDirtyFalse();
|
|
141
145
|
}
|
|
142
146
|
}
|
|
143
|
-
|
|
147
|
+
rebuildPlane() {
|
|
144
148
|
this.sceneWrapper.destroyPlane(this.planeHandler);
|
|
145
149
|
const micro = this.micro;
|
|
146
150
|
const textureTrim = this.texture.trim;
|
|
147
|
-
this.planeHandler = this.sceneWrapper.createPlane(this.
|
|
151
|
+
this.planeHandler = this.sceneWrapper.createPlane(this.maskFunctionInternal.source + source, {
|
|
148
152
|
texture: this.texture.texture,
|
|
149
|
-
textureTransform: this.texture.calculateUVTransform(this.
|
|
150
|
-
textureResolution: this.texture.getResolution(this.
|
|
151
|
-
color: this.
|
|
152
|
-
progress: this.
|
|
153
|
-
...this.
|
|
154
|
-
}, computeTrimmedTransformMatrix(this.x, this.y, this.width, this.height, this.
|
|
155
|
-
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();
|
|
156
160
|
this.texture.setTextureDirtyFalse();
|
|
157
161
|
this.texture.setUVTransformDirtyFalse();
|
|
158
162
|
this.texture.setTrimDirtyFalse();
|
|
159
|
-
this.
|
|
160
|
-
this.
|
|
161
|
-
this.
|
|
163
|
+
this.progressDirty = false;
|
|
164
|
+
this.textureResolutionDirty = false;
|
|
165
|
+
this.maskFunctionInternal.setDirtyFalse();
|
|
162
166
|
this.micro.setDirtyFalse();
|
|
163
167
|
}
|
|
164
168
|
}
|
|
165
|
-
|
|
166
|
-
export { UIProgress };
|