laymur 0.17.0 → 0.17.2
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 +5 -0
- 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
|
@@ -1,296 +0,0 @@
|
|
|
1
|
-
import type { Matrix3 } from "three";
|
|
2
|
-
import { Vector4 } 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 { computeTrimmedTransformMatrix } from "../../miscellaneous/computeTransform";
|
|
7
|
-
import type { UIProperty } from "../../miscellaneous/generic-plane/shared";
|
|
8
|
-
import { UIInsets } from "../../miscellaneous/insets/UIInsets";
|
|
9
|
-
import type { UIInsetsConfig } from "../../miscellaneous/insets/UIInsets.Internal";
|
|
10
|
-
import { UITextureView } from "../../miscellaneous/texture/UITextureView";
|
|
11
|
-
import type { UITextureConfig } from "../../miscellaneous/texture/UITextureView.Internal";
|
|
12
|
-
import source from "../../shaders/UINineSlice.glsl";
|
|
13
|
-
import { UIElement } from "../UIElement/UIElement";
|
|
14
|
-
import type { UINineSliceOptions } from "./UINineSlice.Internal";
|
|
15
|
-
import {
|
|
16
|
-
NINE_SLICE_DEFAULT_BORDER,
|
|
17
|
-
NINE_SLICE_DEFAULT_REGION_MODE,
|
|
18
|
-
UINineSliceRegionMode,
|
|
19
|
-
} from "./UINineSlice.Internal";
|
|
20
|
-
|
|
21
|
-
/** Scalable textured image preserving border regions */
|
|
22
|
-
export class UINineSlice extends UIElement {
|
|
23
|
-
/** Texture displayed by this element */
|
|
24
|
-
public readonly texture: UITextureView;
|
|
25
|
-
|
|
26
|
-
private readonly colorInternal: UIColor;
|
|
27
|
-
private readonly sliceBordersInternal: UIInsets;
|
|
28
|
-
private readonly sliceRegionsInternal: UIInsets;
|
|
29
|
-
private regionModeInternal: UINineSliceRegionMode;
|
|
30
|
-
private regionModeDirty = true;
|
|
31
|
-
|
|
32
|
-
private readonly textureTransform: Matrix3;
|
|
33
|
-
private readonly sliceBordersVector = new Vector4();
|
|
34
|
-
private readonly sliceRegionsVector = new Vector4();
|
|
35
|
-
|
|
36
|
-
private lastElementWidth: number;
|
|
37
|
-
private lastElementHeight: number;
|
|
38
|
-
|
|
39
|
-
private textureDimensionsDirty = true;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Creates a new UINineSlice instance.
|
|
43
|
-
*
|
|
44
|
-
* Defaults size to texture dimensions if width and height not provided.
|
|
45
|
-
*
|
|
46
|
-
* @param layer - Layer containing this element
|
|
47
|
-
* @param texture - Texture to display
|
|
48
|
-
* @param options - Configuration options
|
|
49
|
-
*/
|
|
50
|
-
constructor(layer: UILayer, texture: UITextureConfig, options: Partial<UINineSliceOptions> = {}) {
|
|
51
|
-
const color = new UIColor(options.color);
|
|
52
|
-
const textureView = new UITextureView(texture);
|
|
53
|
-
const textureTransform = textureView.calculateUVTransform();
|
|
54
|
-
|
|
55
|
-
options.width = options.width ?? textureView.width;
|
|
56
|
-
options.height = options.height ?? textureView.height;
|
|
57
|
-
|
|
58
|
-
const sliceBorders = new UIInsets(options.sliceBorders ?? NINE_SLICE_DEFAULT_BORDER);
|
|
59
|
-
const sliceRegions = new UIInsets(options.sliceRegions ?? NINE_SLICE_DEFAULT_BORDER);
|
|
60
|
-
|
|
61
|
-
const regionMode = options.regionMode ?? NINE_SLICE_DEFAULT_REGION_MODE;
|
|
62
|
-
|
|
63
|
-
const sliceBordersVector = new Vector4();
|
|
64
|
-
const sliceRegionsVector = new Vector4();
|
|
65
|
-
|
|
66
|
-
super(
|
|
67
|
-
layer,
|
|
68
|
-
source,
|
|
69
|
-
{
|
|
70
|
-
texture: textureView.texture,
|
|
71
|
-
textureTransform: textureTransform,
|
|
72
|
-
color,
|
|
73
|
-
sliceBorders: sliceBordersVector,
|
|
74
|
-
sliceRegions: sliceRegionsVector,
|
|
75
|
-
},
|
|
76
|
-
options,
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
this.texture = textureView;
|
|
80
|
-
this.textureTransform = textureTransform;
|
|
81
|
-
this.colorInternal = color;
|
|
82
|
-
this.sliceBordersInternal = sliceBorders;
|
|
83
|
-
this.sliceRegionsInternal = sliceRegions;
|
|
84
|
-
this.regionModeInternal = regionMode;
|
|
85
|
-
|
|
86
|
-
this.sliceBordersVector = sliceBordersVector;
|
|
87
|
-
this.sliceRegionsVector = sliceRegionsVector;
|
|
88
|
-
|
|
89
|
-
this.lastElementWidth = this.width;
|
|
90
|
-
this.lastElementHeight = this.height;
|
|
91
|
-
|
|
92
|
-
this.texture.signalDiminsionsChanged.on(this.onTextureDimensionsChanged);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/** Multiplicative tint. Alpha channel controls opacity. */
|
|
96
|
-
public get color(): UIColor {
|
|
97
|
-
return this.colorInternal;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/** Controls how sliceRegions values are interpreted */
|
|
101
|
-
public get regionMode(): UINineSliceRegionMode {
|
|
102
|
-
return this.regionModeInternal;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/** Border size in normalized texture coordinates (0 to 1) */
|
|
106
|
-
public get sliceBorders(): UIInsets {
|
|
107
|
-
return this.sliceBordersInternal;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/** Region size. Interpretation depends on regionMode. */
|
|
111
|
-
public get sliceRegions(): UIInsets {
|
|
112
|
-
return this.sliceRegionsInternal;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/** Multiplicative tint. Alpha channel controls opacity. */
|
|
116
|
-
public set color(value: UIColorConfig) {
|
|
117
|
-
this.colorInternal.set(value);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/** Controls how sliceRegions values are interpreted */
|
|
121
|
-
public set regionMode(value: UINineSliceRegionMode) {
|
|
122
|
-
if (this.regionModeInternal !== value) {
|
|
123
|
-
this.regionModeInternal = value;
|
|
124
|
-
this.regionModeDirty = true;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/** Border size in normalized texture coordinates (0 to 1) */
|
|
129
|
-
public set sliceBorders(value: UIInsetsConfig) {
|
|
130
|
-
this.sliceBordersInternal.set(value);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/** Region size. Interpretation depends on regionMode. */
|
|
134
|
-
public set sliceRegions(value: UIInsetsConfig) {
|
|
135
|
-
this.sliceRegionsInternal.set(value);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/** Removes nine slice and frees resources */
|
|
139
|
-
public override destroy(): void {
|
|
140
|
-
this.texture.signalDiminsionsChanged.off(this.onTextureDimensionsChanged);
|
|
141
|
-
super.destroy();
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
protected override setPlaneTransform(): void {
|
|
145
|
-
let properties: Record<string, UIProperty> | undefined;
|
|
146
|
-
|
|
147
|
-
const sliceBordersDirty =
|
|
148
|
-
this.textureDimensionsDirty || this.sliceBordersInternal.dirty || this.texture.trimDirty;
|
|
149
|
-
|
|
150
|
-
if (sliceBordersDirty) {
|
|
151
|
-
properties ??= {};
|
|
152
|
-
properties["sliceBorders"] = this.calculateSliceBordersForShader(this.sliceBordersVector);
|
|
153
|
-
this.sliceBordersInternal.setDirtyFalse();
|
|
154
|
-
this.textureDimensionsDirty = false;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
const sliceRegionsDirty =
|
|
158
|
-
this.sliceRegionsInternal.dirty ||
|
|
159
|
-
this.regionModeDirty ||
|
|
160
|
-
(this.regionModeInternal === UINineSliceRegionMode.WORLD &&
|
|
161
|
-
this.checkElementDimensionsDirty());
|
|
162
|
-
|
|
163
|
-
if (sliceRegionsDirty) {
|
|
164
|
-
properties ??= {};
|
|
165
|
-
properties["sliceRegions"] = this.calculateSliceRegionsForShader(this.sliceRegionsVector);
|
|
166
|
-
this.sliceRegionsInternal.setDirtyFalse();
|
|
167
|
-
this.regionModeDirty = false;
|
|
168
|
-
this.setElementDimensionsDirtyFalse();
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
if (this.colorInternal.dirty) {
|
|
172
|
-
properties ??= {};
|
|
173
|
-
properties["color"] = this.colorInternal;
|
|
174
|
-
this.colorInternal.setDirtyFalse();
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
if (this.texture.textureDirty) {
|
|
178
|
-
properties ??= {};
|
|
179
|
-
properties["texture"] = this.texture.texture;
|
|
180
|
-
this.texture.setTextureDirtyFalse();
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
if (this.texture.uvTransformDirty) {
|
|
184
|
-
properties ??= {};
|
|
185
|
-
properties["textureTransform"] = this.texture.calculateUVTransform(this.textureTransform);
|
|
186
|
-
this.texture.setUVTransformDirtyFalse();
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
if (properties) {
|
|
190
|
-
this.sceneWrapper.setProperties(this.planeHandler, properties);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
const isTransformDirty =
|
|
194
|
-
this.micro.dirty ||
|
|
195
|
-
this.texture.trimDirty ||
|
|
196
|
-
this.inputWrapper.dirty ||
|
|
197
|
-
this.solverWrapper.dirty;
|
|
198
|
-
|
|
199
|
-
if (isTransformDirty) {
|
|
200
|
-
const micro = this.micro;
|
|
201
|
-
const textureTrim = this.texture.trim;
|
|
202
|
-
|
|
203
|
-
this.sceneWrapper.setTransform(
|
|
204
|
-
this.planeHandler,
|
|
205
|
-
computeTrimmedTransformMatrix(
|
|
206
|
-
this.x,
|
|
207
|
-
this.y,
|
|
208
|
-
this.width,
|
|
209
|
-
this.height,
|
|
210
|
-
this.zIndex,
|
|
211
|
-
micro.x,
|
|
212
|
-
micro.y,
|
|
213
|
-
micro.anchorX,
|
|
214
|
-
micro.anchorY,
|
|
215
|
-
micro.scaleX,
|
|
216
|
-
micro.scaleY,
|
|
217
|
-
micro.rotation,
|
|
218
|
-
micro.anchorMode,
|
|
219
|
-
textureTrim.left,
|
|
220
|
-
textureTrim.right,
|
|
221
|
-
textureTrim.top,
|
|
222
|
-
textureTrim.bottom,
|
|
223
|
-
),
|
|
224
|
-
);
|
|
225
|
-
this.micro.setDirtyFalse();
|
|
226
|
-
this.texture.setTrimDirtyFalse();
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
private calculateSliceBordersForShader(result: Vector4): Vector4 {
|
|
231
|
-
const sourceWidth = this.texture.width;
|
|
232
|
-
const sourceHeight = this.texture.height;
|
|
233
|
-
const trim = this.texture.trim;
|
|
234
|
-
|
|
235
|
-
const trimmedWidth = sourceWidth - trim.left - trim.right;
|
|
236
|
-
const trimmedHeight = sourceHeight - trim.top - trim.bottom;
|
|
237
|
-
|
|
238
|
-
const trimNLeft = trim.left / sourceWidth;
|
|
239
|
-
const trimNRight = trim.right / sourceWidth;
|
|
240
|
-
const trimNTop = trim.top / sourceHeight;
|
|
241
|
-
const trimNBottom = trim.bottom / sourceHeight;
|
|
242
|
-
|
|
243
|
-
const trimmedWidthNorm = trimmedWidth / sourceWidth;
|
|
244
|
-
const trimmedHeightNorm = trimmedHeight / sourceHeight;
|
|
245
|
-
|
|
246
|
-
const srcLeft = this.sliceBordersInternal.left;
|
|
247
|
-
const srcRight = this.sliceBordersInternal.right;
|
|
248
|
-
const srcTop = this.sliceBordersInternal.top;
|
|
249
|
-
const srcBottom = this.sliceBordersInternal.bottom;
|
|
250
|
-
|
|
251
|
-
const left = Math.max(0, srcLeft - trimNLeft) / trimmedWidthNorm;
|
|
252
|
-
const right = Math.max(0, srcRight - trimNRight) / trimmedWidthNorm;
|
|
253
|
-
const top = Math.max(0, srcTop - trimNTop) / trimmedHeightNorm;
|
|
254
|
-
const bottom = Math.max(0, srcBottom - trimNBottom) / trimmedHeightNorm;
|
|
255
|
-
|
|
256
|
-
return result.set(Math.min(1, left), Math.min(1, right), Math.min(1, top), Math.min(1, bottom));
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
private calculateSliceRegionsForShader(result: Vector4): Vector4 {
|
|
260
|
-
if (this.regionModeInternal === UINineSliceRegionMode.NORMALIZED) {
|
|
261
|
-
return result.set(
|
|
262
|
-
this.sliceRegionsInternal.left,
|
|
263
|
-
this.sliceRegionsInternal.right,
|
|
264
|
-
this.sliceRegionsInternal.top,
|
|
265
|
-
this.sliceRegionsInternal.bottom,
|
|
266
|
-
);
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
const width = this.width;
|
|
270
|
-
const height = this.height;
|
|
271
|
-
|
|
272
|
-
return result.set(
|
|
273
|
-
this.sliceRegionsInternal.left / width,
|
|
274
|
-
this.sliceRegionsInternal.right / width,
|
|
275
|
-
this.sliceRegionsInternal.top / height,
|
|
276
|
-
this.sliceRegionsInternal.bottom / height,
|
|
277
|
-
);
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
private checkElementDimensionsDirty(): boolean {
|
|
281
|
-
return (
|
|
282
|
-
this.solverWrapper.dirty &&
|
|
283
|
-
(this.lastElementWidth !== Math.round(this.width) ||
|
|
284
|
-
this.lastElementHeight !== Math.round(this.height))
|
|
285
|
-
);
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
private setElementDimensionsDirtyFalse(): void {
|
|
289
|
-
this.lastElementWidth = Math.round(this.width);
|
|
290
|
-
this.lastElementHeight = Math.round(this.height);
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
private readonly onTextureDimensionsChanged = (): void => {
|
|
294
|
-
this.textureDimensionsDirty = true;
|
|
295
|
-
};
|
|
296
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
|
|
2
|
-
import type { UIProgressMaskFunction } from "../../miscellaneous/mask-function/UIProgressMaskFunction";
|
|
3
|
-
import type { UIElementOptions } from "../UIElement/UIElement.Internal";
|
|
4
|
-
|
|
5
|
-
/** Configuration options for UIProgress */
|
|
6
|
-
export interface UIProgressOptions extends UIElementOptions {
|
|
7
|
-
/** Multiplicative tint */
|
|
8
|
-
color: UIColorConfig;
|
|
9
|
-
/** Function controlling fill direction and shape */
|
|
10
|
-
maskFunction: UIProgressMaskFunction;
|
|
11
|
-
/** Progress from 0 (empty) to 1 (full) */
|
|
12
|
-
progress: number;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const PROGRESS_DEFAULT_VALUE = 1;
|
|
16
|
-
|
|
17
|
-
export function simplifyGLSLSource(source: string): string {
|
|
18
|
-
return source
|
|
19
|
-
.replace(/\/\*[\s\S]*?\*\//g, "")
|
|
20
|
-
.replace(/\/\/[^\n]*/g, "")
|
|
21
|
-
.replace(/\s*([{}(),=;+\-*/<>])\s*/g, "$1")
|
|
22
|
-
.replace(/\s+/g, " ")
|
|
23
|
-
.trim();
|
|
24
|
-
}
|
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
import type { Matrix3, Texture, Vector2 } from "three";
|
|
2
|
-
import { MathUtils } from "three";
|
|
3
|
-
import type { UILayer } from "../../layers/UILayer/UILayer";
|
|
4
|
-
import { assertValidNumber } from "../../miscellaneous/asserts";
|
|
5
|
-
import { UIColor } from "../../miscellaneous/color/UIColor";
|
|
6
|
-
import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
|
|
7
|
-
import { computeTrimmedTransformMatrix } from "../../miscellaneous/computeTransform";
|
|
8
|
-
import type { UIProperty } from "../../miscellaneous/generic-plane/shared";
|
|
9
|
-
import type { UIProgressMaskFunction } from "../../miscellaneous/mask-function/UIProgressMaskFunction";
|
|
10
|
-
import { UIProgressMaskFunctionDirectional } from "../../miscellaneous/mask-function/UIProgressMaskFunctionDirectional";
|
|
11
|
-
import { UITextureView } from "../../miscellaneous/texture/UITextureView";
|
|
12
|
-
import { isUIModeVisible } from "../../miscellaneous/UIMode";
|
|
13
|
-
import source from "../../shaders/UIProgress.glsl";
|
|
14
|
-
import { UIElement } from "../UIElement/UIElement";
|
|
15
|
-
import type { UIProgressOptions } from "./UIProgress.Internal";
|
|
16
|
-
import { PROGRESS_DEFAULT_VALUE } from "./UIProgress.Internal";
|
|
17
|
-
|
|
18
|
-
/** Progress bar with customizable fill direction */
|
|
19
|
-
export class UIProgress extends UIElement {
|
|
20
|
-
/** Texture displayed by this element */
|
|
21
|
-
public readonly texture: UITextureView;
|
|
22
|
-
|
|
23
|
-
private readonly colorInternal: UIColor;
|
|
24
|
-
private readonly textureTransform: Matrix3;
|
|
25
|
-
private readonly textureResolution: Vector2;
|
|
26
|
-
|
|
27
|
-
private maskFunctionInternal: UIProgressMaskFunction;
|
|
28
|
-
private progressInternal: number;
|
|
29
|
-
private progressDirty = false;
|
|
30
|
-
private textureResolutionDirty = false;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Creates a new UIProgress instance.
|
|
34
|
-
*
|
|
35
|
-
* Defaults size to texture dimensions if width and height not provided.
|
|
36
|
-
*
|
|
37
|
-
* @param layer - Layer containing this element
|
|
38
|
-
* @param texture - Texture to display
|
|
39
|
-
* @param options - Configuration options
|
|
40
|
-
*/
|
|
41
|
-
constructor(layer: UILayer, texture: Texture, options: Partial<UIProgressOptions> = {}) {
|
|
42
|
-
if (options.progress !== undefined) {
|
|
43
|
-
assertValidNumber(options.progress, "UIProgress.constructor.options.progress");
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const color = new UIColor(options.color);
|
|
47
|
-
const textureView = new UITextureView(texture);
|
|
48
|
-
const textureTransform = textureView.calculateUVTransform();
|
|
49
|
-
const textureResolution = textureView.getResolution();
|
|
50
|
-
|
|
51
|
-
options.width = options.width ?? textureView.width;
|
|
52
|
-
options.height = options.height ?? textureView.height;
|
|
53
|
-
|
|
54
|
-
const progress = MathUtils.clamp(options.progress ?? PROGRESS_DEFAULT_VALUE, 0, 1);
|
|
55
|
-
|
|
56
|
-
const maskFunction = options.maskFunction ?? new UIProgressMaskFunctionDirectional();
|
|
57
|
-
|
|
58
|
-
super(
|
|
59
|
-
layer,
|
|
60
|
-
maskFunction.source + source,
|
|
61
|
-
{
|
|
62
|
-
texture: textureView.texture,
|
|
63
|
-
textureTransform,
|
|
64
|
-
textureResolution,
|
|
65
|
-
color,
|
|
66
|
-
progress,
|
|
67
|
-
...maskFunction.enumerateProperties(),
|
|
68
|
-
},
|
|
69
|
-
options,
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
this.texture = textureView;
|
|
73
|
-
this.textureTransform = textureTransform;
|
|
74
|
-
this.textureResolution = textureResolution;
|
|
75
|
-
this.colorInternal = color;
|
|
76
|
-
this.progressInternal = progress;
|
|
77
|
-
this.maskFunctionInternal = maskFunction;
|
|
78
|
-
|
|
79
|
-
this.texture.signalDiminsionsChanged.on(this.onTextureDimensionsChanged);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/** Multiplicative tint. Alpha channel controls opacity. */
|
|
83
|
-
public get color(): UIColor {
|
|
84
|
-
return this.colorInternal;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/** Function controlling fill direction and shape */
|
|
88
|
-
public get maskFunction(): UIProgressMaskFunction {
|
|
89
|
-
return this.maskFunctionInternal;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/** Progress from 0 (empty) to 1 (full) */
|
|
93
|
-
public get progress(): number {
|
|
94
|
-
return this.progressInternal;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/** Multiplicative tint. Alpha channel controls opacity. */
|
|
98
|
-
public set color(value: UIColorConfig) {
|
|
99
|
-
this.colorInternal.set(value);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/** Function controlling fill direction and shape */
|
|
103
|
-
public set maskFunction(value: UIProgressMaskFunction) {
|
|
104
|
-
if (this.maskFunctionInternal !== value) {
|
|
105
|
-
this.maskFunctionInternal = value;
|
|
106
|
-
this.rebuildPlane();
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/** Progress from 0 (empty) to 1 (full). Clamped. */
|
|
111
|
-
public set progress(value: number) {
|
|
112
|
-
assertValidNumber(value, "UIProgress.progress");
|
|
113
|
-
value = MathUtils.clamp(value, 0, 1);
|
|
114
|
-
if (this.progressInternal !== value) {
|
|
115
|
-
this.progressInternal = value;
|
|
116
|
-
this.progressDirty = true;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
protected override setPlaneTransform(): void {
|
|
121
|
-
let properties: Record<string, UIProperty> | undefined;
|
|
122
|
-
|
|
123
|
-
if (this.colorInternal.dirty) {
|
|
124
|
-
properties ??= {};
|
|
125
|
-
properties["color"] = this.colorInternal;
|
|
126
|
-
this.colorInternal.setDirtyFalse();
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
if (this.texture.textureDirty) {
|
|
130
|
-
properties ??= {};
|
|
131
|
-
properties["texture"] = this.texture.texture;
|
|
132
|
-
this.texture.setTextureDirtyFalse();
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
if (this.texture.uvTransformDirty) {
|
|
136
|
-
properties ??= {};
|
|
137
|
-
properties["textureTransform"] = this.texture.calculateUVTransform(this.textureTransform);
|
|
138
|
-
this.texture.setUVTransformDirtyFalse();
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
if (this.progressDirty) {
|
|
142
|
-
properties ??= {};
|
|
143
|
-
properties["progress"] = this.progressInternal;
|
|
144
|
-
this.progressDirty = false;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
if (this.textureResolutionDirty) {
|
|
148
|
-
properties ??= {};
|
|
149
|
-
properties["textureResolution"] = this.texture.getResolution(this.textureResolution);
|
|
150
|
-
this.textureResolutionDirty = false;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
if (this.maskFunction.dirty) {
|
|
154
|
-
properties ??= {};
|
|
155
|
-
const maskProperties = this.maskFunction.enumerateProperties();
|
|
156
|
-
for (const key in maskProperties) {
|
|
157
|
-
properties[key] = maskProperties[key];
|
|
158
|
-
}
|
|
159
|
-
this.maskFunction.setDirtyFalse();
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
if (properties) {
|
|
163
|
-
this.sceneWrapper.setProperties(this.planeHandler, properties);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
const isTransformDirty =
|
|
167
|
-
this.micro.dirty ||
|
|
168
|
-
this.texture.trimDirty ||
|
|
169
|
-
this.inputWrapper.dirty ||
|
|
170
|
-
this.solverWrapper.dirty;
|
|
171
|
-
|
|
172
|
-
if (isTransformDirty) {
|
|
173
|
-
const micro = this.micro;
|
|
174
|
-
const textureTrim = this.texture.trim;
|
|
175
|
-
|
|
176
|
-
this.sceneWrapper.setTransform(
|
|
177
|
-
this.planeHandler,
|
|
178
|
-
computeTrimmedTransformMatrix(
|
|
179
|
-
this.x,
|
|
180
|
-
this.y,
|
|
181
|
-
this.width,
|
|
182
|
-
this.height,
|
|
183
|
-
this.zIndex,
|
|
184
|
-
micro.x,
|
|
185
|
-
micro.y,
|
|
186
|
-
micro.anchorX,
|
|
187
|
-
micro.anchorY,
|
|
188
|
-
micro.scaleX,
|
|
189
|
-
micro.scaleY,
|
|
190
|
-
micro.rotation,
|
|
191
|
-
micro.anchorMode,
|
|
192
|
-
textureTrim.left,
|
|
193
|
-
textureTrim.right,
|
|
194
|
-
textureTrim.top,
|
|
195
|
-
textureTrim.bottom,
|
|
196
|
-
),
|
|
197
|
-
);
|
|
198
|
-
this.micro.setDirtyFalse();
|
|
199
|
-
this.texture.setTrimDirtyFalse();
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
private readonly onTextureDimensionsChanged = (width: number, height: number): void => {
|
|
204
|
-
if (this.width !== width || this.height !== height) {
|
|
205
|
-
this.width = width;
|
|
206
|
-
this.height = height;
|
|
207
|
-
this.textureResolutionDirty = true;
|
|
208
|
-
}
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
private rebuildPlane(): void {
|
|
212
|
-
this.sceneWrapper.destroyPlane(this.planeHandler);
|
|
213
|
-
|
|
214
|
-
const micro = this.micro;
|
|
215
|
-
const textureTrim = this.texture.trim;
|
|
216
|
-
|
|
217
|
-
this.planeHandler = this.sceneWrapper.createPlane(
|
|
218
|
-
this.maskFunctionInternal.source + source,
|
|
219
|
-
{
|
|
220
|
-
texture: this.texture.texture,
|
|
221
|
-
textureTransform: this.texture.calculateUVTransform(this.textureTransform),
|
|
222
|
-
textureResolution: this.texture.getResolution(this.textureResolution),
|
|
223
|
-
color: this.colorInternal,
|
|
224
|
-
progress: this.progressInternal,
|
|
225
|
-
...this.maskFunctionInternal.enumerateProperties(),
|
|
226
|
-
},
|
|
227
|
-
computeTrimmedTransformMatrix(
|
|
228
|
-
this.x,
|
|
229
|
-
this.y,
|
|
230
|
-
this.width,
|
|
231
|
-
this.height,
|
|
232
|
-
this.zIndex,
|
|
233
|
-
micro.x,
|
|
234
|
-
micro.y,
|
|
235
|
-
micro.anchorX,
|
|
236
|
-
micro.anchorY,
|
|
237
|
-
micro.scaleX,
|
|
238
|
-
micro.scaleY,
|
|
239
|
-
micro.rotation,
|
|
240
|
-
micro.anchorMode,
|
|
241
|
-
textureTrim.left,
|
|
242
|
-
textureTrim.right,
|
|
243
|
-
textureTrim.top,
|
|
244
|
-
textureTrim.bottom,
|
|
245
|
-
),
|
|
246
|
-
isUIModeVisible(this.mode),
|
|
247
|
-
this.transparencyMode,
|
|
248
|
-
);
|
|
249
|
-
|
|
250
|
-
this.colorInternal.setDirtyFalse();
|
|
251
|
-
this.texture.setTextureDirtyFalse();
|
|
252
|
-
this.texture.setUVTransformDirtyFalse();
|
|
253
|
-
this.texture.setTrimDirtyFalse();
|
|
254
|
-
this.progressDirty = false;
|
|
255
|
-
this.textureResolutionDirty = false;
|
|
256
|
-
this.maskFunctionInternal.setDirtyFalse();
|
|
257
|
-
this.micro.setDirtyFalse();
|
|
258
|
-
}
|
|
259
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { Camera, Scene } from "three";
|
|
2
|
-
import { UIColor } from "../../miscellaneous/color/UIColor";
|
|
3
|
-
import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
|
|
4
|
-
import type { UIElementOptions } from "../UIElement/UIElement.Internal";
|
|
5
|
-
|
|
6
|
-
/** Controls when scene re-renders */
|
|
7
|
-
export enum UISceneUpdateMode {
|
|
8
|
-
/** Re-render every frame */
|
|
9
|
-
EVERY_FRAME = 1,
|
|
10
|
-
/** Re-render every other frame */
|
|
11
|
-
EVERY_SECOND_FRAME = 2,
|
|
12
|
-
/** Re-render when scene, camera, or updateMode changes */
|
|
13
|
-
ON_PROPERTIES_CHANGE = 3,
|
|
14
|
-
/** Re-render when dimensions or resolutionFactor changes */
|
|
15
|
-
ON_DIMENSIONS_CHANGE = 4,
|
|
16
|
-
/** Re-render only via requestUpdate() */
|
|
17
|
-
MANUAL = 5,
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/** Configuration options for UIScene */
|
|
21
|
-
export interface UISceneOptions extends UIElementOptions {
|
|
22
|
-
/** Multiplicative tint */
|
|
23
|
-
color: UIColorConfig;
|
|
24
|
-
/** Three.js scene to render */
|
|
25
|
-
scene: Scene;
|
|
26
|
-
/** Camera used for rendering */
|
|
27
|
-
camera: Camera;
|
|
28
|
-
/** When to re-render */
|
|
29
|
-
updateMode: UISceneUpdateMode;
|
|
30
|
-
/** Render target resolution multiplier. Range 0.1 to 2.0. */
|
|
31
|
-
resolutionFactor: number;
|
|
32
|
-
/** Background color */
|
|
33
|
-
clearColor: UIColorConfig;
|
|
34
|
-
/** Whether to use depth buffer */
|
|
35
|
-
enableDepthBuffer: boolean;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export const SCENE_DEFAULT_RESOLUTION_FACTOR = 0.5;
|
|
39
|
-
export const SCENE_MIN_RESOLUTION_FACTOR = 0.1;
|
|
40
|
-
export const SCENE_MAX_RESOLUTION_FACTOR = 2;
|
|
41
|
-
export const SCENE_DEFAULT_CAMERA_FOV = 60;
|
|
42
|
-
export const SCENE_DEFAULT_CAMERA_NEAR = 0.1;
|
|
43
|
-
export const SCENE_DEFAULT_CAMERA_FAR = 100;
|
|
44
|
-
export const SCENE_DEFAULT_UPDATE_MODE = UISceneUpdateMode.ON_PROPERTIES_CHANGE;
|
|
45
|
-
export const SCENE_DEFAULT_CLEAR_COLOR = new UIColor(0, 0, 0, 1);
|
|
46
|
-
export const SCENE_DEFAULT_USE_DEPTH = true;
|