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,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
|
}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { Color,
|
|
2
|
-
import { assertValidPositiveNumber } from
|
|
3
|
-
import { UIColor } from
|
|
4
|
-
import source from
|
|
5
|
-
import { DUMMY_DEFAULT_WIDTH,
|
|
6
|
-
import { UIElement } from
|
|
7
|
-
import {
|
|
8
|
-
|
|
1
|
+
import { Color, LinearFilter, MathUtils, Matrix3, PerspectiveCamera, RGBAFormat, Scene, UnsignedByteType, WebGLRenderTarget, } from "three";
|
|
2
|
+
import { assertValidPositiveNumber } from "../../miscellaneous/asserts.js";
|
|
3
|
+
import { UIColor } from "../../miscellaneous/color/UIColor.js";
|
|
4
|
+
import source from "../../shaders/UIImage.js";
|
|
5
|
+
import { DUMMY_DEFAULT_HEIGHT, DUMMY_DEFAULT_WIDTH, } from "../UIDummy/UIDummy.Internal.js";
|
|
6
|
+
import { UIElement } from "../UIElement/UIElement.js";
|
|
7
|
+
import { 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, } from "./UIScene.Internal.js";
|
|
9
8
|
let previousClearColor = new Color();
|
|
10
9
|
let previousClearAlpha = 0;
|
|
11
10
|
/** Renders Three.js scene to texture */
|
|
12
|
-
class UIScene extends UIElement {
|
|
11
|
+
export class UIScene extends UIElement {
|
|
13
12
|
/**
|
|
14
13
|
* Creates a new UIScene instance.
|
|
15
14
|
*
|
|
@@ -38,127 +37,127 @@ class UIScene extends UIElement {
|
|
|
38
37
|
textureTransform: new Matrix3(),
|
|
39
38
|
color,
|
|
40
39
|
}, options);
|
|
41
|
-
this.
|
|
42
|
-
this.
|
|
43
|
-
this.
|
|
44
|
-
this.
|
|
45
|
-
this.
|
|
46
|
-
this.
|
|
47
|
-
this.
|
|
48
|
-
this.
|
|
49
|
-
this.
|
|
40
|
+
this.evenFrame = true;
|
|
41
|
+
this.updateRequired = false;
|
|
42
|
+
this.resolutionFactorDirty = false;
|
|
43
|
+
this.propertyDirty = false;
|
|
44
|
+
this.colorInternal = color;
|
|
45
|
+
this.clearColorInternal = new UIColor(options.clearColor ?? SCENE_DEFAULT_CLEAR_COLOR);
|
|
46
|
+
this.renderTarget = renderTarget;
|
|
47
|
+
this.sceneInternal = options.scene ?? new Scene();
|
|
48
|
+
this.cameraInternal =
|
|
50
49
|
options.camera ??
|
|
51
50
|
new PerspectiveCamera(SCENE_DEFAULT_CAMERA_FOV, w / h, SCENE_DEFAULT_CAMERA_NEAR, SCENE_DEFAULT_CAMERA_FAR);
|
|
52
|
-
this.
|
|
53
|
-
this.
|
|
54
|
-
this.
|
|
51
|
+
this.resolutionFactorInternal = resolutionFactor;
|
|
52
|
+
this.updateModeInternal = options.updateMode ?? SCENE_DEFAULT_UPDATE_MODE;
|
|
53
|
+
this.propertyDirty = options.updateMode !== UISceneUpdateMode.MANUAL;
|
|
55
54
|
}
|
|
56
55
|
/** Camera used for rendering */
|
|
57
56
|
get camera() {
|
|
58
|
-
return this.
|
|
57
|
+
return this.cameraInternal;
|
|
59
58
|
}
|
|
60
59
|
/** Background color for render target */
|
|
61
60
|
get clearColor() {
|
|
62
|
-
return this.
|
|
61
|
+
return this.clearColorInternal;
|
|
63
62
|
}
|
|
64
63
|
/** Multiplicative tint. Alpha channel controls opacity. */
|
|
65
64
|
get color() {
|
|
66
|
-
return this.
|
|
65
|
+
return this.colorInternal;
|
|
67
66
|
}
|
|
68
67
|
/** Render target resolution multiplier. Range 0.1 to 2.0. */
|
|
69
68
|
get resolutionFactor() {
|
|
70
|
-
return this.
|
|
69
|
+
return this.resolutionFactorInternal;
|
|
71
70
|
}
|
|
72
71
|
/** Three.js scene to render */
|
|
73
72
|
get scene() {
|
|
74
|
-
return this.
|
|
73
|
+
return this.sceneInternal;
|
|
75
74
|
}
|
|
76
75
|
/** Controls when scene re-renders */
|
|
77
76
|
get updateMode() {
|
|
78
|
-
return this.
|
|
77
|
+
return this.updateModeInternal;
|
|
79
78
|
}
|
|
80
79
|
/** Camera used for rendering */
|
|
81
80
|
set camera(value) {
|
|
82
|
-
if (this.
|
|
83
|
-
this.
|
|
84
|
-
this.
|
|
81
|
+
if (this.cameraInternal !== value) {
|
|
82
|
+
this.cameraInternal = value;
|
|
83
|
+
this.propertyDirty = true;
|
|
85
84
|
}
|
|
86
85
|
}
|
|
87
86
|
/** Background color for render target */
|
|
88
87
|
set clearColor(value) {
|
|
89
|
-
this.
|
|
88
|
+
this.clearColorInternal.set(value);
|
|
90
89
|
}
|
|
91
90
|
/** Multiplicative tint. Alpha channel controls opacity. */
|
|
92
91
|
set color(value) {
|
|
93
|
-
this.
|
|
92
|
+
this.colorInternal.set(value);
|
|
94
93
|
}
|
|
95
94
|
/** Render target resolution multiplier. Range 0.1 to 2.0. */
|
|
96
95
|
set resolutionFactor(value) {
|
|
97
96
|
assertValidPositiveNumber(value, "UIScene.resolutionFactor");
|
|
98
97
|
value = MathUtils.clamp(value, SCENE_MIN_RESOLUTION_FACTOR, SCENE_MAX_RESOLUTION_FACTOR);
|
|
99
|
-
if (this.
|
|
100
|
-
this.
|
|
101
|
-
this.
|
|
98
|
+
if (this.resolutionFactorInternal !== value) {
|
|
99
|
+
this.resolutionFactorInternal = value;
|
|
100
|
+
this.resolutionFactorDirty = true;
|
|
102
101
|
}
|
|
103
102
|
}
|
|
104
103
|
/** Three.js scene to render */
|
|
105
104
|
set scene(value) {
|
|
106
|
-
if (this.
|
|
107
|
-
this.
|
|
108
|
-
this.
|
|
105
|
+
if (this.sceneInternal !== value) {
|
|
106
|
+
this.sceneInternal = value;
|
|
107
|
+
this.propertyDirty = true;
|
|
109
108
|
}
|
|
110
109
|
}
|
|
111
110
|
/** Controls when scene re-renders */
|
|
112
111
|
set updateMode(value) {
|
|
113
|
-
if (this.
|
|
114
|
-
this.
|
|
115
|
-
this.
|
|
112
|
+
if (this.updateModeInternal !== value) {
|
|
113
|
+
this.updateModeInternal = value;
|
|
114
|
+
this.propertyDirty = true;
|
|
116
115
|
}
|
|
117
116
|
}
|
|
118
|
-
/** Removes element and frees resources */
|
|
119
|
-
destroy() {
|
|
120
|
-
this._private_renderTarget.dispose();
|
|
121
|
-
super.destroy();
|
|
122
|
-
}
|
|
123
117
|
/** Triggers re-render on next frame. Useful in MANUAL mode. */
|
|
124
118
|
requestUpdate() {
|
|
125
|
-
this.
|
|
119
|
+
this.updateRequired = true;
|
|
120
|
+
}
|
|
121
|
+
/** Frees resources of the scene */
|
|
122
|
+
destroyInternal() {
|
|
123
|
+
this.renderTarget.dispose();
|
|
124
|
+
super.destroyInternal();
|
|
126
125
|
}
|
|
127
126
|
onWillRender(renderer, deltaTime) {
|
|
128
|
-
this.
|
|
129
|
-
const isFramebufferDirty = this.
|
|
130
|
-
this.
|
|
131
|
-
(this.
|
|
132
|
-
|
|
133
|
-
this.
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
127
|
+
this.evenFrame = !this.evenFrame;
|
|
128
|
+
const isFramebufferDirty = this.updateRequired ||
|
|
129
|
+
this.updateModeInternal === UISceneUpdateMode.EVERY_FRAME ||
|
|
130
|
+
(this.updateModeInternal === UISceneUpdateMode.EVERY_SECOND_FRAME &&
|
|
131
|
+
this.evenFrame) ||
|
|
132
|
+
(this.updateModeInternal === UISceneUpdateMode.ON_PROPERTIES_CHANGE &&
|
|
133
|
+
this.propertyDirty) ||
|
|
134
|
+
this.colorInternal.dirty ||
|
|
135
|
+
this.clearColorInternal.dirty ||
|
|
136
|
+
(this.updateModeInternal === UISceneUpdateMode.ON_DIMENSIONS_CHANGE &&
|
|
137
|
+
(this.resolutionFactorDirty || this.solverWrapper.dirty));
|
|
137
138
|
if (isFramebufferDirty) {
|
|
138
|
-
if (this.
|
|
139
|
-
this.
|
|
140
|
-
this.
|
|
139
|
+
if (this.resolutionFactorDirty || this.solverWrapper.dirty) {
|
|
140
|
+
this.renderTarget.setSize(this.width * this.resolutionFactorInternal, this.height * this.resolutionFactorInternal);
|
|
141
|
+
this.resolutionFactorDirty = false;
|
|
141
142
|
}
|
|
142
|
-
if (this.
|
|
143
|
+
if (this.colorInternal.dirty) {
|
|
143
144
|
this.sceneWrapper.setProperties(this.planeHandler, {
|
|
144
|
-
color: this.
|
|
145
|
+
color: this.colorInternal,
|
|
145
146
|
});
|
|
146
|
-
this.
|
|
147
|
+
this.colorInternal.setDirtyFalse();
|
|
147
148
|
}
|
|
148
149
|
const previousRenderTarget = renderer.getRenderTarget();
|
|
149
150
|
previousClearColor = renderer.getClearColor(previousClearColor);
|
|
150
151
|
previousClearAlpha = renderer.getClearAlpha();
|
|
151
|
-
renderer.setClearColor(this.
|
|
152
|
-
renderer.setRenderTarget(this.
|
|
152
|
+
renderer.setClearColor(this.clearColorInternal.getHexRGB(), this.clearColorInternal.a);
|
|
153
|
+
renderer.setRenderTarget(this.renderTarget);
|
|
153
154
|
renderer.clear(true, true, false);
|
|
154
|
-
renderer.render(this.
|
|
155
|
+
renderer.render(this.sceneInternal, this.cameraInternal);
|
|
155
156
|
renderer.setRenderTarget(previousRenderTarget);
|
|
156
157
|
renderer.setClearColor(previousClearColor, previousClearAlpha);
|
|
157
|
-
this.
|
|
158
|
-
this.
|
|
158
|
+
this.propertyDirty = false;
|
|
159
|
+
this.updateRequired = false;
|
|
159
160
|
}
|
|
160
161
|
super.onWillRender(renderer, deltaTime);
|
|
161
162
|
}
|
|
162
163
|
}
|
|
163
|
-
|
|
164
|
-
export { UIScene };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { UITextSpan } from "../../miscellaneous/text-span/UITextSpan";
|
|
2
|
-
import type { UITextChunk } from "./UIText.Interfaces";
|
|
1
|
+
import type { UITextSpan } from "../../miscellaneous/text-span/UITextSpan.js";
|
|
2
|
+
import type { UITextChunk } from "./UIText.Interfaces.js";
|
|
3
3
|
/**
|
|
4
4
|
* Detects the directional class used to order a chunk among its neighbours.
|
|
5
5
|
* Digit only chunks are ordered left to right in both paragraph directions.
|
|
@@ -64,7 +64,7 @@ function reverseChunkRange(textChunks, from, to) {
|
|
|
64
64
|
* @param text Chunk text
|
|
65
65
|
* @returns Directional class of the chunk
|
|
66
66
|
*/
|
|
67
|
-
function detectBidiClass(text) {
|
|
67
|
+
export function detectBidiClass(text) {
|
|
68
68
|
const strongClass = detectStrongClass(text);
|
|
69
69
|
if (strongClass !== BIDI_NEUTRAL) {
|
|
70
70
|
return strongClass;
|
|
@@ -77,7 +77,7 @@ function detectBidiClass(text) {
|
|
|
77
77
|
* @param textSpans Text spans in logical order
|
|
78
78
|
* @returns Whether the paragraph reads right to left
|
|
79
79
|
*/
|
|
80
|
-
function detectIsRTL(textSpans) {
|
|
80
|
+
export function detectIsRTL(textSpans) {
|
|
81
81
|
for (const textSpan of textSpans) {
|
|
82
82
|
const strongClass = detectStrongClass(textSpan.text);
|
|
83
83
|
if (strongClass !== BIDI_NEUTRAL) {
|
|
@@ -94,7 +94,7 @@ function detectIsRTL(textSpans) {
|
|
|
94
94
|
* @param isRTL Whether the paragraph reads right to left
|
|
95
95
|
* @returns Chunks in visual order, or the same array when reordering is not needed
|
|
96
96
|
*/
|
|
97
|
-
function reorderChunksVisually(textChunks, isRTL) {
|
|
97
|
+
export function reorderChunksVisually(textChunks, isRTL) {
|
|
98
98
|
if (!isRTL && !textChunks.some((textChunk) => textChunk.bidiClass === BIDI_RTL)) {
|
|
99
99
|
return textChunks;
|
|
100
100
|
}
|
|
@@ -129,5 +129,3 @@ function reorderChunksVisually(textChunks, isRTL) {
|
|
|
129
129
|
}
|
|
130
130
|
return result;
|
|
131
131
|
}
|
|
132
|
-
|
|
133
|
-
export { detectBidiClass, detectIsRTL, reorderChunksVisually };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { UITextSpanConfig } from "../../miscellaneous/text-span/UITextSpan.Internal";
|
|
2
|
-
import type { UITextStyleConfig } from "../../miscellaneous/text-style/UITextStyle.Internal";
|
|
1
|
+
import type { UITextSpanConfig } from "../../miscellaneous/text-span/UITextSpan.Internal.js";
|
|
2
|
+
import type { UITextStyleConfig } from "../../miscellaneous/text-style/UITextStyle.Internal.js";
|
|
3
3
|
/** Text content configuration */
|
|
4
4
|
export type UITextContent = (UITextSpanConfig | string)[] | UITextSpanConfig | string;
|
|
5
5
|
/** Text dimensions */
|
|
@@ -15,6 +15,10 @@ export interface UIChunkMetrics extends UITextSize {
|
|
|
15
15
|
baseline: number;
|
|
16
16
|
/** Line height in pixels */
|
|
17
17
|
lineHeight: number;
|
|
18
|
+
/** How far the glyphs reach left of the start of the advance, in pixels */
|
|
19
|
+
overhangLeft: number;
|
|
20
|
+
/** How far the glyphs reach right of the end of the advance, in pixels */
|
|
21
|
+
overhangRight: number;
|
|
18
22
|
}
|
|
19
23
|
/** Styled text chunk */
|
|
20
24
|
export interface UITextChunk {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
|
|
2
|
-
import type { UIInsetsConfig } from "../../miscellaneous/insets/UIInsets.Internal";
|
|
3
|
-
import type { UITextStyleConfig } from "../../miscellaneous/text-style/UITextStyle.Internal";
|
|
4
|
-
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 { UITextStyleConfig } from "../../miscellaneous/text-style/UITextStyle.Internal.js";
|
|
4
|
+
import type { UIElementOptions } from "../UIElement/UIElement.Internal.js";
|
|
5
5
|
/** Base direction used for bidirectional text reordering */
|
|
6
6
|
export declare enum UITextDirection {
|
|
7
7
|
/** Detect from the first strong directional character of the content */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Base direction used for bidirectional text reordering */
|
|
2
|
-
var UITextDirection;
|
|
2
|
+
export var UITextDirection;
|
|
3
3
|
(function (UITextDirection) {
|
|
4
4
|
/** Detect from the first strong directional character of the content */
|
|
5
5
|
UITextDirection[UITextDirection["AUTO"] = 0] = "AUTO";
|
|
@@ -9,15 +9,13 @@ var UITextDirection;
|
|
|
9
9
|
UITextDirection[UITextDirection["RTL"] = 2] = "RTL";
|
|
10
10
|
})(UITextDirection || (UITextDirection = {}));
|
|
11
11
|
/** Controls how text adapts to element size */
|
|
12
|
-
var UITextResizeMode;
|
|
12
|
+
export var UITextResizeMode;
|
|
13
13
|
(function (UITextResizeMode) {
|
|
14
14
|
/** Break text into multiple lines when narrower than content*/
|
|
15
15
|
UITextResizeMode[UITextResizeMode["BREAK"] = 0] = "BREAK";
|
|
16
16
|
/** Scale text to fit fixed element size */
|
|
17
17
|
UITextResizeMode[UITextResizeMode["SCALE"] = 1] = "SCALE";
|
|
18
18
|
})(UITextResizeMode || (UITextResizeMode = {}));
|
|
19
|
-
const TEXT_DEFAULT_MAX_LINE_WIDTH = 1024;
|
|
20
|
-
const TEXT_DEFAULT_RESIZE_MODE = UITextResizeMode.SCALE;
|
|
21
|
-
const TEXT_DEFAULT_DIRECTION = UITextDirection.AUTO;
|
|
22
|
-
|
|
23
|
-
export { TEXT_DEFAULT_DIRECTION, TEXT_DEFAULT_MAX_LINE_WIDTH, TEXT_DEFAULT_RESIZE_MODE, UITextDirection, UITextResizeMode };
|
|
19
|
+
export const TEXT_DEFAULT_MAX_LINE_WIDTH = 1024;
|
|
20
|
+
export const TEXT_DEFAULT_RESIZE_MODE = UITextResizeMode.SCALE;
|
|
21
|
+
export const TEXT_DEFAULT_DIRECTION = UITextDirection.AUTO;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { UICanvasRenderingContext2D } from "../../miscellaneous/canvas";
|
|
2
|
-
import type { UITextSpan } from "../../miscellaneous/text-span/UITextSpan";
|
|
3
|
-
import { UITextStyle } from "../../miscellaneous/text-style/UITextStyle";
|
|
4
|
-
import type { UITextStyleConfig } from "../../miscellaneous/text-style/UITextStyle.Internal";
|
|
5
|
-
import type { UIChunkMetrics, UITextChunk, UITextLine, UITextSize } from "./UIText.Interfaces";
|
|
1
|
+
import type { UICanvasRenderingContext2D } from "../../miscellaneous/canvas.js";
|
|
2
|
+
import type { UITextSpan } from "../../miscellaneous/text-span/UITextSpan.js";
|
|
3
|
+
import { UITextStyle } from "../../miscellaneous/text-style/UITextStyle.js";
|
|
4
|
+
import type { UITextStyleConfig } from "../../miscellaneous/text-style/UITextStyle.Internal.js";
|
|
5
|
+
import type { UIChunkMetrics, UITextChunk, UITextLine, UITextSize } from "./UIText.Interfaces.js";
|
|
6
6
|
/**
|
|
7
7
|
* Applies font of a resolved style to a canvas context.
|
|
8
8
|
* Shared by measuring and rendering so both stay in sync.
|
|
@@ -12,6 +12,7 @@ import type { UIChunkMetrics, UITextChunk, UITextLine, UITextSize } from "./UITe
|
|
|
12
12
|
export declare function applyFontStyle(context: UICanvasRenderingContext2D, textStyle: UITextStyleConfig): void;
|
|
13
13
|
/**
|
|
14
14
|
* Splits text into renderable chunks.
|
|
15
|
+
* No-break spaces stay inside words, so a line never breaks at them.
|
|
15
16
|
* @param text Text to split
|
|
16
17
|
* @returns Array of words, spaces, and newlines
|
|
17
18
|
*/
|
|
@@ -26,11 +27,16 @@ export declare function splitTextIntoChunks(text: string): string[];
|
|
|
26
27
|
export declare function measureTextChunk(context: UICanvasRenderingContext2D, text: string, textStyle: UITextStyleConfig): UIChunkMetrics;
|
|
27
28
|
/**
|
|
28
29
|
* Builds text lines with word wrapping.
|
|
30
|
+
* Spaces behave as in a browser: a space never moves to the next line by itself, spaces at the
|
|
31
|
+
* end of a line are not part of it, and a line made by wrapping does not start with a space.
|
|
32
|
+
* Spaces at the start of the text and after a newline are kept. A newline always ends a line,
|
|
33
|
+
* so two newlines in a row leave an empty line.
|
|
29
34
|
* @param maxWidth Maximum line width in pixels
|
|
30
35
|
* @param textChunks Measured text chunks
|
|
36
|
+
* @param isRTL Whether the paragraph reads right to left
|
|
31
37
|
* @returns Array of text lines
|
|
32
38
|
*/
|
|
33
|
-
export declare function buildTextLines(maxWidth: number, textChunks: UITextChunk[]): UITextLine[];
|
|
39
|
+
export declare function buildTextLines(maxWidth: number, textChunks: UITextChunk[], isRTL: boolean): UITextLine[];
|
|
34
40
|
/**
|
|
35
41
|
* Calculates total text size from lines.
|
|
36
42
|
* The box spans from the ascent of the first line to the descent of the last one.
|
|
@@ -51,9 +57,10 @@ export declare function buildTextChunks(context: UICanvasRenderingContext2D, tex
|
|
|
51
57
|
* Calculates text layout parameters.
|
|
52
58
|
* @param textChunks Measured text chunks
|
|
53
59
|
* @param maxLineWidth Maximum line width in pixels
|
|
60
|
+
* @param isRTL Whether the paragraph reads right to left
|
|
54
61
|
* @returns Lines and total size
|
|
55
62
|
*/
|
|
56
|
-
export declare function calculateTextContentParameters(textChunks: UITextChunk[], maxLineWidth: number): {
|
|
63
|
+
export declare function calculateTextContentParameters(textChunks: UITextChunk[], maxLineWidth: number, isRTL: boolean): {
|
|
57
64
|
lines: UITextLine[];
|
|
58
65
|
size: UITextSize;
|
|
59
66
|
};
|