laymur 0.22.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.js +1 -0
- package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.d.ts +3 -3
- package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.js +14 -16
- package/dist/core/constraints/UIConstraint.d.ts +22 -2
- package/dist/core/constraints/UIConstraint.js +26 -3
- package/dist/core/constraints/UICustomConstraint.d.ts +4 -4
- package/dist/core/constraints/UICustomConstraint.js +15 -15
- package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.js +1 -0
- package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.d.ts +3 -3
- package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.js +11 -13
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.js +1 -3
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.d.ts +3 -3
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.js +30 -30
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.js +2 -4
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.d.ts +3 -3
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.js +40 -39
- package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.js +1 -0
- package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.d.ts +3 -3
- package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.js +13 -15
- package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.d.ts +3 -3
- package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.js +1 -0
- package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.d.ts +13 -7
- package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.js +37 -30
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.js +1 -3
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.d.ts +3 -3
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.js +30 -30
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.js +2 -4
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.d.ts +3 -3
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.js +40 -39
- package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.js +1 -0
- package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.d.ts +3 -3
- package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.js +13 -15
- package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.d.ts +1 -1
- package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.js +1 -0
- package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.d.ts +3 -3
- package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.js +11 -13
- package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.d.ts +3 -3
- package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.js +1 -3
- package/dist/core/constraints/builders/UIConstraint2DBuilder.d.ts +11 -11
- package/dist/core/constraints/builders/UIConstraint2DBuilder.js +10 -13
- package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.d.ts +1 -1
- package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.js +1 -3
- package/dist/core/constraints/builders/UICoverConstraintBuilder.d.ts +7 -7
- package/dist/core/constraints/builders/UICoverConstraintBuilder.js +10 -13
- package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.d.ts +1 -1
- package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.js +1 -3
- package/dist/core/constraints/builders/UIFitConstraintBuilder.d.ts +7 -7
- package/dist/core/constraints/builders/UIFitConstraintBuilder.js +10 -13
- package/dist/core/elements/UIAnchor/UIAnchor.Internal.js +3 -5
- package/dist/core/elements/UIAnchor/UIAnchor.d.ts +23 -5
- package/dist/core/elements/UIAnchor/UIAnchor.js +42 -8
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.d.ts +2 -2
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.js +4 -6
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.d.ts +10 -10
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.js +108 -111
- package/dist/core/elements/UIDummy/UIDummy.Internal.d.ts +4 -4
- package/dist/core/elements/UIDummy/UIDummy.Internal.js +5 -8
- package/dist/core/elements/UIDummy/UIDummy.d.ts +19 -11
- package/dist/core/elements/UIDummy/UIDummy.js +59 -42
- package/dist/core/elements/UIElement/UIElement.Internal.d.ts +5 -5
- package/dist/core/elements/UIElement/UIElement.Internal.js +9 -12
- package/dist/core/elements/UIElement/UIElement.d.ts +25 -17
- package/dist/core/elements/UIElement/UIElement.js +76 -69
- package/dist/core/elements/UIGraphics/UIGraphics.Internal.d.ts +3 -3
- package/dist/core/elements/UIGraphics/UIGraphics.Internal.js +4 -7
- package/dist/core/elements/UIGraphics/UIGraphics.d.ts +7 -7
- package/dist/core/elements/UIGraphics/UIGraphics.js +44 -47
- package/dist/core/elements/UIImage/UIImage.Internal.d.ts +2 -2
- package/dist/core/elements/UIImage/UIImage.Internal.js +1 -0
- package/dist/core/elements/UIImage/UIImage.d.ts +9 -9
- package/dist/core/elements/UIImage/UIImage.js +21 -24
- package/dist/core/elements/UINineSlice/UINineSlice.Internal.d.ts +3 -3
- package/dist/core/elements/UINineSlice/UINineSlice.Internal.js +3 -5
- package/dist/core/elements/UINineSlice/UINineSlice.d.ts +12 -12
- package/dist/core/elements/UINineSlice/UINineSlice.js +71 -73
- package/dist/core/elements/UIProgress/UIProgress.Internal.d.ts +3 -4
- package/dist/core/elements/UIProgress/UIProgress.Internal.js +1 -3
- package/dist/core/elements/UIProgress/UIProgress.d.ts +10 -8
- package/dist/core/elements/UIProgress/UIProgress.js +60 -58
- package/dist/core/elements/UIScene/UIScene.Internal.d.ts +3 -3
- package/dist/core/elements/UIScene/UIScene.Internal.js +11 -14
- package/dist/core/elements/UIScene/UIScene.d.ts +8 -8
- package/dist/core/elements/UIScene/UIScene.js +68 -69
- package/dist/core/elements/UIText/UIText.Bidi.d.ts +2 -2
- package/dist/core/elements/UIText/UIText.Bidi.js +3 -5
- package/dist/core/elements/UIText/UIText.Interfaces.d.ts +6 -2
- package/dist/core/elements/UIText/UIText.Interfaces.js +1 -0
- package/dist/core/elements/UIText/UIText.Internal.d.ts +4 -4
- package/dist/core/elements/UIText/UIText.Internal.js +5 -7
- package/dist/core/elements/UIText/UIText.Measuring.d.ts +14 -7
- package/dist/core/elements/UIText/UIText.Measuring.js +115 -55
- package/dist/core/elements/UIText/UIText.Rendering.d.ts +3 -3
- package/dist/core/elements/UIText/UIText.Rendering.js +6 -9
- package/dist/core/elements/UIText/UIText.d.ts +28 -14
- package/dist/core/elements/UIText/UIText.js +181 -141
- package/dist/core/index.d.ts +55 -54
- package/dist/core/index.js +53 -0
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.d.ts +4 -4
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.js +2 -5
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.d.ts +4 -4
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.js +43 -42
- package/dist/core/layers/UILayer/UILayer.Internal.d.ts +2 -2
- package/dist/core/layers/UILayer/UILayer.Internal.js +4 -7
- package/dist/core/layers/UILayer/UILayer.d.ts +19 -4
- package/dist/core/layers/UILayer/UILayer.js +125 -62
- package/dist/core/miscellaneous/UIBlendMode.js +1 -3
- package/dist/core/miscellaneous/UIExpression.js +16 -19
- package/dist/core/miscellaneous/UIMode.js +3 -5
- package/dist/core/miscellaneous/UIOrientation.js +2 -4
- package/dist/core/miscellaneous/UIPriority.js +5 -8
- package/dist/core/miscellaneous/UIRelation.js +5 -8
- package/dist/core/miscellaneous/UITransparencyMode.js +1 -3
- package/dist/core/miscellaneous/area/UIArea.js +1 -3
- package/dist/core/miscellaneous/area/UIAreaCircle.d.ts +1 -1
- package/dist/core/miscellaneous/area/UIAreaCircle.js +3 -6
- package/dist/core/miscellaneous/area/UIAreaPolygon.d.ts +2 -2
- package/dist/core/miscellaneous/area/UIAreaPolygon.js +3 -6
- package/dist/core/miscellaneous/area/UIAreaRectangle.d.ts +1 -1
- package/dist/core/miscellaneous/area/UIAreaRectangle.js +3 -6
- package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.d.ts +1 -1
- package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.js +3 -6
- package/dist/core/miscellaneous/asserts.d.ts +20 -1
- package/dist/core/miscellaneous/asserts.js +71 -19
- package/dist/core/miscellaneous/canvas.js +13 -7
- package/dist/core/miscellaneous/color/UIColor.Internal.d.ts +1 -1
- package/dist/core/miscellaneous/color/UIColor.Internal.js +1 -3
- package/dist/core/miscellaneous/color/UIColor.d.ts +1 -1
- package/dist/core/miscellaneous/color/UIColor.js +202 -205
- package/dist/core/miscellaneous/computeTransform.d.ts +1 -1
- package/dist/core/miscellaneous/computeTransform.js +4 -7
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.d.ts +2 -2
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.js +13 -16
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.js +115 -118
- package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.d.ts +3 -3
- package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.js +1 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.js +208 -114
- package/dist/core/miscellaneous/generic-plane/shared.d.ts +2 -2
- package/dist/core/miscellaneous/generic-plane/shared.js +16 -19
- package/dist/core/miscellaneous/insets/UIInsets.Internal.js +1 -3
- package/dist/core/miscellaneous/insets/UIInsets.d.ts +1 -1
- package/dist/core/miscellaneous/insets/UIInsets.js +96 -99
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.js +1 -3
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.d.ts +1 -1
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.js +14 -17
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.d.ts +2 -2
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.js +14 -17
- package/dist/core/miscellaneous/math.js +3 -5
- package/dist/core/miscellaneous/micro/UIMicro.Internal.js +6 -8
- package/dist/core/miscellaneous/micro/UIMicro.d.ts +1 -1
- package/dist/core/miscellaneous/micro/UIMicro.js +91 -94
- package/dist/core/miscellaneous/resize-policy/UIResizePolicy.js +1 -3
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.js +12 -15
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.js +13 -16
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.js +13 -16
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.js +12 -15
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.js +13 -16
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.js +13 -16
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.d.ts +1 -1
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.js +3 -6
- package/dist/core/miscellaneous/shared.d.ts +1 -1
- package/dist/core/miscellaneous/shared.js +4 -7
- package/dist/core/miscellaneous/text-span/UITextSpan.Internal.d.ts +1 -1
- package/dist/core/miscellaneous/text-span/UITextSpan.Internal.js +1 -0
- package/dist/core/miscellaneous/text-span/UITextSpan.d.ts +2 -2
- package/dist/core/miscellaneous/text-span/UITextSpan.js +10 -13
- package/dist/core/miscellaneous/text-style/UITextStyle.Internal.js +15 -17
- package/dist/core/miscellaneous/text-style/UITextStyle.d.ts +13 -2
- package/dist/core/miscellaneous/text-style/UITextStyle.js +222 -207
- package/dist/core/miscellaneous/texture/UITextureView.Internal.d.ts +7 -0
- package/dist/core/miscellaneous/texture/UITextureView.Internal.js +16 -6
- package/dist/core/miscellaneous/texture/UITextureView.d.ts +3 -3
- package/dist/core/miscellaneous/texture/UITextureView.js +114 -118
- package/dist/core/miscellaneous/webglCapabilities.js +3 -4
- package/dist/core/shaders/UIImage.d.ts +9 -0
- package/dist/core/shaders/UIImage.js +14 -0
- package/dist/core/shaders/UINineSlice.d.ts +11 -0
- package/dist/core/shaders/UINineSlice.js +57 -0
- package/dist/core/shaders/UIProgress.d.ts +14 -0
- package/dist/core/shaders/UIProgress.js +21 -0
- package/dist/core/shaders/UIProgressMaskFunctionCircular.d.ts +2 -0
- package/dist/core/shaders/UIProgressMaskFunctionCircular.js +16 -0
- package/dist/core/shaders/UIProgressMaskFunctionDirectional.d.ts +2 -0
- package/dist/core/shaders/UIProgressMaskFunctionDirectional.js +15 -0
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.d.ts +4 -0
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.js +1 -0
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.d.ts +7 -1
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.js +50 -47
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.d.ts +5 -2
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.js +1 -0
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.d.ts +11 -3
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.js +42 -26
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.d.ts +5 -3
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.js +1 -0
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.d.ts +27 -4
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.js +162 -123
- package/dist/debug/UIAspectDebug.d.ts +3 -3
- package/dist/debug/UIAspectDebug.js +64 -68
- package/dist/debug/UIConstraintDebug.d.ts +1 -1
- package/dist/debug/UIConstraintDebug.js +1 -0
- package/dist/debug/UIHeightDebug.d.ts +3 -3
- package/dist/debug/UIHeightDebug.js +63 -67
- package/dist/debug/UIHorizontalDistanceDebug.d.ts +3 -3
- package/dist/debug/UIHorizontalDistanceDebug.js +76 -81
- package/dist/debug/UIHorizontalInterpolationDebug.d.ts +3 -3
- package/dist/debug/UIHorizontalInterpolationDebug.js +74 -78
- package/dist/debug/UILayerDebug.d.ts +1 -1
- package/dist/debug/UILayerDebug.js +55 -64
- package/dist/debug/UIVerticalDistanceDebug.d.ts +3 -3
- package/dist/debug/UIVerticalDistanceDebug.js +76 -81
- package/dist/debug/UIVerticalInterpolationDebug.d.ts +3 -3
- package/dist/debug/UIVerticalInterpolationDebug.js +74 -78
- package/dist/debug/UIWidthDebug.d.ts +3 -3
- package/dist/debug/UIWidthDebug.js +63 -67
- package/dist/debug/index.d.ts +8 -8
- package/dist/debug/index.js +8 -8
- package/dist/debug/miscellaneous.js +8 -11
- package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.d.ts +3 -3
- package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.js +13 -16
- package/dist/particles/behaviorModules/UIBehaviorModule.d.ts +1 -1
- package/dist/particles/behaviorModules/UIBehaviorModule.js +1 -3
- package/dist/particles/behaviorModules/UIBehaviorPointGravity.d.ts +3 -3
- package/dist/particles/behaviorModules/UIBehaviorPointGravity.js +37 -40
- package/dist/particles/behaviorModules/UIBehaviorScaleOscillation.d.ts +41 -0
- package/dist/particles/behaviorModules/UIBehaviorScaleOscillation.js +87 -0
- package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.d.ts +2 -2
- package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.js +17 -20
- package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.d.ts +2 -2
- package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.js +13 -16
- package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.d.ts +2 -2
- package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.js +21 -24
- package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.d.ts +2 -2
- package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.js +13 -16
- package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.d.ts +2 -2
- package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.js +21 -24
- package/dist/particles/elements/UIEmitter.Internal.d.ts +2 -2
- package/dist/particles/elements/UIEmitter.Internal.js +6 -9
- package/dist/particles/elements/UIEmitter.d.ts +17 -11
- package/dist/particles/elements/UIEmitter.js +100 -88
- package/dist/particles/index.d.ts +20 -18
- package/dist/particles/index.js +19 -18
- package/dist/particles/instancedParticle/UIInstancedParticle.Internal.d.ts +1 -1
- package/dist/particles/instancedParticle/UIInstancedParticle.Internal.js +14 -15
- package/dist/particles/instancedParticle/UIInstancedParticle.d.ts +1 -1
- package/dist/particles/instancedParticle/UIInstancedParticle.js +29 -32
- package/dist/particles/miscellaneous/miscellaneous.d.ts +3 -3
- package/dist/particles/miscellaneous/miscellaneous.js +26 -27
- package/dist/particles/renderingModules/UIRenderingColorOverLife.d.ts +2 -2
- package/dist/particles/renderingModules/UIRenderingColorOverLife.js +5 -8
- package/dist/particles/renderingModules/UIRenderingColorOverVelocity.d.ts +2 -2
- package/dist/particles/renderingModules/UIRenderingColorOverVelocity.js +6 -9
- package/dist/particles/renderingModules/UIRenderingModule.js +1 -3
- package/dist/particles/renderingModules/UIRenderingTexture.d.ts +2 -2
- package/dist/particles/renderingModules/UIRenderingTexture.js +4 -7
- package/dist/particles/shaders/UIRenderingColorOverLife.d.ts +2 -0
- package/dist/particles/shaders/UIRenderingColorOverLife.js +7 -0
- package/dist/particles/shaders/UIRenderingColorOverVelocity.d.ts +9 -0
- package/dist/particles/shaders/UIRenderingColorOverVelocity.js +16 -0
- package/dist/particles/shaders/UIRenderingTexture.d.ts +2 -0
- package/dist/particles/shaders/UIRenderingTexture.js +7 -0
- package/dist/particles/spawnModules/UISpawnModule.d.ts +1 -1
- package/dist/particles/spawnModules/UISpawnModule.js +1 -3
- package/dist/particles/spawnModules/UISpawnOffset.d.ts +3 -3
- package/dist/particles/spawnModules/UISpawnOffset.js +12 -15
- package/dist/particles/spawnModules/UISpawnRandomLifetime.d.ts +2 -2
- package/dist/particles/spawnModules/UISpawnRandomLifetime.js +13 -16
- package/dist/particles/spawnModules/UISpawnRandomRotation.d.ts +2 -2
- package/dist/particles/spawnModules/UISpawnRandomRotation.js +13 -16
- package/dist/particles/spawnModules/UISpawnRandomScale.d.ts +2 -2
- package/dist/particles/spawnModules/UISpawnRandomScale.js +19 -22
- package/dist/particles/spawnModules/UISpawnRandomTorque.d.ts +2 -2
- package/dist/particles/spawnModules/UISpawnRandomTorque.js +13 -16
- package/dist/particles/spawnModules/UISpawnRandomVelocity.d.ts +2 -2
- package/dist/particles/spawnModules/UISpawnRandomVelocity.js +21 -24
- package/dist/particles/spawnModules/UISpawnRectangle.d.ts +3 -3
- package/dist/particles/spawnModules/UISpawnRectangle.js +21 -24
- package/package.json +13 -17
- package/dist/_virtual/2d.js +0 -3
- package/dist/_virtual/3d.js +0 -3
- package/dist/_virtual/4d.js +0 -3
- package/dist/_virtual/mod.js +0 -5
- package/dist/_virtual/mod2.js +0 -3
- package/dist/core/shaders/UIImage.glsl.js +0 -3
- package/dist/core/shaders/UINineSlice.glsl.js +0 -3
- package/dist/core/shaders/UIProgress.glsl.js +0 -3
- package/dist/core/shaders/UIProgressMaskFunctionCircular.glsl.js +0 -3
- package/dist/core/shaders/UIProgressMaskFunctionDirectional.glsl.js +0 -3
- package/dist/index.js +0 -52
- package/dist/node_modules/fast-simplex-noise/lib/2d.js +0 -93
- package/dist/node_modules/fast-simplex-noise/lib/3d.js +0 -142
- package/dist/node_modules/fast-simplex-noise/lib/4d.js +0 -196
- package/dist/node_modules/fast-simplex-noise/lib/mod.js +0 -24
- package/dist/node_modules/three/examples/jsm/lines/Line2.js +0 -56
- package/dist/node_modules/three/examples/jsm/lines/LineGeometry.js +0 -157
- package/dist/node_modules/three/examples/jsm/lines/LineMaterial.js +0 -691
- package/dist/node_modules/three/examples/jsm/lines/LineSegments2.js +0 -415
- package/dist/node_modules/three/examples/jsm/lines/LineSegmentsGeometry.js +0 -289
- package/dist/particles/shaders/UIRenderingColorOverLife.glsl.js +0 -3
- package/dist/particles/shaders/UIRenderingColorOverVelocity.glsl.js +0 -3
- package/dist/particles/shaders/UIRenderingTexture.glsl.js +0 -3
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { Ferrsign0 } from
|
|
2
|
-
import {
|
|
3
|
-
import { UIColor } from
|
|
4
|
-
import { computeTrimmedTransformMatrix } from
|
|
5
|
-
import { UITextureView } from
|
|
6
|
-
import source from
|
|
7
|
-
import { UIElement } from
|
|
8
|
-
import { ANIMATED_IMAGE_DEFAULT_FRAME_RATE,
|
|
9
|
-
|
|
1
|
+
import { Ferrsign0 } from "ferrsign";
|
|
2
|
+
import { assertValidNumber, assertValidPositiveNumber } from "../../miscellaneous/asserts.js";
|
|
3
|
+
import { UIColor } from "../../miscellaneous/color/UIColor.js";
|
|
4
|
+
import { computeTrimmedTransformMatrix } from "../../miscellaneous/computeTransform.js";
|
|
5
|
+
import { UITextureView } from "../../miscellaneous/texture/UITextureView.js";
|
|
6
|
+
import source from "../../shaders/UIImage.js";
|
|
7
|
+
import { UIElement } from "../UIElement/UIElement.js";
|
|
8
|
+
import { ANIMATED_IMAGE_DEFAULT_FRAME_RATE, ANIMATED_IMAGE_DEFAULT_LOOP_MODE, ANIMATED_IMAGE_DEFAULT_TIME_SCALE, UIAnimatedImageLoopMode, } from "./UIAnimatedImage.Internal.js";
|
|
10
9
|
/** Frame-based texture animation element */
|
|
11
|
-
class UIAnimatedImage extends UIElement {
|
|
10
|
+
export class UIAnimatedImage extends UIElement {
|
|
12
11
|
/**
|
|
13
12
|
* Creates a new UIAnimatedImage instance.
|
|
14
13
|
*
|
|
@@ -30,180 +29,180 @@ class UIAnimatedImage extends UIElement {
|
|
|
30
29
|
textureTransform: textureTransform,
|
|
31
30
|
color,
|
|
32
31
|
}, options);
|
|
33
|
-
this.
|
|
34
|
-
this.
|
|
35
|
-
this.
|
|
36
|
-
this.
|
|
37
|
-
this.
|
|
38
|
-
this.
|
|
39
|
-
this.
|
|
40
|
-
this.
|
|
41
|
-
if (this.
|
|
32
|
+
this.isPlaying = false;
|
|
33
|
+
this.sequenceFrameIndex = 0;
|
|
34
|
+
this.currentFrameIndexDirty = false;
|
|
35
|
+
this.accumulatedTime = 0;
|
|
36
|
+
this.signalPlayedInternal = new Ferrsign0();
|
|
37
|
+
this.signalPausedInternal = new Ferrsign0();
|
|
38
|
+
this.signalStoppedInternal = new Ferrsign0();
|
|
39
|
+
this.onTextureDimensionsChanged = (width, height, texture) => {
|
|
40
|
+
if (this.sequenceInternal[this.sequenceFrameIndex] === texture) {
|
|
42
41
|
this.width = width;
|
|
43
42
|
this.height = height;
|
|
44
43
|
}
|
|
45
44
|
};
|
|
46
|
-
this.
|
|
47
|
-
this.
|
|
48
|
-
this.
|
|
49
|
-
this.
|
|
50
|
-
this.
|
|
51
|
-
this.
|
|
52
|
-
this.
|
|
45
|
+
this.colorInternal = color;
|
|
46
|
+
this.sequenceInternal = uiTextures;
|
|
47
|
+
this.textureTransform = textureTransform;
|
|
48
|
+
this.frameRateInternal = options.frameRate ?? ANIMATED_IMAGE_DEFAULT_FRAME_RATE;
|
|
49
|
+
this.timeScaleInternal = options.timeScale ?? ANIMATED_IMAGE_DEFAULT_TIME_SCALE;
|
|
50
|
+
this.loopModeInternal = options.loopMode ?? ANIMATED_IMAGE_DEFAULT_LOOP_MODE;
|
|
51
|
+
this.subscribeSequenceEvents();
|
|
53
52
|
if (options.playByDefault === true) {
|
|
54
53
|
this.play();
|
|
55
54
|
}
|
|
56
55
|
}
|
|
57
56
|
/** Multiplicative tint. Alpha channel controls opacity. */
|
|
58
57
|
get color() {
|
|
59
|
-
return this.
|
|
58
|
+
return this.colorInternal;
|
|
60
59
|
}
|
|
61
60
|
/** Total animation duration in seconds */
|
|
62
61
|
get duration() {
|
|
63
|
-
return this.
|
|
62
|
+
return this.sequenceInternal.length / this.frameRateInternal;
|
|
64
63
|
}
|
|
65
64
|
/** Animation speed in frames per second */
|
|
66
65
|
get frameRate() {
|
|
67
|
-
return this.
|
|
66
|
+
return this.frameRateInternal;
|
|
68
67
|
}
|
|
69
68
|
/** Loop behavior */
|
|
70
69
|
get loopMode() {
|
|
71
|
-
return this.
|
|
70
|
+
return this.loopModeInternal;
|
|
72
71
|
}
|
|
73
72
|
/** Animation frames as readonly array */
|
|
74
73
|
get sequence() {
|
|
75
|
-
return this.
|
|
74
|
+
return this.sequenceInternal;
|
|
76
75
|
}
|
|
77
76
|
/** Playback speed multiplier. Can be negative for reverse playback. */
|
|
78
77
|
get timeScale() {
|
|
79
|
-
return this.
|
|
78
|
+
return this.timeScaleInternal;
|
|
80
79
|
}
|
|
81
80
|
/** Signal fired when animation starts or resumes */
|
|
82
81
|
get signalPlayed() {
|
|
83
|
-
return this.
|
|
82
|
+
return this.signalPlayedInternal;
|
|
84
83
|
}
|
|
85
84
|
/** Signal fired when animation pauses */
|
|
86
85
|
get signalPaused() {
|
|
87
|
-
return this.
|
|
86
|
+
return this.signalPausedInternal;
|
|
88
87
|
}
|
|
89
88
|
/** Signal fired when animation stops and resets */
|
|
90
89
|
get signalStopped() {
|
|
91
|
-
return this.
|
|
90
|
+
return this.signalStoppedInternal;
|
|
92
91
|
}
|
|
93
92
|
/** Multiplicative tint. Alpha channel controls opacity. */
|
|
94
93
|
set color(value) {
|
|
95
|
-
this.
|
|
94
|
+
this.colorInternal.set(value);
|
|
96
95
|
}
|
|
97
96
|
/** Animation speed in frames per second */
|
|
98
97
|
set frameRate(value) {
|
|
99
98
|
assertValidPositiveNumber(value, "UIAnimatedImage.frameRate");
|
|
100
|
-
this.
|
|
99
|
+
this.frameRateInternal = value;
|
|
101
100
|
}
|
|
102
101
|
/** Loop behavior */
|
|
103
102
|
set loopMode(value) {
|
|
104
|
-
this.
|
|
103
|
+
this.loopModeInternal = value;
|
|
105
104
|
}
|
|
106
105
|
/** Replaces animation frames. Stops playback. */
|
|
107
106
|
set sequence(sequence) {
|
|
108
107
|
this.stop();
|
|
109
|
-
this.
|
|
108
|
+
this.unsubscribeSequenceEvents();
|
|
110
109
|
const newLength = sequence.length;
|
|
111
|
-
const currentLength = this.
|
|
110
|
+
const currentLength = this.sequenceInternal.length;
|
|
112
111
|
for (let i = 0; i < Math.min(newLength, currentLength); i++) {
|
|
113
|
-
this.
|
|
112
|
+
this.sequenceInternal[i].set(sequence[i]);
|
|
114
113
|
}
|
|
115
114
|
if (newLength < currentLength) {
|
|
116
|
-
this.
|
|
115
|
+
this.sequenceInternal.length = newLength;
|
|
117
116
|
}
|
|
118
117
|
else if (newLength > currentLength) {
|
|
119
118
|
for (let i = currentLength; i < newLength; i++) {
|
|
120
|
-
this.
|
|
119
|
+
this.sequenceInternal.push(new UITextureView(sequence[i]));
|
|
121
120
|
}
|
|
122
121
|
}
|
|
123
|
-
this.
|
|
122
|
+
this.subscribeSequenceEvents();
|
|
124
123
|
}
|
|
125
124
|
/** Playback speed multiplier. Can be negative for reverse playback. */
|
|
126
125
|
set timeScale(value) {
|
|
127
126
|
assertValidNumber(value, "UIAnimatedImage.timeScale");
|
|
128
|
-
this.
|
|
129
|
-
}
|
|
130
|
-
/** Removes element and frees resources */
|
|
131
|
-
destroy() {
|
|
132
|
-
this._private_unsubscribeSequenceEvents();
|
|
133
|
-
super.destroy();
|
|
127
|
+
this.timeScaleInternal = value;
|
|
134
128
|
}
|
|
135
129
|
/** Starts or resumes animation playback */
|
|
136
130
|
play() {
|
|
137
|
-
if (!this.
|
|
138
|
-
this.
|
|
139
|
-
this.
|
|
131
|
+
if (!this.isPlaying) {
|
|
132
|
+
this.isPlaying = true;
|
|
133
|
+
this.signalPlayedInternal.emit();
|
|
140
134
|
}
|
|
141
135
|
}
|
|
142
136
|
/** Pauses animation at current frame */
|
|
143
137
|
pause() {
|
|
144
|
-
if (this.
|
|
145
|
-
this.
|
|
146
|
-
this.
|
|
138
|
+
if (this.isPlaying) {
|
|
139
|
+
this.isPlaying = false;
|
|
140
|
+
this.signalPausedInternal.emit();
|
|
147
141
|
}
|
|
148
142
|
}
|
|
149
143
|
/** Stops animation and resets to first frame */
|
|
150
144
|
stop() {
|
|
151
|
-
if (this.
|
|
152
|
-
this.
|
|
153
|
-
this.
|
|
154
|
-
this.
|
|
155
|
-
this.
|
|
156
|
-
this.
|
|
145
|
+
if (this.isPlaying || this.accumulatedTime > 0 || this.sequenceFrameIndex > 0) {
|
|
146
|
+
this.isPlaying = false;
|
|
147
|
+
this.accumulatedTime = 0;
|
|
148
|
+
this.sequenceFrameIndex = 0;
|
|
149
|
+
this.currentFrameIndexDirty = true;
|
|
150
|
+
this.signalStoppedInternal.emit();
|
|
157
151
|
}
|
|
158
152
|
}
|
|
153
|
+
/** Frees resources of the animated image */
|
|
154
|
+
destroyInternal() {
|
|
155
|
+
this.unsubscribeSequenceEvents();
|
|
156
|
+
super.destroyInternal();
|
|
157
|
+
}
|
|
159
158
|
onWillRender(renderer, deltaTime) {
|
|
160
|
-
if (this.
|
|
161
|
-
this.
|
|
162
|
-
const frameDuration = 1 / this.
|
|
163
|
-
const sequenceLength = this.
|
|
159
|
+
if (this.isPlaying && this.timeScaleInternal !== 0) {
|
|
160
|
+
this.accumulatedTime += deltaTime * this.timeScaleInternal;
|
|
161
|
+
const frameDuration = 1 / this.frameRateInternal;
|
|
162
|
+
const sequenceLength = this.sequenceInternal.length;
|
|
164
163
|
const lastFrameIndex = sequenceLength - 1;
|
|
165
|
-
if (this.
|
|
166
|
-
while (this.
|
|
167
|
-
this.
|
|
168
|
-
this.
|
|
169
|
-
if (this.
|
|
170
|
-
if (this.
|
|
171
|
-
this.
|
|
164
|
+
if (this.timeScaleInternal > 0) {
|
|
165
|
+
while (this.accumulatedTime >= frameDuration) {
|
|
166
|
+
this.accumulatedTime -= frameDuration;
|
|
167
|
+
this.sequenceFrameIndex += 1;
|
|
168
|
+
if (this.sequenceFrameIndex >= sequenceLength) {
|
|
169
|
+
if (this.loopModeInternal === UIAnimatedImageLoopMode.LOOP) {
|
|
170
|
+
this.sequenceFrameIndex = 0;
|
|
172
171
|
}
|
|
173
|
-
else if (this.
|
|
174
|
-
this.
|
|
175
|
-
this.
|
|
172
|
+
else if (this.loopModeInternal === UIAnimatedImageLoopMode.PING_PONG) {
|
|
173
|
+
this.sequenceFrameIndex = lastFrameIndex;
|
|
174
|
+
this.timeScaleInternal = -this.timeScaleInternal;
|
|
176
175
|
}
|
|
177
176
|
else {
|
|
178
|
-
this.
|
|
179
|
-
this.
|
|
180
|
-
this.
|
|
177
|
+
this.sequenceFrameIndex = lastFrameIndex;
|
|
178
|
+
this.isPlaying = false;
|
|
179
|
+
this.signalPausedInternal.emit();
|
|
181
180
|
break;
|
|
182
181
|
}
|
|
183
182
|
}
|
|
184
|
-
this.
|
|
183
|
+
this.currentFrameIndexDirty = true;
|
|
185
184
|
}
|
|
186
185
|
}
|
|
187
186
|
else {
|
|
188
|
-
while (this.
|
|
189
|
-
this.
|
|
190
|
-
this.
|
|
191
|
-
if (this.
|
|
192
|
-
if (this.
|
|
193
|
-
this.
|
|
187
|
+
while (this.accumulatedTime <= -frameDuration) {
|
|
188
|
+
this.accumulatedTime += frameDuration;
|
|
189
|
+
this.sequenceFrameIndex -= 1;
|
|
190
|
+
if (this.sequenceFrameIndex < 0) {
|
|
191
|
+
if (this.loopModeInternal === UIAnimatedImageLoopMode.LOOP) {
|
|
192
|
+
this.sequenceFrameIndex = lastFrameIndex;
|
|
194
193
|
}
|
|
195
|
-
else if (this.
|
|
196
|
-
this.
|
|
197
|
-
this.
|
|
194
|
+
else if (this.loopModeInternal === UIAnimatedImageLoopMode.PING_PONG) {
|
|
195
|
+
this.sequenceFrameIndex = 0;
|
|
196
|
+
this.timeScaleInternal = -this.timeScaleInternal;
|
|
198
197
|
}
|
|
199
198
|
else {
|
|
200
|
-
this.
|
|
201
|
-
this.
|
|
202
|
-
this.
|
|
199
|
+
this.sequenceFrameIndex = 0;
|
|
200
|
+
this.isPlaying = false;
|
|
201
|
+
this.signalPausedInternal.emit();
|
|
203
202
|
break;
|
|
204
203
|
}
|
|
205
204
|
}
|
|
206
|
-
this.
|
|
205
|
+
this.currentFrameIndexDirty = true;
|
|
207
206
|
}
|
|
208
207
|
}
|
|
209
208
|
}
|
|
@@ -211,26 +210,26 @@ class UIAnimatedImage extends UIElement {
|
|
|
211
210
|
}
|
|
212
211
|
setPlaneTransform() {
|
|
213
212
|
let properties;
|
|
214
|
-
if (this.
|
|
213
|
+
if (this.colorInternal.dirty) {
|
|
215
214
|
properties ?? (properties = {});
|
|
216
|
-
properties["color"] = this.
|
|
217
|
-
this.
|
|
215
|
+
properties["color"] = this.colorInternal;
|
|
216
|
+
this.colorInternal.setDirtyFalse();
|
|
218
217
|
}
|
|
219
|
-
const frame = this.
|
|
220
|
-
if (frame.textureDirty || this.
|
|
218
|
+
const frame = this.sequenceInternal[this.sequenceFrameIndex];
|
|
219
|
+
if (frame.textureDirty || this.currentFrameIndexDirty) {
|
|
221
220
|
properties ?? (properties = {});
|
|
222
221
|
properties["texture"] = frame.texture;
|
|
223
222
|
frame.setTextureDirtyFalse();
|
|
224
223
|
}
|
|
225
|
-
if (frame.uvTransformDirty || this.
|
|
224
|
+
if (frame.uvTransformDirty || this.currentFrameIndexDirty) {
|
|
226
225
|
properties ?? (properties = {});
|
|
227
|
-
properties["textureTransform"] = frame.calculateUVTransform(this.
|
|
226
|
+
properties["textureTransform"] = frame.calculateUVTransform(this.textureTransform);
|
|
228
227
|
frame.setUVTransformDirtyFalse();
|
|
229
228
|
}
|
|
230
229
|
if (properties) {
|
|
231
230
|
this.sceneWrapper.setProperties(this.planeHandler, properties);
|
|
232
231
|
}
|
|
233
|
-
const isTransformDirty = this.
|
|
232
|
+
const isTransformDirty = this.currentFrameIndexDirty ||
|
|
234
233
|
this.micro.dirty ||
|
|
235
234
|
frame.trimDirty ||
|
|
236
235
|
this.inputWrapper.dirty ||
|
|
@@ -238,22 +237,20 @@ class UIAnimatedImage extends UIElement {
|
|
|
238
237
|
if (isTransformDirty) {
|
|
239
238
|
const micro = this.micro;
|
|
240
239
|
const textureTrim = frame.trim;
|
|
241
|
-
this.sceneWrapper.setTransform(this.planeHandler, computeTrimmedTransformMatrix(this.x, this.y, this.width, this.height, this.
|
|
242
|
-
this.
|
|
240
|
+
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));
|
|
241
|
+
this.currentFrameIndexDirty = false;
|
|
243
242
|
this.micro.setDirtyFalse();
|
|
244
243
|
frame.setTrimDirtyFalse();
|
|
245
244
|
}
|
|
246
245
|
}
|
|
247
|
-
|
|
248
|
-
for (const frame of this.
|
|
249
|
-
frame.
|
|
246
|
+
subscribeSequenceEvents() {
|
|
247
|
+
for (const frame of this.sequenceInternal) {
|
|
248
|
+
frame.signalDimensionsChanged.on(this.onTextureDimensionsChanged);
|
|
250
249
|
}
|
|
251
250
|
}
|
|
252
|
-
|
|
253
|
-
for (const frame of this.
|
|
254
|
-
frame.
|
|
251
|
+
unsubscribeSequenceEvents() {
|
|
252
|
+
for (const frame of this.sequenceInternal) {
|
|
253
|
+
frame.signalDimensionsChanged.off(this.onTextureDimensionsChanged);
|
|
255
254
|
}
|
|
256
255
|
}
|
|
257
256
|
}
|
|
258
|
-
|
|
259
|
-
export { UIAnimatedImage };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { UIArea } from "../../miscellaneous/area/UIArea";
|
|
2
|
-
import { UIMode } from "../../miscellaneous/UIMode";
|
|
3
|
-
import type { UIAnchorOptions } from "../UIAnchor/UIAnchor.Internal";
|
|
4
|
-
import type { UIDummy } from "./UIDummy";
|
|
1
|
+
import type { UIArea } from "../../miscellaneous/area/UIArea.js";
|
|
2
|
+
import { UIMode } from "../../miscellaneous/UIMode.js";
|
|
3
|
+
import type { UIAnchorOptions } from "../UIAnchor/UIAnchor.Internal.js";
|
|
4
|
+
import type { UIDummy } from "./UIDummy.js";
|
|
5
5
|
/** Input event data */
|
|
6
6
|
export interface UIInputEventData {
|
|
7
7
|
/** X coordinate */
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { UIMode } from
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const DUMMY_DEFAULT_Z_INDEX = 0;
|
|
7
|
-
|
|
8
|
-
export { DUMMY_DEFAULT_HEIGHT, DUMMY_DEFAULT_MODE, DUMMY_DEFAULT_WIDTH, DUMMY_DEFAULT_Z_INDEX };
|
|
1
|
+
import { UIMode } from "../../miscellaneous/UIMode.js";
|
|
2
|
+
export const DUMMY_DEFAULT_WIDTH = 64;
|
|
3
|
+
export const DUMMY_DEFAULT_HEIGHT = 32;
|
|
4
|
+
export const DUMMY_DEFAULT_MODE = UIMode.VISIBLE;
|
|
5
|
+
export const DUMMY_DEFAULT_Z_INDEX = 0;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { FerrsignView1 } from "ferrsign";
|
|
2
2
|
import { Ferrsign1 } from "ferrsign";
|
|
3
|
-
import type { UILayer } from "../../layers/UILayer/UILayer";
|
|
4
|
-
import type { UIArea } from "../../miscellaneous/area/UIArea";
|
|
5
|
-
import type { UIPlaneElement } from "../../miscellaneous/shared";
|
|
6
|
-
import { UIMode } from "../../miscellaneous/UIMode";
|
|
7
|
-
import type { UIInputWrapperView } from "../../wrappers/UIInputWrapper/UIInputWrapper.Internal";
|
|
8
|
-
import { UIAnchor } from "../UIAnchor/UIAnchor";
|
|
9
|
-
import type { UIDummyOptions, UIInputEventData } from "./UIDummy.Internal";
|
|
3
|
+
import type { UILayer } from "../../layers/UILayer/UILayer.js";
|
|
4
|
+
import type { UIArea } from "../../miscellaneous/area/UIArea.js";
|
|
5
|
+
import type { UIPlaneElement } from "../../miscellaneous/shared.js";
|
|
6
|
+
import { UIMode } from "../../miscellaneous/UIMode.js";
|
|
7
|
+
import type { UIInputWrapperView } from "../../wrappers/UIInputWrapper/UIInputWrapper.Internal.js";
|
|
8
|
+
import { UIAnchor } from "../UIAnchor/UIAnchor.js";
|
|
9
|
+
import type { UIDummyOptions, UIInputEventData } from "./UIDummy.Internal.js";
|
|
10
10
|
/** Rectangular area with dimensions but no rendering */
|
|
11
11
|
export declare class UIDummy extends UIAnchor implements UIPlaneElement {
|
|
12
12
|
/** Shape defining interactive region in element-local space (0,0 = bottom-left, 1,1 = top-right) */
|
|
@@ -45,7 +45,10 @@ export declare class UIDummy extends UIAnchor implements UIPlaneElement {
|
|
|
45
45
|
get centerY(): number;
|
|
46
46
|
/** Controls visibility and interactivity */
|
|
47
47
|
get mode(): UIMode;
|
|
48
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* Rendering and input priority. Higher values on top; elements with equal values keep the
|
|
50
|
+
* order of creation, a later one on top.
|
|
51
|
+
*/
|
|
49
52
|
get zIndex(): number;
|
|
50
53
|
/** Signal fired when pointer is pressed */
|
|
51
54
|
get signalPointerPressed(): FerrsignView1<UIInputEventData>;
|
|
@@ -57,6 +60,8 @@ export declare class UIDummy extends UIAnchor implements UIPlaneElement {
|
|
|
57
60
|
get signalPointerEntered(): FerrsignView1<UIInputEventData>;
|
|
58
61
|
/** Signal fired when pointer leaves element */
|
|
59
62
|
get signalPointerLeft(): FerrsignView1<UIInputEventData>;
|
|
63
|
+
/** Unique depth of the element among the elements of the layer, derived from `zIndex` */
|
|
64
|
+
protected get renderDepth(): number;
|
|
60
65
|
/** Width in world units */
|
|
61
66
|
set width(value: number);
|
|
62
67
|
/** Height in world units */
|
|
@@ -71,10 +76,13 @@ export declare class UIDummy extends UIAnchor implements UIPlaneElement {
|
|
|
71
76
|
set centerY(value: number);
|
|
72
77
|
/** Controls visibility and interactivity */
|
|
73
78
|
set mode(value: UIMode);
|
|
74
|
-
/**
|
|
79
|
+
/**
|
|
80
|
+
* Rendering and input priority. Higher values on top; elements with equal values keep the
|
|
81
|
+
* order of creation, a later one on top.
|
|
82
|
+
*/
|
|
75
83
|
set zIndex(value: number);
|
|
76
|
-
|
|
77
|
-
|
|
84
|
+
protected getSolverVariables(): number[];
|
|
85
|
+
protected destroyInternal(): void;
|
|
78
86
|
protected readonly catchPointerDown: (x: number, y: number, identifier: number) => boolean;
|
|
79
87
|
protected readonly catchPointerMove: (x: number, y: number, identifier: number) => boolean;
|
|
80
88
|
protected readonly catchPointerUp: (x: number, y: number, identifier: number) => boolean;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { Ferrsign1 } from
|
|
2
|
-
import { MathUtils } from
|
|
3
|
-
import { UIAreaRectangle } from
|
|
4
|
-
import {
|
|
5
|
-
import { isUIModeInteractive, UIMode } from
|
|
6
|
-
import { UIPriority } from
|
|
7
|
-
import { UIAnchor } from
|
|
8
|
-
import {
|
|
9
|
-
|
|
1
|
+
import { Ferrsign1 } from "ferrsign";
|
|
2
|
+
import { MathUtils } from "three";
|
|
3
|
+
import { UIAreaRectangle } from "../../miscellaneous/area/UIAreaRectangle.js";
|
|
4
|
+
import { assertValidNumber, assertValidPositiveNumber } from "../../miscellaneous/asserts.js";
|
|
5
|
+
import { isUIModeInteractive, UIMode } from "../../miscellaneous/UIMode.js";
|
|
6
|
+
import { UIPriority } from "../../miscellaneous/UIPriority.js";
|
|
7
|
+
import { UIAnchor } from "../UIAnchor/UIAnchor.js";
|
|
8
|
+
import { DUMMY_DEFAULT_HEIGHT, DUMMY_DEFAULT_MODE, DUMMY_DEFAULT_WIDTH, DUMMY_DEFAULT_Z_INDEX, } from "./UIDummy.Internal.js";
|
|
10
9
|
/** Rectangular area with dimensions but no rendering */
|
|
11
|
-
class UIDummy extends UIAnchor {
|
|
10
|
+
export class UIDummy extends UIAnchor {
|
|
12
11
|
/**
|
|
13
12
|
* Creates a new UIDummy instance.
|
|
14
13
|
*
|
|
@@ -21,28 +20,28 @@ class UIDummy extends UIAnchor {
|
|
|
21
20
|
assertValidPositiveNumber(w, "UIDummy.constructor.width");
|
|
22
21
|
assertValidPositiveNumber(h, "UIDummy.constructor.height");
|
|
23
22
|
super(layer, options);
|
|
24
|
-
this.
|
|
25
|
-
this.
|
|
26
|
-
this.
|
|
27
|
-
this.
|
|
28
|
-
this.
|
|
29
|
-
this.
|
|
23
|
+
this.wasPointerInside = false;
|
|
24
|
+
this.signalPointerPressedInternal = new Ferrsign1();
|
|
25
|
+
this.signalPointerMovedInternal = new Ferrsign1();
|
|
26
|
+
this.signalPointerReleasedInternal = new Ferrsign1();
|
|
27
|
+
this.signalPointerEnteredInternal = new Ferrsign1();
|
|
28
|
+
this.signalPointerLeftInternal = new Ferrsign1();
|
|
30
29
|
this.catchPointerDown = (x, y, identifier) => {
|
|
31
|
-
return this.handleInputEvent(x, y, identifier, this.
|
|
30
|
+
return this.handleInputEvent(x, y, identifier, this.signalPointerPressedInternal);
|
|
32
31
|
};
|
|
33
32
|
this.catchPointerMove = (x, y, identifier) => {
|
|
34
|
-
return this.handleInputEvent(x, y, identifier, this.
|
|
33
|
+
return this.handleInputEvent(x, y, identifier, this.signalPointerMovedInternal);
|
|
35
34
|
};
|
|
36
35
|
this.catchPointerUp = (x, y, identifier) => {
|
|
37
|
-
return this.handleInputEvent(x, y, identifier, this.
|
|
36
|
+
return this.handleInputEvent(x, y, identifier, this.signalPointerReleasedInternal);
|
|
38
37
|
};
|
|
39
38
|
this.interactionArea = options?.interactionArea ?? new UIAreaRectangle(0, 0, 1, 1);
|
|
40
39
|
this.modeInternal = options?.mode ?? DUMMY_DEFAULT_MODE;
|
|
41
40
|
this.inputWrapper = this.layer.inputWrapper;
|
|
42
41
|
this.wVariable = this.solverWrapper.createVariable(w, UIPriority.P6);
|
|
43
42
|
this.hVariable = this.solverWrapper.createVariable(h, UIPriority.P6);
|
|
44
|
-
this.
|
|
45
|
-
this.inputWrapper.setActive(this.
|
|
43
|
+
this.catcherHandler = this.inputWrapper.createInputCatcher(this.catchPointerDown, this.catchPointerMove, this.catchPointerUp, DUMMY_DEFAULT_Z_INDEX);
|
|
44
|
+
this.inputWrapper.setActive(this.catcherHandler, isUIModeInteractive(this.modeInternal));
|
|
46
45
|
}
|
|
47
46
|
/** Width in world units */
|
|
48
47
|
get width() {
|
|
@@ -72,79 +71,99 @@ class UIDummy extends UIAnchor {
|
|
|
72
71
|
get mode() {
|
|
73
72
|
return this.modeInternal;
|
|
74
73
|
}
|
|
75
|
-
/**
|
|
74
|
+
/**
|
|
75
|
+
* Rendering and input priority. Higher values on top; elements with equal values keep the
|
|
76
|
+
* order of creation, a later one on top.
|
|
77
|
+
*/
|
|
76
78
|
get zIndex() {
|
|
77
|
-
return this.inputWrapper.getZIndex(this.
|
|
79
|
+
return this.inputWrapper.getZIndex(this.catcherHandler);
|
|
78
80
|
}
|
|
79
81
|
/** Signal fired when pointer is pressed */
|
|
80
82
|
get signalPointerPressed() {
|
|
81
|
-
return this.
|
|
83
|
+
return this.signalPointerPressedInternal;
|
|
82
84
|
}
|
|
83
85
|
/** Signal fired when pointer is moved */
|
|
84
86
|
get signalPointerMoved() {
|
|
85
|
-
return this.
|
|
87
|
+
return this.signalPointerMovedInternal;
|
|
86
88
|
}
|
|
87
89
|
/** Signal fired when pointer is released */
|
|
88
90
|
get signalPointerReleased() {
|
|
89
|
-
return this.
|
|
91
|
+
return this.signalPointerReleasedInternal;
|
|
90
92
|
}
|
|
91
93
|
/** Signal fired when pointer enters element */
|
|
92
94
|
get signalPointerEntered() {
|
|
93
|
-
return this.
|
|
95
|
+
return this.signalPointerEnteredInternal;
|
|
94
96
|
}
|
|
95
97
|
/** Signal fired when pointer leaves element */
|
|
96
98
|
get signalPointerLeft() {
|
|
97
|
-
return this.
|
|
99
|
+
return this.signalPointerLeftInternal;
|
|
100
|
+
}
|
|
101
|
+
/** Unique depth of the element among the elements of the layer, derived from `zIndex` */
|
|
102
|
+
get renderDepth() {
|
|
103
|
+
return this.inputWrapper.getDepth(this.catcherHandler);
|
|
98
104
|
}
|
|
99
105
|
/** Width in world units */
|
|
100
106
|
set width(value) {
|
|
107
|
+
this.assertNotDestroyed("UIDummy.width");
|
|
101
108
|
assertValidPositiveNumber(value, "UIDummy.width");
|
|
102
109
|
this.solverWrapper.suggestVariableValue(this.wVariable, value);
|
|
103
110
|
}
|
|
104
111
|
/** Height in world units */
|
|
105
112
|
set height(value) {
|
|
113
|
+
this.assertNotDestroyed("UIDummy.height");
|
|
106
114
|
assertValidPositiveNumber(value, "UIDummy.height");
|
|
107
115
|
this.solverWrapper.suggestVariableValue(this.hVariable, value);
|
|
108
116
|
}
|
|
109
117
|
/** X coordinate of right edge */
|
|
110
118
|
set oppositeX(value) {
|
|
119
|
+
this.assertNotDestroyed("UIDummy.oppositeX");
|
|
111
120
|
assertValidNumber(value, "UIDummy.oppositeX");
|
|
112
121
|
this.x = value - this.width;
|
|
113
122
|
}
|
|
114
123
|
/** Y coordinate of top edge */
|
|
115
124
|
set oppositeY(value) {
|
|
125
|
+
this.assertNotDestroyed("UIDummy.oppositeY");
|
|
116
126
|
assertValidNumber(value, "UIDummy.oppositeY");
|
|
117
127
|
this.y = value - this.height;
|
|
118
128
|
}
|
|
119
129
|
/** X coordinate of horizontal center */
|
|
120
130
|
set centerX(value) {
|
|
131
|
+
this.assertNotDestroyed("UIDummy.centerX");
|
|
121
132
|
assertValidNumber(value, "UIDummy.centerX");
|
|
122
133
|
this.x = value - this.width / 2;
|
|
123
134
|
}
|
|
124
135
|
/** Y coordinate of vertical center */
|
|
125
136
|
set centerY(value) {
|
|
137
|
+
this.assertNotDestroyed("UIDummy.centerY");
|
|
126
138
|
assertValidNumber(value, "UIDummy.centerY");
|
|
127
139
|
this.y = value - this.height / 2;
|
|
128
140
|
}
|
|
129
141
|
/** Controls visibility and interactivity */
|
|
130
142
|
set mode(value) {
|
|
143
|
+
this.assertNotDestroyed("UIDummy.mode");
|
|
131
144
|
if (this.modeInternal !== value) {
|
|
132
145
|
const newInteractivity = isUIModeInteractive(value);
|
|
133
|
-
this.inputWrapper.setActive(this.
|
|
146
|
+
this.inputWrapper.setActive(this.catcherHandler, newInteractivity);
|
|
134
147
|
this.modeInternal = value;
|
|
135
148
|
}
|
|
136
149
|
}
|
|
137
|
-
/**
|
|
150
|
+
/**
|
|
151
|
+
* Rendering and input priority. Higher values on top; elements with equal values keep the
|
|
152
|
+
* order of creation, a later one on top.
|
|
153
|
+
*/
|
|
138
154
|
set zIndex(value) {
|
|
155
|
+
this.assertNotDestroyed("UIDummy.zIndex");
|
|
139
156
|
assertValidNumber(value, "UIDummy.zIndex");
|
|
140
|
-
this.inputWrapper.setZIndex(this.
|
|
157
|
+
this.inputWrapper.setZIndex(this.catcherHandler, value);
|
|
158
|
+
}
|
|
159
|
+
getSolverVariables() {
|
|
160
|
+
return [...super.getSolverVariables(), this.wVariable, this.hVariable];
|
|
141
161
|
}
|
|
142
|
-
|
|
143
|
-
destroy() {
|
|
162
|
+
destroyInternal() {
|
|
144
163
|
this.solverWrapper.removeVariable(this.hVariable);
|
|
145
164
|
this.solverWrapper.removeVariable(this.wVariable);
|
|
146
|
-
this.inputWrapper.destroyInputCatcher(this.
|
|
147
|
-
super.
|
|
165
|
+
this.inputWrapper.destroyInputCatcher(this.catcherHandler);
|
|
166
|
+
super.destroyInternal();
|
|
148
167
|
}
|
|
149
168
|
handleInputEvent(x, y, identifier, signal) {
|
|
150
169
|
assertValidNumber(x, "UIDummy.handleInputEvent.x");
|
|
@@ -154,20 +173,18 @@ class UIDummy extends UIAnchor {
|
|
|
154
173
|
if (isPointerInside) {
|
|
155
174
|
signal.emit({ x, y, identifier, element: this });
|
|
156
175
|
}
|
|
157
|
-
if (this.
|
|
158
|
-
this.
|
|
176
|
+
if (this.wasPointerInside && !isPointerInside) {
|
|
177
|
+
this.signalPointerLeftInternal.emit({ x, y, identifier, element: this });
|
|
159
178
|
}
|
|
160
|
-
else if (!this.
|
|
161
|
-
this.
|
|
179
|
+
else if (!this.wasPointerInside && isPointerInside) {
|
|
180
|
+
this.signalPointerEnteredInternal.emit({
|
|
162
181
|
x,
|
|
163
182
|
y,
|
|
164
183
|
identifier,
|
|
165
184
|
element: this,
|
|
166
185
|
});
|
|
167
186
|
}
|
|
168
|
-
this.
|
|
187
|
+
this.wasPointerInside = isPointerInside;
|
|
169
188
|
return this.modeInternal !== UIMode.INTERACTIVE_TRANSPARENT && isPointerInside;
|
|
170
189
|
}
|
|
171
190
|
}
|
|
172
|
-
|
|
173
|
-
export { UIDummy };
|