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,323 +0,0 @@
|
|
|
1
|
-
import type { IUniform, ShaderMaterial } from "three";
|
|
2
|
-
import { Matrix3, Matrix4, Texture, Vector2, Vector3, Vector4 } from "three";
|
|
3
|
-
import type { UITransparencyMode } from "../UITransparencyMode";
|
|
4
|
-
import { UIColor } from "../color/UIColor";
|
|
5
|
-
import { checkSRGBSupport } from "../webglCapabilities";
|
|
6
|
-
|
|
7
|
-
export type UIProperty =
|
|
8
|
-
| Texture
|
|
9
|
-
| UIColor
|
|
10
|
-
| Vector2
|
|
11
|
-
| Vector3
|
|
12
|
-
| Vector4
|
|
13
|
-
| Matrix3
|
|
14
|
-
| Matrix4
|
|
15
|
-
| number;
|
|
16
|
-
|
|
17
|
-
export type UIPropertyName =
|
|
18
|
-
| "Texture"
|
|
19
|
-
| "UIColor"
|
|
20
|
-
| "Vector2"
|
|
21
|
-
| "Vector3"
|
|
22
|
-
| "Vector4"
|
|
23
|
-
| "Matrix3"
|
|
24
|
-
| "Matrix4"
|
|
25
|
-
| "number";
|
|
26
|
-
|
|
27
|
-
export type UIPropertyConstructor =
|
|
28
|
-
| typeof Texture
|
|
29
|
-
| typeof UIColor
|
|
30
|
-
| typeof Vector2
|
|
31
|
-
| typeof Vector3
|
|
32
|
-
| typeof Vector4
|
|
33
|
-
| typeof Matrix3
|
|
34
|
-
| typeof Matrix4
|
|
35
|
-
| NumberConstructor;
|
|
36
|
-
|
|
37
|
-
export type UIPropertyCopyTo = UIColor | Vector2 | Vector3 | Vector4 | Matrix3 | Matrix4;
|
|
38
|
-
|
|
39
|
-
export type UIPropertyCopyFrom = UIColor & Vector2 & Vector3 & Vector4 & Matrix3 & Matrix4;
|
|
40
|
-
|
|
41
|
-
export interface GLTypeInfo {
|
|
42
|
-
glslTypeName: string;
|
|
43
|
-
bufferSize: number;
|
|
44
|
-
instantiable: boolean;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export interface GLProperty {
|
|
48
|
-
value: UIProperty;
|
|
49
|
-
glslTypeInfo: GLTypeInfo;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export interface PlaneData {
|
|
53
|
-
source: string;
|
|
54
|
-
properties: Record<string, GLProperty>;
|
|
55
|
-
transform: Matrix4;
|
|
56
|
-
visibility: boolean;
|
|
57
|
-
transparency: UITransparencyMode;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export const DEFAULT_ALPHA_TEST = 0.5;
|
|
61
|
-
|
|
62
|
-
const GLSL_TYPE_INFO_FLOAT: GLTypeInfo = Object.freeze({
|
|
63
|
-
glslTypeName: "float",
|
|
64
|
-
bufferSize: 1,
|
|
65
|
-
instantiable: true,
|
|
66
|
-
} as const);
|
|
67
|
-
|
|
68
|
-
const GLSL_TYPE_INFO_SAMPLER2D: GLTypeInfo = Object.freeze({
|
|
69
|
-
glslTypeName: "sampler2D",
|
|
70
|
-
bufferSize: -1,
|
|
71
|
-
instantiable: false,
|
|
72
|
-
} as const);
|
|
73
|
-
|
|
74
|
-
const GLSL_TYPE_INFO_VEC2: GLTypeInfo = Object.freeze({
|
|
75
|
-
glslTypeName: "vec2",
|
|
76
|
-
bufferSize: 2,
|
|
77
|
-
instantiable: true,
|
|
78
|
-
} as const);
|
|
79
|
-
|
|
80
|
-
const GLSL_TYPE_INFO_VEC3: GLTypeInfo = Object.freeze({
|
|
81
|
-
glslTypeName: "vec3",
|
|
82
|
-
bufferSize: 3,
|
|
83
|
-
instantiable: true,
|
|
84
|
-
} as const);
|
|
85
|
-
|
|
86
|
-
const GLSL_TYPE_INFO_VEC4: GLTypeInfo = Object.freeze({
|
|
87
|
-
glslTypeName: "vec4",
|
|
88
|
-
bufferSize: 4,
|
|
89
|
-
instantiable: true,
|
|
90
|
-
} as const);
|
|
91
|
-
|
|
92
|
-
const GLSL_TYPE_INFO_MAT3: GLTypeInfo = Object.freeze({
|
|
93
|
-
glslTypeName: "mat3",
|
|
94
|
-
bufferSize: 9,
|
|
95
|
-
instantiable: true,
|
|
96
|
-
} as const);
|
|
97
|
-
|
|
98
|
-
const GLSL_TYPE_INFO_MAT4: GLTypeInfo = Object.freeze({
|
|
99
|
-
glslTypeName: "mat4",
|
|
100
|
-
bufferSize: 16,
|
|
101
|
-
instantiable: true,
|
|
102
|
-
} as const);
|
|
103
|
-
|
|
104
|
-
export function resolveGLSLTypeInfo(
|
|
105
|
-
value: UIProperty | UIPropertyName | UIPropertyConstructor,
|
|
106
|
-
): GLTypeInfo {
|
|
107
|
-
if (typeof value === "string") {
|
|
108
|
-
switch (value) {
|
|
109
|
-
case "number":
|
|
110
|
-
return GLSL_TYPE_INFO_FLOAT;
|
|
111
|
-
case "Texture":
|
|
112
|
-
return GLSL_TYPE_INFO_SAMPLER2D;
|
|
113
|
-
case "UIColor":
|
|
114
|
-
return GLSL_TYPE_INFO_VEC4;
|
|
115
|
-
case "Vector2":
|
|
116
|
-
return GLSL_TYPE_INFO_VEC2;
|
|
117
|
-
case "Vector3":
|
|
118
|
-
return GLSL_TYPE_INFO_VEC3;
|
|
119
|
-
case "Vector4":
|
|
120
|
-
return GLSL_TYPE_INFO_VEC4;
|
|
121
|
-
case "Matrix3":
|
|
122
|
-
return GLSL_TYPE_INFO_MAT3;
|
|
123
|
-
case "Matrix4":
|
|
124
|
-
return GLSL_TYPE_INFO_MAT4;
|
|
125
|
-
default:
|
|
126
|
-
throw new Error(`resolveGLSLTypeInfo.value: unsupported property type name`);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
if (typeof value === "function") {
|
|
130
|
-
if (value === Number) {
|
|
131
|
-
return GLSL_TYPE_INFO_FLOAT;
|
|
132
|
-
}
|
|
133
|
-
if (value === Texture) {
|
|
134
|
-
return GLSL_TYPE_INFO_SAMPLER2D;
|
|
135
|
-
}
|
|
136
|
-
if (value === UIColor) {
|
|
137
|
-
return GLSL_TYPE_INFO_VEC4;
|
|
138
|
-
}
|
|
139
|
-
if (value === Vector2) {
|
|
140
|
-
return GLSL_TYPE_INFO_VEC2;
|
|
141
|
-
}
|
|
142
|
-
if (value === Vector3) {
|
|
143
|
-
return GLSL_TYPE_INFO_VEC3;
|
|
144
|
-
}
|
|
145
|
-
if (value === Vector4) {
|
|
146
|
-
return GLSL_TYPE_INFO_VEC4;
|
|
147
|
-
}
|
|
148
|
-
if (value === Matrix3) {
|
|
149
|
-
return GLSL_TYPE_INFO_MAT3;
|
|
150
|
-
}
|
|
151
|
-
if (value === Matrix4) {
|
|
152
|
-
return GLSL_TYPE_INFO_MAT4;
|
|
153
|
-
}
|
|
154
|
-
throw new Error(`resolveGLSLTypeInfo.value: unsupported property type constructor`);
|
|
155
|
-
}
|
|
156
|
-
if (typeof value === "number") {
|
|
157
|
-
return GLSL_TYPE_INFO_FLOAT;
|
|
158
|
-
}
|
|
159
|
-
if (value instanceof Texture) {
|
|
160
|
-
return GLSL_TYPE_INFO_SAMPLER2D;
|
|
161
|
-
}
|
|
162
|
-
if (value instanceof UIColor) {
|
|
163
|
-
return GLSL_TYPE_INFO_VEC4;
|
|
164
|
-
}
|
|
165
|
-
if (value instanceof Vector2) {
|
|
166
|
-
return GLSL_TYPE_INFO_VEC2;
|
|
167
|
-
}
|
|
168
|
-
if (value instanceof Vector3) {
|
|
169
|
-
return GLSL_TYPE_INFO_VEC3;
|
|
170
|
-
}
|
|
171
|
-
if (value instanceof Vector4) {
|
|
172
|
-
return GLSL_TYPE_INFO_VEC4;
|
|
173
|
-
}
|
|
174
|
-
if (value instanceof Matrix3) {
|
|
175
|
-
return GLSL_TYPE_INFO_MAT3;
|
|
176
|
-
}
|
|
177
|
-
if (value instanceof Matrix4) {
|
|
178
|
-
return GLSL_TYPE_INFO_MAT4;
|
|
179
|
-
}
|
|
180
|
-
throw new Error(`resolveGLSLTypeInfo.value: unsupported property type`);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
export function resolvePropertyUniform(
|
|
184
|
-
name: string,
|
|
185
|
-
material: ShaderMaterial,
|
|
186
|
-
): IUniform<UIProperty> {
|
|
187
|
-
const uniform = material.uniforms[`p_${name}`] as IUniform<UIProperty> | undefined;
|
|
188
|
-
if (uniform === undefined) {
|
|
189
|
-
throw new Error(`resolvePropertyUniform.name: unknown uniform`);
|
|
190
|
-
}
|
|
191
|
-
return uniform;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
export function arePropertiesPartiallyCompatible(
|
|
195
|
-
full: Readonly<Record<string, Readonly<GLProperty>>>,
|
|
196
|
-
partial: Readonly<Record<string, Readonly<GLProperty>>>,
|
|
197
|
-
): boolean {
|
|
198
|
-
for (const key in partial) {
|
|
199
|
-
if (!(key in full)) {
|
|
200
|
-
return false;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
const infoFull = full[key].glslTypeInfo;
|
|
204
|
-
const infoPartial = partial[key].glslTypeInfo;
|
|
205
|
-
|
|
206
|
-
if (infoFull.glslTypeName !== infoPartial.glslTypeName) {
|
|
207
|
-
return false;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
// Non-instantiable (textures) must match by reference
|
|
211
|
-
if (!infoFull.instantiable && full[key].value !== partial[key].value) {
|
|
212
|
-
return false;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
return true;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
export function convertUIPropertiesToGLProperties(
|
|
220
|
-
uiProperties: Record<string, UIProperty>,
|
|
221
|
-
): Record<string, GLProperty> {
|
|
222
|
-
const glProperties: Record<string, GLProperty> = {};
|
|
223
|
-
|
|
224
|
-
for (const name in uiProperties) {
|
|
225
|
-
const value = uiProperties[name];
|
|
226
|
-
glProperties[name] = { value, glslTypeInfo: resolveGLSLTypeInfo(value) };
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
return glProperties;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
export function cloneProperty<T extends UIProperty>(property: T): T {
|
|
233
|
-
if (typeof property === "number" || property instanceof Texture) {
|
|
234
|
-
return property;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
return property.clone() as T;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
export function cloneProperties(
|
|
241
|
-
properties: Record<string, UIProperty>,
|
|
242
|
-
): Record<string, UIProperty> {
|
|
243
|
-
const result: Record<string, UIProperty> = {};
|
|
244
|
-
for (const name in properties) {
|
|
245
|
-
result[name] = cloneProperty(properties[name]);
|
|
246
|
-
}
|
|
247
|
-
return result;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
export function cloneGLProperties(
|
|
251
|
-
properties: Record<string, GLProperty>,
|
|
252
|
-
): Record<string, GLProperty> {
|
|
253
|
-
const result: Record<string, GLProperty> = {};
|
|
254
|
-
for (const name in properties) {
|
|
255
|
-
const prop = properties[name];
|
|
256
|
-
result[name] = {
|
|
257
|
-
value: cloneProperty(prop.value),
|
|
258
|
-
glslTypeInfo: prop.glslTypeInfo,
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
|
-
return result;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
/** Extracts zIndex from transform matrix (translation.z component) */
|
|
265
|
-
export function extractZIndex(transform: Matrix4): number {
|
|
266
|
-
return transform.elements[14];
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
/** Extracts zIndex from transform buffer at given instance index */
|
|
270
|
-
export function extractZIndexFromBuffer(buffer: Float32Array, instanceIndex: number): number {
|
|
271
|
-
return buffer[instanceIndex * 16 + 14];
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
export function buildGenericPlaneFragmentShader(
|
|
275
|
-
uniformDeclarations: string[],
|
|
276
|
-
varyingDeclarations: string[],
|
|
277
|
-
source: string,
|
|
278
|
-
): string {
|
|
279
|
-
return `
|
|
280
|
-
// Defines
|
|
281
|
-
#define PI 3.14159265359
|
|
282
|
-
#define SRGB_SUPPORTED ${checkSRGBSupport() ? "1" : "0"}
|
|
283
|
-
|
|
284
|
-
// Uniforms
|
|
285
|
-
${uniformDeclarations.join("\n")}
|
|
286
|
-
|
|
287
|
-
// Builtin varyings
|
|
288
|
-
varying vec3 p_position;
|
|
289
|
-
varying vec2 p_uv;
|
|
290
|
-
|
|
291
|
-
// User varyings
|
|
292
|
-
${varyingDeclarations.join("\n")}
|
|
293
|
-
|
|
294
|
-
#include <alphahash_pars_fragment>
|
|
295
|
-
|
|
296
|
-
// sRGB decode helper
|
|
297
|
-
vec4 srgbTexture2D(sampler2D textureSampler, vec2 uv) {
|
|
298
|
-
#if SRGB_SUPPORTED
|
|
299
|
-
return texture2D(textureSampler, uv);
|
|
300
|
-
#else
|
|
301
|
-
vec4 textureValue = texture2D(textureSampler, uv);
|
|
302
|
-
return vec4(pow(textureValue.rgb, vec3(2.2)), textureValue.a);
|
|
303
|
-
#endif
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
// Source must define vec4 draw() function
|
|
307
|
-
${source}
|
|
308
|
-
void main() {
|
|
309
|
-
vec4 diffuseColor = draw();
|
|
310
|
-
#ifdef USE_ALPHATEST
|
|
311
|
-
if (diffuseColor.a < ${DEFAULT_ALPHA_TEST.toFixed(2)}) {
|
|
312
|
-
discard;
|
|
313
|
-
}
|
|
314
|
-
#endif
|
|
315
|
-
#ifdef USE_ALPHAHASH
|
|
316
|
-
if (diffuseColor.a < getAlphaHashThreshold(p_position)) {
|
|
317
|
-
discard;
|
|
318
|
-
}
|
|
319
|
-
#endif
|
|
320
|
-
gl_FragColor = linearToOutputTexel(diffuseColor);
|
|
321
|
-
}
|
|
322
|
-
`;
|
|
323
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/** Insets configuration as number, per-side, or per-axis */
|
|
2
|
-
export type UIInsetsConfig =
|
|
3
|
-
| { horizontal: number; vertical: number }
|
|
4
|
-
| { left: number; right: number; top: number; bottom: number }
|
|
5
|
-
| [number, number, number, number]
|
|
6
|
-
| [number, number]
|
|
7
|
-
| number;
|
|
8
|
-
|
|
9
|
-
export const INSETS_DEFAULT_VALUE = 0;
|
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
import { Vector4 } from "three";
|
|
2
|
-
import { assertValidNonNegativeNumber } from "../asserts";
|
|
3
|
-
import type { UIInsetsConfig } from "./UIInsets.Internal";
|
|
4
|
-
import { INSETS_DEFAULT_VALUE } from "./UIInsets.Internal";
|
|
5
|
-
|
|
6
|
-
/** Insets values for four sides */
|
|
7
|
-
export class UIInsets {
|
|
8
|
-
private lInternal = INSETS_DEFAULT_VALUE;
|
|
9
|
-
private rInternal = INSETS_DEFAULT_VALUE;
|
|
10
|
-
private tInternal = INSETS_DEFAULT_VALUE;
|
|
11
|
-
private bInternal = INSETS_DEFAULT_VALUE;
|
|
12
|
-
|
|
13
|
-
private dirtyInternal = false;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Creates UIInsets instance.
|
|
17
|
-
*
|
|
18
|
-
* @param config - Insets configuration
|
|
19
|
-
*/
|
|
20
|
-
constructor(config?: UIInsetsConfig) {
|
|
21
|
-
this.set(config);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/** Left inset */
|
|
25
|
-
public get left(): number {
|
|
26
|
-
return this.lInternal;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/** Right inset */
|
|
30
|
-
public get right(): number {
|
|
31
|
-
return this.rInternal;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/** Top inset */
|
|
35
|
-
public get top(): number {
|
|
36
|
-
return this.tInternal;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/** Bottom inset */
|
|
40
|
-
public get bottom(): number {
|
|
41
|
-
return this.bInternal;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/** @internal */
|
|
45
|
-
public get dirty(): boolean {
|
|
46
|
-
return this.dirtyInternal;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/** Left inset */
|
|
50
|
-
public set left(value: number) {
|
|
51
|
-
assertValidNonNegativeNumber(value, "UIInsets.left");
|
|
52
|
-
if (this.lInternal !== value) {
|
|
53
|
-
this.lInternal = value;
|
|
54
|
-
this.dirtyInternal = true;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/** Right inset */
|
|
59
|
-
public set right(value: number) {
|
|
60
|
-
assertValidNonNegativeNumber(value, "UIInsets.right");
|
|
61
|
-
if (this.rInternal !== value) {
|
|
62
|
-
this.rInternal = value;
|
|
63
|
-
this.dirtyInternal = true;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/** Top inset */
|
|
68
|
-
public set top(value: number) {
|
|
69
|
-
assertValidNonNegativeNumber(value, "UIInsets.top");
|
|
70
|
-
if (this.tInternal !== value) {
|
|
71
|
-
this.tInternal = value;
|
|
72
|
-
this.dirtyInternal = true;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/** Bottom inset */
|
|
77
|
-
public set bottom(value: number) {
|
|
78
|
-
assertValidNonNegativeNumber(value, "UIInsets.bottom");
|
|
79
|
-
if (this.bInternal !== value) {
|
|
80
|
-
this.bInternal = value;
|
|
81
|
-
this.dirtyInternal = true;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/** Sets left and right to same value */
|
|
86
|
-
public setHorizontal(value: number): void {
|
|
87
|
-
assertValidNonNegativeNumber(value, "UIInsets.setHorizontal.value");
|
|
88
|
-
if (this.lInternal !== value || this.rInternal !== value) {
|
|
89
|
-
this.lInternal = value;
|
|
90
|
-
this.rInternal = value;
|
|
91
|
-
this.dirtyInternal = true;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/** Sets top and bottom to same value */
|
|
96
|
-
public setVertical(value: number): void {
|
|
97
|
-
assertValidNonNegativeNumber(value, "UIInsets.setVertical.value");
|
|
98
|
-
if (this.tInternal !== value || this.bInternal !== value) {
|
|
99
|
-
this.tInternal = value;
|
|
100
|
-
this.bInternal = value;
|
|
101
|
-
this.dirtyInternal = true;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/** Sets all sides to same value */
|
|
106
|
-
public setUnified(value: number): void {
|
|
107
|
-
assertValidNonNegativeNumber(value, "UIInsets.setUnified.value");
|
|
108
|
-
if (
|
|
109
|
-
this.lInternal !== value ||
|
|
110
|
-
this.rInternal !== value ||
|
|
111
|
-
this.tInternal !== value ||
|
|
112
|
-
this.bInternal !== value
|
|
113
|
-
) {
|
|
114
|
-
this.lInternal = value;
|
|
115
|
-
this.rInternal = value;
|
|
116
|
-
this.tInternal = value;
|
|
117
|
-
this.bInternal = value;
|
|
118
|
-
this.dirtyInternal = true;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/** Sets insets */
|
|
123
|
-
public set(config?: UIInsetsConfig): void {
|
|
124
|
-
const lOld = this.lInternal;
|
|
125
|
-
const rOld = this.rInternal;
|
|
126
|
-
const tOld = this.tInternal;
|
|
127
|
-
const bOld = this.bInternal;
|
|
128
|
-
|
|
129
|
-
if (config === undefined) {
|
|
130
|
-
this.lInternal = INSETS_DEFAULT_VALUE;
|
|
131
|
-
this.rInternal = INSETS_DEFAULT_VALUE;
|
|
132
|
-
this.tInternal = INSETS_DEFAULT_VALUE;
|
|
133
|
-
this.bInternal = INSETS_DEFAULT_VALUE;
|
|
134
|
-
} else if (typeof config === "number") {
|
|
135
|
-
assertValidNonNegativeNumber(config, "UIInsets.set.config");
|
|
136
|
-
this.lInternal = config;
|
|
137
|
-
this.rInternal = config;
|
|
138
|
-
this.tInternal = config;
|
|
139
|
-
this.bInternal = config;
|
|
140
|
-
} else if (Array.isArray(config)) {
|
|
141
|
-
if (config.length === 2) {
|
|
142
|
-
const horizontal = config[0];
|
|
143
|
-
const vertical = config[1];
|
|
144
|
-
assertValidNonNegativeNumber(horizontal, "UIInsets.set.config[0]");
|
|
145
|
-
assertValidNonNegativeNumber(vertical, "UIInsets.set.config[1]");
|
|
146
|
-
this.lInternal = horizontal;
|
|
147
|
-
this.rInternal = horizontal;
|
|
148
|
-
this.tInternal = vertical;
|
|
149
|
-
this.bInternal = vertical;
|
|
150
|
-
} else {
|
|
151
|
-
const left = config[0];
|
|
152
|
-
const right = config[1];
|
|
153
|
-
const top = config[2];
|
|
154
|
-
const bottom = config[3];
|
|
155
|
-
assertValidNonNegativeNumber(left, "UIInsets.set.config[0]");
|
|
156
|
-
assertValidNonNegativeNumber(right, "UIInsets.set.config[1]");
|
|
157
|
-
assertValidNonNegativeNumber(top, "UIInsets.set.config[2]");
|
|
158
|
-
assertValidNonNegativeNumber(bottom, "UIInsets.set.config[3]");
|
|
159
|
-
this.lInternal = left;
|
|
160
|
-
this.rInternal = right;
|
|
161
|
-
this.tInternal = top;
|
|
162
|
-
this.bInternal = bottom;
|
|
163
|
-
}
|
|
164
|
-
} else if ("left" in config) {
|
|
165
|
-
const left = config.left;
|
|
166
|
-
const right = config.right;
|
|
167
|
-
const top = config.top;
|
|
168
|
-
const bottom = config.bottom;
|
|
169
|
-
assertValidNonNegativeNumber(left, "UIInsets.set.config.left");
|
|
170
|
-
assertValidNonNegativeNumber(right, "UIInsets.set.config.right");
|
|
171
|
-
assertValidNonNegativeNumber(top, "UIInsets.set.config.top");
|
|
172
|
-
assertValidNonNegativeNumber(bottom, "UIInsets.set.config.bottom");
|
|
173
|
-
this.lInternal = left;
|
|
174
|
-
this.rInternal = right;
|
|
175
|
-
this.tInternal = top;
|
|
176
|
-
this.bInternal = bottom;
|
|
177
|
-
} else {
|
|
178
|
-
const horizontal = config.horizontal;
|
|
179
|
-
const vertical = config.vertical;
|
|
180
|
-
assertValidNonNegativeNumber(horizontal, "UIInsets.set.config.horizontal");
|
|
181
|
-
assertValidNonNegativeNumber(vertical, "UIInsets.set.config.vertical");
|
|
182
|
-
this.lInternal = horizontal;
|
|
183
|
-
this.rInternal = horizontal;
|
|
184
|
-
this.tInternal = vertical;
|
|
185
|
-
this.bInternal = vertical;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
if (
|
|
189
|
-
this.lInternal !== lOld ||
|
|
190
|
-
this.rInternal !== rOld ||
|
|
191
|
-
this.tInternal !== tOld ||
|
|
192
|
-
this.bInternal !== bOld
|
|
193
|
-
) {
|
|
194
|
-
this.dirtyInternal = true;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
/** Sets from Vector4 (x=left, y=right, z=top, w=bottom) */
|
|
199
|
-
public setVector4(vector: Vector4): void {
|
|
200
|
-
assertValidNonNegativeNumber(vector.x, "UIInsets.setVector4.vector.x");
|
|
201
|
-
assertValidNonNegativeNumber(vector.y, "UIInsets.setVector4.vector.y");
|
|
202
|
-
assertValidNonNegativeNumber(vector.z, "UIInsets.setVector4.vector.z");
|
|
203
|
-
assertValidNonNegativeNumber(vector.w, "UIInsets.setVector4.vector.w");
|
|
204
|
-
if (
|
|
205
|
-
this.lInternal !== vector.x ||
|
|
206
|
-
this.rInternal !== vector.y ||
|
|
207
|
-
this.tInternal !== vector.z ||
|
|
208
|
-
this.bInternal !== vector.w
|
|
209
|
-
) {
|
|
210
|
-
this.lInternal = vector.x;
|
|
211
|
-
this.rInternal = vector.y;
|
|
212
|
-
this.tInternal = vector.z;
|
|
213
|
-
this.bInternal = vector.w;
|
|
214
|
-
this.dirtyInternal = true;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
/** Converts to Vector4 (left, right, top, bottom) */
|
|
219
|
-
public toVector4(result = new Vector4()): Vector4 {
|
|
220
|
-
return result.set(this.lInternal, this.rInternal, this.tInternal, this.bInternal);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
/** Resets all sides to 0 */
|
|
224
|
-
public reset(): void {
|
|
225
|
-
this.setUnified(0);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
/** Copies from another instance */
|
|
229
|
-
public copy(other: UIInsets): void {
|
|
230
|
-
if (
|
|
231
|
-
this.lInternal !== other.lInternal ||
|
|
232
|
-
this.rInternal !== other.rInternal ||
|
|
233
|
-
this.tInternal !== other.tInternal ||
|
|
234
|
-
this.bInternal !== other.bInternal
|
|
235
|
-
) {
|
|
236
|
-
this.lInternal = other.lInternal;
|
|
237
|
-
this.rInternal = other.rInternal;
|
|
238
|
-
this.tInternal = other.tInternal;
|
|
239
|
-
this.bInternal = other.bInternal;
|
|
240
|
-
this.dirtyInternal = true;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
/** @internal */
|
|
245
|
-
public setDirtyFalse(): void {
|
|
246
|
-
this.dirtyInternal = false;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { UIProperty } from "../generic-plane/shared";
|
|
2
|
-
|
|
3
|
-
/** Base class for progress bar fill functions */
|
|
4
|
-
export abstract class UIProgressMaskFunction {
|
|
5
|
-
protected dirtyInternal = false;
|
|
6
|
-
|
|
7
|
-
protected constructor(
|
|
8
|
-
/** GLSL shader source code defining fill behavior */
|
|
9
|
-
public readonly source: string,
|
|
10
|
-
) {}
|
|
11
|
-
|
|
12
|
-
/** @internal */
|
|
13
|
-
public get dirty(): boolean {
|
|
14
|
-
return this.dirtyInternal;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/** @internal */
|
|
18
|
-
public setDirtyFalse(): void {
|
|
19
|
-
this.dirtyInternal = false;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/** @internal */
|
|
23
|
-
public abstract enumerateProperties(): Record<string, UIProperty>;
|
|
24
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import source from "../../shaders/UIProgressMaskFunctionCircular.glsl";
|
|
2
|
-
import { assertValidNumber } from "../asserts";
|
|
3
|
-
import type { UIProperty } from "../generic-plane/shared";
|
|
4
|
-
import { UIProgressMaskFunction } from "./UIProgressMaskFunction";
|
|
5
|
-
|
|
6
|
-
/** Circular radial progress fill */
|
|
7
|
-
export class UIProgressMaskFunctionCircular extends UIProgressMaskFunction {
|
|
8
|
-
private startAngleInternal: number;
|
|
9
|
-
private inverseDirectionInternal: boolean;
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Creates circular mask function.
|
|
13
|
-
*
|
|
14
|
-
* @param startAngle - Starting angle in radians
|
|
15
|
-
* @param inverseDirection - Whether to fill counter-clockwise
|
|
16
|
-
*/
|
|
17
|
-
constructor(startAngle = 0, inverseDirection = false) {
|
|
18
|
-
assertValidNumber(startAngle, "UIProgressMaskFunctionCircular.constructor.startAngle");
|
|
19
|
-
super(source);
|
|
20
|
-
this.startAngleInternal = startAngle;
|
|
21
|
-
this.inverseDirectionInternal = inverseDirection;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/** Starting angle in radians */
|
|
25
|
-
public get startAngle(): number {
|
|
26
|
-
return this.startAngleInternal;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/** Whether fill is counter-clockwise */
|
|
30
|
-
public get inverseDirection(): boolean {
|
|
31
|
-
return this.inverseDirectionInternal;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/** Starting angle in radians */
|
|
35
|
-
public set startAngle(value: number) {
|
|
36
|
-
assertValidNumber(value, "UIProgressMaskFunctionCircular.startAngle");
|
|
37
|
-
if (this.startAngleInternal !== value) {
|
|
38
|
-
this.startAngleInternal = value;
|
|
39
|
-
this.dirtyInternal = true;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/** Whether fill is counter-clockwise */
|
|
44
|
-
public set inverseDirection(value: boolean) {
|
|
45
|
-
if (this.inverseDirectionInternal !== value) {
|
|
46
|
-
this.inverseDirectionInternal = value;
|
|
47
|
-
this.dirtyInternal = true;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/** @internal */
|
|
52
|
-
public enumerateProperties(): Record<string, UIProperty> {
|
|
53
|
-
return {
|
|
54
|
-
direction: this.inverseDirectionInternal ? -1 : 1,
|
|
55
|
-
startAngle: this.startAngleInternal,
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
}
|