laymur 0.23.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 +11 -11
- package/dist/core/elements/UIElement/UIElement.js +57 -60
- package/dist/core/elements/UIGraphics/UIGraphics.Internal.d.ts +3 -3
- package/dist/core/elements/UIGraphics/UIGraphics.Internal.js +4 -7
- package/dist/core/elements/UIGraphics/UIGraphics.d.ts +7 -7
- package/dist/core/elements/UIGraphics/UIGraphics.js +44 -47
- package/dist/core/elements/UIImage/UIImage.Internal.d.ts +2 -2
- package/dist/core/elements/UIImage/UIImage.Internal.js +1 -0
- package/dist/core/elements/UIImage/UIImage.d.ts +9 -9
- package/dist/core/elements/UIImage/UIImage.js +21 -24
- package/dist/core/elements/UINineSlice/UINineSlice.Internal.d.ts +3 -3
- package/dist/core/elements/UINineSlice/UINineSlice.Internal.js +3 -5
- package/dist/core/elements/UINineSlice/UINineSlice.d.ts +12 -12
- package/dist/core/elements/UINineSlice/UINineSlice.js +71 -73
- package/dist/core/elements/UIProgress/UIProgress.Internal.d.ts +3 -4
- package/dist/core/elements/UIProgress/UIProgress.Internal.js +1 -3
- package/dist/core/elements/UIProgress/UIProgress.d.ts +10 -10
- package/dist/core/elements/UIProgress/UIProgress.js +59 -62
- package/dist/core/elements/UIScene/UIScene.Internal.d.ts +3 -3
- package/dist/core/elements/UIScene/UIScene.Internal.js +11 -14
- package/dist/core/elements/UIScene/UIScene.d.ts +8 -8
- package/dist/core/elements/UIScene/UIScene.js +68 -69
- package/dist/core/elements/UIText/UIText.Bidi.d.ts +2 -2
- package/dist/core/elements/UIText/UIText.Bidi.js +3 -5
- package/dist/core/elements/UIText/UIText.Interfaces.d.ts +6 -2
- package/dist/core/elements/UIText/UIText.Interfaces.js +1 -0
- package/dist/core/elements/UIText/UIText.Internal.d.ts +4 -4
- package/dist/core/elements/UIText/UIText.Internal.js +5 -7
- package/dist/core/elements/UIText/UIText.Measuring.d.ts +14 -7
- package/dist/core/elements/UIText/UIText.Measuring.js +115 -55
- package/dist/core/elements/UIText/UIText.Rendering.d.ts +3 -3
- package/dist/core/elements/UIText/UIText.Rendering.js +6 -9
- package/dist/core/elements/UIText/UIText.d.ts +28 -14
- package/dist/core/elements/UIText/UIText.js +181 -141
- package/dist/core/index.d.ts +55 -54
- package/dist/core/index.js +53 -0
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.d.ts +4 -4
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.js +2 -5
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.d.ts +4 -4
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.js +43 -42
- package/dist/core/layers/UILayer/UILayer.Internal.d.ts +2 -2
- package/dist/core/layers/UILayer/UILayer.Internal.js +4 -7
- package/dist/core/layers/UILayer/UILayer.d.ts +19 -4
- package/dist/core/layers/UILayer/UILayer.js +125 -62
- package/dist/core/miscellaneous/UIBlendMode.js +1 -3
- package/dist/core/miscellaneous/UIExpression.js +16 -19
- package/dist/core/miscellaneous/UIMode.js +3 -5
- package/dist/core/miscellaneous/UIOrientation.js +2 -4
- package/dist/core/miscellaneous/UIPriority.js +5 -8
- package/dist/core/miscellaneous/UIRelation.js +5 -8
- package/dist/core/miscellaneous/UITransparencyMode.js +1 -3
- package/dist/core/miscellaneous/area/UIArea.js +1 -3
- package/dist/core/miscellaneous/area/UIAreaCircle.d.ts +1 -1
- package/dist/core/miscellaneous/area/UIAreaCircle.js +3 -6
- package/dist/core/miscellaneous/area/UIAreaPolygon.d.ts +2 -2
- package/dist/core/miscellaneous/area/UIAreaPolygon.js +3 -6
- package/dist/core/miscellaneous/area/UIAreaRectangle.d.ts +1 -1
- package/dist/core/miscellaneous/area/UIAreaRectangle.js +3 -6
- package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.d.ts +1 -1
- package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.js +3 -6
- package/dist/core/miscellaneous/asserts.d.ts +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 +13 -16
- package/dist/core/miscellaneous/math.js +3 -5
- package/dist/core/miscellaneous/micro/UIMicro.Internal.js +6 -8
- package/dist/core/miscellaneous/micro/UIMicro.d.ts +1 -1
- package/dist/core/miscellaneous/micro/UIMicro.js +91 -94
- package/dist/core/miscellaneous/resize-policy/UIResizePolicy.js +1 -3
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.js +12 -15
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.js +13 -16
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.js +13 -16
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.js +12 -15
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.js +13 -16
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.js +13 -16
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.js +3 -6
- package/dist/core/miscellaneous/shared.d.ts +1 -1
- package/dist/core/miscellaneous/shared.js +4 -7
- package/dist/core/miscellaneous/text-span/UITextSpan.Internal.d.ts +1 -1
- package/dist/core/miscellaneous/text-span/UITextSpan.Internal.js +1 -0
- package/dist/core/miscellaneous/text-span/UITextSpan.d.ts +2 -2
- package/dist/core/miscellaneous/text-span/UITextSpan.js +10 -13
- package/dist/core/miscellaneous/text-style/UITextStyle.Internal.js +15 -17
- package/dist/core/miscellaneous/text-style/UITextStyle.d.ts +13 -2
- package/dist/core/miscellaneous/text-style/UITextStyle.js +222 -207
- package/dist/core/miscellaneous/texture/UITextureView.Internal.d.ts +7 -0
- package/dist/core/miscellaneous/texture/UITextureView.Internal.js +16 -6
- package/dist/core/miscellaneous/texture/UITextureView.d.ts +1 -1
- package/dist/core/miscellaneous/texture/UITextureView.js +113 -117
- package/dist/core/miscellaneous/webglCapabilities.js +3 -4
- package/dist/core/shaders/UIImage.d.ts +9 -0
- package/dist/core/shaders/UIImage.js +14 -0
- package/dist/core/shaders/UINineSlice.d.ts +11 -0
- package/dist/core/shaders/UINineSlice.js +57 -0
- package/dist/core/shaders/UIProgress.d.ts +14 -0
- package/dist/core/shaders/UIProgress.js +21 -0
- package/dist/core/shaders/UIProgressMaskFunctionCircular.d.ts +2 -0
- package/dist/core/shaders/UIProgressMaskFunctionCircular.js +16 -0
- package/dist/core/shaders/UIProgressMaskFunctionDirectional.d.ts +2 -0
- package/dist/core/shaders/UIProgressMaskFunctionDirectional.js +15 -0
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.d.ts +4 -0
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.js +1 -0
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.d.ts +7 -1
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.js +50 -47
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.d.ts +5 -2
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.js +1 -0
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.d.ts +11 -3
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.js +42 -26
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.d.ts +5 -3
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.js +1 -0
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.d.ts +20 -4
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.js +138 -117
- package/dist/debug/UIAspectDebug.d.ts +3 -3
- package/dist/debug/UIAspectDebug.js +64 -68
- package/dist/debug/UIConstraintDebug.d.ts +1 -1
- package/dist/debug/UIConstraintDebug.js +1 -0
- package/dist/debug/UIHeightDebug.d.ts +3 -3
- package/dist/debug/UIHeightDebug.js +63 -67
- package/dist/debug/UIHorizontalDistanceDebug.d.ts +3 -3
- package/dist/debug/UIHorizontalDistanceDebug.js +76 -81
- package/dist/debug/UIHorizontalInterpolationDebug.d.ts +3 -3
- package/dist/debug/UIHorizontalInterpolationDebug.js +74 -78
- package/dist/debug/UILayerDebug.d.ts +1 -1
- package/dist/debug/UILayerDebug.js +55 -64
- package/dist/debug/UIVerticalDistanceDebug.d.ts +3 -3
- package/dist/debug/UIVerticalDistanceDebug.js +76 -81
- package/dist/debug/UIVerticalInterpolationDebug.d.ts +3 -3
- package/dist/debug/UIVerticalInterpolationDebug.js +74 -78
- package/dist/debug/UIWidthDebug.d.ts +3 -3
- package/dist/debug/UIWidthDebug.js +63 -67
- package/dist/debug/index.d.ts +8 -8
- package/dist/debug/index.js +8 -8
- package/dist/debug/miscellaneous.js +8 -11
- package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.d.ts +3 -3
- package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.js +13 -16
- package/dist/particles/behaviorModules/UIBehaviorModule.d.ts +1 -1
- package/dist/particles/behaviorModules/UIBehaviorModule.js +1 -3
- package/dist/particles/behaviorModules/UIBehaviorPointGravity.d.ts +3 -3
- package/dist/particles/behaviorModules/UIBehaviorPointGravity.js +37 -40
- package/dist/particles/behaviorModules/UIBehaviorScaleOscillation.d.ts +41 -0
- package/dist/particles/behaviorModules/UIBehaviorScaleOscillation.js +87 -0
- package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.d.ts +2 -2
- package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.js +17 -20
- package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.d.ts +2 -2
- package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.js +13 -16
- package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.d.ts +2 -2
- package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.js +21 -24
- package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.d.ts +2 -2
- package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.js +13 -16
- package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.d.ts +2 -2
- package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.js +21 -24
- package/dist/particles/elements/UIEmitter.Internal.d.ts +2 -2
- package/dist/particles/elements/UIEmitter.Internal.js +6 -9
- package/dist/particles/elements/UIEmitter.d.ts +17 -11
- package/dist/particles/elements/UIEmitter.js +100 -88
- package/dist/particles/index.d.ts +20 -18
- package/dist/particles/index.js +19 -18
- package/dist/particles/instancedParticle/UIInstancedParticle.Internal.d.ts +1 -1
- package/dist/particles/instancedParticle/UIInstancedParticle.Internal.js +14 -15
- package/dist/particles/instancedParticle/UIInstancedParticle.d.ts +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,86 +1,85 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { assertValidNonNegativeNumber, assertValidNumber, assertValidPositiveNumber, } from "../asserts.js";
|
|
2
|
+
import { TEXT_STYLE_DEFAULT_ALIGN, TEXT_STYLE_DEFAULT_COLOR, TEXT_STYLE_DEFAULT_ENABLE_SHADOW, TEXT_STYLE_DEFAULT_ENABLE_STROKE, TEXT_STYLE_DEFAULT_FONT_FAMILY, TEXT_STYLE_DEFAULT_FONT_SIZE, TEXT_STYLE_DEFAULT_FONT_STYLE, TEXT_STYLE_DEFAULT_FONT_WEIGHT, TEXT_STYLE_DEFAULT_LINE_HEIGHT, TEXT_STYLE_DEFAULT_SHADOW_BLUR, TEXT_STYLE_DEFAULT_SHADOW_COLOR, TEXT_STYLE_DEFAULT_SHADOW_OFFSET_X, TEXT_STYLE_DEFAULT_SHADOW_OFFSET_Y, TEXT_STYLE_DEFAULT_STROKE_COLOR, TEXT_STYLE_DEFAULT_STROKE_THICKNESS, } from "./UITextStyle.Internal.js";
|
|
4
3
|
/** Text style configuration for UI text rendering */
|
|
5
|
-
class UITextStyle {
|
|
4
|
+
export class UITextStyle {
|
|
6
5
|
/** @param config Partial style configuration. Unspecified properties remain undefined. */
|
|
7
6
|
constructor(config) {
|
|
8
|
-
this.
|
|
9
|
-
this.
|
|
10
|
-
this.
|
|
11
|
-
this.
|
|
12
|
-
this.
|
|
13
|
-
this.
|
|
14
|
-
this.
|
|
15
|
-
this.
|
|
16
|
-
this.
|
|
17
|
-
this.
|
|
18
|
-
this.
|
|
19
|
-
this.
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
22
|
-
this.
|
|
23
|
-
this.
|
|
7
|
+
this.dirtyInternal = true;
|
|
8
|
+
this.colorInternal = config?.color;
|
|
9
|
+
this.alignInternal = config?.align;
|
|
10
|
+
this.fontFamilyInternal = config?.fontFamily;
|
|
11
|
+
this.fontSizeInternal = config?.fontSize;
|
|
12
|
+
this.fontStyleInternal = config?.fontStyle;
|
|
13
|
+
this.fontWeightInternal = config?.fontWeight;
|
|
14
|
+
this.lineHeightInternal = config?.lineHeight;
|
|
15
|
+
this.enableShadowInternal = config?.enableShadow;
|
|
16
|
+
this.shadowOffsetXInternal = config?.shadowOffsetX;
|
|
17
|
+
this.shadowOffsetYInternal = config?.shadowOffsetY;
|
|
18
|
+
this.shadowBlurInternal = config?.shadowBlur;
|
|
19
|
+
this.shadowColorInternal = config?.shadowColor;
|
|
20
|
+
this.enableStrokeInternal = config?.enableStroke;
|
|
21
|
+
this.strokeColorInternal = config?.strokeColor;
|
|
22
|
+
this.strokeThicknessInternal = config?.strokeThickness;
|
|
24
23
|
}
|
|
25
24
|
/** Text color */
|
|
26
25
|
get color() {
|
|
27
|
-
return this.
|
|
26
|
+
return this.colorInternal;
|
|
28
27
|
}
|
|
29
28
|
/** Text alignment */
|
|
30
29
|
get align() {
|
|
31
|
-
return this.
|
|
30
|
+
return this.alignInternal;
|
|
32
31
|
}
|
|
33
32
|
/** Font family name */
|
|
34
33
|
get fontFamily() {
|
|
35
|
-
return this.
|
|
34
|
+
return this.fontFamilyInternal;
|
|
36
35
|
}
|
|
37
36
|
/** Font size in pixels */
|
|
38
37
|
get fontSize() {
|
|
39
|
-
return this.
|
|
38
|
+
return this.fontSizeInternal;
|
|
40
39
|
}
|
|
41
40
|
/** Font style */
|
|
42
41
|
get fontStyle() {
|
|
43
|
-
return this.
|
|
42
|
+
return this.fontStyleInternal;
|
|
44
43
|
}
|
|
45
44
|
/** Font weight */
|
|
46
45
|
get fontWeight() {
|
|
47
|
-
return this.
|
|
46
|
+
return this.fontWeightInternal;
|
|
48
47
|
}
|
|
49
48
|
/** Line height in pixels */
|
|
50
49
|
get lineHeight() {
|
|
51
|
-
return this.
|
|
50
|
+
return this.lineHeightInternal;
|
|
52
51
|
}
|
|
53
52
|
/** Whether shadow is enabled */
|
|
54
53
|
get enableShadow() {
|
|
55
|
-
return this.
|
|
54
|
+
return this.enableShadowInternal;
|
|
56
55
|
}
|
|
57
56
|
/** Shadow horizontal offset in pixels */
|
|
58
57
|
get shadowOffsetX() {
|
|
59
|
-
return this.
|
|
58
|
+
return this.shadowOffsetXInternal;
|
|
60
59
|
}
|
|
61
60
|
/** Shadow vertical offset in pixels */
|
|
62
61
|
get shadowOffsetY() {
|
|
63
|
-
return this.
|
|
62
|
+
return this.shadowOffsetYInternal;
|
|
64
63
|
}
|
|
65
64
|
/** Shadow blur radius in pixels */
|
|
66
65
|
get shadowBlur() {
|
|
67
|
-
return this.
|
|
66
|
+
return this.shadowBlurInternal;
|
|
68
67
|
}
|
|
69
68
|
/** Shadow color */
|
|
70
69
|
get shadowColor() {
|
|
71
|
-
return this.
|
|
70
|
+
return this.shadowColorInternal;
|
|
72
71
|
}
|
|
73
72
|
/** Whether stroke is enabled */
|
|
74
73
|
get enableStroke() {
|
|
75
|
-
return this.
|
|
74
|
+
return this.enableStrokeInternal;
|
|
76
75
|
}
|
|
77
76
|
/** Stroke color */
|
|
78
77
|
get strokeColor() {
|
|
79
|
-
return this.
|
|
78
|
+
return this.strokeColorInternal;
|
|
80
79
|
}
|
|
81
80
|
/** Stroke thickness in pixels */
|
|
82
81
|
get strokeThickness() {
|
|
83
|
-
return this.
|
|
82
|
+
return this.strokeThicknessInternal;
|
|
84
83
|
}
|
|
85
84
|
/**
|
|
86
85
|
* Indicates whether any property has been modified.
|
|
@@ -88,117 +87,117 @@ class UITextStyle {
|
|
|
88
87
|
* @internal
|
|
89
88
|
*/
|
|
90
89
|
get dirty() {
|
|
91
|
-
return this.
|
|
90
|
+
return this.dirtyInternal;
|
|
92
91
|
}
|
|
93
92
|
set color(value) {
|
|
94
|
-
if (value !== this.
|
|
95
|
-
this.
|
|
96
|
-
this.
|
|
93
|
+
if (value !== this.colorInternal) {
|
|
94
|
+
this.colorInternal = value;
|
|
95
|
+
this.dirtyInternal = true;
|
|
97
96
|
}
|
|
98
97
|
}
|
|
99
98
|
set align(value) {
|
|
100
|
-
if (value !== this.
|
|
101
|
-
this.
|
|
102
|
-
this.
|
|
99
|
+
if (value !== this.alignInternal) {
|
|
100
|
+
this.alignInternal = value;
|
|
101
|
+
this.dirtyInternal = true;
|
|
103
102
|
}
|
|
104
103
|
}
|
|
105
104
|
set fontFamily(value) {
|
|
106
|
-
if (value !== this.
|
|
107
|
-
this.
|
|
108
|
-
this.
|
|
105
|
+
if (value !== this.fontFamilyInternal) {
|
|
106
|
+
this.fontFamilyInternal = value;
|
|
107
|
+
this.dirtyInternal = true;
|
|
109
108
|
}
|
|
110
109
|
}
|
|
111
110
|
set fontSize(value) {
|
|
112
111
|
if (value !== undefined) {
|
|
113
112
|
assertValidPositiveNumber(value, "UITextStyle.fontSize");
|
|
114
113
|
}
|
|
115
|
-
if (value !== this.
|
|
116
|
-
this.
|
|
117
|
-
this.
|
|
114
|
+
if (value !== this.fontSizeInternal) {
|
|
115
|
+
this.fontSizeInternal = value;
|
|
116
|
+
this.dirtyInternal = true;
|
|
118
117
|
}
|
|
119
118
|
}
|
|
120
119
|
set fontStyle(value) {
|
|
121
|
-
if (value !== this.
|
|
122
|
-
this.
|
|
123
|
-
this.
|
|
120
|
+
if (value !== this.fontStyleInternal) {
|
|
121
|
+
this.fontStyleInternal = value;
|
|
122
|
+
this.dirtyInternal = true;
|
|
124
123
|
}
|
|
125
124
|
}
|
|
126
125
|
set fontWeight(value) {
|
|
127
126
|
if (typeof value === "number") {
|
|
128
127
|
assertValidPositiveNumber(value, "UITextStyle.fontWeight");
|
|
129
128
|
}
|
|
130
|
-
if (value !== this.
|
|
131
|
-
this.
|
|
132
|
-
this.
|
|
129
|
+
if (value !== this.fontWeightInternal) {
|
|
130
|
+
this.fontWeightInternal = value;
|
|
131
|
+
this.dirtyInternal = true;
|
|
133
132
|
}
|
|
134
133
|
}
|
|
135
134
|
set lineHeight(value) {
|
|
136
135
|
if (value !== undefined) {
|
|
137
136
|
assertValidNumber(value, "UITextStyle.lineHeight");
|
|
138
137
|
}
|
|
139
|
-
if (value !== this.
|
|
140
|
-
this.
|
|
141
|
-
this.
|
|
138
|
+
if (value !== this.lineHeightInternal) {
|
|
139
|
+
this.lineHeightInternal = value;
|
|
140
|
+
this.dirtyInternal = true;
|
|
142
141
|
}
|
|
143
142
|
}
|
|
144
143
|
set enableShadow(value) {
|
|
145
|
-
if (value !== this.
|
|
146
|
-
this.
|
|
147
|
-
this.
|
|
144
|
+
if (value !== this.enableShadowInternal) {
|
|
145
|
+
this.enableShadowInternal = value;
|
|
146
|
+
this.dirtyInternal = true;
|
|
148
147
|
}
|
|
149
148
|
}
|
|
150
149
|
set shadowOffsetX(value) {
|
|
151
150
|
if (value !== undefined) {
|
|
152
151
|
assertValidNonNegativeNumber(value, "UITextStyle.shadowOffsetX");
|
|
153
152
|
}
|
|
154
|
-
if (value !== this.
|
|
155
|
-
this.
|
|
156
|
-
this.
|
|
153
|
+
if (value !== this.shadowOffsetXInternal) {
|
|
154
|
+
this.shadowOffsetXInternal = value;
|
|
155
|
+
this.dirtyInternal = true;
|
|
157
156
|
}
|
|
158
157
|
}
|
|
159
158
|
set shadowOffsetY(value) {
|
|
160
159
|
if (value !== undefined) {
|
|
161
160
|
assertValidNonNegativeNumber(value, "UITextStyle.shadowOffsetY");
|
|
162
161
|
}
|
|
163
|
-
if (value !== this.
|
|
164
|
-
this.
|
|
165
|
-
this.
|
|
162
|
+
if (value !== this.shadowOffsetYInternal) {
|
|
163
|
+
this.shadowOffsetYInternal = value;
|
|
164
|
+
this.dirtyInternal = true;
|
|
166
165
|
}
|
|
167
166
|
}
|
|
168
167
|
set shadowBlur(value) {
|
|
169
168
|
if (value !== undefined) {
|
|
170
169
|
assertValidNonNegativeNumber(value, "UITextStyle.shadowBlur");
|
|
171
170
|
}
|
|
172
|
-
if (value !== this.
|
|
173
|
-
this.
|
|
174
|
-
this.
|
|
171
|
+
if (value !== this.shadowBlurInternal) {
|
|
172
|
+
this.shadowBlurInternal = value;
|
|
173
|
+
this.dirtyInternal = true;
|
|
175
174
|
}
|
|
176
175
|
}
|
|
177
176
|
set shadowColor(value) {
|
|
178
|
-
if (value !== this.
|
|
179
|
-
this.
|
|
180
|
-
this.
|
|
177
|
+
if (value !== this.shadowColorInternal) {
|
|
178
|
+
this.shadowColorInternal = value;
|
|
179
|
+
this.dirtyInternal = true;
|
|
181
180
|
}
|
|
182
181
|
}
|
|
183
182
|
set enableStroke(value) {
|
|
184
|
-
if (value !== this.
|
|
185
|
-
this.
|
|
186
|
-
this.
|
|
183
|
+
if (value !== this.enableStrokeInternal) {
|
|
184
|
+
this.enableStrokeInternal = value;
|
|
185
|
+
this.dirtyInternal = true;
|
|
187
186
|
}
|
|
188
187
|
}
|
|
189
188
|
set strokeColor(value) {
|
|
190
|
-
if (value !== this.
|
|
191
|
-
this.
|
|
192
|
-
this.
|
|
189
|
+
if (value !== this.strokeColorInternal) {
|
|
190
|
+
this.strokeColorInternal = value;
|
|
191
|
+
this.dirtyInternal = true;
|
|
193
192
|
}
|
|
194
193
|
}
|
|
195
194
|
set strokeThickness(value) {
|
|
196
195
|
if (value !== undefined) {
|
|
197
196
|
assertValidNonNegativeNumber(value, "UITextStyle.strokeThickness");
|
|
198
197
|
}
|
|
199
|
-
if (value !== this.
|
|
200
|
-
this.
|
|
201
|
-
this.
|
|
198
|
+
if (value !== this.strokeThicknessInternal) {
|
|
199
|
+
this.strokeThicknessInternal = value;
|
|
200
|
+
this.dirtyInternal = true;
|
|
202
201
|
}
|
|
203
202
|
}
|
|
204
203
|
/**
|
|
@@ -208,165 +207,181 @@ class UITextStyle {
|
|
|
208
207
|
* @returns Complete style configuration with all defaults applied
|
|
209
208
|
*/
|
|
210
209
|
static resolve(primary, fallback) {
|
|
211
|
-
const fontSize = primary
|
|
210
|
+
const fontSize = primary?.fontSizeInternal ?? fallback?.fontSizeInternal ?? TEXT_STYLE_DEFAULT_FONT_SIZE;
|
|
212
211
|
return {
|
|
213
|
-
color: primary
|
|
214
|
-
align: primary
|
|
215
|
-
fontFamily: primary
|
|
212
|
+
color: primary?.colorInternal ?? fallback?.colorInternal ?? TEXT_STYLE_DEFAULT_COLOR,
|
|
213
|
+
align: primary?.alignInternal ?? fallback?.alignInternal ?? TEXT_STYLE_DEFAULT_ALIGN,
|
|
214
|
+
fontFamily: primary?.fontFamilyInternal ??
|
|
215
|
+
fallback?.fontFamilyInternal ??
|
|
216
216
|
TEXT_STYLE_DEFAULT_FONT_FAMILY,
|
|
217
217
|
fontSize,
|
|
218
|
-
fontStyle: primary
|
|
219
|
-
fontWeight: primary
|
|
218
|
+
fontStyle: primary?.fontStyleInternal ?? fallback?.fontStyleInternal ?? TEXT_STYLE_DEFAULT_FONT_STYLE,
|
|
219
|
+
fontWeight: primary?.fontWeightInternal ??
|
|
220
|
+
fallback?.fontWeightInternal ??
|
|
220
221
|
TEXT_STYLE_DEFAULT_FONT_WEIGHT,
|
|
221
|
-
lineHeight: primary
|
|
222
|
+
lineHeight: primary?.lineHeightInternal ??
|
|
223
|
+
fallback?.lineHeightInternal ??
|
|
222
224
|
fontSize * TEXT_STYLE_DEFAULT_LINE_HEIGHT,
|
|
223
|
-
enableShadow: primary
|
|
225
|
+
enableShadow: primary?.enableShadowInternal ??
|
|
226
|
+
fallback?.enableShadowInternal ??
|
|
224
227
|
TEXT_STYLE_DEFAULT_ENABLE_SHADOW,
|
|
225
|
-
shadowOffsetX: primary
|
|
228
|
+
shadowOffsetX: primary?.shadowOffsetXInternal ??
|
|
229
|
+
fallback?.shadowOffsetXInternal ??
|
|
226
230
|
TEXT_STYLE_DEFAULT_SHADOW_OFFSET_X,
|
|
227
|
-
shadowOffsetY: primary
|
|
231
|
+
shadowOffsetY: primary?.shadowOffsetYInternal ??
|
|
232
|
+
fallback?.shadowOffsetYInternal ??
|
|
228
233
|
TEXT_STYLE_DEFAULT_SHADOW_OFFSET_Y,
|
|
229
|
-
shadowBlur: primary
|
|
234
|
+
shadowBlur: primary?.shadowBlurInternal ??
|
|
235
|
+
fallback?.shadowBlurInternal ??
|
|
230
236
|
TEXT_STYLE_DEFAULT_SHADOW_BLUR,
|
|
231
|
-
shadowColor: primary
|
|
237
|
+
shadowColor: primary?.shadowColorInternal ??
|
|
238
|
+
fallback?.shadowColorInternal ??
|
|
232
239
|
TEXT_STYLE_DEFAULT_SHADOW_COLOR,
|
|
233
|
-
enableStroke: primary
|
|
240
|
+
enableStroke: primary?.enableStrokeInternal ??
|
|
241
|
+
fallback?.enableStrokeInternal ??
|
|
234
242
|
TEXT_STYLE_DEFAULT_ENABLE_STROKE,
|
|
235
|
-
strokeColor: primary
|
|
243
|
+
strokeColor: primary?.strokeColorInternal ??
|
|
244
|
+
fallback?.strokeColorInternal ??
|
|
236
245
|
TEXT_STYLE_DEFAULT_STROKE_COLOR,
|
|
237
|
-
strokeThickness: primary
|
|
246
|
+
strokeThickness: primary?.strokeThicknessInternal ??
|
|
247
|
+
fallback?.strokeThicknessInternal ??
|
|
238
248
|
TEXT_STYLE_DEFAULT_STROKE_THICKNESS,
|
|
239
249
|
};
|
|
240
250
|
}
|
|
251
|
+
/**
|
|
252
|
+
* Calculates maximum padding required for stroke and shadow of a resolved style.
|
|
253
|
+
* The stroke is centered on the glyph outline, so only half of it is outside.
|
|
254
|
+
* The shadow is cast by the stroke as well as by the fill.
|
|
255
|
+
* @param style Resolved style
|
|
256
|
+
* @returns Padding in pixels needed on all sides
|
|
257
|
+
*/
|
|
258
|
+
static calculatePadding(style) {
|
|
259
|
+
let padding = style.enableStroke ? style.strokeThickness / 2 : 0;
|
|
260
|
+
if (style.enableShadow) {
|
|
261
|
+
const shadowSpread = style.shadowBlur * 2;
|
|
262
|
+
const shadowMaxX = Math.abs(style.shadowOffsetX) + shadowSpread;
|
|
263
|
+
const shadowMaxY = Math.abs(style.shadowOffsetY) + shadowSpread;
|
|
264
|
+
padding += Math.max(shadowMaxX, shadowMaxY);
|
|
265
|
+
}
|
|
266
|
+
return Math.ceil(padding);
|
|
267
|
+
}
|
|
241
268
|
/** @internal */
|
|
242
269
|
setDirtyFalse() {
|
|
243
|
-
this.
|
|
270
|
+
this.dirtyInternal = false;
|
|
244
271
|
}
|
|
245
272
|
/** Sets all properties to default values */
|
|
246
273
|
setDefaults() {
|
|
247
|
-
if (this.
|
|
248
|
-
this.
|
|
249
|
-
this.
|
|
250
|
-
this.
|
|
251
|
-
this.
|
|
252
|
-
this.
|
|
253
|
-
this.
|
|
254
|
-
this.
|
|
255
|
-
this.
|
|
256
|
-
this.
|
|
257
|
-
this.
|
|
258
|
-
this.
|
|
259
|
-
this.
|
|
260
|
-
this.
|
|
261
|
-
this.
|
|
262
|
-
this.
|
|
263
|
-
this.
|
|
264
|
-
this.
|
|
265
|
-
this.
|
|
266
|
-
this.
|
|
267
|
-
this.
|
|
268
|
-
this.
|
|
269
|
-
this.
|
|
270
|
-
this.
|
|
271
|
-
this.
|
|
272
|
-
this.
|
|
273
|
-
this.
|
|
274
|
-
this.
|
|
275
|
-
this.
|
|
276
|
-
this.
|
|
277
|
-
this.
|
|
274
|
+
if (this.colorInternal !== TEXT_STYLE_DEFAULT_COLOR ||
|
|
275
|
+
this.alignInternal !== TEXT_STYLE_DEFAULT_ALIGN ||
|
|
276
|
+
this.fontFamilyInternal !== TEXT_STYLE_DEFAULT_FONT_FAMILY ||
|
|
277
|
+
this.fontSizeInternal !== TEXT_STYLE_DEFAULT_FONT_SIZE ||
|
|
278
|
+
this.fontStyleInternal !== TEXT_STYLE_DEFAULT_FONT_STYLE ||
|
|
279
|
+
this.fontWeightInternal !== TEXT_STYLE_DEFAULT_FONT_WEIGHT ||
|
|
280
|
+
this.lineHeightInternal !== TEXT_STYLE_DEFAULT_FONT_SIZE * TEXT_STYLE_DEFAULT_LINE_HEIGHT ||
|
|
281
|
+
this.enableShadowInternal !== TEXT_STYLE_DEFAULT_ENABLE_SHADOW ||
|
|
282
|
+
this.shadowOffsetXInternal !== TEXT_STYLE_DEFAULT_SHADOW_OFFSET_X ||
|
|
283
|
+
this.shadowOffsetYInternal !== TEXT_STYLE_DEFAULT_SHADOW_OFFSET_Y ||
|
|
284
|
+
this.shadowBlurInternal !== TEXT_STYLE_DEFAULT_SHADOW_BLUR ||
|
|
285
|
+
this.shadowColorInternal !== TEXT_STYLE_DEFAULT_SHADOW_COLOR ||
|
|
286
|
+
this.enableStrokeInternal !== TEXT_STYLE_DEFAULT_ENABLE_STROKE ||
|
|
287
|
+
this.strokeColorInternal !== TEXT_STYLE_DEFAULT_STROKE_COLOR ||
|
|
288
|
+
this.strokeThicknessInternal !== TEXT_STYLE_DEFAULT_STROKE_THICKNESS) {
|
|
289
|
+
this.colorInternal = TEXT_STYLE_DEFAULT_COLOR;
|
|
290
|
+
this.alignInternal = TEXT_STYLE_DEFAULT_ALIGN;
|
|
291
|
+
this.fontFamilyInternal = TEXT_STYLE_DEFAULT_FONT_FAMILY;
|
|
292
|
+
this.fontSizeInternal = TEXT_STYLE_DEFAULT_FONT_SIZE;
|
|
293
|
+
this.fontStyleInternal = TEXT_STYLE_DEFAULT_FONT_STYLE;
|
|
294
|
+
this.fontWeightInternal = TEXT_STYLE_DEFAULT_FONT_WEIGHT;
|
|
295
|
+
this.lineHeightInternal = TEXT_STYLE_DEFAULT_FONT_SIZE * TEXT_STYLE_DEFAULT_LINE_HEIGHT;
|
|
296
|
+
this.enableShadowInternal = TEXT_STYLE_DEFAULT_ENABLE_SHADOW;
|
|
297
|
+
this.shadowOffsetXInternal = TEXT_STYLE_DEFAULT_SHADOW_OFFSET_X;
|
|
298
|
+
this.shadowOffsetYInternal = TEXT_STYLE_DEFAULT_SHADOW_OFFSET_Y;
|
|
299
|
+
this.shadowBlurInternal = TEXT_STYLE_DEFAULT_SHADOW_BLUR;
|
|
300
|
+
this.shadowColorInternal = TEXT_STYLE_DEFAULT_SHADOW_COLOR;
|
|
301
|
+
this.enableStrokeInternal = TEXT_STYLE_DEFAULT_ENABLE_STROKE;
|
|
302
|
+
this.strokeColorInternal = TEXT_STYLE_DEFAULT_STROKE_COLOR;
|
|
303
|
+
this.strokeThicknessInternal = TEXT_STYLE_DEFAULT_STROKE_THICKNESS;
|
|
304
|
+
this.dirtyInternal = true;
|
|
278
305
|
}
|
|
279
306
|
}
|
|
280
307
|
/** Sets all properties to undefined */
|
|
281
308
|
clear() {
|
|
282
|
-
if (this.
|
|
283
|
-
this.
|
|
284
|
-
this.
|
|
285
|
-
this.
|
|
286
|
-
this.
|
|
287
|
-
this.
|
|
288
|
-
this.
|
|
289
|
-
this.
|
|
290
|
-
this.
|
|
291
|
-
this.
|
|
292
|
-
this.
|
|
293
|
-
this.
|
|
294
|
-
this.
|
|
295
|
-
this.
|
|
296
|
-
this.
|
|
297
|
-
this.
|
|
298
|
-
this.
|
|
299
|
-
this.
|
|
300
|
-
this.
|
|
301
|
-
this.
|
|
302
|
-
this.
|
|
303
|
-
this.
|
|
304
|
-
this.
|
|
305
|
-
this.
|
|
306
|
-
this.
|
|
307
|
-
this.
|
|
308
|
-
this.
|
|
309
|
-
this.
|
|
310
|
-
this.
|
|
311
|
-
this.
|
|
312
|
-
this.
|
|
309
|
+
if (this.colorInternal !== undefined ||
|
|
310
|
+
this.alignInternal !== undefined ||
|
|
311
|
+
this.fontFamilyInternal !== undefined ||
|
|
312
|
+
this.fontSizeInternal !== undefined ||
|
|
313
|
+
this.fontStyleInternal !== undefined ||
|
|
314
|
+
this.fontWeightInternal !== undefined ||
|
|
315
|
+
this.lineHeightInternal !== undefined ||
|
|
316
|
+
this.enableShadowInternal !== undefined ||
|
|
317
|
+
this.shadowOffsetXInternal !== undefined ||
|
|
318
|
+
this.shadowOffsetYInternal !== undefined ||
|
|
319
|
+
this.shadowBlurInternal !== undefined ||
|
|
320
|
+
this.shadowColorInternal !== undefined ||
|
|
321
|
+
this.enableStrokeInternal !== undefined ||
|
|
322
|
+
this.strokeColorInternal !== undefined ||
|
|
323
|
+
this.strokeThicknessInternal !== undefined) {
|
|
324
|
+
this.colorInternal = undefined;
|
|
325
|
+
this.alignInternal = undefined;
|
|
326
|
+
this.fontFamilyInternal = undefined;
|
|
327
|
+
this.fontSizeInternal = undefined;
|
|
328
|
+
this.fontStyleInternal = undefined;
|
|
329
|
+
this.fontWeightInternal = undefined;
|
|
330
|
+
this.lineHeightInternal = undefined;
|
|
331
|
+
this.enableShadowInternal = undefined;
|
|
332
|
+
this.shadowOffsetXInternal = undefined;
|
|
333
|
+
this.shadowOffsetYInternal = undefined;
|
|
334
|
+
this.shadowBlurInternal = undefined;
|
|
335
|
+
this.shadowColorInternal = undefined;
|
|
336
|
+
this.enableStrokeInternal = undefined;
|
|
337
|
+
this.strokeColorInternal = undefined;
|
|
338
|
+
this.strokeThicknessInternal = undefined;
|
|
339
|
+
this.dirtyInternal = true;
|
|
313
340
|
}
|
|
314
341
|
}
|
|
315
342
|
/** Copies from another style instance */
|
|
316
343
|
copy(value) {
|
|
317
|
-
if (this.
|
|
318
|
-
this.
|
|
319
|
-
this.
|
|
320
|
-
this.
|
|
321
|
-
this.
|
|
322
|
-
this.
|
|
323
|
-
this.
|
|
324
|
-
this.
|
|
325
|
-
this.
|
|
326
|
-
this.
|
|
327
|
-
this.
|
|
328
|
-
this.
|
|
329
|
-
this.
|
|
330
|
-
this.
|
|
331
|
-
this.
|
|
332
|
-
this.
|
|
333
|
-
this.
|
|
334
|
-
this.
|
|
335
|
-
this.
|
|
336
|
-
this.
|
|
337
|
-
this.
|
|
338
|
-
this.
|
|
339
|
-
this.
|
|
340
|
-
this.
|
|
341
|
-
this.
|
|
342
|
-
this.
|
|
343
|
-
this.
|
|
344
|
-
this.
|
|
345
|
-
this.
|
|
346
|
-
this.
|
|
347
|
-
this.
|
|
344
|
+
if (this.colorInternal !== value.colorInternal ||
|
|
345
|
+
this.alignInternal !== value.alignInternal ||
|
|
346
|
+
this.fontFamilyInternal !== value.fontFamilyInternal ||
|
|
347
|
+
this.fontSizeInternal !== value.fontSizeInternal ||
|
|
348
|
+
this.fontStyleInternal !== value.fontStyleInternal ||
|
|
349
|
+
this.fontWeightInternal !== value.fontWeightInternal ||
|
|
350
|
+
this.lineHeightInternal !== value.lineHeightInternal ||
|
|
351
|
+
this.enableShadowInternal !== value.enableShadowInternal ||
|
|
352
|
+
this.shadowOffsetXInternal !== value.shadowOffsetXInternal ||
|
|
353
|
+
this.shadowOffsetYInternal !== value.shadowOffsetYInternal ||
|
|
354
|
+
this.shadowBlurInternal !== value.shadowBlurInternal ||
|
|
355
|
+
this.shadowColorInternal !== value.shadowColorInternal ||
|
|
356
|
+
this.enableStrokeInternal !== value.enableStrokeInternal ||
|
|
357
|
+
this.strokeColorInternal !== value.strokeColorInternal ||
|
|
358
|
+
this.strokeThicknessInternal !== value.strokeThicknessInternal) {
|
|
359
|
+
this.colorInternal = value.colorInternal;
|
|
360
|
+
this.alignInternal = value.alignInternal;
|
|
361
|
+
this.fontFamilyInternal = value.fontFamilyInternal;
|
|
362
|
+
this.fontSizeInternal = value.fontSizeInternal;
|
|
363
|
+
this.fontStyleInternal = value.fontStyleInternal;
|
|
364
|
+
this.fontWeightInternal = value.fontWeightInternal;
|
|
365
|
+
this.lineHeightInternal = value.lineHeightInternal;
|
|
366
|
+
this.enableShadowInternal = value.enableShadowInternal;
|
|
367
|
+
this.shadowOffsetXInternal = value.shadowOffsetXInternal;
|
|
368
|
+
this.shadowOffsetYInternal = value.shadowOffsetYInternal;
|
|
369
|
+
this.shadowBlurInternal = value.shadowBlurInternal;
|
|
370
|
+
this.shadowColorInternal = value.shadowColorInternal;
|
|
371
|
+
this.enableStrokeInternal = value.enableStrokeInternal;
|
|
372
|
+
this.strokeColorInternal = value.strokeColorInternal;
|
|
373
|
+
this.strokeThicknessInternal = value.strokeThicknessInternal;
|
|
374
|
+
this.dirtyInternal = true;
|
|
348
375
|
}
|
|
349
376
|
}
|
|
350
377
|
/**
|
|
351
378
|
* Calculates maximum padding required for stroke and shadow.
|
|
379
|
+
* Properties left undefined here are taken from `fallback`, then from defaults,
|
|
380
|
+
* so a span style is measured with the stroke and shadow it is drawn with.
|
|
381
|
+
* @param fallback Style that supplies undefined properties (usually the common style)
|
|
352
382
|
* @returns Padding in pixels needed on all sides
|
|
353
383
|
*/
|
|
354
|
-
calculatePadding() {
|
|
355
|
-
|
|
356
|
-
if (this._private_enableStrokeInternal !== undefined) {
|
|
357
|
-
padding += this._private_strokeThicknessInternal ?? 0;
|
|
358
|
-
}
|
|
359
|
-
if (this._private_enableShadowInternal !== undefined) {
|
|
360
|
-
const blur = this._private_shadowBlurInternal ?? 0;
|
|
361
|
-
const offsetX = this._private_shadowOffsetXInternal ?? 0;
|
|
362
|
-
const offsetY = this._private_shadowOffsetYInternal ?? 0;
|
|
363
|
-
const shadowSpread = blur * 2;
|
|
364
|
-
const shadowMaxX = Math.abs(offsetX) + shadowSpread;
|
|
365
|
-
const shadowMaxY = Math.abs(offsetY) + shadowSpread;
|
|
366
|
-
padding += Math.max(shadowMaxX, shadowMaxY);
|
|
367
|
-
}
|
|
368
|
-
return Math.ceil(padding);
|
|
384
|
+
calculatePadding(fallback) {
|
|
385
|
+
return UITextStyle.calculatePadding(UITextStyle.resolve(this, fallback));
|
|
369
386
|
}
|
|
370
387
|
}
|
|
371
|
-
|
|
372
|
-
export { UITextStyle };
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { Texture } from "three";
|
|
2
2
|
export declare const TEXTURE_DEFAULT_TEXTURE: Texture;
|
|
3
3
|
export declare const TEXTURE_DEFAULT_SIZE = 2;
|
|
4
|
+
/**
|
|
5
|
+
* Reads the pixel size of a texture image: an image, a video, a canvas, a bitmap
|
|
6
|
+
* or the data of a DataTexture.
|
|
7
|
+
* @param texture Texture to measure
|
|
8
|
+
* @returns Width and height in pixels
|
|
9
|
+
*/
|
|
10
|
+
export declare function getTextureImageSize(texture: Texture): UITextureSize;
|
|
4
11
|
/** Rectangle coordinates and dimensions in atlas */
|
|
5
12
|
export interface UITextureRect {
|
|
6
13
|
/** X coordinate in pixels */
|
|
@@ -1,6 +1,16 @@
|
|
|
1
|
-
import { Texture } from
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { Texture } from "three";
|
|
2
|
+
export const TEXTURE_DEFAULT_TEXTURE = new Texture();
|
|
3
|
+
export const TEXTURE_DEFAULT_SIZE = 2;
|
|
4
|
+
/**
|
|
5
|
+
* Reads the pixel size of a texture image: an image, a video, a canvas, a bitmap
|
|
6
|
+
* or the data of a DataTexture.
|
|
7
|
+
* @param texture Texture to measure
|
|
8
|
+
* @returns Width and height in pixels
|
|
9
|
+
*/
|
|
10
|
+
export function getTextureImageSize(texture) {
|
|
11
|
+
const image = texture.image;
|
|
12
|
+
return {
|
|
13
|
+
w: image?.naturalWidth ?? image?.videoWidth ?? image?.width ?? TEXTURE_DEFAULT_SIZE,
|
|
14
|
+
h: image?.naturalHeight ?? image?.videoHeight ?? image?.height ?? TEXTURE_DEFAULT_SIZE,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FerrsignView3 } from "ferrsign";
|
|
2
2
|
import { Matrix3, Texture, Vector2 } from "three";
|
|
3
|
-
import type { UITextureConfig, UITextureTrim } from "./UITextureView.Internal";
|
|
3
|
+
import type { UITextureConfig, UITextureTrim } from "./UITextureView.Internal.js";
|
|
4
4
|
/** Wrapper for Three.js texture with atlas and trim support. Does not own the underlying texture; user must dispose it. */
|
|
5
5
|
export declare class UITextureView {
|
|
6
6
|
private textureInternal;
|