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,8 +1,8 @@
|
|
|
1
|
-
import type { HSLAdjustment } from "../../miscellaneous/generic-plane/shared";
|
|
2
|
-
import { UIBlendMode } from "../../miscellaneous/UIBlendMode";
|
|
3
|
-
import type { UIMicroConfig } from "../../miscellaneous/micro/UIMicro.Internal";
|
|
4
|
-
import { UITransparencyMode } from "../../miscellaneous/UITransparencyMode";
|
|
5
|
-
import type { UIDummyOptions } from "../UIDummy/UIDummy.Internal";
|
|
1
|
+
import type { HSLAdjustment } from "../../miscellaneous/generic-plane/shared.js";
|
|
2
|
+
import { UIBlendMode } from "../../miscellaneous/UIBlendMode.js";
|
|
3
|
+
import type { UIMicroConfig } from "../../miscellaneous/micro/UIMicro.Internal.js";
|
|
4
|
+
import { UITransparencyMode } from "../../miscellaneous/UITransparencyMode.js";
|
|
5
|
+
import type { UIDummyOptions } from "../UIDummy/UIDummy.Internal.js";
|
|
6
6
|
/** Configuration options for UIElement */
|
|
7
7
|
export interface UIElementOptions extends UIDummyOptions {
|
|
8
8
|
/** Transforms that don't affect constraints */
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { UIBlendMode } from
|
|
2
|
-
import { UITransparencyMode } from
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const ELEMENT_DEFAULT_LIGHTNESS = 0;
|
|
1
|
+
import { UIBlendMode } from "../../miscellaneous/UIBlendMode.js";
|
|
2
|
+
import { UITransparencyMode } from "../../miscellaneous/UITransparencyMode.js";
|
|
3
|
+
export const ELEMENT_DEFAULT_TRANSPARENCY_MODE = UITransparencyMode.BLEND;
|
|
4
|
+
export const ELEMENT_DEFAULT_BLEND_MODE = UIBlendMode.NORMAL;
|
|
5
|
+
export const ELEMENT_DEFAULT_HUE = 0;
|
|
6
|
+
export const ELEMENT_DEFAULT_SATURATION = 1;
|
|
7
|
+
export const ELEMENT_DEFAULT_LIGHTNESS = 0;
|
|
9
8
|
/** Maps a blend mode to the output-alpha multiplier used by the premultiplied shader. */
|
|
10
|
-
function blendModeToFactor(mode) {
|
|
9
|
+
export function blendModeToFactor(mode) {
|
|
11
10
|
return mode === UIBlendMode.ADDITIVE ? 0 : 1;
|
|
12
11
|
}
|
|
13
12
|
/**
|
|
@@ -15,11 +14,9 @@ function blendModeToFactor(mode) {
|
|
|
15
14
|
* multiplier, lightness offset). Hue degrees become turns so the shader can wrap
|
|
16
15
|
* them with a cheap fract().
|
|
17
16
|
*/
|
|
18
|
-
function packHSL(target, hue, saturation, lightness) {
|
|
17
|
+
export function packHSL(target, hue, saturation, lightness) {
|
|
19
18
|
target.h = hue / 360;
|
|
20
19
|
target.s = saturation;
|
|
21
20
|
target.l = lightness;
|
|
22
21
|
return target;
|
|
23
22
|
}
|
|
24
|
-
|
|
25
|
-
export { ELEMENT_DEFAULT_BLEND_MODE, ELEMENT_DEFAULT_HUE, ELEMENT_DEFAULT_LIGHTNESS, ELEMENT_DEFAULT_SATURATION, ELEMENT_DEFAULT_TRANSPARENCY_MODE, blendModeToFactor, packHSL };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { WebGLRenderer } from "three";
|
|
2
|
-
import type { UILayer } from "../../layers/UILayer/UILayer";
|
|
3
|
-
import type { UIProperty } from "../../miscellaneous/generic-plane/shared";
|
|
4
|
-
import { UIMicro } from "../../miscellaneous/micro/UIMicro";
|
|
5
|
-
import type { UIBlendMode } from "../../miscellaneous/UIBlendMode";
|
|
6
|
-
import type { UIMode } from "../../miscellaneous/UIMode";
|
|
7
|
-
import type { UITransparencyMode } from "../../miscellaneous/UITransparencyMode";
|
|
8
|
-
import type { UISceneWrapperView } from "../../wrappers/UISceneWrapper/UISceneWrapper.Internal";
|
|
9
|
-
import { UIDummy } from "../UIDummy/UIDummy";
|
|
10
|
-
import type { UIElementOptions } from "./UIElement.Internal";
|
|
2
|
+
import type { UILayer } from "../../layers/UILayer/UILayer.js";
|
|
3
|
+
import type { UIProperty } from "../../miscellaneous/generic-plane/shared.js";
|
|
4
|
+
import { UIMicro } from "../../miscellaneous/micro/UIMicro.js";
|
|
5
|
+
import type { UIBlendMode } from "../../miscellaneous/UIBlendMode.js";
|
|
6
|
+
import type { UIMode } from "../../miscellaneous/UIMode.js";
|
|
7
|
+
import type { UITransparencyMode } from "../../miscellaneous/UITransparencyMode.js";
|
|
8
|
+
import type { UISceneWrapperView } from "../../wrappers/UISceneWrapper/UISceneWrapper.Internal.js";
|
|
9
|
+
import { UIDummy } from "../UIDummy/UIDummy.js";
|
|
10
|
+
import type { UIElementOptions } from "./UIElement.Internal.js";
|
|
11
11
|
/** Base class for renderable UI elements */
|
|
12
12
|
export declare abstract class UIElement extends UIDummy {
|
|
13
13
|
/** Transforms that don't affect constraints */
|
|
@@ -62,8 +62,8 @@ export declare abstract class UIElement extends UIDummy {
|
|
|
62
62
|
set lightness(value: number);
|
|
63
63
|
/** Controls visibility and interactivity */
|
|
64
64
|
set mode(value: UIMode);
|
|
65
|
-
/**
|
|
66
|
-
|
|
65
|
+
/** Frees resources of the element */
|
|
66
|
+
protected destroyInternal(): void;
|
|
67
67
|
protected setPlaneTransform(): void;
|
|
68
68
|
protected onWillRender(renderer: WebGLRenderer, deltaTime: number): void;
|
|
69
69
|
private readonly handleWillRender;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { Matrix4 } from
|
|
2
|
-
import { computeTransformMatrix } from
|
|
3
|
-
import { UIMicro } from
|
|
4
|
-
import { isUIModeVisible } from
|
|
5
|
-
import { UIDummy } from
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import { Matrix4 } from "three";
|
|
2
|
+
import { computeTransformMatrix } from "../../miscellaneous/computeTransform.js";
|
|
3
|
+
import { UIMicro } from "../../miscellaneous/micro/UIMicro.js";
|
|
4
|
+
import { isUIModeVisible } from "../../miscellaneous/UIMode.js";
|
|
5
|
+
import { UIDummy } from "../UIDummy/UIDummy.js";
|
|
6
|
+
import { blendModeToFactor, ELEMENT_DEFAULT_BLEND_MODE, ELEMENT_DEFAULT_HUE, ELEMENT_DEFAULT_LIGHTNESS, ELEMENT_DEFAULT_SATURATION, ELEMENT_DEFAULT_TRANSPARENCY_MODE, packHSL, } from "./UIElement.Internal.js";
|
|
8
7
|
/** Base class for renderable UI elements */
|
|
9
|
-
class UIElement extends UIDummy {
|
|
8
|
+
export class UIElement extends UIDummy {
|
|
10
9
|
/**
|
|
11
10
|
* Creates a new UIElement instance.
|
|
12
11
|
*
|
|
@@ -17,43 +16,43 @@ class UIElement extends UIDummy {
|
|
|
17
16
|
*/
|
|
18
17
|
constructor(layer, source, properties, options) {
|
|
19
18
|
super(layer, options);
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
22
|
-
this.
|
|
23
|
-
this.
|
|
24
|
-
this.
|
|
25
|
-
this.
|
|
19
|
+
this.transparencyModeDirty = false;
|
|
20
|
+
this.blendModeDirty = false;
|
|
21
|
+
this.hslDirty = false;
|
|
22
|
+
this.hslValue = { h: 0, s: 0, l: 0 };
|
|
23
|
+
this.visibilityDirty = false;
|
|
24
|
+
this.handleWillRender = (renderer, deltaTime) => {
|
|
26
25
|
this.onWillRender(renderer, deltaTime);
|
|
27
26
|
};
|
|
28
27
|
this.micro = new UIMicro(options?.micro);
|
|
29
|
-
this.
|
|
30
|
-
this.
|
|
31
|
-
this.
|
|
32
|
-
this.
|
|
33
|
-
this.
|
|
28
|
+
this.transparencyModeInternal = options?.transparencyMode ?? ELEMENT_DEFAULT_TRANSPARENCY_MODE;
|
|
29
|
+
this.blendModeInternal = options?.blendMode ?? ELEMENT_DEFAULT_BLEND_MODE;
|
|
30
|
+
this.hueInternal = options?.hue ?? ELEMENT_DEFAULT_HUE;
|
|
31
|
+
this.saturationInternal = options?.saturation ?? ELEMENT_DEFAULT_SATURATION;
|
|
32
|
+
this.lightnessInternal = options?.lightness ?? ELEMENT_DEFAULT_LIGHTNESS;
|
|
34
33
|
this.sceneWrapper = this.layer.sceneWrapper;
|
|
35
|
-
this.planeHandler = this.sceneWrapper.createPlane(source, properties, new Matrix4().identity(), isUIModeVisible(options?.mode ?? this.mode), this.
|
|
36
|
-
this.layer.signalRendering.on(this.
|
|
34
|
+
this.planeHandler = this.sceneWrapper.createPlane(source, properties, new Matrix4().identity(), isUIModeVisible(options?.mode ?? this.mode), this.transparencyModeInternal, blendModeToFactor(this.blendModeInternal), packHSL(this.hslValue, this.hueInternal, this.saturationInternal, this.lightnessInternal));
|
|
35
|
+
this.layer.signalRendering.on(this.handleWillRender);
|
|
37
36
|
}
|
|
38
37
|
/** Alpha blending mode */
|
|
39
38
|
get transparencyMode() {
|
|
40
|
-
return this.
|
|
39
|
+
return this.transparencyModeInternal;
|
|
41
40
|
}
|
|
42
41
|
/** Color blending mode (only affects BLEND transparency) */
|
|
43
42
|
get blendMode() {
|
|
44
|
-
return this.
|
|
43
|
+
return this.blendModeInternal;
|
|
45
44
|
}
|
|
46
45
|
/** Hue shift in degrees */
|
|
47
46
|
get hue() {
|
|
48
|
-
return this.
|
|
47
|
+
return this.hueInternal;
|
|
49
48
|
}
|
|
50
49
|
/** Saturation multiplier (1 = unchanged, 0 = grayscale) */
|
|
51
50
|
get saturation() {
|
|
52
|
-
return this.
|
|
51
|
+
return this.saturationInternal;
|
|
53
52
|
}
|
|
54
53
|
/** Lightness offset (0 = unchanged) */
|
|
55
54
|
get lightness() {
|
|
56
|
-
return this.
|
|
55
|
+
return this.lightnessInternal;
|
|
57
56
|
}
|
|
58
57
|
/**
|
|
59
58
|
* Controls visibility and interactivity.
|
|
@@ -66,78 +65,76 @@ class UIElement extends UIDummy {
|
|
|
66
65
|
}
|
|
67
66
|
/** Alpha blending mode */
|
|
68
67
|
set transparencyMode(value) {
|
|
69
|
-
if (this.
|
|
70
|
-
this.
|
|
71
|
-
this.
|
|
68
|
+
if (this.transparencyModeInternal !== value) {
|
|
69
|
+
this.transparencyModeInternal = value;
|
|
70
|
+
this.transparencyModeDirty = true;
|
|
72
71
|
}
|
|
73
72
|
}
|
|
74
73
|
/** Color blending mode (only affects BLEND transparency) */
|
|
75
74
|
set blendMode(value) {
|
|
76
|
-
if (this.
|
|
77
|
-
this.
|
|
78
|
-
this.
|
|
75
|
+
if (this.blendModeInternal !== value) {
|
|
76
|
+
this.blendModeInternal = value;
|
|
77
|
+
this.blendModeDirty = true;
|
|
79
78
|
}
|
|
80
79
|
}
|
|
81
80
|
/** Hue shift in degrees */
|
|
82
81
|
set hue(value) {
|
|
83
|
-
if (this.
|
|
84
|
-
this.
|
|
85
|
-
this.
|
|
82
|
+
if (this.hueInternal !== value) {
|
|
83
|
+
this.hueInternal = value;
|
|
84
|
+
this.hslDirty = true;
|
|
86
85
|
}
|
|
87
86
|
}
|
|
88
87
|
/** Saturation multiplier (1 = unchanged, 0 = grayscale) */
|
|
89
88
|
set saturation(value) {
|
|
90
|
-
if (this.
|
|
91
|
-
this.
|
|
92
|
-
this.
|
|
89
|
+
if (this.saturationInternal !== value) {
|
|
90
|
+
this.saturationInternal = value;
|
|
91
|
+
this.hslDirty = true;
|
|
93
92
|
}
|
|
94
93
|
}
|
|
95
94
|
/** Lightness offset (0 = unchanged) */
|
|
96
95
|
set lightness(value) {
|
|
97
|
-
if (this.
|
|
98
|
-
this.
|
|
99
|
-
this.
|
|
96
|
+
if (this.lightnessInternal !== value) {
|
|
97
|
+
this.lightnessInternal = value;
|
|
98
|
+
this.hslDirty = true;
|
|
100
99
|
}
|
|
101
100
|
}
|
|
102
101
|
/** Controls visibility and interactivity */
|
|
103
102
|
set mode(value) {
|
|
104
103
|
if (this.modeInternal !== value) {
|
|
105
|
-
this.
|
|
104
|
+
this.visibilityDirty = isUIModeVisible(this.modeInternal) !== isUIModeVisible(value);
|
|
106
105
|
super.mode = value;
|
|
107
106
|
}
|
|
108
107
|
}
|
|
109
|
-
/**
|
|
110
|
-
|
|
111
|
-
this.layer.signalRendering.off(this.
|
|
108
|
+
/** Frees resources of the element */
|
|
109
|
+
destroyInternal() {
|
|
110
|
+
this.layer.signalRendering.off(this.handleWillRender);
|
|
112
111
|
this.sceneWrapper.destroyPlane(this.planeHandler);
|
|
113
|
-
super.
|
|
112
|
+
super.destroyInternal();
|
|
114
113
|
}
|
|
115
114
|
setPlaneTransform() {
|
|
116
115
|
if (this.micro.dirty || this.inputWrapper.dirty || this.solverWrapper.dirty) {
|
|
117
|
-
this.sceneWrapper.setTransform(this.planeHandler, computeTransformMatrix(this.x, this.y, this.width, this.height, this.
|
|
116
|
+
this.sceneWrapper.setTransform(this.planeHandler, computeTransformMatrix(this.x, this.y, this.width, this.height, this.renderDepth, this.micro.x, this.micro.y, this.micro.anchorX, this.micro.anchorY, this.micro.scaleX, this.micro.scaleY, this.micro.rotation, this.micro.anchorMode));
|
|
118
117
|
this.micro.setDirtyFalse();
|
|
119
118
|
}
|
|
120
119
|
}
|
|
121
120
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- Required by UILayer event interface but not used in base implementation
|
|
122
121
|
onWillRender(renderer, deltaTime) {
|
|
123
|
-
if (this.
|
|
124
|
-
this.sceneWrapper.setTransparency(this.planeHandler, this.
|
|
125
|
-
this.
|
|
122
|
+
if (this.transparencyModeDirty) {
|
|
123
|
+
this.sceneWrapper.setTransparency(this.planeHandler, this.transparencyModeInternal);
|
|
124
|
+
this.transparencyModeDirty = false;
|
|
126
125
|
}
|
|
127
|
-
if (this.
|
|
128
|
-
this.sceneWrapper.setBlend(this.planeHandler, blendModeToFactor(this.
|
|
129
|
-
this.
|
|
126
|
+
if (this.blendModeDirty) {
|
|
127
|
+
this.sceneWrapper.setBlend(this.planeHandler, blendModeToFactor(this.blendModeInternal));
|
|
128
|
+
this.blendModeDirty = false;
|
|
130
129
|
}
|
|
131
|
-
if (this.
|
|
132
|
-
this.sceneWrapper.setHSL(this.planeHandler, packHSL(this.
|
|
133
|
-
this.
|
|
130
|
+
if (this.hslDirty) {
|
|
131
|
+
this.sceneWrapper.setHSL(this.planeHandler, packHSL(this.hslValue, this.hueInternal, this.saturationInternal, this.lightnessInternal));
|
|
132
|
+
this.hslDirty = false;
|
|
134
133
|
}
|
|
135
|
-
if (this.
|
|
134
|
+
if (this.visibilityDirty) {
|
|
136
135
|
this.sceneWrapper.setVisibility(this.planeHandler, isUIModeVisible(this.modeInternal));
|
|
137
|
-
this.
|
|
136
|
+
this.visibilityDirty = false;
|
|
138
137
|
}
|
|
139
138
|
this.setPlaneTransform();
|
|
140
139
|
}
|
|
141
140
|
}
|
|
142
|
-
|
|
143
|
-
export { UIElement };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { UIColor } from "../../miscellaneous/color/UIColor";
|
|
2
|
-
import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
|
|
3
|
-
import type { UIElementOptions } from "../UIElement/UIElement.Internal";
|
|
1
|
+
import { UIColor } from "../../miscellaneous/color/UIColor.js";
|
|
2
|
+
import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal.js";
|
|
3
|
+
import type { UIElementOptions } from "../UIElement/UIElement.Internal.js";
|
|
4
4
|
/** Configuration options for UIGraphics */
|
|
5
5
|
export interface UIGraphicsOptions extends UIElementOptions {
|
|
6
6
|
/** Multiplicative tint */
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import { UIColor } from
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const GRAPHICS_TEMP_COLOR = new UIColor();
|
|
6
|
-
|
|
7
|
-
export { GRAPHICS_DEFAULT_HEIGHT, GRAPHICS_DEFAULT_WIDTH, GRAPHICS_TEMP_COLOR };
|
|
1
|
+
import { UIColor } from "../../miscellaneous/color/UIColor.js";
|
|
2
|
+
export const GRAPHICS_DEFAULT_WIDTH = 2;
|
|
3
|
+
export const GRAPHICS_DEFAULT_HEIGHT = 2;
|
|
4
|
+
export const GRAPHICS_TEMP_COLOR = new UIColor();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { WebGLRenderer } from "three";
|
|
2
|
-
import type { UILayer } from "../../layers/UILayer/UILayer";
|
|
3
|
-
import { UIColor } from "../../miscellaneous/color/UIColor";
|
|
4
|
-
import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
|
|
5
|
-
import { UIElement } from "../UIElement/UIElement";
|
|
6
|
-
import type { UIGraphicsOptions } from "./UIGraphics.Internal";
|
|
2
|
+
import type { UILayer } from "../../layers/UILayer/UILayer.js";
|
|
3
|
+
import { UIColor } from "../../miscellaneous/color/UIColor.js";
|
|
4
|
+
import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal.js";
|
|
5
|
+
import { UIElement } from "../UIElement/UIElement.js";
|
|
6
|
+
import type { UIGraphicsOptions } from "./UIGraphics.Internal.js";
|
|
7
7
|
/** Canvas-based 2D drawing element */
|
|
8
8
|
export declare class UIGraphics extends UIElement {
|
|
9
9
|
private readonly colorInternal;
|
|
@@ -45,7 +45,7 @@ export declare class UIGraphics extends UIElement {
|
|
|
45
45
|
* @param lineWidth - Line width in pixels
|
|
46
46
|
*/
|
|
47
47
|
drawPolyline(points: [number, number][], color: UIColorConfig, lineWidth?: number): this;
|
|
48
|
-
/**
|
|
49
|
-
|
|
48
|
+
/** Frees resources of the graphics */
|
|
49
|
+
protected destroyInternal(): void;
|
|
50
50
|
protected onWillRender(renderer: WebGLRenderer, deltaTime: number): void;
|
|
51
51
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { Matrix3 } from
|
|
2
|
-
import { createCanvas, createCanvasTexture } from
|
|
3
|
-
import { UIColor } from
|
|
4
|
-
import source from
|
|
5
|
-
import { UIElement } from
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import { Matrix3 } from "three";
|
|
2
|
+
import { createCanvas, createCanvasTexture } from "../../miscellaneous/canvas.js";
|
|
3
|
+
import { UIColor } from "../../miscellaneous/color/UIColor.js";
|
|
4
|
+
import source from "../../shaders/UIImage.js";
|
|
5
|
+
import { UIElement } from "../UIElement/UIElement.js";
|
|
6
|
+
import { GRAPHICS_DEFAULT_HEIGHT, GRAPHICS_DEFAULT_WIDTH, GRAPHICS_TEMP_COLOR, } from "./UIGraphics.Internal.js";
|
|
8
7
|
/** Canvas-based 2D drawing element */
|
|
9
|
-
class UIGraphics extends UIElement {
|
|
8
|
+
export class UIGraphics extends UIElement {
|
|
10
9
|
/**
|
|
11
10
|
* Creates a new UIGraphics instance.
|
|
12
11
|
*
|
|
@@ -29,18 +28,18 @@ class UIGraphics extends UIElement {
|
|
|
29
28
|
textureTransform: new Matrix3(),
|
|
30
29
|
color,
|
|
31
30
|
}, options);
|
|
32
|
-
this.
|
|
33
|
-
this.
|
|
34
|
-
this.
|
|
35
|
-
this.
|
|
31
|
+
this.canvas = canvas;
|
|
32
|
+
this.context = context;
|
|
33
|
+
this.texture = texture;
|
|
34
|
+
this.colorInternal = color;
|
|
36
35
|
}
|
|
37
36
|
/** Multiplicative tint. Alpha channel controls opacity. */
|
|
38
37
|
get color() {
|
|
39
|
-
return this.
|
|
38
|
+
return this.colorInternal;
|
|
40
39
|
}
|
|
41
40
|
/** Multiplicative tint. Alpha channel controls opacity. */
|
|
42
41
|
set color(value) {
|
|
43
|
-
this.
|
|
42
|
+
this.colorInternal.set(value);
|
|
44
43
|
}
|
|
45
44
|
/**
|
|
46
45
|
* Clears canvas. Optionally fills with color.
|
|
@@ -48,28 +47,28 @@ class UIGraphics extends UIElement {
|
|
|
48
47
|
* @param color - Fill color after clearing
|
|
49
48
|
*/
|
|
50
49
|
clear(color) {
|
|
51
|
-
this.
|
|
50
|
+
this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);
|
|
52
51
|
if (color !== undefined) {
|
|
53
|
-
this.
|
|
54
|
-
this.
|
|
52
|
+
this.context.fillStyle = GRAPHICS_TEMP_COLOR.set(color).toCSSColor();
|
|
53
|
+
this.context.fillRect(0, 0, this.canvas.width, this.canvas.height);
|
|
55
54
|
}
|
|
56
|
-
this.
|
|
55
|
+
this.texture.needsUpdate = true;
|
|
57
56
|
return this;
|
|
58
57
|
}
|
|
59
58
|
/** Draws filled rectangle */
|
|
60
59
|
drawRect(x, y, width, height, color) {
|
|
61
|
-
this.
|
|
62
|
-
this.
|
|
63
|
-
this.
|
|
60
|
+
this.context.fillStyle = GRAPHICS_TEMP_COLOR.set(color).toCSSColor();
|
|
61
|
+
this.context.fillRect(x, y, width, height);
|
|
62
|
+
this.texture.needsUpdate = true;
|
|
64
63
|
return this;
|
|
65
64
|
}
|
|
66
65
|
/** Draws filled circle */
|
|
67
66
|
drawCircle(x, y, radius, color) {
|
|
68
|
-
this.
|
|
69
|
-
this.
|
|
70
|
-
this.
|
|
71
|
-
this.
|
|
72
|
-
this.
|
|
67
|
+
this.context.fillStyle = GRAPHICS_TEMP_COLOR.set(color).toCSSColor();
|
|
68
|
+
this.context.beginPath();
|
|
69
|
+
this.context.arc(x, y, radius, 0, Math.PI * 2);
|
|
70
|
+
this.context.fill();
|
|
71
|
+
this.texture.needsUpdate = true;
|
|
73
72
|
return this;
|
|
74
73
|
}
|
|
75
74
|
/**
|
|
@@ -79,11 +78,11 @@ class UIGraphics extends UIElement {
|
|
|
79
78
|
* @param endAngle - End angle in radians
|
|
80
79
|
*/
|
|
81
80
|
drawArc(x, y, radius, startAngle, endAngle, color) {
|
|
82
|
-
this.
|
|
83
|
-
this.
|
|
84
|
-
this.
|
|
85
|
-
this.
|
|
86
|
-
this.
|
|
81
|
+
this.context.fillStyle = GRAPHICS_TEMP_COLOR.set(color).toCSSColor();
|
|
82
|
+
this.context.beginPath();
|
|
83
|
+
this.context.arc(x, y, radius, startAngle, endAngle);
|
|
84
|
+
this.context.fill();
|
|
85
|
+
this.texture.needsUpdate = true;
|
|
87
86
|
return this;
|
|
88
87
|
}
|
|
89
88
|
/**
|
|
@@ -96,31 +95,29 @@ class UIGraphics extends UIElement {
|
|
|
96
95
|
if (points.length < 2) {
|
|
97
96
|
return this;
|
|
98
97
|
}
|
|
99
|
-
this.
|
|
100
|
-
this.
|
|
101
|
-
this.
|
|
102
|
-
this.
|
|
98
|
+
this.context.strokeStyle = GRAPHICS_TEMP_COLOR.set(color).toCSSColor();
|
|
99
|
+
this.context.lineWidth = lineWidth;
|
|
100
|
+
this.context.beginPath();
|
|
101
|
+
this.context.moveTo(points[0][0], points[0][1]);
|
|
103
102
|
for (let i = 1; i < points.length; i++) {
|
|
104
|
-
this.
|
|
103
|
+
this.context.lineTo(points[i][0], points[i][1]);
|
|
105
104
|
}
|
|
106
|
-
this.
|
|
107
|
-
this.
|
|
105
|
+
this.context.stroke();
|
|
106
|
+
this.texture.needsUpdate = true;
|
|
108
107
|
return this;
|
|
109
108
|
}
|
|
110
|
-
/**
|
|
111
|
-
|
|
112
|
-
this.
|
|
113
|
-
super.
|
|
109
|
+
/** Frees resources of the graphics */
|
|
110
|
+
destroyInternal() {
|
|
111
|
+
this.texture.dispose();
|
|
112
|
+
super.destroyInternal();
|
|
114
113
|
}
|
|
115
114
|
onWillRender(renderer, deltaTime) {
|
|
116
|
-
if (this.
|
|
115
|
+
if (this.colorInternal.dirty) {
|
|
117
116
|
this.sceneWrapper.setProperties(this.planeHandler, {
|
|
118
|
-
color: this.
|
|
117
|
+
color: this.colorInternal,
|
|
119
118
|
});
|
|
120
|
-
this.
|
|
119
|
+
this.colorInternal.setDirtyFalse();
|
|
121
120
|
}
|
|
122
121
|
super.onWillRender(renderer, deltaTime);
|
|
123
122
|
}
|
|
124
123
|
}
|
|
125
|
-
|
|
126
|
-
export { UIGraphics };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
|
|
2
|
-
import type { UIElementOptions } from "../UIElement/UIElement.Internal";
|
|
1
|
+
import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal.js";
|
|
2
|
+
import type { UIElementOptions } from "../UIElement/UIElement.Internal.js";
|
|
3
3
|
/** Configuration options for UIImage */
|
|
4
4
|
export interface UIImageOptions extends UIElementOptions {
|
|
5
5
|
/** Multiplicative tint */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { UILayer } from "../../layers/UILayer/UILayer";
|
|
2
|
-
import { UIColor } from "../../miscellaneous/color/UIColor";
|
|
3
|
-
import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
|
|
4
|
-
import { UITextureView } from "../../miscellaneous/texture/UITextureView";
|
|
5
|
-
import type { UITextureConfig } from "../../miscellaneous/texture/UITextureView.Internal";
|
|
6
|
-
import { UIElement } from "../UIElement/UIElement";
|
|
7
|
-
import type { UIImageOptions } from "./UIImage.Internal";
|
|
1
|
+
import type { UILayer } from "../../layers/UILayer/UILayer.js";
|
|
2
|
+
import { UIColor } from "../../miscellaneous/color/UIColor.js";
|
|
3
|
+
import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal.js";
|
|
4
|
+
import { UITextureView } from "../../miscellaneous/texture/UITextureView.js";
|
|
5
|
+
import type { UITextureConfig } from "../../miscellaneous/texture/UITextureView.Internal.js";
|
|
6
|
+
import { UIElement } from "../UIElement/UIElement.js";
|
|
7
|
+
import type { UIImageOptions } from "./UIImage.Internal.js";
|
|
8
8
|
/** Textured image element */
|
|
9
9
|
export declare class UIImage extends UIElement {
|
|
10
10
|
/** Texture displayed by this image */
|
|
@@ -25,8 +25,8 @@ export declare class UIImage extends UIElement {
|
|
|
25
25
|
get color(): UIColor;
|
|
26
26
|
/** Multiplicative tint. Alpha channel controls opacity. */
|
|
27
27
|
set color(value: UIColorConfig);
|
|
28
|
-
/**
|
|
29
|
-
|
|
28
|
+
/** Frees resources of the image */
|
|
29
|
+
protected destroyInternal(): void;
|
|
30
30
|
protected setPlaneTransform(): void;
|
|
31
31
|
private readonly onTextureDimensionsChanged;
|
|
32
32
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { UIColor } from
|
|
2
|
-
import { computeTrimmedTransformMatrix } from
|
|
3
|
-
import { UITextureView } from
|
|
4
|
-
import source from
|
|
5
|
-
import { UIElement } from
|
|
6
|
-
|
|
1
|
+
import { UIColor } from "../../miscellaneous/color/UIColor.js";
|
|
2
|
+
import { computeTrimmedTransformMatrix } from "../../miscellaneous/computeTransform.js";
|
|
3
|
+
import { UITextureView } from "../../miscellaneous/texture/UITextureView.js";
|
|
4
|
+
import source from "../../shaders/UIImage.js";
|
|
5
|
+
import { UIElement } from "../UIElement/UIElement.js";
|
|
7
6
|
/** Textured image element */
|
|
8
|
-
class UIImage extends UIElement {
|
|
7
|
+
export class UIImage extends UIElement {
|
|
9
8
|
/**
|
|
10
9
|
* Creates a new UIImage instance.
|
|
11
10
|
*
|
|
@@ -26,34 +25,34 @@ class UIImage extends UIElement {
|
|
|
26
25
|
textureTransform: textureTransform,
|
|
27
26
|
color,
|
|
28
27
|
}, options);
|
|
29
|
-
this.
|
|
28
|
+
this.onTextureDimensionsChanged = (width, height) => {
|
|
30
29
|
this.width = width;
|
|
31
30
|
this.height = height;
|
|
32
31
|
};
|
|
33
32
|
this.texture = textureView;
|
|
34
|
-
this.
|
|
35
|
-
this.
|
|
36
|
-
this.texture.signalDimensionsChanged.on(this.
|
|
33
|
+
this.textureTransform = textureTransform;
|
|
34
|
+
this.colorInternal = color;
|
|
35
|
+
this.texture.signalDimensionsChanged.on(this.onTextureDimensionsChanged);
|
|
37
36
|
}
|
|
38
37
|
/** Multiplicative tint. Alpha channel controls opacity. */
|
|
39
38
|
get color() {
|
|
40
|
-
return this.
|
|
39
|
+
return this.colorInternal;
|
|
41
40
|
}
|
|
42
41
|
/** Multiplicative tint. Alpha channel controls opacity. */
|
|
43
42
|
set color(value) {
|
|
44
|
-
this.
|
|
43
|
+
this.colorInternal.set(value);
|
|
45
44
|
}
|
|
46
|
-
/**
|
|
47
|
-
|
|
48
|
-
this.texture.signalDimensionsChanged.off(this.
|
|
49
|
-
super.
|
|
45
|
+
/** Frees resources of the image */
|
|
46
|
+
destroyInternal() {
|
|
47
|
+
this.texture.signalDimensionsChanged.off(this.onTextureDimensionsChanged);
|
|
48
|
+
super.destroyInternal();
|
|
50
49
|
}
|
|
51
50
|
setPlaneTransform() {
|
|
52
51
|
let properties;
|
|
53
|
-
if (this.
|
|
52
|
+
if (this.colorInternal.dirty) {
|
|
54
53
|
properties ?? (properties = {});
|
|
55
|
-
properties["color"] = this.
|
|
56
|
-
this.
|
|
54
|
+
properties["color"] = this.colorInternal;
|
|
55
|
+
this.colorInternal.setDirtyFalse();
|
|
57
56
|
}
|
|
58
57
|
if (this.texture.textureDirty) {
|
|
59
58
|
properties ?? (properties = {});
|
|
@@ -62,7 +61,7 @@ class UIImage extends UIElement {
|
|
|
62
61
|
}
|
|
63
62
|
if (this.texture.uvTransformDirty) {
|
|
64
63
|
properties ?? (properties = {});
|
|
65
|
-
properties["textureTransform"] = this.texture.calculateUVTransform(this.
|
|
64
|
+
properties["textureTransform"] = this.texture.calculateUVTransform(this.textureTransform);
|
|
66
65
|
this.texture.setUVTransformDirtyFalse();
|
|
67
66
|
}
|
|
68
67
|
if (properties) {
|
|
@@ -75,11 +74,9 @@ class UIImage extends UIElement {
|
|
|
75
74
|
if (isTransformDirty) {
|
|
76
75
|
const micro = this.micro;
|
|
77
76
|
const textureTrim = this.texture.trim;
|
|
78
|
-
this.sceneWrapper.setTransform(this.planeHandler, computeTrimmedTransformMatrix(this.x, this.y, this.width, this.height, this.
|
|
77
|
+
this.sceneWrapper.setTransform(this.planeHandler, computeTrimmedTransformMatrix(this.x, this.y, this.width, this.height, this.renderDepth, micro.x, micro.y, micro.anchorX, micro.anchorY, micro.scaleX, micro.scaleY, micro.rotation, micro.anchorMode, textureTrim.left, textureTrim.right, textureTrim.top, textureTrim.bottom));
|
|
79
78
|
this.micro.setDirtyFalse();
|
|
80
79
|
this.texture.setTrimDirtyFalse();
|
|
81
80
|
}
|
|
82
81
|
}
|
|
83
82
|
}
|
|
84
|
-
|
|
85
|
-
export { UIImage };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
|
|
2
|
-
import type { UIInsetsConfig } from "../../miscellaneous/insets/UIInsets.Internal";
|
|
3
|
-
import type { UIElementOptions } from "../UIElement/UIElement.Internal";
|
|
1
|
+
import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal.js";
|
|
2
|
+
import type { UIInsetsConfig } from "../../miscellaneous/insets/UIInsets.Internal.js";
|
|
3
|
+
import type { UIElementOptions } from "../UIElement/UIElement.Internal.js";
|
|
4
4
|
/** Controls how sliceRegions values are interpreted */
|
|
5
5
|
export declare enum UINineSliceRegionMode {
|
|
6
6
|
/** sliceRegions in normalized coordinates (0 to 1) */
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
/** Controls how sliceRegions values are interpreted */
|
|
2
|
-
var UINineSliceRegionMode;
|
|
2
|
+
export var UINineSliceRegionMode;
|
|
3
3
|
(function (UINineSliceRegionMode) {
|
|
4
4
|
/** sliceRegions in normalized coordinates (0 to 1) */
|
|
5
5
|
UINineSliceRegionMode[UINineSliceRegionMode["NORMALIZED"] = 0] = "NORMALIZED";
|
|
6
6
|
/** sliceRegions in world units */
|
|
7
7
|
UINineSliceRegionMode[UINineSliceRegionMode["WORLD"] = 1] = "WORLD";
|
|
8
8
|
})(UINineSliceRegionMode || (UINineSliceRegionMode = {}));
|
|
9
|
-
const NINE_SLICE_DEFAULT_BORDER = 0.1;
|
|
10
|
-
const NINE_SLICE_DEFAULT_REGION_MODE = UINineSliceRegionMode.WORLD;
|
|
11
|
-
|
|
12
|
-
export { NINE_SLICE_DEFAULT_BORDER, NINE_SLICE_DEFAULT_REGION_MODE, UINineSliceRegionMode };
|
|
9
|
+
export const NINE_SLICE_DEFAULT_BORDER = 0.1;
|
|
10
|
+
export const NINE_SLICE_DEFAULT_REGION_MODE = UINineSliceRegionMode.WORLD;
|