laymur 0.17.0 → 0.17.1
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/{src/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.ts → dist/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.d.ts} +2 -3
- package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.d.ts +22 -0
- package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.js +41 -0
- package/dist/core/constraints/UIConstraint.d.ts +12 -0
- package/dist/core/constraints/UIConstraint.js +11 -0
- package/dist/core/constraints/UICustomConstraint.d.ts +28 -0
- package/dist/core/constraints/UICustomConstraint.js +37 -0
- package/{src/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.ts → dist/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.d.ts} +2 -3
- package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.d.ts +20 -0
- package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.js +34 -0
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.d.ts +11 -0
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.js +3 -0
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.d.ts +36 -0
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.js +100 -0
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.d.ts +14 -0
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.js +4 -0
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.d.ts +44 -0
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.js +136 -0
- package/{src/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.ts → dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.d.ts} +2 -3
- package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.d.ts +22 -0
- package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.js +40 -0
- package/{src/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.ts → dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.d.ts} +8 -9
- package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.d.ts +43 -0
- package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.js +71 -0
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.d.ts +11 -0
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.js +3 -0
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.d.ts +32 -0
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.js +100 -0
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.d.ts +14 -0
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.js +4 -0
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.d.ts +44 -0
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.js +136 -0
- package/{src/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.ts → dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.d.ts} +2 -3
- package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.d.ts +22 -0
- package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.js +40 -0
- package/{src/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.ts → dist/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.d.ts} +2 -3
- package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.d.ts +20 -0
- package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.js +34 -0
- package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.d.ts +64 -0
- package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.js +19 -0
- package/dist/core/constraints/builders/UIConstraint2DBuilder.d.ts +46 -0
- package/dist/core/constraints/builders/UIConstraint2DBuilder.js +138 -0
- package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.d.ts +13 -0
- package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.js +3 -0
- package/dist/core/constraints/builders/UICoverConstraintBuilder.d.ts +29 -0
- package/dist/core/constraints/builders/UICoverConstraintBuilder.js +63 -0
- package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.d.ts +13 -0
- package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.js +3 -0
- package/dist/core/constraints/builders/UIFitConstraintBuilder.d.ts +29 -0
- package/dist/core/constraints/builders/UIFitConstraintBuilder.js +63 -0
- package/dist/core/elements/UIAnchor/UIAnchor.Internal.d.ts +12 -0
- package/dist/core/elements/UIAnchor/UIAnchor.Internal.js +5 -0
- package/dist/core/elements/UIAnchor/UIAnchor.d.ts +32 -0
- package/dist/core/elements/UIAnchor/UIAnchor.js +49 -0
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.d.ts +27 -0
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.js +15 -0
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.d.ts +77 -0
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.js +259 -0
- package/dist/core/elements/UIDummy/UIDummy.Internal.d.ts +30 -0
- package/dist/core/elements/UIDummy/UIDummy.Internal.js +8 -0
- package/dist/core/elements/UIDummy/UIDummy.d.ts +82 -0
- package/dist/core/elements/UIDummy/UIDummy.js +173 -0
- package/{src/core/elements/UIElement/UIElement.Internal.ts → dist/core/elements/UIElement/UIElement.Internal.d.ts} +5 -7
- package/dist/core/elements/UIElement/UIElement.Internal.js +5 -0
- package/dist/core/elements/UIElement/UIElement.d.ts +38 -0
- package/dist/core/elements/UIElement/UIElement.js +74 -0
- package/{src/core/elements/UIGraphics/UIGraphics.Internal.ts → dist/core/elements/UIGraphics/UIGraphics.Internal.d.ts} +5 -7
- package/dist/core/elements/UIGraphics/UIGraphics.Internal.js +7 -0
- package/dist/core/elements/UIGraphics/UIGraphics.d.ts +51 -0
- package/dist/core/elements/UIGraphics/UIGraphics.js +126 -0
- package/{src/core/elements/UIImage/UIImage.Internal.ts → dist/core/elements/UIImage/UIImage.Internal.d.ts} +2 -3
- package/dist/core/elements/UIImage/UIImage.d.ts +32 -0
- package/dist/core/elements/UIImage/UIImage.js +85 -0
- package/dist/core/elements/UINineSlice/UINineSlice.Internal.d.ts +23 -0
- package/dist/core/elements/UINineSlice/UINineSlice.Internal.js +12 -0
- package/dist/core/elements/UINineSlice/UINineSlice.d.ts +60 -0
- package/dist/core/elements/UINineSlice/UINineSlice.js +188 -0
- package/dist/core/elements/UIProgress/UIProgress.Internal.d.ts +14 -0
- package/dist/core/elements/UIProgress/UIProgress.Internal.js +3 -0
- package/dist/core/elements/UIProgress/UIProgress.d.ts +45 -0
- package/dist/core/elements/UIProgress/UIProgress.js +165 -0
- package/dist/core/elements/UIScene/UIScene.Internal.d.ts +43 -0
- package/dist/core/elements/UIScene/UIScene.Internal.js +27 -0
- package/dist/core/elements/UIScene/UIScene.d.ts +59 -0
- package/dist/core/elements/UIScene/UIScene.js +157 -0
- package/{src/core/elements/UIText/UIText.Interfaces.ts → dist/core/elements/UIText/UIText.Interfaces.d.ts} +16 -21
- package/dist/core/elements/UIText/UIText.Internal.d.ts +26 -0
- package/dist/core/elements/UIText/UIText.Internal.js +12 -0
- package/dist/core/elements/UIText/UIText.Measuring.d.ts +50 -0
- package/dist/core/elements/UIText/UIText.Measuring.js +153 -0
- package/dist/core/elements/UIText/UIText.Rendering.d.ts +20 -0
- package/dist/core/elements/UIText/UIText.Rendering.js +61 -0
- package/dist/core/elements/UIText/UIText.d.ts +71 -0
- package/dist/core/elements/UIText/UIText.js +265 -0
- package/{src/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.ts → dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.d.ts} +11 -14
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.js +5 -0
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.d.ts +63 -0
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.js +147 -0
- package/{src/core/layers/UILayer/UILayer.Internal.ts → dist/core/layers/UILayer/UILayer.Internal.d.ts} +11 -15
- package/dist/core/layers/UILayer/UILayer.Internal.js +7 -0
- package/dist/core/layers/UILayer/UILayer.d.ts +49 -0
- package/dist/core/layers/UILayer/UILayer.js +113 -0
- package/dist/core/miscellaneous/UIExpression.d.ts +69 -0
- package/dist/core/miscellaneous/UIExpression.js +128 -0
- package/dist/core/miscellaneous/UIMode.d.ts +23 -0
- package/dist/core/miscellaneous/UIMode.js +30 -0
- package/dist/core/miscellaneous/UIOrientation.d.ts +15 -0
- package/dist/core/miscellaneous/UIOrientation.js +20 -0
- package/dist/core/miscellaneous/UIPriority.d.ts +32 -0
- package/dist/core/miscellaneous/UIPriority.js +63 -0
- package/dist/core/miscellaneous/UIRelation.d.ts +23 -0
- package/dist/core/miscellaneous/UIRelation.js +40 -0
- package/dist/core/miscellaneous/UITransparencyMode.d.ts +9 -0
- package/dist/core/miscellaneous/UITransparencyMode.js +12 -0
- package/dist/core/miscellaneous/area/UIArea.d.ts +3 -0
- package/dist/core/miscellaneous/area/UIArea.js +5 -0
- package/dist/core/miscellaneous/area/UIAreaCircle.d.ts +15 -0
- package/dist/core/miscellaneous/area/UIAreaCircle.js +32 -0
- package/dist/core/miscellaneous/area/UIAreaPolygon.d.ts +12 -0
- package/dist/core/miscellaneous/area/UIAreaPolygon.js +40 -0
- package/dist/core/miscellaneous/area/UIAreaRectangle.d.ts +17 -0
- package/dist/core/miscellaneous/area/UIAreaRectangle.js +36 -0
- package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.d.ts +21 -0
- package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.js +72 -0
- package/dist/core/miscellaneous/asserts.d.ts +43 -0
- package/dist/core/miscellaneous/asserts.js +163 -0
- package/dist/core/miscellaneous/canvas.d.ts +31 -0
- package/dist/core/miscellaneous/canvas.js +37 -0
- package/dist/core/miscellaneous/color/UIColor.Internal.d.ts +7 -0
- package/dist/core/miscellaneous/color/UIColor.Internal.js +42 -0
- package/dist/core/miscellaneous/color/UIColor.d.ts +234 -0
- package/dist/core/miscellaneous/color/UIColor.js +636 -0
- package/dist/core/miscellaneous/computeTransform.d.ts +18 -0
- package/dist/core/miscellaneous/computeTransform.js +82 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.d.ts +19 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.js +168 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.d.ts +1 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.js +349 -0
- package/{src/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.ts → dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.d.ts} +8 -10
- package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.d.ts +1 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.js +357 -0
- package/dist/core/miscellaneous/generic-plane/shared.d.ts +38 -0
- package/dist/core/miscellaneous/generic-plane/shared.js +228 -0
- package/dist/core/miscellaneous/insets/UIInsets.Internal.d.ts +11 -0
- package/dist/core/miscellaneous/insets/UIInsets.Internal.js +3 -0
- package/dist/core/miscellaneous/insets/UIInsets.d.ts +48 -0
- package/dist/core/miscellaneous/insets/UIInsets.js +224 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.d.ts +9 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.js +19 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.d.ts +21 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.js +51 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.d.ts +16 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.js +48 -0
- package/dist/core/miscellaneous/math.d.ts +7 -0
- package/dist/core/miscellaneous/math.js +11 -0
- package/dist/core/miscellaneous/micro/UIMicro.Internal.d.ts +31 -0
- package/dist/core/miscellaneous/micro/UIMicro.Internal.js +15 -0
- package/dist/core/miscellaneous/micro/UIMicro.d.ts +59 -0
- package/dist/core/miscellaneous/micro/UIMicro.js +181 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicy.d.ts +3 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicy.js +9 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.d.ts +22 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.js +50 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.d.ts +22 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.js +52 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.d.ts +22 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.js +52 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.d.ts +22 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.js +50 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.d.ts +22 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.js +52 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.d.ts +22 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.js +52 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.d.ts +5 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.js +13 -0
- package/dist/core/miscellaneous/shared.d.ts +46 -0
- package/dist/core/miscellaneous/shared.js +37 -0
- package/{src/core/miscellaneous/text-span/UITextSpan.Internal.ts → dist/core/miscellaneous/text-span/UITextSpan.Internal.d.ts} +4 -5
- package/dist/core/miscellaneous/text-span/UITextSpan.d.ts +14 -0
- package/dist/core/miscellaneous/text-span/UITextSpan.js +36 -0
- package/dist/core/miscellaneous/text-style/UITextStyle.Internal.d.ts +48 -0
- package/dist/core/miscellaneous/text-style/UITextStyle.Internal.js +17 -0
- package/dist/core/miscellaneous/text-style/UITextStyle.d.ts +85 -0
- package/dist/core/miscellaneous/text-style/UITextStyle.js +372 -0
- package/dist/core/miscellaneous/texture/UITextureView.Internal.d.ts +49 -0
- package/dist/core/miscellaneous/texture/UITextureView.Internal.js +6 -0
- package/dist/core/miscellaneous/texture/UITextureView.d.ts +67 -0
- package/dist/core/miscellaneous/texture/UITextureView.js +234 -0
- package/dist/core/miscellaneous/webglCapabilities.d.ts +2 -0
- package/dist/core/miscellaneous/webglCapabilities.js +103 -0
- package/dist/core/shaders/UIImage.glsl.js +3 -0
- package/dist/core/shaders/UINineSlice.glsl.js +3 -0
- package/dist/core/shaders/UIProgress.glsl.js +3 -0
- package/dist/core/shaders/UIProgressMaskFunctionCircular.glsl.js +3 -0
- package/dist/core/shaders/UIProgressMaskFunctionDirectional.glsl.js +3 -0
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.d.ts +17 -0
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.d.ts +13 -0
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.js +108 -0
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.d.ts +13 -0
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.d.ts +20 -0
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.js +75 -0
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.d.ts +49 -0
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.d.ts +215 -0
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.js +505 -0
- package/dist/index.js +51 -0
- package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.d.ts +21 -0
- package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.js +47 -0
- package/dist/particles/behaviorModules/UIBehaviorModule.d.ts +14 -0
- package/dist/particles/behaviorModules/UIBehaviorModule.js +9 -0
- package/dist/particles/behaviorModules/UIBehaviorPointGravity.d.ts +39 -0
- package/dist/particles/behaviorModules/UIBehaviorPointGravity.js +110 -0
- package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.d.ts +22 -0
- package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.js +66 -0
- package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.d.ts +20 -0
- package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.js +48 -0
- package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.d.ts +26 -0
- package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.js +66 -0
- package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.d.ts +20 -0
- package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.js +49 -0
- package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.d.ts +26 -0
- package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.js +70 -0
- package/dist/particles/elements/UIEmitter.Internal.d.ts +15 -0
- package/dist/particles/elements/UIEmitter.Internal.js +11 -0
- package/dist/particles/elements/UIEmitter.d.ts +68 -0
- package/dist/particles/elements/UIEmitter.js +203 -0
- package/dist/particles/index.js +18 -0
- package/dist/particles/instancedParticle/UIInstancedParticle.Internal.d.ts +13 -0
- package/dist/particles/instancedParticle/UIInstancedParticle.Internal.js +211 -0
- package/dist/particles/instancedParticle/UIInstancedParticle.d.ts +17 -0
- package/dist/particles/instancedParticle/UIInstancedParticle.js +93 -0
- package/dist/particles/miscellaneous/miscellaneous.d.ts +32 -0
- package/dist/particles/miscellaneous/miscellaneous.js +67 -0
- package/dist/particles/renderingModules/UIRenderingColorOverLife.d.ts +14 -0
- package/dist/particles/renderingModules/UIRenderingColorOverLife.js +32 -0
- package/dist/particles/renderingModules/UIRenderingColorOverVelocity.d.ts +15 -0
- package/dist/particles/renderingModules/UIRenderingColorOverVelocity.js +37 -0
- package/dist/particles/renderingModules/UIRenderingModule.d.ts +8 -0
- package/dist/particles/renderingModules/UIRenderingModule.js +9 -0
- package/dist/particles/renderingModules/UIRenderingTexture.d.ts +14 -0
- package/dist/particles/renderingModules/UIRenderingTexture.js +26 -0
- package/dist/particles/shaders/UIRenderingColorOverLife.glsl.js +3 -0
- package/dist/particles/shaders/UIRenderingColorOverVelocity.glsl.js +3 -0
- package/dist/particles/shaders/UIRenderingTexture.glsl.js +3 -0
- package/dist/particles/spawnModules/UISpawnModule.d.ts +9 -0
- package/dist/particles/spawnModules/UISpawnModule.js +9 -0
- package/dist/particles/spawnModules/UISpawnOffset.d.ts +21 -0
- package/dist/particles/spawnModules/UISpawnOffset.js +46 -0
- package/dist/particles/spawnModules/UISpawnRandomLifetime.d.ts +20 -0
- package/dist/particles/spawnModules/UISpawnRandomLifetime.js +47 -0
- package/dist/particles/spawnModules/UISpawnRandomRotation.d.ts +20 -0
- package/dist/particles/spawnModules/UISpawnRandomRotation.js +45 -0
- package/dist/particles/spawnModules/UISpawnRandomScale.d.ts +26 -0
- package/dist/particles/spawnModules/UISpawnRandomScale.js +60 -0
- package/dist/particles/spawnModules/UISpawnRandomTorque.d.ts +20 -0
- package/dist/particles/spawnModules/UISpawnRandomTorque.js +45 -0
- package/dist/particles/spawnModules/UISpawnRandomVelocity.d.ts +26 -0
- package/dist/particles/spawnModules/UISpawnRandomVelocity.js +64 -0
- package/dist/particles/spawnModules/UISpawnRectangle.d.ts +27 -0
- package/dist/particles/spawnModules/UISpawnRectangle.js +62 -0
- package/package.json +8 -1
- package/.claude/settings.local.json +0 -9
- package/.editorconfig +0 -14
- package/CLAUDE.md +0 -181
- package/assets/logotype.png +0 -0
- package/eslint.config.js +0 -111
- package/rollup.config.js +0 -52
- package/src/core/constraints/UIAspectConstraint/UIAspectConstraint.ts +0 -60
- package/src/core/constraints/UIConstraint.ts +0 -20
- package/src/core/constraints/UICustomConstraint.ts +0 -62
- package/src/core/constraints/UIHeightConstraint/UIHeightConstraint.ts +0 -52
- package/src/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.ts +0 -13
- package/src/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.ts +0 -139
- package/src/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.ts +0 -16
- package/src/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.ts +0 -189
- package/src/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.ts +0 -68
- package/src/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.ts +0 -94
- package/src/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.ts +0 -13
- package/src/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.ts +0 -135
- package/src/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.ts +0 -16
- package/src/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.ts +0 -189
- package/src/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.ts +0 -68
- package/src/core/constraints/UIWidthConstraint/UIWidthConstraint.ts +0 -52
- package/src/core/constraints/builders/UIConstraint2DBuilder.Internal.ts +0 -84
- package/src/core/constraints/builders/UIConstraint2DBuilder.ts +0 -168
- package/src/core/constraints/builders/UICoverConstraintBuilder.Internal.ts +0 -15
- package/src/core/constraints/builders/UICoverConstraintBuilder.ts +0 -84
- package/src/core/constraints/builders/UIFitConstraintBuilder.Internal.ts +0 -15
- package/src/core/constraints/builders/UIFitConstraintBuilder.ts +0 -84
- package/src/core/elements/UIAnchor/UIAnchor.Internal.ts +0 -13
- package/src/core/elements/UIAnchor/UIAnchor.ts +0 -70
- package/src/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.ts +0 -30
- package/src/core/elements/UIAnimatedImage/UIAnimatedImage.ts +0 -355
- package/src/core/elements/UIDummy/UIDummy.Internal.ts +0 -33
- package/src/core/elements/UIDummy/UIDummy.ts +0 -244
- package/src/core/elements/UIElement/UIElement.ts +0 -127
- package/src/core/elements/UIGraphics/UIGraphics.ts +0 -168
- package/src/core/elements/UIImage/UIImage.ts +0 -138
- package/src/core/elements/UINineSlice/UINineSlice.Internal.ts +0 -26
- package/src/core/elements/UINineSlice/UINineSlice.ts +0 -296
- package/src/core/elements/UIProgress/UIProgress.Internal.ts +0 -24
- package/src/core/elements/UIProgress/UIProgress.ts +0 -259
- package/src/core/elements/UIScene/UIScene.Internal.ts +0 -46
- package/src/core/elements/UIScene/UIScene.ts +0 -259
- package/src/core/elements/UIText/UIText.Internal.ts +0 -29
- package/src/core/elements/UIText/UIText.Measuring.ts +0 -183
- package/src/core/elements/UIText/UIText.Rendering.ts +0 -83
- package/src/core/elements/UIText/UIText.ts +0 -376
- package/src/core/layers/UIFullscreenLayer/UIFullscreenLayer.ts +0 -233
- package/src/core/layers/UILayer/UILayer.ts +0 -156
- package/src/core/miscellaneous/UIExpression.ts +0 -142
- package/src/core/miscellaneous/UIMode.ts +0 -29
- package/src/core/miscellaneous/UIOrientation.ts +0 -18
- package/src/core/miscellaneous/UIPriority.ts +0 -63
- package/src/core/miscellaneous/UIRelation.ts +0 -39
- package/src/core/miscellaneous/UITransparencyMode.ts +0 -9
- package/src/core/miscellaneous/area/UIArea.ts +0 -5
- package/src/core/miscellaneous/area/UIAreaCircle.ts +0 -32
- package/src/core/miscellaneous/area/UIAreaPolygon.ts +0 -50
- package/src/core/miscellaneous/area/UIAreaRectangle.ts +0 -38
- package/src/core/miscellaneous/area/UIAreaRoundedRectangle.ts +0 -78
- package/src/core/miscellaneous/asserts.ts +0 -187
- package/src/core/miscellaneous/canvas.ts +0 -73
- package/src/core/miscellaneous/color/UIColor.Internal.ts +0 -89
- package/src/core/miscellaneous/color/UIColor.ts +0 -844
- package/src/core/miscellaneous/computeTransform.ts +0 -127
- package/src/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.ts +0 -235
- package/src/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.ts +0 -524
- package/src/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.ts +0 -448
- package/src/core/miscellaneous/generic-plane/shared.ts +0 -323
- package/src/core/miscellaneous/insets/UIInsets.Internal.ts +0 -9
- package/src/core/miscellaneous/insets/UIInsets.ts +0 -248
- package/src/core/miscellaneous/mask-function/UIProgressMaskFunction.ts +0 -24
- package/src/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.ts +0 -58
- package/src/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.ts +0 -52
- package/src/core/miscellaneous/math.ts +0 -16
- package/src/core/miscellaneous/micro/UIMicro.Internal.ts +0 -33
- package/src/core/miscellaneous/micro/UIMicro.ts +0 -222
- package/src/core/miscellaneous/resize-policy/UIResizePolicy.ts +0 -8
- package/src/core/miscellaneous/resize-policy/UIResizePolicyCover.ts +0 -57
- package/src/core/miscellaneous/resize-policy/UIResizePolicyCross.ts +0 -65
- package/src/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.ts +0 -65
- package/src/core/miscellaneous/resize-policy/UIResizePolicyFit.ts +0 -57
- package/src/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.ts +0 -65
- package/src/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.ts +0 -65
- package/src/core/miscellaneous/resize-policy/UIResizePolicyNone.ts +0 -11
- package/src/core/miscellaneous/shared.ts +0 -73
- package/src/core/miscellaneous/text-span/UITextSpan.ts +0 -43
- package/src/core/miscellaneous/text-style/UITextStyle.Internal.ts +0 -52
- package/src/core/miscellaneous/text-style/UITextStyle.ts +0 -479
- package/src/core/miscellaneous/texture/UITextureView.Internal.ts +0 -55
- package/src/core/miscellaneous/texture/UITextureView.ts +0 -308
- package/src/core/miscellaneous/webglCapabilities.ts +0 -129
- package/src/core/shaders/UIImage.glsl +0 -10
- package/src/core/shaders/UINineSlice.glsl +0 -53
- package/src/core/shaders/UIProgress.glsl +0 -15
- package/src/core/shaders/UIProgressMaskFunctionCircular.glsl +0 -13
- package/src/core/shaders/UIProgressMaskFunctionDirectional.glsl +0 -12
- package/src/core/shaders/glsl.d.ts +0 -27
- package/src/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.ts +0 -23
- package/src/core/wrappers/UIInputWrapper/UIInputWrapper.ts +0 -124
- package/src/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.ts +0 -22
- package/src/core/wrappers/UISceneWrapper/UISceneWrapper.ts +0 -101
- package/src/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.ts +0 -58
- package/src/core/wrappers/UISolverWrapper/UISolverWrapper.ts +0 -605
- package/src/particles/behaviorModules/UIBehaviorDirectionalGravity.ts +0 -70
- package/src/particles/behaviorModules/UIBehaviorModule.ts +0 -20
- package/src/particles/behaviorModules/UIBehaviorPointGravity.ts +0 -173
- package/src/particles/behaviorModules/UIBehaviorScaleOverLife.ts +0 -104
- package/src/particles/behaviorModules/UIBehaviorTorqueDamping.ts +0 -75
- package/src/particles/behaviorModules/UIBehaviorTorqueNoise.ts +0 -115
- package/src/particles/behaviorModules/UIBehaviorVelocityDamping.ts +0 -77
- package/src/particles/behaviorModules/UIBehaviorVelocityNoise.ts +0 -118
- package/src/particles/elements/UIEmitter.Internal.ts +0 -22
- package/src/particles/elements/UIEmitter.ts +0 -313
- package/src/particles/instancedParticle/UIInstancedParticle.Internal.ts +0 -263
- package/src/particles/instancedParticle/UIInstancedParticle.ts +0 -138
- package/src/particles/miscellaneous/miscellaneous.ts +0 -115
- package/src/particles/renderingModules/UIRenderingColorOverLife.ts +0 -39
- package/src/particles/renderingModules/UIRenderingColorOverVelocity.ts +0 -49
- package/src/particles/renderingModules/UIRenderingModule.ts +0 -17
- package/src/particles/renderingModules/UIRenderingTexture.ts +0 -30
- package/src/particles/shaders/UIRenderingColorOverLife.glsl +0 -4
- package/src/particles/shaders/UIRenderingColorOverVelocity.glsl +0 -6
- package/src/particles/shaders/UIRenderingTexture.glsl +0 -4
- package/src/particles/spawnModules/UISpawnModule.ts +0 -22
- package/src/particles/spawnModules/UISpawnOffset.ts +0 -62
- package/src/particles/spawnModules/UISpawnRandomLifetime.ts +0 -68
- package/src/particles/spawnModules/UISpawnRandomRotation.ts +0 -60
- package/src/particles/spawnModules/UISpawnRandomScale.ts +0 -81
- package/src/particles/spawnModules/UISpawnRandomTorque.ts +0 -62
- package/src/particles/spawnModules/UISpawnRandomVelocity.ts +0 -92
- package/src/particles/spawnModules/UISpawnRectangle.ts +0 -81
- package/tsconfig.json +0 -29
- /package/{src/core/index.ts → dist/core/index.d.ts} +0 -0
- /package/{src/particles/index.ts → dist/particles/index.d.ts} +0 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
|
|
2
|
+
import type { UIElementOptions } from "../UIElement/UIElement.Internal";
|
|
3
|
+
/** Animation loop behavior */
|
|
4
|
+
export declare enum UIAnimatedImageLoopMode {
|
|
5
|
+
/** No looping, stops at boundary frame */
|
|
6
|
+
NONE = 0,
|
|
7
|
+
/** Loops back to opposite frame */
|
|
8
|
+
LOOP = 1,
|
|
9
|
+
/** Reverses direction at boundaries */
|
|
10
|
+
PING_PONG = 2
|
|
11
|
+
}
|
|
12
|
+
/** Configuration options for UIAnimatedImage */
|
|
13
|
+
export interface UIAnimatedImageOptions extends UIElementOptions {
|
|
14
|
+
/** Multiplicative tint */
|
|
15
|
+
color: UIColorConfig;
|
|
16
|
+
/** Animation speed in frames per second */
|
|
17
|
+
frameRate: number;
|
|
18
|
+
/** Playback speed multiplier. Can be negative for reverse playback. */
|
|
19
|
+
timeScale: number;
|
|
20
|
+
/** Loop behavior */
|
|
21
|
+
loopMode: UIAnimatedImageLoopMode;
|
|
22
|
+
/** Whether to start playing immediately */
|
|
23
|
+
playByDefault: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare const ANIMATED_IMAGE_DEFAULT_FRAME_RATE = 24;
|
|
26
|
+
export declare const ANIMATED_IMAGE_DEFAULT_TIME_SCALE = 1;
|
|
27
|
+
export declare const ANIMATED_IMAGE_DEFAULT_LOOP_MODE = UIAnimatedImageLoopMode.LOOP;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Animation loop behavior */
|
|
2
|
+
var UIAnimatedImageLoopMode;
|
|
3
|
+
(function (UIAnimatedImageLoopMode) {
|
|
4
|
+
/** No looping, stops at boundary frame */
|
|
5
|
+
UIAnimatedImageLoopMode[UIAnimatedImageLoopMode["NONE"] = 0] = "NONE";
|
|
6
|
+
/** Loops back to opposite frame */
|
|
7
|
+
UIAnimatedImageLoopMode[UIAnimatedImageLoopMode["LOOP"] = 1] = "LOOP";
|
|
8
|
+
/** Reverses direction at boundaries */
|
|
9
|
+
UIAnimatedImageLoopMode[UIAnimatedImageLoopMode["PING_PONG"] = 2] = "PING_PONG";
|
|
10
|
+
})(UIAnimatedImageLoopMode || (UIAnimatedImageLoopMode = {}));
|
|
11
|
+
const ANIMATED_IMAGE_DEFAULT_FRAME_RATE = 24;
|
|
12
|
+
const ANIMATED_IMAGE_DEFAULT_TIME_SCALE = 1;
|
|
13
|
+
const ANIMATED_IMAGE_DEFAULT_LOOP_MODE = UIAnimatedImageLoopMode.LOOP;
|
|
14
|
+
|
|
15
|
+
export { ANIMATED_IMAGE_DEFAULT_FRAME_RATE, ANIMATED_IMAGE_DEFAULT_LOOP_MODE, ANIMATED_IMAGE_DEFAULT_TIME_SCALE, UIAnimatedImageLoopMode };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { FerrsignView0 } from "ferrsign";
|
|
2
|
+
import type { WebGLRenderer } from "three";
|
|
3
|
+
import type { UILayer } from "../../layers/UILayer/UILayer";
|
|
4
|
+
import { UIColor } from "../../miscellaneous/color/UIColor";
|
|
5
|
+
import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
|
|
6
|
+
import { UITextureView } from "../../miscellaneous/texture/UITextureView";
|
|
7
|
+
import type { UITextureConfig } from "../../miscellaneous/texture/UITextureView.Internal";
|
|
8
|
+
import { UIElement } from "../UIElement/UIElement";
|
|
9
|
+
import type { UIAnimatedImageOptions } from "./UIAnimatedImage.Internal";
|
|
10
|
+
import { UIAnimatedImageLoopMode } from "./UIAnimatedImage.Internal";
|
|
11
|
+
/** Frame-based texture animation element */
|
|
12
|
+
export declare class UIAnimatedImage extends UIElement {
|
|
13
|
+
private readonly colorInternal;
|
|
14
|
+
private readonly sequenceInternal;
|
|
15
|
+
private frameRateInternal;
|
|
16
|
+
private timeScaleInternal;
|
|
17
|
+
private loopModeInternal;
|
|
18
|
+
private readonly textureTransform;
|
|
19
|
+
private isPlaying;
|
|
20
|
+
private sequenceFrameIndex;
|
|
21
|
+
private currentFrameIndexDirty;
|
|
22
|
+
private accumulatedTime;
|
|
23
|
+
private readonly signalPlayedInternal;
|
|
24
|
+
private readonly signalPausedInternal;
|
|
25
|
+
private readonly signalStoppedInternal;
|
|
26
|
+
/**
|
|
27
|
+
* Creates a new UIAnimatedImage instance.
|
|
28
|
+
*
|
|
29
|
+
* Defaults size to first frame dimensions if width and height not provided.
|
|
30
|
+
*
|
|
31
|
+
* @param layer - Layer containing this element
|
|
32
|
+
* @param sequence - Array of textures forming animation
|
|
33
|
+
* @param options - Configuration options
|
|
34
|
+
*/
|
|
35
|
+
constructor(layer: UILayer, sequence: UITextureConfig[], options?: Partial<UIAnimatedImageOptions>);
|
|
36
|
+
/** Multiplicative tint. Alpha channel controls opacity. */
|
|
37
|
+
get color(): UIColor;
|
|
38
|
+
/** Total animation duration in seconds */
|
|
39
|
+
get duration(): number;
|
|
40
|
+
/** Animation speed in frames per second */
|
|
41
|
+
get frameRate(): number;
|
|
42
|
+
/** Loop behavior */
|
|
43
|
+
get loopMode(): UIAnimatedImageLoopMode;
|
|
44
|
+
/** Animation frames as readonly array */
|
|
45
|
+
get sequence(): readonly UITextureView[];
|
|
46
|
+
/** Playback speed multiplier. Can be negative for reverse playback. */
|
|
47
|
+
get timeScale(): number;
|
|
48
|
+
/** Signal fired when animation starts or resumes */
|
|
49
|
+
get signalPlayed(): FerrsignView0;
|
|
50
|
+
/** Signal fired when animation pauses */
|
|
51
|
+
get signalPaused(): FerrsignView0;
|
|
52
|
+
/** Signal fired when animation stops and resets */
|
|
53
|
+
get signalStopped(): FerrsignView0;
|
|
54
|
+
/** Multiplicative tint. Alpha channel controls opacity. */
|
|
55
|
+
set color(value: UIColorConfig);
|
|
56
|
+
/** Animation speed in frames per second */
|
|
57
|
+
set frameRate(value: number);
|
|
58
|
+
/** Loop behavior */
|
|
59
|
+
set loopMode(value: UIAnimatedImageLoopMode);
|
|
60
|
+
/** Replaces animation frames. Stops playback. */
|
|
61
|
+
set sequence(sequence: UITextureConfig[]);
|
|
62
|
+
/** Playback speed multiplier. Can be negative for reverse playback. */
|
|
63
|
+
set timeScale(value: number);
|
|
64
|
+
/** Removes element and frees resources */
|
|
65
|
+
destroy(): void;
|
|
66
|
+
/** Starts or resumes animation playback */
|
|
67
|
+
play(): void;
|
|
68
|
+
/** Pauses animation at current frame */
|
|
69
|
+
pause(): void;
|
|
70
|
+
/** Stops animation and resets to first frame */
|
|
71
|
+
stop(): void;
|
|
72
|
+
protected onWillRender(renderer: WebGLRenderer, deltaTime: number): void;
|
|
73
|
+
protected setPlaneTransform(): void;
|
|
74
|
+
private readonly onTextureDimensionsChanged;
|
|
75
|
+
private subscribeSequenceEvents;
|
|
76
|
+
private unsubscribeSequenceEvents;
|
|
77
|
+
}
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { Ferrsign0 } from 'ferrsign';
|
|
2
|
+
import { assertValidPositiveNumber, assertValidNumber } 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.glsl.js';
|
|
7
|
+
import { UIElement } from '../UIElement/UIElement.js';
|
|
8
|
+
import { ANIMATED_IMAGE_DEFAULT_FRAME_RATE, ANIMATED_IMAGE_DEFAULT_TIME_SCALE, ANIMATED_IMAGE_DEFAULT_LOOP_MODE, UIAnimatedImageLoopMode } from './UIAnimatedImage.Internal.js';
|
|
9
|
+
|
|
10
|
+
/** Frame-based texture animation element */
|
|
11
|
+
class UIAnimatedImage extends UIElement {
|
|
12
|
+
/**
|
|
13
|
+
* Creates a new UIAnimatedImage instance.
|
|
14
|
+
*
|
|
15
|
+
* Defaults size to first frame dimensions if width and height not provided.
|
|
16
|
+
*
|
|
17
|
+
* @param layer - Layer containing this element
|
|
18
|
+
* @param sequence - Array of textures forming animation
|
|
19
|
+
* @param options - Configuration options
|
|
20
|
+
*/
|
|
21
|
+
constructor(layer, sequence, options = {}) {
|
|
22
|
+
const color = new UIColor(options.color);
|
|
23
|
+
const uiTextures = sequence.map((textureConfig) => new UITextureView(textureConfig));
|
|
24
|
+
const frame = uiTextures[0];
|
|
25
|
+
options.width = options.width ?? frame.width;
|
|
26
|
+
options.height = options.height ?? frame.height;
|
|
27
|
+
const textureTransform = frame.calculateUVTransform();
|
|
28
|
+
super(layer, source, {
|
|
29
|
+
texture: frame.texture,
|
|
30
|
+
textureTransform: textureTransform,
|
|
31
|
+
color,
|
|
32
|
+
}, options);
|
|
33
|
+
this._private_isPlaying = false;
|
|
34
|
+
this._private_sequenceFrameIndex = 0;
|
|
35
|
+
this._private_currentFrameIndexDirty = false;
|
|
36
|
+
this._private_accumulatedTime = 0;
|
|
37
|
+
this._private_signalPlayedInternal = new Ferrsign0();
|
|
38
|
+
this._private_signalPausedInternal = new Ferrsign0();
|
|
39
|
+
this._private_signalStoppedInternal = new Ferrsign0();
|
|
40
|
+
this._private_onTextureDimensionsChanged = (width, height, texture) => {
|
|
41
|
+
if (this._private_sequenceInternal[this._private_sequenceFrameIndex] === texture) {
|
|
42
|
+
this.width = width;
|
|
43
|
+
this.height = height;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
this._private_colorInternal = color;
|
|
47
|
+
this._private_sequenceInternal = uiTextures;
|
|
48
|
+
this._private_textureTransform = textureTransform;
|
|
49
|
+
this._private_frameRateInternal = options.frameRate ?? ANIMATED_IMAGE_DEFAULT_FRAME_RATE;
|
|
50
|
+
this._private_timeScaleInternal = options.timeScale ?? ANIMATED_IMAGE_DEFAULT_TIME_SCALE;
|
|
51
|
+
this._private_loopModeInternal = options.loopMode ?? ANIMATED_IMAGE_DEFAULT_LOOP_MODE;
|
|
52
|
+
this._private_subscribeSequenceEvents();
|
|
53
|
+
if (options.playByDefault === true) {
|
|
54
|
+
this.play();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/** Multiplicative tint. Alpha channel controls opacity. */
|
|
58
|
+
get color() {
|
|
59
|
+
return this._private_colorInternal;
|
|
60
|
+
}
|
|
61
|
+
/** Total animation duration in seconds */
|
|
62
|
+
get duration() {
|
|
63
|
+
return this._private_sequenceInternal.length / this._private_frameRateInternal;
|
|
64
|
+
}
|
|
65
|
+
/** Animation speed in frames per second */
|
|
66
|
+
get frameRate() {
|
|
67
|
+
return this._private_frameRateInternal;
|
|
68
|
+
}
|
|
69
|
+
/** Loop behavior */
|
|
70
|
+
get loopMode() {
|
|
71
|
+
return this._private_loopModeInternal;
|
|
72
|
+
}
|
|
73
|
+
/** Animation frames as readonly array */
|
|
74
|
+
get sequence() {
|
|
75
|
+
return this._private_sequenceInternal;
|
|
76
|
+
}
|
|
77
|
+
/** Playback speed multiplier. Can be negative for reverse playback. */
|
|
78
|
+
get timeScale() {
|
|
79
|
+
return this._private_timeScaleInternal;
|
|
80
|
+
}
|
|
81
|
+
/** Signal fired when animation starts or resumes */
|
|
82
|
+
get signalPlayed() {
|
|
83
|
+
return this._private_signalPlayedInternal;
|
|
84
|
+
}
|
|
85
|
+
/** Signal fired when animation pauses */
|
|
86
|
+
get signalPaused() {
|
|
87
|
+
return this._private_signalPausedInternal;
|
|
88
|
+
}
|
|
89
|
+
/** Signal fired when animation stops and resets */
|
|
90
|
+
get signalStopped() {
|
|
91
|
+
return this._private_signalStoppedInternal;
|
|
92
|
+
}
|
|
93
|
+
/** Multiplicative tint. Alpha channel controls opacity. */
|
|
94
|
+
set color(value) {
|
|
95
|
+
this._private_colorInternal.set(value);
|
|
96
|
+
}
|
|
97
|
+
/** Animation speed in frames per second */
|
|
98
|
+
set frameRate(value) {
|
|
99
|
+
assertValidPositiveNumber(value, "UIAnimatedImage.frameRate");
|
|
100
|
+
this._private_frameRateInternal = value;
|
|
101
|
+
}
|
|
102
|
+
/** Loop behavior */
|
|
103
|
+
set loopMode(value) {
|
|
104
|
+
this._private_loopModeInternal = value;
|
|
105
|
+
}
|
|
106
|
+
/** Replaces animation frames. Stops playback. */
|
|
107
|
+
set sequence(sequence) {
|
|
108
|
+
this.stop();
|
|
109
|
+
this._private_unsubscribeSequenceEvents();
|
|
110
|
+
const newLength = sequence.length;
|
|
111
|
+
const currentLength = this._private_sequenceInternal.length;
|
|
112
|
+
for (let i = 0; i < Math.min(newLength, currentLength); i++) {
|
|
113
|
+
this._private_sequenceInternal[i].set(sequence[i]);
|
|
114
|
+
}
|
|
115
|
+
if (newLength < currentLength) {
|
|
116
|
+
this._private_sequenceInternal.length = newLength;
|
|
117
|
+
}
|
|
118
|
+
else if (newLength > currentLength) {
|
|
119
|
+
for (let i = currentLength; i < newLength; i++) {
|
|
120
|
+
this._private_sequenceInternal.push(new UITextureView(sequence[i]));
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
this._private_subscribeSequenceEvents();
|
|
124
|
+
}
|
|
125
|
+
/** Playback speed multiplier. Can be negative for reverse playback. */
|
|
126
|
+
set timeScale(value) {
|
|
127
|
+
assertValidNumber(value, "UIAnimatedImage.timeScale");
|
|
128
|
+
this._private_timeScaleInternal = value;
|
|
129
|
+
}
|
|
130
|
+
/** Removes element and frees resources */
|
|
131
|
+
destroy() {
|
|
132
|
+
this._private_unsubscribeSequenceEvents();
|
|
133
|
+
super.destroy();
|
|
134
|
+
}
|
|
135
|
+
/** Starts or resumes animation playback */
|
|
136
|
+
play() {
|
|
137
|
+
if (!this._private_isPlaying) {
|
|
138
|
+
this._private_isPlaying = true;
|
|
139
|
+
this._private_signalPlayedInternal.emit();
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
/** Pauses animation at current frame */
|
|
143
|
+
pause() {
|
|
144
|
+
if (this._private_isPlaying) {
|
|
145
|
+
this._private_isPlaying = false;
|
|
146
|
+
this._private_signalPausedInternal.emit();
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
/** Stops animation and resets to first frame */
|
|
150
|
+
stop() {
|
|
151
|
+
if (this._private_isPlaying || this._private_accumulatedTime > 0 || this._private_sequenceFrameIndex > 0) {
|
|
152
|
+
this._private_isPlaying = false;
|
|
153
|
+
this._private_accumulatedTime = 0;
|
|
154
|
+
this._private_sequenceFrameIndex = 0;
|
|
155
|
+
this._private_currentFrameIndexDirty = true;
|
|
156
|
+
this._private_signalStoppedInternal.emit();
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
onWillRender(renderer, deltaTime) {
|
|
160
|
+
if (this._private_isPlaying && this._private_timeScaleInternal !== 0) {
|
|
161
|
+
this._private_accumulatedTime += deltaTime * this._private_timeScaleInternal;
|
|
162
|
+
const frameDuration = 1 / this._private_frameRateInternal;
|
|
163
|
+
const sequenceLength = this._private_sequenceInternal.length;
|
|
164
|
+
const lastFrameIndex = sequenceLength - 1;
|
|
165
|
+
if (this._private_timeScaleInternal > 0) {
|
|
166
|
+
while (this._private_accumulatedTime >= frameDuration) {
|
|
167
|
+
this._private_accumulatedTime -= frameDuration;
|
|
168
|
+
this._private_sequenceFrameIndex += 1;
|
|
169
|
+
if (this._private_sequenceFrameIndex >= sequenceLength) {
|
|
170
|
+
if (this._private_loopModeInternal === UIAnimatedImageLoopMode.LOOP) {
|
|
171
|
+
this._private_sequenceFrameIndex = 0;
|
|
172
|
+
}
|
|
173
|
+
else if (this._private_loopModeInternal === UIAnimatedImageLoopMode.PING_PONG) {
|
|
174
|
+
this._private_sequenceFrameIndex = lastFrameIndex;
|
|
175
|
+
this._private_timeScaleInternal = -this._private_timeScaleInternal;
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
this._private_sequenceFrameIndex = lastFrameIndex;
|
|
179
|
+
this._private_isPlaying = false;
|
|
180
|
+
this._private_signalPausedInternal.emit();
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
this._private_currentFrameIndexDirty = true;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
while (this._private_accumulatedTime <= -frameDuration) {
|
|
189
|
+
this._private_accumulatedTime += frameDuration;
|
|
190
|
+
this._private_sequenceFrameIndex -= 1;
|
|
191
|
+
if (this._private_sequenceFrameIndex < 0) {
|
|
192
|
+
if (this._private_loopModeInternal === UIAnimatedImageLoopMode.LOOP) {
|
|
193
|
+
this._private_sequenceFrameIndex = lastFrameIndex;
|
|
194
|
+
}
|
|
195
|
+
else if (this._private_loopModeInternal === UIAnimatedImageLoopMode.PING_PONG) {
|
|
196
|
+
this._private_sequenceFrameIndex = 0;
|
|
197
|
+
this._private_timeScaleInternal = -this._private_timeScaleInternal;
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
this._private_sequenceFrameIndex = 0;
|
|
201
|
+
this._private_isPlaying = false;
|
|
202
|
+
this._private_signalPausedInternal.emit();
|
|
203
|
+
break;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
this._private_currentFrameIndexDirty = true;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
super.onWillRender(renderer, deltaTime);
|
|
211
|
+
}
|
|
212
|
+
setPlaneTransform() {
|
|
213
|
+
let properties;
|
|
214
|
+
if (this._private_colorInternal.dirty) {
|
|
215
|
+
properties ?? (properties = {});
|
|
216
|
+
properties["color"] = this._private_colorInternal;
|
|
217
|
+
this._private_colorInternal.setDirtyFalse();
|
|
218
|
+
}
|
|
219
|
+
const frame = this._private_sequenceInternal[this._private_sequenceFrameIndex];
|
|
220
|
+
if (frame.textureDirty || this._private_currentFrameIndexDirty) {
|
|
221
|
+
properties ?? (properties = {});
|
|
222
|
+
properties["texture"] = frame.texture;
|
|
223
|
+
frame.setTextureDirtyFalse();
|
|
224
|
+
}
|
|
225
|
+
if (frame.uvTransformDirty || this._private_currentFrameIndexDirty) {
|
|
226
|
+
properties ?? (properties = {});
|
|
227
|
+
properties["textureTransform"] = frame.calculateUVTransform(this._private_textureTransform);
|
|
228
|
+
frame.setUVTransformDirtyFalse();
|
|
229
|
+
}
|
|
230
|
+
if (properties) {
|
|
231
|
+
this.sceneWrapper.setProperties(this.planeHandler, properties);
|
|
232
|
+
}
|
|
233
|
+
const isTransformDirty = this._private_currentFrameIndexDirty ||
|
|
234
|
+
this.micro.dirty ||
|
|
235
|
+
frame.trimDirty ||
|
|
236
|
+
this.inputWrapper.dirty ||
|
|
237
|
+
this.solverWrapper.dirty;
|
|
238
|
+
if (isTransformDirty) {
|
|
239
|
+
const micro = this.micro;
|
|
240
|
+
const textureTrim = frame.trim;
|
|
241
|
+
this.sceneWrapper.setTransform(this.planeHandler, computeTrimmedTransformMatrix(this.x, this.y, this.width, this.height, this.zIndex, micro.x, micro.y, micro.anchorX, micro.anchorY, micro.scaleX, micro.scaleY, micro.rotation, micro.anchorMode, textureTrim.left, textureTrim.right, textureTrim.top, textureTrim.bottom));
|
|
242
|
+
this._private_currentFrameIndexDirty = false;
|
|
243
|
+
this.micro.setDirtyFalse();
|
|
244
|
+
frame.setTrimDirtyFalse();
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
_private_subscribeSequenceEvents() {
|
|
248
|
+
for (const frame of this._private_sequenceInternal) {
|
|
249
|
+
frame.signalDiminsionsChanged.on(this._private_onTextureDimensionsChanged);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
_private_unsubscribeSequenceEvents() {
|
|
253
|
+
for (const frame of this._private_sequenceInternal) {
|
|
254
|
+
frame.signalDiminsionsChanged.off(this._private_onTextureDimensionsChanged);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export { UIAnimatedImage };
|
|
@@ -0,0 +1,30 @@
|
|
|
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";
|
|
5
|
+
/** Input event data */
|
|
6
|
+
export interface UIInputEventData {
|
|
7
|
+
/** X coordinate */
|
|
8
|
+
x: number;
|
|
9
|
+
/** Y coordinate */
|
|
10
|
+
y: number;
|
|
11
|
+
/** Pointer identifier */
|
|
12
|
+
identifier: number;
|
|
13
|
+
/** Element that emitted the event */
|
|
14
|
+
element: UIDummy;
|
|
15
|
+
}
|
|
16
|
+
/** Configuration options for UIDummy */
|
|
17
|
+
export interface UIDummyOptions extends UIAnchorOptions {
|
|
18
|
+
/** Width in world units */
|
|
19
|
+
width: number;
|
|
20
|
+
/** Height in world units */
|
|
21
|
+
height: number;
|
|
22
|
+
/** Shape defining interactive region in element-local space (0,0 = bottom-left, 1,1 = top-right) */
|
|
23
|
+
interactionArea: UIArea;
|
|
24
|
+
/** Controls visibility and interactivity */
|
|
25
|
+
mode: UIMode;
|
|
26
|
+
}
|
|
27
|
+
export declare const DUMMY_DEFAULT_WIDTH = 64;
|
|
28
|
+
export declare const DUMMY_DEFAULT_HEIGHT = 32;
|
|
29
|
+
export declare const DUMMY_DEFAULT_MODE = UIMode.VISIBLE;
|
|
30
|
+
export declare const DUMMY_DEFAULT_Z_INDEX = 0;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { UIMode } from '../../miscellaneous/UIMode.js';
|
|
2
|
+
|
|
3
|
+
const DUMMY_DEFAULT_WIDTH = 64;
|
|
4
|
+
const DUMMY_DEFAULT_HEIGHT = 32;
|
|
5
|
+
const DUMMY_DEFAULT_MODE = UIMode.VISIBLE;
|
|
6
|
+
const DUMMY_DEFAULT_Z_INDEX = 0;
|
|
7
|
+
|
|
8
|
+
export { DUMMY_DEFAULT_HEIGHT, DUMMY_DEFAULT_MODE, DUMMY_DEFAULT_WIDTH, DUMMY_DEFAULT_Z_INDEX };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { FerrsignView1 } from "ferrsign";
|
|
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";
|
|
10
|
+
/** Rectangular area with dimensions but no rendering */
|
|
11
|
+
export declare class UIDummy extends UIAnchor implements UIPlaneElement {
|
|
12
|
+
/** Shape defining interactive region in element-local space (0,0 = bottom-left, 1,1 = top-right) */
|
|
13
|
+
interactionArea: UIArea;
|
|
14
|
+
/** Solver variable for width */
|
|
15
|
+
readonly wVariable: number;
|
|
16
|
+
/** Solver variable for height */
|
|
17
|
+
readonly hVariable: number;
|
|
18
|
+
protected modeInternal: UIMode;
|
|
19
|
+
protected readonly inputWrapper: UIInputWrapperView;
|
|
20
|
+
private readonly catcherHandler;
|
|
21
|
+
private wasPointerInside;
|
|
22
|
+
private readonly signalPointerPressedInternal;
|
|
23
|
+
private readonly signalPointerMovedInternal;
|
|
24
|
+
private readonly signalPointerReleasedInternal;
|
|
25
|
+
private readonly signalPointerEnteredInternal;
|
|
26
|
+
private readonly signalPointerLeftInternal;
|
|
27
|
+
/**
|
|
28
|
+
* Creates a new UIDummy instance.
|
|
29
|
+
*
|
|
30
|
+
* @param layer - Layer containing this element
|
|
31
|
+
* @param options - Configuration options
|
|
32
|
+
*/
|
|
33
|
+
constructor(layer: UILayer, options?: Partial<UIDummyOptions>);
|
|
34
|
+
/** Width in world units */
|
|
35
|
+
get width(): number;
|
|
36
|
+
/** Height in world units */
|
|
37
|
+
get height(): number;
|
|
38
|
+
/** X coordinate of right edge */
|
|
39
|
+
get oppositeX(): number;
|
|
40
|
+
/** Y coordinate of top edge */
|
|
41
|
+
get oppositeY(): number;
|
|
42
|
+
/** X coordinate of horizontal center */
|
|
43
|
+
get centerX(): number;
|
|
44
|
+
/** Y coordinate of vertical center */
|
|
45
|
+
get centerY(): number;
|
|
46
|
+
/** Controls visibility and interactivity */
|
|
47
|
+
get mode(): UIMode;
|
|
48
|
+
/** Rendering and input priority. Higher values on top. */
|
|
49
|
+
get zIndex(): number;
|
|
50
|
+
/** Signal fired when pointer is pressed */
|
|
51
|
+
get signalPointerPressed(): FerrsignView1<UIInputEventData>;
|
|
52
|
+
/** Signal fired when pointer is moved */
|
|
53
|
+
get signalPointerMoved(): FerrsignView1<UIInputEventData>;
|
|
54
|
+
/** Signal fired when pointer is released */
|
|
55
|
+
get signalPointerReleased(): FerrsignView1<UIInputEventData>;
|
|
56
|
+
/** Signal fired when pointer enters element */
|
|
57
|
+
get signalPointerEntered(): FerrsignView1<UIInputEventData>;
|
|
58
|
+
/** Signal fired when pointer leaves element */
|
|
59
|
+
get signalPointerLeft(): FerrsignView1<UIInputEventData>;
|
|
60
|
+
/** Width in world units */
|
|
61
|
+
set width(value: number);
|
|
62
|
+
/** Height in world units */
|
|
63
|
+
set height(value: number);
|
|
64
|
+
/** X coordinate of right edge */
|
|
65
|
+
set oppositeX(value: number);
|
|
66
|
+
/** Y coordinate of top edge */
|
|
67
|
+
set oppositeY(value: number);
|
|
68
|
+
/** X coordinate of horizontal center */
|
|
69
|
+
set centerX(value: number);
|
|
70
|
+
/** Y coordinate of vertical center */
|
|
71
|
+
set centerY(value: number);
|
|
72
|
+
/** Controls visibility and interactivity */
|
|
73
|
+
set mode(value: UIMode);
|
|
74
|
+
/** Rendering and input priority. Higher values on top. */
|
|
75
|
+
set zIndex(value: number);
|
|
76
|
+
/** Removes element and frees resources */
|
|
77
|
+
destroy(): void;
|
|
78
|
+
protected readonly catchPointerDown: (x: number, y: number, identifier: number) => boolean;
|
|
79
|
+
protected readonly catchPointerMove: (x: number, y: number, identifier: number) => boolean;
|
|
80
|
+
protected readonly catchPointerUp: (x: number, y: number, identifier: number) => boolean;
|
|
81
|
+
protected handleInputEvent(x: number, y: number, identifier: number, signal: Ferrsign1<UIInputEventData>): boolean;
|
|
82
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { Ferrsign1 } from 'ferrsign';
|
|
2
|
+
import { MathUtils } from 'three';
|
|
3
|
+
import { UIAreaRectangle } from '../../miscellaneous/area/UIAreaRectangle.js';
|
|
4
|
+
import { assertValidPositiveNumber, assertValidNumber } 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_WIDTH, DUMMY_DEFAULT_HEIGHT, DUMMY_DEFAULT_MODE, DUMMY_DEFAULT_Z_INDEX } from './UIDummy.Internal.js';
|
|
9
|
+
|
|
10
|
+
/** Rectangular area with dimensions but no rendering */
|
|
11
|
+
class UIDummy extends UIAnchor {
|
|
12
|
+
/**
|
|
13
|
+
* Creates a new UIDummy instance.
|
|
14
|
+
*
|
|
15
|
+
* @param layer - Layer containing this element
|
|
16
|
+
* @param options - Configuration options
|
|
17
|
+
*/
|
|
18
|
+
constructor(layer, options) {
|
|
19
|
+
const w = options?.width ?? DUMMY_DEFAULT_WIDTH;
|
|
20
|
+
const h = options?.height ?? DUMMY_DEFAULT_HEIGHT;
|
|
21
|
+
assertValidPositiveNumber(w, "UIDummy.constructor.width");
|
|
22
|
+
assertValidPositiveNumber(h, "UIDummy.constructor.height");
|
|
23
|
+
super(layer, options);
|
|
24
|
+
this._private_wasPointerInside = false;
|
|
25
|
+
this._private_signalPointerPressedInternal = new Ferrsign1();
|
|
26
|
+
this._private_signalPointerMovedInternal = new Ferrsign1();
|
|
27
|
+
this._private_signalPointerReleasedInternal = new Ferrsign1();
|
|
28
|
+
this._private_signalPointerEnteredInternal = new Ferrsign1();
|
|
29
|
+
this._private_signalPointerLeftInternal = new Ferrsign1();
|
|
30
|
+
this.catchPointerDown = (x, y, identifier) => {
|
|
31
|
+
return this.handleInputEvent(x, y, identifier, this._private_signalPointerPressedInternal);
|
|
32
|
+
};
|
|
33
|
+
this.catchPointerMove = (x, y, identifier) => {
|
|
34
|
+
return this.handleInputEvent(x, y, identifier, this._private_signalPointerMovedInternal);
|
|
35
|
+
};
|
|
36
|
+
this.catchPointerUp = (x, y, identifier) => {
|
|
37
|
+
return this.handleInputEvent(x, y, identifier, this._private_signalPointerReleasedInternal);
|
|
38
|
+
};
|
|
39
|
+
this.interactionArea = options?.interactionArea ?? new UIAreaRectangle(0, 0, 1, 1);
|
|
40
|
+
this.modeInternal = options?.mode ?? DUMMY_DEFAULT_MODE;
|
|
41
|
+
this.inputWrapper = this.layer.inputWrapper;
|
|
42
|
+
this.wVariable = this.solverWrapper.createVariable(w, UIPriority.P6);
|
|
43
|
+
this.hVariable = this.solverWrapper.createVariable(h, UIPriority.P6);
|
|
44
|
+
this._private_catcherHandler = this.inputWrapper.createInputCatcher(this.catchPointerDown, this.catchPointerMove, this.catchPointerUp, DUMMY_DEFAULT_Z_INDEX);
|
|
45
|
+
this.inputWrapper.setActive(this._private_catcherHandler, isUIModeInteractive(this.modeInternal));
|
|
46
|
+
}
|
|
47
|
+
/** Width in world units */
|
|
48
|
+
get width() {
|
|
49
|
+
return this.solverWrapper.readVariableValue(this.wVariable);
|
|
50
|
+
}
|
|
51
|
+
/** Height in world units */
|
|
52
|
+
get height() {
|
|
53
|
+
return this.solverWrapper.readVariableValue(this.hVariable);
|
|
54
|
+
}
|
|
55
|
+
/** X coordinate of right edge */
|
|
56
|
+
get oppositeX() {
|
|
57
|
+
return this.x + this.width;
|
|
58
|
+
}
|
|
59
|
+
/** Y coordinate of top edge */
|
|
60
|
+
get oppositeY() {
|
|
61
|
+
return this.y + this.height;
|
|
62
|
+
}
|
|
63
|
+
/** X coordinate of horizontal center */
|
|
64
|
+
get centerX() {
|
|
65
|
+
return this.x + this.width / 2;
|
|
66
|
+
}
|
|
67
|
+
/** Y coordinate of vertical center */
|
|
68
|
+
get centerY() {
|
|
69
|
+
return this.y + this.height / 2;
|
|
70
|
+
}
|
|
71
|
+
/** Controls visibility and interactivity */
|
|
72
|
+
get mode() {
|
|
73
|
+
return this.modeInternal;
|
|
74
|
+
}
|
|
75
|
+
/** Rendering and input priority. Higher values on top. */
|
|
76
|
+
get zIndex() {
|
|
77
|
+
return this.inputWrapper.getZIndex(this._private_catcherHandler);
|
|
78
|
+
}
|
|
79
|
+
/** Signal fired when pointer is pressed */
|
|
80
|
+
get signalPointerPressed() {
|
|
81
|
+
return this._private_signalPointerPressedInternal;
|
|
82
|
+
}
|
|
83
|
+
/** Signal fired when pointer is moved */
|
|
84
|
+
get signalPointerMoved() {
|
|
85
|
+
return this._private_signalPointerMovedInternal;
|
|
86
|
+
}
|
|
87
|
+
/** Signal fired when pointer is released */
|
|
88
|
+
get signalPointerReleased() {
|
|
89
|
+
return this._private_signalPointerReleasedInternal;
|
|
90
|
+
}
|
|
91
|
+
/** Signal fired when pointer enters element */
|
|
92
|
+
get signalPointerEntered() {
|
|
93
|
+
return this._private_signalPointerEnteredInternal;
|
|
94
|
+
}
|
|
95
|
+
/** Signal fired when pointer leaves element */
|
|
96
|
+
get signalPointerLeft() {
|
|
97
|
+
return this._private_signalPointerLeftInternal;
|
|
98
|
+
}
|
|
99
|
+
/** Width in world units */
|
|
100
|
+
set width(value) {
|
|
101
|
+
assertValidPositiveNumber(value, "UIDummy.width");
|
|
102
|
+
this.solverWrapper.suggestVariableValue(this.wVariable, value);
|
|
103
|
+
}
|
|
104
|
+
/** Height in world units */
|
|
105
|
+
set height(value) {
|
|
106
|
+
assertValidPositiveNumber(value, "UIDummy.height");
|
|
107
|
+
this.solverWrapper.suggestVariableValue(this.hVariable, value);
|
|
108
|
+
}
|
|
109
|
+
/** X coordinate of right edge */
|
|
110
|
+
set oppositeX(value) {
|
|
111
|
+
assertValidNumber(value, "UIDummy.oppositeX");
|
|
112
|
+
this.x = value - this.width;
|
|
113
|
+
}
|
|
114
|
+
/** Y coordinate of top edge */
|
|
115
|
+
set oppositeY(value) {
|
|
116
|
+
assertValidNumber(value, "UIDummy.oppositeY");
|
|
117
|
+
this.y = value - this.height;
|
|
118
|
+
}
|
|
119
|
+
/** X coordinate of horizontal center */
|
|
120
|
+
set centerX(value) {
|
|
121
|
+
assertValidNumber(value, "UIDummy.centerX");
|
|
122
|
+
this.x = value - this.width / 2;
|
|
123
|
+
}
|
|
124
|
+
/** Y coordinate of vertical center */
|
|
125
|
+
set centerY(value) {
|
|
126
|
+
assertValidNumber(value, "UIDummy.centerY");
|
|
127
|
+
this.y = value - this.height / 2;
|
|
128
|
+
}
|
|
129
|
+
/** Controls visibility and interactivity */
|
|
130
|
+
set mode(value) {
|
|
131
|
+
if (this.modeInternal !== value) {
|
|
132
|
+
const newInteractivity = isUIModeInteractive(value);
|
|
133
|
+
this.inputWrapper.setActive(this._private_catcherHandler, newInteractivity);
|
|
134
|
+
this.modeInternal = value;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
/** Rendering and input priority. Higher values on top. */
|
|
138
|
+
set zIndex(value) {
|
|
139
|
+
assertValidNumber(value, "UIDummy.zIndex");
|
|
140
|
+
this.inputWrapper.setZIndex(this._private_catcherHandler, value);
|
|
141
|
+
}
|
|
142
|
+
/** Removes element and frees resources */
|
|
143
|
+
destroy() {
|
|
144
|
+
this.solverWrapper.removeVariable(this.hVariable);
|
|
145
|
+
this.solverWrapper.removeVariable(this.wVariable);
|
|
146
|
+
this.inputWrapper.destroyInputCatcher(this._private_catcherHandler);
|
|
147
|
+
super.destroy();
|
|
148
|
+
}
|
|
149
|
+
handleInputEvent(x, y, identifier, signal) {
|
|
150
|
+
assertValidNumber(x, "UIDummy.handleInputEvent.x");
|
|
151
|
+
assertValidNumber(y, "UIDummy.handleInputEvent.y");
|
|
152
|
+
assertValidNumber(identifier, "UIDummy.handleInputEvent.identifier");
|
|
153
|
+
const isPointerInside = this.interactionArea.contains(MathUtils.mapLinear(x, this.x, this.oppositeX, 0, 1), MathUtils.mapLinear(y, this.y, this.oppositeY, 0, 1));
|
|
154
|
+
if (isPointerInside) {
|
|
155
|
+
signal.emit({ x, y, identifier, element: this });
|
|
156
|
+
}
|
|
157
|
+
if (this._private_wasPointerInside && !isPointerInside) {
|
|
158
|
+
this._private_signalPointerLeftInternal.emit({ x, y, identifier, element: this });
|
|
159
|
+
}
|
|
160
|
+
else if (!this._private_wasPointerInside && isPointerInside) {
|
|
161
|
+
this._private_signalPointerEnteredInternal.emit({
|
|
162
|
+
x,
|
|
163
|
+
y,
|
|
164
|
+
identifier,
|
|
165
|
+
element: this,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
this._private_wasPointerInside = isPointerInside;
|
|
169
|
+
return this.modeInternal !== UIMode.INTERACTIVE_TRANSPARENT && isPointerInside;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export { UIDummy };
|