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
package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.js
ADDED
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
import { convertUIPropertiesToGLProperties, cloneProperties, extractZIndex, cloneGLProperties } from '../shared.js';
|
|
2
|
+
import { UIGenericInstancedPlane } from '../UIGenericInstancedPlane/UIGenericInstancedPlane.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Manages shader plane instances with automatic batching based on zIndex order.
|
|
6
|
+
*
|
|
7
|
+
* Uses dirty/flush pattern:
|
|
8
|
+
* - Mutations update internal state and mark dirty
|
|
9
|
+
* - flush() applies all pending changes to GPU representation
|
|
10
|
+
* - setVisibility is immediate (doesn't affect structure)
|
|
11
|
+
*
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
class UIPlaneRegistry {
|
|
15
|
+
constructor(scene) {
|
|
16
|
+
// Source of truth
|
|
17
|
+
this._private_handlerToState = new Map();
|
|
18
|
+
this._private_lastHandler = 0;
|
|
19
|
+
// GPU representation
|
|
20
|
+
this._private_orderedMeshes = [];
|
|
21
|
+
this._private_handlerToDescriptor = new Map();
|
|
22
|
+
// Dirty tracking
|
|
23
|
+
this._private_pendingCreate = new Set();
|
|
24
|
+
this._private_pendingDelete = new Set();
|
|
25
|
+
this._private_pendingRelocate = new Set();
|
|
26
|
+
this._private_needsFlush = false;
|
|
27
|
+
this._private_scene = scene;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Creates plane with given shader and properties.
|
|
31
|
+
* Properties and transform are cloned; originals can be safely modified.
|
|
32
|
+
* Changes are pending until flush() is called.
|
|
33
|
+
* @returns Plane handler for subsequent operations
|
|
34
|
+
*/
|
|
35
|
+
createPlane(source, properties, transform, visibility, transparency) {
|
|
36
|
+
const handler = this._private_lastHandler++;
|
|
37
|
+
const glProperties = convertUIPropertiesToGLProperties(cloneProperties(properties));
|
|
38
|
+
const zIndex = extractZIndex(transform);
|
|
39
|
+
const state = {
|
|
40
|
+
source,
|
|
41
|
+
properties: glProperties,
|
|
42
|
+
transform: transform.clone(),
|
|
43
|
+
visibility,
|
|
44
|
+
transparency,
|
|
45
|
+
zIndex,
|
|
46
|
+
};
|
|
47
|
+
this._private_handlerToState.set(handler, state);
|
|
48
|
+
this._private_pendingCreate.add(handler);
|
|
49
|
+
this._private_needsFlush = true;
|
|
50
|
+
return handler;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Removes plane. Changes are pending until flush() is called.
|
|
54
|
+
*/
|
|
55
|
+
destroyPlane(handler) {
|
|
56
|
+
if (!this._private_handlerToState.has(handler)) {
|
|
57
|
+
throw new Error(`UIPlaneRegistry.destroyPlane: handler ${handler} not found`);
|
|
58
|
+
}
|
|
59
|
+
this._private_handlerToState.delete(handler);
|
|
60
|
+
// If was pending create, just remove from there
|
|
61
|
+
if (this._private_pendingCreate.has(handler)) {
|
|
62
|
+
this._private_pendingCreate.delete(handler);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
// Remove from relocate if was there
|
|
66
|
+
this._private_pendingRelocate.delete(handler);
|
|
67
|
+
// Mark for deletion
|
|
68
|
+
this._private_pendingDelete.add(handler);
|
|
69
|
+
this._private_needsFlush = true;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Updates plane properties.
|
|
73
|
+
* Values are copied; originals can be safely modified.
|
|
74
|
+
* If texture changes, element will be relocated on flush().
|
|
75
|
+
* Instantiable properties are applied immediately.
|
|
76
|
+
*/
|
|
77
|
+
setProperties(handler, properties) {
|
|
78
|
+
const state = this._private_resolveState(handler);
|
|
79
|
+
const glProperties = convertUIPropertiesToGLProperties(properties);
|
|
80
|
+
// Check if any non-instantiable (texture) changed
|
|
81
|
+
let textureChanged = false;
|
|
82
|
+
for (const name in glProperties) {
|
|
83
|
+
const newProp = glProperties[name];
|
|
84
|
+
const oldProp = state.properties[name];
|
|
85
|
+
if (!newProp.glslTypeInfo.instantiable) {
|
|
86
|
+
if (oldProp.value !== newProp.value) {
|
|
87
|
+
textureChanged = true;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// Update state
|
|
91
|
+
state.properties[name] = {
|
|
92
|
+
value: newProp.value,
|
|
93
|
+
glslTypeInfo: newProp.glslTypeInfo,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
if (textureChanged && !this._private_pendingCreate.has(handler)) {
|
|
97
|
+
this._private_pendingRelocate.add(handler);
|
|
98
|
+
this._private_needsFlush = true;
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
// Apply immediately if already in mesh and no texture change
|
|
102
|
+
const descriptor = this._private_handlerToDescriptor.get(handler);
|
|
103
|
+
if (descriptor) {
|
|
104
|
+
descriptor.mesh.setPropertiesAt(descriptor.instanceIndex, glProperties);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Updates plane transform matrix.
|
|
110
|
+
* Matrix is copied; original can be safely modified.
|
|
111
|
+
* If zIndex changes, element will be relocated on flush().
|
|
112
|
+
*/
|
|
113
|
+
setTransform(handler, transform) {
|
|
114
|
+
const state = this._private_resolveState(handler);
|
|
115
|
+
const newZIndex = extractZIndex(transform);
|
|
116
|
+
const oldZIndex = state.zIndex;
|
|
117
|
+
state.transform.copy(transform);
|
|
118
|
+
state.zIndex = newZIndex;
|
|
119
|
+
if (oldZIndex !== newZIndex && !this._private_pendingCreate.has(handler)) {
|
|
120
|
+
this._private_pendingRelocate.add(handler);
|
|
121
|
+
this._private_needsFlush = true;
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
// Apply immediately if already in mesh and zIndex unchanged
|
|
125
|
+
const descriptor = this._private_handlerToDescriptor.get(handler);
|
|
126
|
+
if (descriptor) {
|
|
127
|
+
descriptor.mesh.setTransformAt(descriptor.instanceIndex, transform);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Updates plane visibility.
|
|
133
|
+
* This is applied immediately (doesn't affect batching structure).
|
|
134
|
+
*/
|
|
135
|
+
setVisibility(handler, visibility) {
|
|
136
|
+
const state = this._private_resolveState(handler);
|
|
137
|
+
state.visibility = visibility;
|
|
138
|
+
// Apply immediately if already in a mesh
|
|
139
|
+
const descriptor = this._private_handlerToDescriptor.get(handler);
|
|
140
|
+
if (descriptor) {
|
|
141
|
+
descriptor.mesh.setVisibilityAt(descriptor.instanceIndex, visibility);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Updates plane transparency mode.
|
|
146
|
+
* Element will be relocated on flush() if transparency changes.
|
|
147
|
+
*/
|
|
148
|
+
setTransparency(handler, transparency) {
|
|
149
|
+
const state = this._private_resolveState(handler);
|
|
150
|
+
if (state.transparency === transparency) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
state.transparency = transparency;
|
|
154
|
+
if (!this._private_pendingCreate.has(handler)) {
|
|
155
|
+
this._private_pendingRelocate.add(handler);
|
|
156
|
+
this._private_needsFlush = true;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Apply all pending changes to GPU representation.
|
|
161
|
+
* Call this before rendering.
|
|
162
|
+
*/
|
|
163
|
+
flush() {
|
|
164
|
+
if (!this._private_needsFlush) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
this._private_processDeletes();
|
|
168
|
+
this._private_processRelocates();
|
|
169
|
+
this._private_processCreates();
|
|
170
|
+
this._private_mergeCompatibleNeighbors();
|
|
171
|
+
this._private_cleanupEmptyMeshes();
|
|
172
|
+
this._private_syncSceneOrder();
|
|
173
|
+
this._private_pendingCreate.clear();
|
|
174
|
+
this._private_pendingDelete.clear();
|
|
175
|
+
this._private_pendingRelocate.clear();
|
|
176
|
+
this._private_needsFlush = false;
|
|
177
|
+
}
|
|
178
|
+
_private_processDeletes() {
|
|
179
|
+
for (const handler of this._private_pendingDelete) {
|
|
180
|
+
const descriptor = this._private_handlerToDescriptor.get(handler);
|
|
181
|
+
if (!descriptor) {
|
|
182
|
+
continue; // Already removed
|
|
183
|
+
}
|
|
184
|
+
const { mesh, instanceIndex } = descriptor;
|
|
185
|
+
mesh.removeAt(instanceIndex);
|
|
186
|
+
this._private_shiftHandlerIndices(mesh, instanceIndex + 1, -1);
|
|
187
|
+
this._private_handlerToDescriptor.delete(handler);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
_private_processRelocates() {
|
|
191
|
+
for (const handler of this._private_pendingRelocate) {
|
|
192
|
+
const descriptor = this._private_handlerToDescriptor.get(handler);
|
|
193
|
+
if (!descriptor) {
|
|
194
|
+
continue; // Not in mesh yet
|
|
195
|
+
}
|
|
196
|
+
const { mesh, instanceIndex } = descriptor;
|
|
197
|
+
mesh.removeAt(instanceIndex);
|
|
198
|
+
this._private_shiftHandlerIndices(mesh, instanceIndex + 1, -1);
|
|
199
|
+
this._private_handlerToDescriptor.delete(handler);
|
|
200
|
+
// Will be re-inserted in processCreates
|
|
201
|
+
this._private_pendingCreate.add(handler);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
_private_processCreates() {
|
|
205
|
+
if (this._private_pendingCreate.size === 0) {
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
// Collect and sort by zIndex
|
|
209
|
+
const toCreate = [];
|
|
210
|
+
for (const handler of this._private_pendingCreate) {
|
|
211
|
+
const state = this._private_handlerToState.get(handler);
|
|
212
|
+
if (state) {
|
|
213
|
+
toCreate.push({ handler, state });
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
toCreate.sort((a, b) => a.state.zIndex - b.state.zIndex);
|
|
217
|
+
// Check for duplicate zIndex
|
|
218
|
+
for (let i = 1; i < toCreate.length; i++) {
|
|
219
|
+
if (toCreate[i].state.zIndex === toCreate[i - 1].state.zIndex) {
|
|
220
|
+
throw new Error(`UIPlaneRegistry.flush: duplicate zIndex=${toCreate[i].state.zIndex} ` +
|
|
221
|
+
`for handlers ${toCreate[i - 1].handler} and ${toCreate[i].handler}`);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
// Insert each element
|
|
225
|
+
for (const { handler, state } of toCreate) {
|
|
226
|
+
this._private_insertSingleElement(handler, state);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
_private_insertSingleElement(handler, state) {
|
|
230
|
+
const { source, properties, transform, visibility, transparency, zIndex } = state;
|
|
231
|
+
// Find compatible mesh
|
|
232
|
+
let candidateMesh = null;
|
|
233
|
+
for (const mesh of this._private_orderedMeshes) {
|
|
234
|
+
if (!mesh.isCompatibleWith(source, properties, transparency)) {
|
|
235
|
+
continue;
|
|
236
|
+
}
|
|
237
|
+
if (mesh.instancesCount === 0) {
|
|
238
|
+
candidateMesh = mesh;
|
|
239
|
+
break;
|
|
240
|
+
}
|
|
241
|
+
const meshMinZ = mesh.getZIndexAt(0);
|
|
242
|
+
const meshMaxZ = mesh.getZIndexAt(mesh.instancesCount - 1);
|
|
243
|
+
// Can insert if zIndex fits within or extends the range
|
|
244
|
+
if (zIndex >= meshMinZ - 1 && zIndex <= meshMaxZ + 1) {
|
|
245
|
+
candidateMesh = mesh;
|
|
246
|
+
break;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
if (candidateMesh) {
|
|
250
|
+
const instanceIndex = this._private_findInstanceIndexInMesh(candidateMesh, zIndex);
|
|
251
|
+
candidateMesh.insertAt(instanceIndex, properties, transform, visibility);
|
|
252
|
+
this._private_shiftHandlerIndices(candidateMesh, instanceIndex, 1);
|
|
253
|
+
this._private_handlerToDescriptor.set(handler, {
|
|
254
|
+
mesh: candidateMesh,
|
|
255
|
+
instanceIndex,
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
// Create new mesh
|
|
260
|
+
const meshIndex = this._private_findMeshIndexForZIndex(zIndex);
|
|
261
|
+
const mesh = new UIGenericInstancedPlane(source, cloneGLProperties(properties), transparency);
|
|
262
|
+
mesh.insertAt(0, properties, transform, visibility);
|
|
263
|
+
this._private_orderedMeshes.splice(meshIndex, 0, mesh);
|
|
264
|
+
this._private_scene.add(mesh);
|
|
265
|
+
this._private_handlerToDescriptor.set(handler, { mesh, instanceIndex: 0 });
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
_private_mergeCompatibleNeighbors() {
|
|
269
|
+
let i = 0;
|
|
270
|
+
while (i < this._private_orderedMeshes.length - 1) {
|
|
271
|
+
const left = this._private_orderedMeshes[i];
|
|
272
|
+
const right = this._private_orderedMeshes[i + 1];
|
|
273
|
+
if (left.instancesCount === 0 || right.instancesCount === 0) {
|
|
274
|
+
i++;
|
|
275
|
+
continue;
|
|
276
|
+
}
|
|
277
|
+
const leftMaxZ = left.getZIndexAt(left.instancesCount - 1);
|
|
278
|
+
const rightMinZ = right.getZIndexAt(0);
|
|
279
|
+
// Check if they can be merged (non-overlapping zIndex ranges and compatible)
|
|
280
|
+
if (leftMaxZ < rightMinZ &&
|
|
281
|
+
left.isCompatibleWith(right.source, right.getProperties(), right.transparency)) {
|
|
282
|
+
const indexOffset = left.instancesCount;
|
|
283
|
+
left.merge(right);
|
|
284
|
+
this._private_remapHandlersAfterMerge(right, left, indexOffset);
|
|
285
|
+
this._private_scene.remove(right);
|
|
286
|
+
right.destroy();
|
|
287
|
+
this._private_orderedMeshes.splice(i + 1, 1);
|
|
288
|
+
// Don't increment i, check if we can merge again
|
|
289
|
+
continue;
|
|
290
|
+
}
|
|
291
|
+
i++;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
_private_cleanupEmptyMeshes() {
|
|
295
|
+
for (let i = this._private_orderedMeshes.length - 1; i >= 0; i--) {
|
|
296
|
+
const mesh = this._private_orderedMeshes[i];
|
|
297
|
+
if (mesh.instancesCount === 0) {
|
|
298
|
+
this._private_scene.remove(mesh);
|
|
299
|
+
mesh.destroy();
|
|
300
|
+
this._private_orderedMeshes.splice(i, 1);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
_private_resolveState(handler) {
|
|
305
|
+
const state = this._private_handlerToState.get(handler);
|
|
306
|
+
if (!state) {
|
|
307
|
+
throw new Error(`UIPlaneRegistry.resolveState: handler ${handler} not found`);
|
|
308
|
+
}
|
|
309
|
+
return state;
|
|
310
|
+
}
|
|
311
|
+
_private_findMeshIndexForZIndex(zIndex) {
|
|
312
|
+
for (let i = 0; i < this._private_orderedMeshes.length; i++) {
|
|
313
|
+
const mesh = this._private_orderedMeshes[i];
|
|
314
|
+
if (mesh.instancesCount > 0 && mesh.getZIndexAt(0) > zIndex) {
|
|
315
|
+
return i;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
return this._private_orderedMeshes.length;
|
|
319
|
+
}
|
|
320
|
+
_private_findInstanceIndexInMesh(mesh, zIndex) {
|
|
321
|
+
for (let i = 0; i < mesh.instancesCount; i++) {
|
|
322
|
+
if (mesh.getZIndexAt(i) > zIndex) {
|
|
323
|
+
return i;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
return mesh.instancesCount;
|
|
327
|
+
}
|
|
328
|
+
_private_shiftHandlerIndices(mesh, fromIndex, delta) {
|
|
329
|
+
for (const descriptor of this._private_handlerToDescriptor.values()) {
|
|
330
|
+
if (descriptor.mesh === mesh && descriptor.instanceIndex >= fromIndex) {
|
|
331
|
+
descriptor.instanceIndex += delta;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
_private_remapHandlersAfterMerge(fromMesh, toMesh, indexOffset) {
|
|
336
|
+
for (const descriptor of this._private_handlerToDescriptor.values()) {
|
|
337
|
+
if (descriptor.mesh === fromMesh) {
|
|
338
|
+
descriptor.mesh = toMesh;
|
|
339
|
+
descriptor.instanceIndex += indexOffset;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
_private_syncSceneOrder() {
|
|
344
|
+
// Sort meshes by their minimum zIndex
|
|
345
|
+
this._private_orderedMeshes.sort((a, b) => {
|
|
346
|
+
const aZ = a.instancesCount > 0 ? a.getZIndexAt(0) : 0;
|
|
347
|
+
const bZ = b.instancesCount > 0 ? b.getZIndexAt(0) : 0;
|
|
348
|
+
return aZ - bZ;
|
|
349
|
+
});
|
|
350
|
+
// Update render order
|
|
351
|
+
for (let i = 0; i < this._private_orderedMeshes.length; i++) {
|
|
352
|
+
this._private_orderedMeshes[i].renderOrder = i;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
export { UIPlaneRegistry };
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
export type UIProperty = Texture | UIColor | Vector2 | Vector3 | Vector4 | Matrix3 | Matrix4 | number;
|
|
6
|
+
export type UIPropertyName = "Texture" | "UIColor" | "Vector2" | "Vector3" | "Vector4" | "Matrix3" | "Matrix4" | "number";
|
|
7
|
+
export type UIPropertyConstructor = typeof Texture | typeof UIColor | typeof Vector2 | typeof Vector3 | typeof Vector4 | typeof Matrix3 | typeof Matrix4 | NumberConstructor;
|
|
8
|
+
export type UIPropertyCopyTo = UIColor | Vector2 | Vector3 | Vector4 | Matrix3 | Matrix4;
|
|
9
|
+
export type UIPropertyCopyFrom = UIColor & Vector2 & Vector3 & Vector4 & Matrix3 & Matrix4;
|
|
10
|
+
export interface GLTypeInfo {
|
|
11
|
+
glslTypeName: string;
|
|
12
|
+
bufferSize: number;
|
|
13
|
+
instantiable: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface GLProperty {
|
|
16
|
+
value: UIProperty;
|
|
17
|
+
glslTypeInfo: GLTypeInfo;
|
|
18
|
+
}
|
|
19
|
+
export interface PlaneData {
|
|
20
|
+
source: string;
|
|
21
|
+
properties: Record<string, GLProperty>;
|
|
22
|
+
transform: Matrix4;
|
|
23
|
+
visibility: boolean;
|
|
24
|
+
transparency: UITransparencyMode;
|
|
25
|
+
}
|
|
26
|
+
export declare const DEFAULT_ALPHA_TEST = 0.5;
|
|
27
|
+
export declare function resolveGLSLTypeInfo(value: UIProperty | UIPropertyName | UIPropertyConstructor): GLTypeInfo;
|
|
28
|
+
export declare function resolvePropertyUniform(name: string, material: ShaderMaterial): IUniform<UIProperty>;
|
|
29
|
+
export declare function arePropertiesPartiallyCompatible(full: Readonly<Record<string, Readonly<GLProperty>>>, partial: Readonly<Record<string, Readonly<GLProperty>>>): boolean;
|
|
30
|
+
export declare function convertUIPropertiesToGLProperties(uiProperties: Record<string, UIProperty>): Record<string, GLProperty>;
|
|
31
|
+
export declare function cloneProperty<T extends UIProperty>(property: T): T;
|
|
32
|
+
export declare function cloneProperties(properties: Record<string, UIProperty>): Record<string, UIProperty>;
|
|
33
|
+
export declare function cloneGLProperties(properties: Record<string, GLProperty>): Record<string, GLProperty>;
|
|
34
|
+
/** Extracts zIndex from transform matrix (translation.z component) */
|
|
35
|
+
export declare function extractZIndex(transform: Matrix4): number;
|
|
36
|
+
/** Extracts zIndex from transform buffer at given instance index */
|
|
37
|
+
export declare function extractZIndexFromBuffer(buffer: Float32Array, instanceIndex: number): number;
|
|
38
|
+
export declare function buildGenericPlaneFragmentShader(uniformDeclarations: string[], varyingDeclarations: string[], source: string): string;
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { Texture, Vector2, Vector3, Vector4, Matrix3, Matrix4 } from 'three';
|
|
2
|
+
import { UIColor } from '../color/UIColor.js';
|
|
3
|
+
import { checkSRGBSupport } from '../webglCapabilities.js';
|
|
4
|
+
|
|
5
|
+
const DEFAULT_ALPHA_TEST = 0.5;
|
|
6
|
+
const GLSL_TYPE_INFO_FLOAT = Object.freeze({
|
|
7
|
+
glslTypeName: "float",
|
|
8
|
+
bufferSize: 1,
|
|
9
|
+
instantiable: true,
|
|
10
|
+
});
|
|
11
|
+
const GLSL_TYPE_INFO_SAMPLER2D = Object.freeze({
|
|
12
|
+
glslTypeName: "sampler2D",
|
|
13
|
+
bufferSize: -1,
|
|
14
|
+
instantiable: false,
|
|
15
|
+
});
|
|
16
|
+
const GLSL_TYPE_INFO_VEC2 = Object.freeze({
|
|
17
|
+
glslTypeName: "vec2",
|
|
18
|
+
bufferSize: 2,
|
|
19
|
+
instantiable: true,
|
|
20
|
+
});
|
|
21
|
+
const GLSL_TYPE_INFO_VEC3 = Object.freeze({
|
|
22
|
+
glslTypeName: "vec3",
|
|
23
|
+
bufferSize: 3,
|
|
24
|
+
instantiable: true,
|
|
25
|
+
});
|
|
26
|
+
const GLSL_TYPE_INFO_VEC4 = Object.freeze({
|
|
27
|
+
glslTypeName: "vec4",
|
|
28
|
+
bufferSize: 4,
|
|
29
|
+
instantiable: true,
|
|
30
|
+
});
|
|
31
|
+
const GLSL_TYPE_INFO_MAT3 = Object.freeze({
|
|
32
|
+
glslTypeName: "mat3",
|
|
33
|
+
bufferSize: 9,
|
|
34
|
+
instantiable: true,
|
|
35
|
+
});
|
|
36
|
+
const GLSL_TYPE_INFO_MAT4 = Object.freeze({
|
|
37
|
+
glslTypeName: "mat4",
|
|
38
|
+
bufferSize: 16,
|
|
39
|
+
instantiable: true,
|
|
40
|
+
});
|
|
41
|
+
function resolveGLSLTypeInfo(value) {
|
|
42
|
+
if (typeof value === "string") {
|
|
43
|
+
switch (value) {
|
|
44
|
+
case "number":
|
|
45
|
+
return GLSL_TYPE_INFO_FLOAT;
|
|
46
|
+
case "Texture":
|
|
47
|
+
return GLSL_TYPE_INFO_SAMPLER2D;
|
|
48
|
+
case "UIColor":
|
|
49
|
+
return GLSL_TYPE_INFO_VEC4;
|
|
50
|
+
case "Vector2":
|
|
51
|
+
return GLSL_TYPE_INFO_VEC2;
|
|
52
|
+
case "Vector3":
|
|
53
|
+
return GLSL_TYPE_INFO_VEC3;
|
|
54
|
+
case "Vector4":
|
|
55
|
+
return GLSL_TYPE_INFO_VEC4;
|
|
56
|
+
case "Matrix3":
|
|
57
|
+
return GLSL_TYPE_INFO_MAT3;
|
|
58
|
+
case "Matrix4":
|
|
59
|
+
return GLSL_TYPE_INFO_MAT4;
|
|
60
|
+
default:
|
|
61
|
+
throw new Error(`resolveGLSLTypeInfo.value: unsupported property type name`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (typeof value === "function") {
|
|
65
|
+
if (value === Number) {
|
|
66
|
+
return GLSL_TYPE_INFO_FLOAT;
|
|
67
|
+
}
|
|
68
|
+
if (value === Texture) {
|
|
69
|
+
return GLSL_TYPE_INFO_SAMPLER2D;
|
|
70
|
+
}
|
|
71
|
+
if (value === UIColor) {
|
|
72
|
+
return GLSL_TYPE_INFO_VEC4;
|
|
73
|
+
}
|
|
74
|
+
if (value === Vector2) {
|
|
75
|
+
return GLSL_TYPE_INFO_VEC2;
|
|
76
|
+
}
|
|
77
|
+
if (value === Vector3) {
|
|
78
|
+
return GLSL_TYPE_INFO_VEC3;
|
|
79
|
+
}
|
|
80
|
+
if (value === Vector4) {
|
|
81
|
+
return GLSL_TYPE_INFO_VEC4;
|
|
82
|
+
}
|
|
83
|
+
if (value === Matrix3) {
|
|
84
|
+
return GLSL_TYPE_INFO_MAT3;
|
|
85
|
+
}
|
|
86
|
+
if (value === Matrix4) {
|
|
87
|
+
return GLSL_TYPE_INFO_MAT4;
|
|
88
|
+
}
|
|
89
|
+
throw new Error(`resolveGLSLTypeInfo.value: unsupported property type constructor`);
|
|
90
|
+
}
|
|
91
|
+
if (typeof value === "number") {
|
|
92
|
+
return GLSL_TYPE_INFO_FLOAT;
|
|
93
|
+
}
|
|
94
|
+
if (value instanceof Texture) {
|
|
95
|
+
return GLSL_TYPE_INFO_SAMPLER2D;
|
|
96
|
+
}
|
|
97
|
+
if (value instanceof UIColor) {
|
|
98
|
+
return GLSL_TYPE_INFO_VEC4;
|
|
99
|
+
}
|
|
100
|
+
if (value instanceof Vector2) {
|
|
101
|
+
return GLSL_TYPE_INFO_VEC2;
|
|
102
|
+
}
|
|
103
|
+
if (value instanceof Vector3) {
|
|
104
|
+
return GLSL_TYPE_INFO_VEC3;
|
|
105
|
+
}
|
|
106
|
+
if (value instanceof Vector4) {
|
|
107
|
+
return GLSL_TYPE_INFO_VEC4;
|
|
108
|
+
}
|
|
109
|
+
if (value instanceof Matrix3) {
|
|
110
|
+
return GLSL_TYPE_INFO_MAT3;
|
|
111
|
+
}
|
|
112
|
+
if (value instanceof Matrix4) {
|
|
113
|
+
return GLSL_TYPE_INFO_MAT4;
|
|
114
|
+
}
|
|
115
|
+
throw new Error(`resolveGLSLTypeInfo.value: unsupported property type`);
|
|
116
|
+
}
|
|
117
|
+
function resolvePropertyUniform(name, material) {
|
|
118
|
+
const uniform = material.uniforms[`p_${name}`];
|
|
119
|
+
if (uniform === undefined) {
|
|
120
|
+
throw new Error(`resolvePropertyUniform.name: unknown uniform`);
|
|
121
|
+
}
|
|
122
|
+
return uniform;
|
|
123
|
+
}
|
|
124
|
+
function arePropertiesPartiallyCompatible(full, partial) {
|
|
125
|
+
for (const key in partial) {
|
|
126
|
+
if (!(key in full)) {
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
const infoFull = full[key].glslTypeInfo;
|
|
130
|
+
const infoPartial = partial[key].glslTypeInfo;
|
|
131
|
+
if (infoFull.glslTypeName !== infoPartial.glslTypeName) {
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
// Non-instantiable (textures) must match by reference
|
|
135
|
+
if (!infoFull.instantiable && full[key].value !== partial[key].value) {
|
|
136
|
+
return false;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return true;
|
|
140
|
+
}
|
|
141
|
+
function convertUIPropertiesToGLProperties(uiProperties) {
|
|
142
|
+
const glProperties = {};
|
|
143
|
+
for (const name in uiProperties) {
|
|
144
|
+
const value = uiProperties[name];
|
|
145
|
+
glProperties[name] = { value, glslTypeInfo: resolveGLSLTypeInfo(value) };
|
|
146
|
+
}
|
|
147
|
+
return glProperties;
|
|
148
|
+
}
|
|
149
|
+
function cloneProperty(property) {
|
|
150
|
+
if (typeof property === "number" || property instanceof Texture) {
|
|
151
|
+
return property;
|
|
152
|
+
}
|
|
153
|
+
return property.clone();
|
|
154
|
+
}
|
|
155
|
+
function cloneProperties(properties) {
|
|
156
|
+
const result = {};
|
|
157
|
+
for (const name in properties) {
|
|
158
|
+
result[name] = cloneProperty(properties[name]);
|
|
159
|
+
}
|
|
160
|
+
return result;
|
|
161
|
+
}
|
|
162
|
+
function cloneGLProperties(properties) {
|
|
163
|
+
const result = {};
|
|
164
|
+
for (const name in properties) {
|
|
165
|
+
const prop = properties[name];
|
|
166
|
+
result[name] = {
|
|
167
|
+
value: cloneProperty(prop.value),
|
|
168
|
+
glslTypeInfo: prop.glslTypeInfo,
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
return result;
|
|
172
|
+
}
|
|
173
|
+
/** Extracts zIndex from transform matrix (translation.z component) */
|
|
174
|
+
function extractZIndex(transform) {
|
|
175
|
+
return transform.elements[14];
|
|
176
|
+
}
|
|
177
|
+
/** Extracts zIndex from transform buffer at given instance index */
|
|
178
|
+
function extractZIndexFromBuffer(buffer, instanceIndex) {
|
|
179
|
+
return buffer[instanceIndex * 16 + 14];
|
|
180
|
+
}
|
|
181
|
+
function buildGenericPlaneFragmentShader(uniformDeclarations, varyingDeclarations, source) {
|
|
182
|
+
return `
|
|
183
|
+
// Defines
|
|
184
|
+
#define PI 3.14159265359
|
|
185
|
+
#define SRGB_SUPPORTED ${checkSRGBSupport() ? "1" : "0"}
|
|
186
|
+
|
|
187
|
+
// Uniforms
|
|
188
|
+
${uniformDeclarations.join("\n")}
|
|
189
|
+
|
|
190
|
+
// Builtin varyings
|
|
191
|
+
varying vec3 p_position;
|
|
192
|
+
varying vec2 p_uv;
|
|
193
|
+
|
|
194
|
+
// User varyings
|
|
195
|
+
${varyingDeclarations.join("\n")}
|
|
196
|
+
|
|
197
|
+
#include <alphahash_pars_fragment>
|
|
198
|
+
|
|
199
|
+
// sRGB decode helper
|
|
200
|
+
vec4 srgbTexture2D(sampler2D textureSampler, vec2 uv) {
|
|
201
|
+
#if SRGB_SUPPORTED
|
|
202
|
+
return texture2D(textureSampler, uv);
|
|
203
|
+
#else
|
|
204
|
+
vec4 textureValue = texture2D(textureSampler, uv);
|
|
205
|
+
return vec4(pow(textureValue.rgb, vec3(2.2)), textureValue.a);
|
|
206
|
+
#endif
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// Source must define vec4 draw() function
|
|
210
|
+
${source}
|
|
211
|
+
void main() {
|
|
212
|
+
vec4 diffuseColor = draw();
|
|
213
|
+
#ifdef USE_ALPHATEST
|
|
214
|
+
if (diffuseColor.a < ${DEFAULT_ALPHA_TEST.toFixed(2)}) {
|
|
215
|
+
discard;
|
|
216
|
+
}
|
|
217
|
+
#endif
|
|
218
|
+
#ifdef USE_ALPHAHASH
|
|
219
|
+
if (diffuseColor.a < getAlphaHashThreshold(p_position)) {
|
|
220
|
+
discard;
|
|
221
|
+
}
|
|
222
|
+
#endif
|
|
223
|
+
gl_FragColor = linearToOutputTexel(diffuseColor);
|
|
224
|
+
}
|
|
225
|
+
`;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
export { DEFAULT_ALPHA_TEST, arePropertiesPartiallyCompatible, buildGenericPlaneFragmentShader, cloneGLProperties, cloneProperties, cloneProperty, convertUIPropertiesToGLProperties, extractZIndex, extractZIndexFromBuffer, resolveGLSLTypeInfo, resolvePropertyUniform };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Insets configuration as number, per-side, or per-axis */
|
|
2
|
+
export type UIInsetsConfig = {
|
|
3
|
+
horizontal: number;
|
|
4
|
+
vertical: number;
|
|
5
|
+
} | {
|
|
6
|
+
left: number;
|
|
7
|
+
right: number;
|
|
8
|
+
top: number;
|
|
9
|
+
bottom: number;
|
|
10
|
+
} | [number, number, number, number] | [number, number] | number;
|
|
11
|
+
export declare const INSETS_DEFAULT_VALUE = 0;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Vector4 } from "three";
|
|
2
|
+
import type { UIInsetsConfig } from "./UIInsets.Internal";
|
|
3
|
+
/** Insets values for four sides */
|
|
4
|
+
export declare class UIInsets {
|
|
5
|
+
private lInternal;
|
|
6
|
+
private rInternal;
|
|
7
|
+
private tInternal;
|
|
8
|
+
private bInternal;
|
|
9
|
+
private dirtyInternal;
|
|
10
|
+
/**
|
|
11
|
+
* Creates UIInsets instance.
|
|
12
|
+
*
|
|
13
|
+
* @param config - Insets configuration
|
|
14
|
+
*/
|
|
15
|
+
constructor(config?: UIInsetsConfig);
|
|
16
|
+
/** Left inset */
|
|
17
|
+
get left(): number;
|
|
18
|
+
/** Right inset */
|
|
19
|
+
get right(): number;
|
|
20
|
+
/** Top inset */
|
|
21
|
+
get top(): number;
|
|
22
|
+
/** Bottom inset */
|
|
23
|
+
get bottom(): number;
|
|
24
|
+
/** Left inset */
|
|
25
|
+
set left(value: number);
|
|
26
|
+
/** Right inset */
|
|
27
|
+
set right(value: number);
|
|
28
|
+
/** Top inset */
|
|
29
|
+
set top(value: number);
|
|
30
|
+
/** Bottom inset */
|
|
31
|
+
set bottom(value: number);
|
|
32
|
+
/** Sets left and right to same value */
|
|
33
|
+
setHorizontal(value: number): void;
|
|
34
|
+
/** Sets top and bottom to same value */
|
|
35
|
+
setVertical(value: number): void;
|
|
36
|
+
/** Sets all sides to same value */
|
|
37
|
+
setUnified(value: number): void;
|
|
38
|
+
/** Sets insets */
|
|
39
|
+
set(config?: UIInsetsConfig): void;
|
|
40
|
+
/** Sets from Vector4 (x=left, y=right, z=top, w=bottom) */
|
|
41
|
+
setVector4(vector: Vector4): void;
|
|
42
|
+
/** Converts to Vector4 (left, right, top, bottom) */
|
|
43
|
+
toVector4(result?: Vector4): Vector4;
|
|
44
|
+
/** Resets all sides to 0 */
|
|
45
|
+
reset(): void;
|
|
46
|
+
/** Copies from another instance */
|
|
47
|
+
copy(other: UIInsets): void;
|
|
48
|
+
}
|