laymur 0.16.0 → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +84 -208
- package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.js +41 -0
- package/dist/{constraints → core/constraints}/UIConstraint.d.ts +2 -2
- package/dist/core/constraints/UIConstraint.js +11 -0
- package/dist/core/constraints/UICustomConstraint.js +37 -0
- package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.js +34 -0
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.js +3 -0
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.js +100 -0
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.js +4 -0
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.js +136 -0
- package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.js +40 -0
- package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.js +71 -0
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.js +3 -0
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.js +100 -0
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.js +4 -0
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.js +136 -0
- package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.js +40 -0
- package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.js +34 -0
- package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.js +19 -0
- package/dist/core/constraints/builders/UIConstraint2DBuilder.js +138 -0
- package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.js +3 -0
- package/dist/core/constraints/builders/UICoverConstraintBuilder.js +63 -0
- package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.js +3 -0
- package/dist/core/constraints/builders/UIFitConstraintBuilder.js +63 -0
- package/dist/{elements → core/elements}/UIAnchor/UIAnchor.Internal.d.ts +3 -0
- package/dist/core/elements/UIAnchor/UIAnchor.Internal.js +5 -0
- package/dist/{elements → core/elements}/UIAnchor/UIAnchor.d.ts +3 -3
- package/dist/core/elements/UIAnchor/UIAnchor.js +49 -0
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.js +15 -0
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.js +259 -0
- package/dist/core/elements/UIDummy/UIDummy.Internal.js +8 -0
- package/dist/{elements → core/elements}/UIDummy/UIDummy.d.ts +2 -2
- package/dist/core/elements/UIDummy/UIDummy.js +173 -0
- package/dist/core/elements/UIElement/UIElement.Internal.js +5 -0
- package/dist/{elements → core/elements}/UIElement/UIElement.d.ts +2 -2
- package/dist/core/elements/UIElement/UIElement.js +74 -0
- package/dist/core/elements/UIGraphics/UIGraphics.Internal.js +7 -0
- package/dist/core/elements/UIGraphics/UIGraphics.js +126 -0
- package/dist/core/elements/UIImage/UIImage.js +85 -0
- package/dist/core/elements/UINineSlice/UINineSlice.Internal.js +12 -0
- package/dist/core/elements/UINineSlice/UINineSlice.js +188 -0
- package/dist/core/elements/UIProgress/UIProgress.Internal.js +3 -0
- package/dist/core/elements/UIProgress/UIProgress.js +165 -0
- package/dist/core/elements/UIScene/UIScene.Internal.js +27 -0
- package/dist/core/elements/UIScene/UIScene.js +157 -0
- package/dist/core/elements/UIText/UIText.Internal.js +12 -0
- package/dist/core/elements/UIText/UIText.Measuring.js +153 -0
- package/dist/core/elements/UIText/UIText.Rendering.js +61 -0
- package/dist/core/elements/UIText/UIText.js +265 -0
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.js +5 -0
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.js +147 -0
- package/dist/core/layers/UILayer/UILayer.Internal.js +7 -0
- package/dist/core/layers/UILayer/UILayer.js +113 -0
- package/dist/core/miscellaneous/UIExpression.js +128 -0
- package/dist/core/miscellaneous/UIMode.js +30 -0
- package/dist/core/miscellaneous/UIOrientation.js +20 -0
- package/dist/core/miscellaneous/UIPriority.js +63 -0
- package/dist/core/miscellaneous/UIRelation.js +40 -0
- package/dist/core/miscellaneous/UITransparencyMode.js +12 -0
- package/dist/core/miscellaneous/area/UIArea.js +5 -0
- package/dist/core/miscellaneous/area/UIAreaCircle.js +32 -0
- package/dist/core/miscellaneous/area/UIAreaPolygon.js +40 -0
- package/dist/core/miscellaneous/area/UIAreaRectangle.js +36 -0
- package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.js +72 -0
- package/dist/core/miscellaneous/asserts.js +163 -0
- package/dist/core/miscellaneous/canvas.js +37 -0
- package/dist/core/miscellaneous/color/UIColor.Internal.js +42 -0
- package/dist/core/miscellaneous/color/UIColor.js +636 -0
- package/dist/core/miscellaneous/computeTransform.js +82 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.js +168 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.js +349 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.js +357 -0
- package/dist/core/miscellaneous/generic-plane/shared.js +228 -0
- package/dist/core/miscellaneous/insets/UIInsets.Internal.js +3 -0
- package/dist/core/miscellaneous/insets/UIInsets.js +224 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.js +19 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.js +51 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.js +48 -0
- package/dist/{miscellaneous → core/miscellaneous}/math.d.ts +2 -0
- package/dist/core/miscellaneous/math.js +11 -0
- package/dist/core/miscellaneous/micro/UIMicro.Internal.js +15 -0
- package/dist/core/miscellaneous/micro/UIMicro.js +181 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicy.js +9 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.js +50 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.js +52 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.js +52 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.js +50 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.js +52 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.js +52 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.js +13 -0
- package/dist/core/miscellaneous/shared.js +37 -0
- package/dist/core/miscellaneous/text-span/UITextSpan.js +36 -0
- package/dist/core/miscellaneous/text-style/UITextStyle.Internal.js +17 -0
- package/dist/core/miscellaneous/text-style/UITextStyle.js +372 -0
- package/dist/core/miscellaneous/texture/UITextureView.Internal.js +6 -0
- package/dist/core/miscellaneous/texture/UITextureView.js +234 -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/{wrappers → core/wrappers}/UIInputWrapper/UIInputWrapper.Internal.d.ts +1 -1
- package/dist/{wrappers → core/wrappers}/UIInputWrapper/UIInputWrapper.d.ts +2 -2
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.js +108 -0
- package/dist/{wrappers → core/wrappers}/UISceneWrapper/UISceneWrapper.Internal.d.ts +1 -1
- package/dist/{wrappers → core/wrappers}/UISceneWrapper/UISceneWrapper.d.ts +2 -2
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.js +75 -0
- package/dist/{wrappers → core/wrappers}/UISolverWrapper/UISolverWrapper.Internal.d.ts +1 -1
- package/dist/{wrappers → core/wrappers}/UISolverWrapper/UISolverWrapper.d.ts +2 -2
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.js +505 -0
- package/dist/index.js +51 -9246
- 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.d.ts +18 -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 +27 -36
- package/dist/index.js.map +0 -1
- package/dist/index.min.js +0 -2
- package/dist/index.min.js.map +0 -1
- /package/dist/{constraints → core/constraints}/UIAspectConstraint/UIAspectConstraint.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIAspectConstraint/UIAspectConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UICustomConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIHeightConstraint/UIHeightConstraint.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIHeightConstraint/UIHeightConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UISingleParameterConstraint/UISingleParameterConstraint.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UISingleParameterConstraint/UISingleParameterConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIVerticalProportionConstraint/UIVerticalProportionConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIWidthConstraint/UIWidthConstraint.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/UIWidthConstraint/UIWidthConstraint.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/builders/UIConstraint2DBuilder.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/builders/UIConstraint2DBuilder.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/builders/UICoverConstraintBuilder.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/builders/UICoverConstraintBuilder.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/builders/UIFitConstraintBuilder.Internal.d.ts +0 -0
- /package/dist/{constraints → core/constraints}/builders/UIFitConstraintBuilder.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIAnimatedImage/UIAnimatedImage.Internal.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIAnimatedImage/UIAnimatedImage.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIDummy/UIDummy.Internal.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIElement/UIElement.Internal.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIGraphics/UIGraphics.Internal.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIGraphics/UIGraphics.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIImage/UIImage.Internal.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIImage/UIImage.d.ts +0 -0
- /package/dist/{elements → core/elements}/UINineSlice/UINineSlice.Internal.d.ts +0 -0
- /package/dist/{elements → core/elements}/UINineSlice/UINineSlice.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIProgress/UIProgress.Internal.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIProgress/UIProgress.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIScene/UIScene.Internal.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIScene/UIScene.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIText/UIText.Interfaces.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIText/UIText.Internal.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIText/UIText.Measuring.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIText/UIText.Rendering.d.ts +0 -0
- /package/dist/{elements → core/elements}/UIText/UIText.d.ts +0 -0
- /package/dist/{index.d.ts → core/index.d.ts} +0 -0
- /package/dist/{layers → core/layers}/UIFullscreenLayer/UIFullscreenLayer.Internal.d.ts +0 -0
- /package/dist/{layers → core/layers}/UIFullscreenLayer/UIFullscreenLayer.d.ts +0 -0
- /package/dist/{layers → core/layers}/UILayer/UILayer.Internal.d.ts +0 -0
- /package/dist/{layers → core/layers}/UILayer/UILayer.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/UIExpression.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/UIMode.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/UIOrientation.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/UIPriority.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/UIRelation.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/UITransparencyMode.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/area/UIArea.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/area/UIAreaCircle.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/area/UIAreaPolygon.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/area/UIAreaRectangle.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/area/UIAreaRoundedRectangle.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/asserts.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/canvas.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/color/UIColor.Internal.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/color/UIColor.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/computeTransform.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/generic-plane/shared.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/insets/UIInsets.Internal.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/insets/UIInsets.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/mask-function/UIProgressMaskFunction.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/mask-function/UIProgressMaskFunctionCircular.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/mask-function/UIProgressMaskFunctionDirectional.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/micro/UIMicro.Internal.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/micro/UIMicro.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/resize-policy/UIResizePolicy.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/resize-policy/UIResizePolicyCover.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/resize-policy/UIResizePolicyCross.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/resize-policy/UIResizePolicyCrossInverted.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/resize-policy/UIResizePolicyFit.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/resize-policy/UIResizePolicyFixedHeight.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/resize-policy/UIResizePolicyFixedWidth.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/resize-policy/UIResizePolicyNone.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/shared.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/text-span/UITextSpan.Internal.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/text-span/UITextSpan.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/text-style/UITextStyle.Internal.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/text-style/UITextStyle.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/texture/UITextureView.Internal.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/texture/UITextureView.d.ts +0 -0
- /package/dist/{miscellaneous → core/miscellaneous}/webglCapabilities.d.ts +0 -0
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { Vector4 } from 'three';
|
|
2
|
+
import { assertValidNonNegativeNumber } from '../asserts.js';
|
|
3
|
+
import { INSETS_DEFAULT_VALUE } from './UIInsets.Internal.js';
|
|
4
|
+
|
|
5
|
+
/** Insets values for four sides */
|
|
6
|
+
class UIInsets {
|
|
7
|
+
/**
|
|
8
|
+
* Creates UIInsets instance.
|
|
9
|
+
*
|
|
10
|
+
* @param config - Insets configuration
|
|
11
|
+
*/
|
|
12
|
+
constructor(config) {
|
|
13
|
+
this._private_lInternal = INSETS_DEFAULT_VALUE;
|
|
14
|
+
this._private_rInternal = INSETS_DEFAULT_VALUE;
|
|
15
|
+
this._private_tInternal = INSETS_DEFAULT_VALUE;
|
|
16
|
+
this._private_bInternal = INSETS_DEFAULT_VALUE;
|
|
17
|
+
this._private_dirtyInternal = false;
|
|
18
|
+
this.set(config);
|
|
19
|
+
}
|
|
20
|
+
/** Left inset */
|
|
21
|
+
get left() {
|
|
22
|
+
return this._private_lInternal;
|
|
23
|
+
}
|
|
24
|
+
/** Right inset */
|
|
25
|
+
get right() {
|
|
26
|
+
return this._private_rInternal;
|
|
27
|
+
}
|
|
28
|
+
/** Top inset */
|
|
29
|
+
get top() {
|
|
30
|
+
return this._private_tInternal;
|
|
31
|
+
}
|
|
32
|
+
/** Bottom inset */
|
|
33
|
+
get bottom() {
|
|
34
|
+
return this._private_bInternal;
|
|
35
|
+
}
|
|
36
|
+
/** @internal */
|
|
37
|
+
get dirty() {
|
|
38
|
+
return this._private_dirtyInternal;
|
|
39
|
+
}
|
|
40
|
+
/** Left inset */
|
|
41
|
+
set left(value) {
|
|
42
|
+
assertValidNonNegativeNumber(value, "UIInsets.left");
|
|
43
|
+
if (this._private_lInternal !== value) {
|
|
44
|
+
this._private_lInternal = value;
|
|
45
|
+
this._private_dirtyInternal = true;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/** Right inset */
|
|
49
|
+
set right(value) {
|
|
50
|
+
assertValidNonNegativeNumber(value, "UIInsets.right");
|
|
51
|
+
if (this._private_rInternal !== value) {
|
|
52
|
+
this._private_rInternal = value;
|
|
53
|
+
this._private_dirtyInternal = true;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/** Top inset */
|
|
57
|
+
set top(value) {
|
|
58
|
+
assertValidNonNegativeNumber(value, "UIInsets.top");
|
|
59
|
+
if (this._private_tInternal !== value) {
|
|
60
|
+
this._private_tInternal = value;
|
|
61
|
+
this._private_dirtyInternal = true;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/** Bottom inset */
|
|
65
|
+
set bottom(value) {
|
|
66
|
+
assertValidNonNegativeNumber(value, "UIInsets.bottom");
|
|
67
|
+
if (this._private_bInternal !== value) {
|
|
68
|
+
this._private_bInternal = value;
|
|
69
|
+
this._private_dirtyInternal = true;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/** Sets left and right to same value */
|
|
73
|
+
setHorizontal(value) {
|
|
74
|
+
assertValidNonNegativeNumber(value, "UIInsets.setHorizontal.value");
|
|
75
|
+
if (this._private_lInternal !== value || this._private_rInternal !== value) {
|
|
76
|
+
this._private_lInternal = value;
|
|
77
|
+
this._private_rInternal = value;
|
|
78
|
+
this._private_dirtyInternal = true;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/** Sets top and bottom to same value */
|
|
82
|
+
setVertical(value) {
|
|
83
|
+
assertValidNonNegativeNumber(value, "UIInsets.setVertical.value");
|
|
84
|
+
if (this._private_tInternal !== value || this._private_bInternal !== value) {
|
|
85
|
+
this._private_tInternal = value;
|
|
86
|
+
this._private_bInternal = value;
|
|
87
|
+
this._private_dirtyInternal = true;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/** Sets all sides to same value */
|
|
91
|
+
setUnified(value) {
|
|
92
|
+
assertValidNonNegativeNumber(value, "UIInsets.setUnified.value");
|
|
93
|
+
if (this._private_lInternal !== value ||
|
|
94
|
+
this._private_rInternal !== value ||
|
|
95
|
+
this._private_tInternal !== value ||
|
|
96
|
+
this._private_bInternal !== value) {
|
|
97
|
+
this._private_lInternal = value;
|
|
98
|
+
this._private_rInternal = value;
|
|
99
|
+
this._private_tInternal = value;
|
|
100
|
+
this._private_bInternal = value;
|
|
101
|
+
this._private_dirtyInternal = true;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/** Sets insets */
|
|
105
|
+
set(config) {
|
|
106
|
+
const lOld = this._private_lInternal;
|
|
107
|
+
const rOld = this._private_rInternal;
|
|
108
|
+
const tOld = this._private_tInternal;
|
|
109
|
+
const bOld = this._private_bInternal;
|
|
110
|
+
if (config === undefined) {
|
|
111
|
+
this._private_lInternal = INSETS_DEFAULT_VALUE;
|
|
112
|
+
this._private_rInternal = INSETS_DEFAULT_VALUE;
|
|
113
|
+
this._private_tInternal = INSETS_DEFAULT_VALUE;
|
|
114
|
+
this._private_bInternal = INSETS_DEFAULT_VALUE;
|
|
115
|
+
}
|
|
116
|
+
else if (typeof config === "number") {
|
|
117
|
+
assertValidNonNegativeNumber(config, "UIInsets.set.config");
|
|
118
|
+
this._private_lInternal = config;
|
|
119
|
+
this._private_rInternal = config;
|
|
120
|
+
this._private_tInternal = config;
|
|
121
|
+
this._private_bInternal = config;
|
|
122
|
+
}
|
|
123
|
+
else if (Array.isArray(config)) {
|
|
124
|
+
if (config.length === 2) {
|
|
125
|
+
const horizontal = config[0];
|
|
126
|
+
const vertical = config[1];
|
|
127
|
+
assertValidNonNegativeNumber(horizontal, "UIInsets.set.config[0]");
|
|
128
|
+
assertValidNonNegativeNumber(vertical, "UIInsets.set.config[1]");
|
|
129
|
+
this._private_lInternal = horizontal;
|
|
130
|
+
this._private_rInternal = horizontal;
|
|
131
|
+
this._private_tInternal = vertical;
|
|
132
|
+
this._private_bInternal = vertical;
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
const left = config[0];
|
|
136
|
+
const right = config[1];
|
|
137
|
+
const top = config[2];
|
|
138
|
+
const bottom = config[3];
|
|
139
|
+
assertValidNonNegativeNumber(left, "UIInsets.set.config[0]");
|
|
140
|
+
assertValidNonNegativeNumber(right, "UIInsets.set.config[1]");
|
|
141
|
+
assertValidNonNegativeNumber(top, "UIInsets.set.config[2]");
|
|
142
|
+
assertValidNonNegativeNumber(bottom, "UIInsets.set.config[3]");
|
|
143
|
+
this._private_lInternal = left;
|
|
144
|
+
this._private_rInternal = right;
|
|
145
|
+
this._private_tInternal = top;
|
|
146
|
+
this._private_bInternal = bottom;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
else if ("left" in config) {
|
|
150
|
+
const left = config.left;
|
|
151
|
+
const right = config.right;
|
|
152
|
+
const top = config.top;
|
|
153
|
+
const bottom = config.bottom;
|
|
154
|
+
assertValidNonNegativeNumber(left, "UIInsets.set.config.left");
|
|
155
|
+
assertValidNonNegativeNumber(right, "UIInsets.set.config.right");
|
|
156
|
+
assertValidNonNegativeNumber(top, "UIInsets.set.config.top");
|
|
157
|
+
assertValidNonNegativeNumber(bottom, "UIInsets.set.config.bottom");
|
|
158
|
+
this._private_lInternal = left;
|
|
159
|
+
this._private_rInternal = right;
|
|
160
|
+
this._private_tInternal = top;
|
|
161
|
+
this._private_bInternal = bottom;
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
const horizontal = config.horizontal;
|
|
165
|
+
const vertical = config.vertical;
|
|
166
|
+
assertValidNonNegativeNumber(horizontal, "UIInsets.set.config.horizontal");
|
|
167
|
+
assertValidNonNegativeNumber(vertical, "UIInsets.set.config.vertical");
|
|
168
|
+
this._private_lInternal = horizontal;
|
|
169
|
+
this._private_rInternal = horizontal;
|
|
170
|
+
this._private_tInternal = vertical;
|
|
171
|
+
this._private_bInternal = vertical;
|
|
172
|
+
}
|
|
173
|
+
if (this._private_lInternal !== lOld ||
|
|
174
|
+
this._private_rInternal !== rOld ||
|
|
175
|
+
this._private_tInternal !== tOld ||
|
|
176
|
+
this._private_bInternal !== bOld) {
|
|
177
|
+
this._private_dirtyInternal = true;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
/** Sets from Vector4 (x=left, y=right, z=top, w=bottom) */
|
|
181
|
+
setVector4(vector) {
|
|
182
|
+
assertValidNonNegativeNumber(vector.x, "UIInsets.setVector4.vector.x");
|
|
183
|
+
assertValidNonNegativeNumber(vector.y, "UIInsets.setVector4.vector.y");
|
|
184
|
+
assertValidNonNegativeNumber(vector.z, "UIInsets.setVector4.vector.z");
|
|
185
|
+
assertValidNonNegativeNumber(vector.w, "UIInsets.setVector4.vector.w");
|
|
186
|
+
if (this._private_lInternal !== vector.x ||
|
|
187
|
+
this._private_rInternal !== vector.y ||
|
|
188
|
+
this._private_tInternal !== vector.z ||
|
|
189
|
+
this._private_bInternal !== vector.w) {
|
|
190
|
+
this._private_lInternal = vector.x;
|
|
191
|
+
this._private_rInternal = vector.y;
|
|
192
|
+
this._private_tInternal = vector.z;
|
|
193
|
+
this._private_bInternal = vector.w;
|
|
194
|
+
this._private_dirtyInternal = true;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
/** Converts to Vector4 (left, right, top, bottom) */
|
|
198
|
+
toVector4(result = new Vector4()) {
|
|
199
|
+
return result.set(this._private_lInternal, this._private_rInternal, this._private_tInternal, this._private_bInternal);
|
|
200
|
+
}
|
|
201
|
+
/** Resets all sides to 0 */
|
|
202
|
+
reset() {
|
|
203
|
+
this.setUnified(0);
|
|
204
|
+
}
|
|
205
|
+
/** Copies from another instance */
|
|
206
|
+
copy(other) {
|
|
207
|
+
if (this._private_lInternal !== other._private_lInternal ||
|
|
208
|
+
this._private_rInternal !== other._private_rInternal ||
|
|
209
|
+
this._private_tInternal !== other._private_tInternal ||
|
|
210
|
+
this._private_bInternal !== other._private_bInternal) {
|
|
211
|
+
this._private_lInternal = other._private_lInternal;
|
|
212
|
+
this._private_rInternal = other._private_rInternal;
|
|
213
|
+
this._private_tInternal = other._private_tInternal;
|
|
214
|
+
this._private_bInternal = other._private_bInternal;
|
|
215
|
+
this._private_dirtyInternal = true;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
/** @internal */
|
|
219
|
+
setDirtyFalse() {
|
|
220
|
+
this._private_dirtyInternal = false;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export { UIInsets };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Base class for progress bar fill functions */
|
|
2
|
+
class UIProgressMaskFunction {
|
|
3
|
+
constructor(
|
|
4
|
+
/** GLSL shader source code defining fill behavior */
|
|
5
|
+
source) {
|
|
6
|
+
this.source = source;
|
|
7
|
+
this.dirtyInternal = false;
|
|
8
|
+
}
|
|
9
|
+
/** @internal */
|
|
10
|
+
get dirty() {
|
|
11
|
+
return this.dirtyInternal;
|
|
12
|
+
}
|
|
13
|
+
/** @internal */
|
|
14
|
+
setDirtyFalse() {
|
|
15
|
+
this.dirtyInternal = false;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { UIProgressMaskFunction };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import source from '../../shaders/UIProgressMaskFunctionCircular.glsl.js';
|
|
2
|
+
import { assertValidNumber } from '../asserts.js';
|
|
3
|
+
import { UIProgressMaskFunction } from './UIProgressMaskFunction.js';
|
|
4
|
+
|
|
5
|
+
/** Circular radial progress fill */
|
|
6
|
+
class UIProgressMaskFunctionCircular extends UIProgressMaskFunction {
|
|
7
|
+
/**
|
|
8
|
+
* Creates circular mask function.
|
|
9
|
+
*
|
|
10
|
+
* @param startAngle - Starting angle in radians
|
|
11
|
+
* @param inverseDirection - Whether to fill counter-clockwise
|
|
12
|
+
*/
|
|
13
|
+
constructor(startAngle = 0, inverseDirection = false) {
|
|
14
|
+
assertValidNumber(startAngle, "UIProgressMaskFunctionCircular.constructor.startAngle");
|
|
15
|
+
super(source);
|
|
16
|
+
this._private_startAngleInternal = startAngle;
|
|
17
|
+
this._private_inverseDirectionInternal = inverseDirection;
|
|
18
|
+
}
|
|
19
|
+
/** Starting angle in radians */
|
|
20
|
+
get startAngle() {
|
|
21
|
+
return this._private_startAngleInternal;
|
|
22
|
+
}
|
|
23
|
+
/** Whether fill is counter-clockwise */
|
|
24
|
+
get inverseDirection() {
|
|
25
|
+
return this._private_inverseDirectionInternal;
|
|
26
|
+
}
|
|
27
|
+
/** Starting angle in radians */
|
|
28
|
+
set startAngle(value) {
|
|
29
|
+
assertValidNumber(value, "UIProgressMaskFunctionCircular.startAngle");
|
|
30
|
+
if (this._private_startAngleInternal !== value) {
|
|
31
|
+
this._private_startAngleInternal = value;
|
|
32
|
+
this.dirtyInternal = true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/** Whether fill is counter-clockwise */
|
|
36
|
+
set inverseDirection(value) {
|
|
37
|
+
if (this._private_inverseDirectionInternal !== value) {
|
|
38
|
+
this._private_inverseDirectionInternal = value;
|
|
39
|
+
this.dirtyInternal = true;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/** @internal */
|
|
43
|
+
enumerateProperties() {
|
|
44
|
+
return {
|
|
45
|
+
direction: this._private_inverseDirectionInternal ? -1 : 1,
|
|
46
|
+
startAngle: this._private_startAngleInternal,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export { UIProgressMaskFunctionCircular };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Vector2 } from 'three';
|
|
2
|
+
import source from '../../shaders/UIProgressMaskFunctionDirectional.glsl.js';
|
|
3
|
+
import { EPSILON } from '../math.js';
|
|
4
|
+
import { UIProgressMaskFunction } from './UIProgressMaskFunction.js';
|
|
5
|
+
|
|
6
|
+
/** Linear directional progress fill */
|
|
7
|
+
class UIProgressMaskFunctionDirectional extends UIProgressMaskFunction {
|
|
8
|
+
/**
|
|
9
|
+
* Creates directional mask function.
|
|
10
|
+
*
|
|
11
|
+
* @param direction - Fill direction vector. Automatically normalized.
|
|
12
|
+
*/
|
|
13
|
+
constructor(direction = { x: 1, y: 0 }) {
|
|
14
|
+
super(source);
|
|
15
|
+
/** Fill direction as normalized vector */
|
|
16
|
+
this.direction = new Vector2();
|
|
17
|
+
this._private_cachedDirection = new Vector2();
|
|
18
|
+
this.direction.set(direction.x, direction.y).normalize();
|
|
19
|
+
this._private_cachedDirection.copy(this.direction);
|
|
20
|
+
}
|
|
21
|
+
/** @internal */
|
|
22
|
+
get dirty() {
|
|
23
|
+
this._private_ensureDirectionNormalized();
|
|
24
|
+
return this.dirtyInternal || !this._private_cachedDirection.equals(this.direction);
|
|
25
|
+
}
|
|
26
|
+
/** @internal */
|
|
27
|
+
setDirtyFalse() {
|
|
28
|
+
this._private_ensureDirectionNormalized();
|
|
29
|
+
this._private_cachedDirection.copy(this.direction);
|
|
30
|
+
super.setDirtyFalse();
|
|
31
|
+
}
|
|
32
|
+
/** @internal */
|
|
33
|
+
enumerateProperties() {
|
|
34
|
+
this._private_ensureDirectionNormalized();
|
|
35
|
+
return { direction: this.direction };
|
|
36
|
+
}
|
|
37
|
+
_private_ensureDirectionNormalized() {
|
|
38
|
+
const squaredLength = this.direction.lengthSq();
|
|
39
|
+
if (Math.abs(squaredLength) <= EPSILON) {
|
|
40
|
+
this.direction.set(1, 0);
|
|
41
|
+
}
|
|
42
|
+
else if (Math.abs(squaredLength - 1) > EPSILON) {
|
|
43
|
+
this.direction.divideScalar(squaredLength);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { UIProgressMaskFunctionDirectional };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const EPSILON = 1e-6;
|
|
2
|
+
function srgbToLinear(color) {
|
|
3
|
+
return color < 0.04045
|
|
4
|
+
? color * 0.0773993808
|
|
5
|
+
: Math.pow(color * 0.9478672986 + 0.0521327014, 2.4);
|
|
6
|
+
}
|
|
7
|
+
function linearToSRGB(color) {
|
|
8
|
+
return color < 0.0031308 ? color * 12.92 : 1.055 * Math.pow(color, 0.41666) - 0.055;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { EPSILON, linearToSRGB, srgbToLinear };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Controls which transforms apply relative to anchor */
|
|
2
|
+
var UIMicroAnchorMode;
|
|
3
|
+
(function (UIMicroAnchorMode) {
|
|
4
|
+
/** Apply rotation and scale around anchor point */
|
|
5
|
+
UIMicroAnchorMode[UIMicroAnchorMode["ROTATION_SCALE"] = 0] = "ROTATION_SCALE";
|
|
6
|
+
/** Apply position, rotation, and scale around anchor point */
|
|
7
|
+
UIMicroAnchorMode[UIMicroAnchorMode["POSITION_ROTATION_SCALE"] = 1] = "POSITION_ROTATION_SCALE";
|
|
8
|
+
})(UIMicroAnchorMode || (UIMicroAnchorMode = {}));
|
|
9
|
+
const MICRO_DEFAULT_POSITION = 0;
|
|
10
|
+
const MICRO_DEFAULT_ANCHOR = 0.5;
|
|
11
|
+
const MICRO_DEFAULT_SCALE = 1;
|
|
12
|
+
const MICRO_DEFAULT_ROTATION = 0;
|
|
13
|
+
const MICRO_DEFAULT_ANCHOR_MODE = UIMicroAnchorMode.ROTATION_SCALE;
|
|
14
|
+
|
|
15
|
+
export { MICRO_DEFAULT_ANCHOR, MICRO_DEFAULT_ANCHOR_MODE, MICRO_DEFAULT_POSITION, MICRO_DEFAULT_ROTATION, MICRO_DEFAULT_SCALE, UIMicroAnchorMode };
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { MathUtils } from 'three';
|
|
2
|
+
import { assertValidNumber } from '../asserts.js';
|
|
3
|
+
import { MICRO_DEFAULT_POSITION, MICRO_DEFAULT_ANCHOR, MICRO_DEFAULT_SCALE, MICRO_DEFAULT_ROTATION, MICRO_DEFAULT_ANCHOR_MODE } from './UIMicro.Internal.js';
|
|
4
|
+
|
|
5
|
+
/** Transforms that don't affect constraints */
|
|
6
|
+
class UIMicro {
|
|
7
|
+
/**
|
|
8
|
+
* Creates UIMicro instance.
|
|
9
|
+
*
|
|
10
|
+
* @param config - Transform configuration
|
|
11
|
+
*/
|
|
12
|
+
constructor(config) {
|
|
13
|
+
this._private_dirtyInternal = true;
|
|
14
|
+
this._private_xInternal = config?.x ?? MICRO_DEFAULT_POSITION;
|
|
15
|
+
this._private_yInternal = config?.y ?? MICRO_DEFAULT_POSITION;
|
|
16
|
+
this._private_anchorXInternal = config?.anchorX ?? MICRO_DEFAULT_ANCHOR;
|
|
17
|
+
this._private_anchorYInternal = config?.anchorY ?? MICRO_DEFAULT_ANCHOR;
|
|
18
|
+
this._private_scaleXInternal = config?.scaleX ?? MICRO_DEFAULT_SCALE;
|
|
19
|
+
this._private_scaleYInternal = config?.scaleY ?? MICRO_DEFAULT_SCALE;
|
|
20
|
+
this._private_rotationInternal = config?.rotation ?? MICRO_DEFAULT_ROTATION;
|
|
21
|
+
this._private_anchorModeInternal = config?.anchorMode ?? MICRO_DEFAULT_ANCHOR_MODE;
|
|
22
|
+
}
|
|
23
|
+
/** X offset in world units */
|
|
24
|
+
get x() {
|
|
25
|
+
return this._private_xInternal;
|
|
26
|
+
}
|
|
27
|
+
/** Y offset in world units */
|
|
28
|
+
get y() {
|
|
29
|
+
return this._private_yInternal;
|
|
30
|
+
}
|
|
31
|
+
/** X anchor in normalized coordinates (0 to 1) */
|
|
32
|
+
get anchorX() {
|
|
33
|
+
return this._private_anchorXInternal;
|
|
34
|
+
}
|
|
35
|
+
/** Y anchor in normalized coordinates (0 to 1) */
|
|
36
|
+
get anchorY() {
|
|
37
|
+
return this._private_anchorYInternal;
|
|
38
|
+
}
|
|
39
|
+
/** X scale multiplier */
|
|
40
|
+
get scaleX() {
|
|
41
|
+
return this._private_scaleXInternal;
|
|
42
|
+
}
|
|
43
|
+
/** Y scale multiplier */
|
|
44
|
+
get scaleY() {
|
|
45
|
+
return this._private_scaleYInternal;
|
|
46
|
+
}
|
|
47
|
+
/** Rotation in degrees */
|
|
48
|
+
get angle() {
|
|
49
|
+
return MathUtils.radToDeg(this._private_rotationInternal);
|
|
50
|
+
}
|
|
51
|
+
/** Which transforms apply relative to anchor */
|
|
52
|
+
get anchorMode() {
|
|
53
|
+
return this._private_anchorModeInternal;
|
|
54
|
+
}
|
|
55
|
+
/** Rotation in radians */
|
|
56
|
+
get rotation() {
|
|
57
|
+
return this._private_rotationInternal;
|
|
58
|
+
}
|
|
59
|
+
/** @internal */
|
|
60
|
+
get dirty() {
|
|
61
|
+
return this._private_dirtyInternal;
|
|
62
|
+
}
|
|
63
|
+
/** X offset in world units */
|
|
64
|
+
set x(value) {
|
|
65
|
+
assertValidNumber(value, "UIMicro.x");
|
|
66
|
+
if (value !== this._private_xInternal) {
|
|
67
|
+
this._private_xInternal = value;
|
|
68
|
+
this._private_dirtyInternal = true;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/** Y offset in world units */
|
|
72
|
+
set y(value) {
|
|
73
|
+
assertValidNumber(value, "UIMicro.y");
|
|
74
|
+
if (value !== this._private_yInternal) {
|
|
75
|
+
this._private_yInternal = value;
|
|
76
|
+
this._private_dirtyInternal = true;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/** X anchor in normalized coordinates (0 to 1) */
|
|
80
|
+
set anchorX(value) {
|
|
81
|
+
assertValidNumber(value, "UIMicro.anchorX");
|
|
82
|
+
if (value !== this._private_anchorXInternal) {
|
|
83
|
+
this._private_anchorXInternal = value;
|
|
84
|
+
this._private_dirtyInternal = true;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/** Y anchor in normalized coordinates (0 to 1) */
|
|
88
|
+
set anchorY(value) {
|
|
89
|
+
assertValidNumber(value, "UIMicro.anchorY");
|
|
90
|
+
if (value !== this._private_anchorYInternal) {
|
|
91
|
+
this._private_anchorYInternal = value;
|
|
92
|
+
this._private_dirtyInternal = true;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
/** X scale multiplier */
|
|
96
|
+
set scaleX(value) {
|
|
97
|
+
assertValidNumber(value, "UIMicro.scaleX");
|
|
98
|
+
if (value !== this._private_scaleXInternal) {
|
|
99
|
+
this._private_scaleXInternal = value;
|
|
100
|
+
this._private_dirtyInternal = true;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/** Y scale multiplier */
|
|
104
|
+
set scaleY(value) {
|
|
105
|
+
assertValidNumber(value, "UIMicro.scaleY");
|
|
106
|
+
if (value !== this._private_scaleYInternal) {
|
|
107
|
+
this._private_scaleYInternal = value;
|
|
108
|
+
this._private_dirtyInternal = true;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
/** Rotation in degrees */
|
|
112
|
+
set angle(value) {
|
|
113
|
+
assertValidNumber(value, "UIMicro.angle");
|
|
114
|
+
const rotation = MathUtils.degToRad(value);
|
|
115
|
+
if (rotation !== this._private_rotationInternal) {
|
|
116
|
+
this._private_rotationInternal = rotation;
|
|
117
|
+
this._private_dirtyInternal = true;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/** Rotation in radians */
|
|
121
|
+
set rotation(value) {
|
|
122
|
+
assertValidNumber(value, "UIMicro.rotation");
|
|
123
|
+
if (value !== this._private_rotationInternal) {
|
|
124
|
+
this._private_rotationInternal = value;
|
|
125
|
+
this._private_dirtyInternal = true;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
/** Which transforms apply relative to anchor */
|
|
129
|
+
set anchorMode(value) {
|
|
130
|
+
if (value !== this._private_anchorModeInternal) {
|
|
131
|
+
this._private_anchorModeInternal = value;
|
|
132
|
+
this._private_dirtyInternal = true;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
/** @internal */
|
|
136
|
+
setDirtyFalse() {
|
|
137
|
+
this._private_dirtyInternal = false;
|
|
138
|
+
}
|
|
139
|
+
/** Resets all transforms to defaults */
|
|
140
|
+
reset() {
|
|
141
|
+
if (this._private_xInternal !== MICRO_DEFAULT_POSITION ||
|
|
142
|
+
this._private_yInternal !== MICRO_DEFAULT_POSITION ||
|
|
143
|
+
this._private_anchorXInternal !== MICRO_DEFAULT_ANCHOR ||
|
|
144
|
+
this._private_anchorYInternal !== MICRO_DEFAULT_ANCHOR ||
|
|
145
|
+
this._private_scaleXInternal !== MICRO_DEFAULT_SCALE ||
|
|
146
|
+
this._private_scaleYInternal !== MICRO_DEFAULT_SCALE ||
|
|
147
|
+
this._private_rotationInternal !== MICRO_DEFAULT_ROTATION) {
|
|
148
|
+
this._private_xInternal = MICRO_DEFAULT_POSITION;
|
|
149
|
+
this._private_yInternal = MICRO_DEFAULT_POSITION;
|
|
150
|
+
this._private_anchorXInternal = MICRO_DEFAULT_ANCHOR;
|
|
151
|
+
this._private_anchorYInternal = MICRO_DEFAULT_ANCHOR;
|
|
152
|
+
this._private_scaleXInternal = MICRO_DEFAULT_SCALE;
|
|
153
|
+
this._private_scaleYInternal = MICRO_DEFAULT_SCALE;
|
|
154
|
+
this._private_rotationInternal = MICRO_DEFAULT_ROTATION;
|
|
155
|
+
this._private_dirtyInternal = true;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
/** Copies transforms from another instance */
|
|
159
|
+
copy(value) {
|
|
160
|
+
if (this._private_xInternal !== value._private_xInternal ||
|
|
161
|
+
this._private_yInternal !== value._private_yInternal ||
|
|
162
|
+
this._private_anchorXInternal !== value._private_anchorXInternal ||
|
|
163
|
+
this._private_anchorYInternal !== value._private_anchorYInternal ||
|
|
164
|
+
this._private_scaleXInternal !== value._private_scaleXInternal ||
|
|
165
|
+
this._private_scaleYInternal !== value._private_scaleYInternal ||
|
|
166
|
+
this._private_rotationInternal !== value._private_rotationInternal ||
|
|
167
|
+
this._private_anchorModeInternal !== value._private_anchorModeInternal) {
|
|
168
|
+
this._private_xInternal = value._private_xInternal;
|
|
169
|
+
this._private_yInternal = value._private_yInternal;
|
|
170
|
+
this._private_anchorXInternal = value._private_anchorXInternal;
|
|
171
|
+
this._private_anchorYInternal = value._private_anchorYInternal;
|
|
172
|
+
this._private_scaleXInternal = value._private_scaleXInternal;
|
|
173
|
+
this._private_scaleYInternal = value._private_scaleYInternal;
|
|
174
|
+
this._private_rotationInternal = value._private_rotationInternal;
|
|
175
|
+
this._private_anchorModeInternal = value._private_anchorModeInternal;
|
|
176
|
+
this._private_dirtyInternal = true;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export { UIMicro };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { assertValidPositiveNumber } from '../asserts.js';
|
|
2
|
+
import { UIResizePolicy } from './UIResizePolicy.js';
|
|
3
|
+
|
|
4
|
+
/** Scales area to cover rect preserving proportions */
|
|
5
|
+
class UIResizePolicyCover extends UIResizePolicy {
|
|
6
|
+
/**
|
|
7
|
+
* Creates cover resize policy.
|
|
8
|
+
*
|
|
9
|
+
* @param rectWidth - Target rect width
|
|
10
|
+
* @param rectHeight - Target rect height
|
|
11
|
+
*/
|
|
12
|
+
constructor(rectWidth, rectHeight) {
|
|
13
|
+
super();
|
|
14
|
+
assertValidPositiveNumber(rectWidth, "UIResizePolicyCover.constructor.rectWidth");
|
|
15
|
+
assertValidPositiveNumber(rectHeight, "UIResizePolicyCover.constructor.rectHeight");
|
|
16
|
+
this._private_rectWidthInternal = rectWidth;
|
|
17
|
+
this._private_rectHeightInternal = rectHeight;
|
|
18
|
+
}
|
|
19
|
+
/** Target rect width */
|
|
20
|
+
get rectWidth() {
|
|
21
|
+
return this._private_rectWidthInternal;
|
|
22
|
+
}
|
|
23
|
+
/** Target rect height */
|
|
24
|
+
get rectHeight() {
|
|
25
|
+
return this._private_rectHeightInternal;
|
|
26
|
+
}
|
|
27
|
+
/** Target rect width */
|
|
28
|
+
set rectWidth(value) {
|
|
29
|
+
assertValidPositiveNumber(value, "UIResizePolicyCover.rectWidth");
|
|
30
|
+
if (value !== this._private_rectWidthInternal) {
|
|
31
|
+
this._private_rectWidthInternal = value;
|
|
32
|
+
this.dirty = true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/** Target rect height */
|
|
36
|
+
set rectHeight(value) {
|
|
37
|
+
assertValidPositiveNumber(value, "UIResizePolicyCover.rectHeight");
|
|
38
|
+
if (value !== this._private_rectHeightInternal) {
|
|
39
|
+
this._private_rectHeightInternal = value;
|
|
40
|
+
this.dirty = true;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
calculateScale(width, height) {
|
|
44
|
+
assertValidPositiveNumber(width, "UIResizePolicyCover.calculateScale.width");
|
|
45
|
+
assertValidPositiveNumber(height, "UIResizePolicyCover.calculateScale.height");
|
|
46
|
+
return Math.min(this._private_rectWidthInternal / width, this._private_rectHeightInternal / height);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export { UIResizePolicyCover };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { assertValidPositiveNumber } from '../asserts.js';
|
|
2
|
+
import { UIResizePolicy } from './UIResizePolicy.js';
|
|
3
|
+
|
|
4
|
+
/** Scales by width in landscape, by height in portrait */
|
|
5
|
+
class UIResizePolicyCross extends UIResizePolicy {
|
|
6
|
+
/**
|
|
7
|
+
* Creates cross resize policy.
|
|
8
|
+
*
|
|
9
|
+
* @param fixedWidthLandscape - Target width when landscape
|
|
10
|
+
* @param fixedHeightPortrait - Target height when portrait
|
|
11
|
+
*/
|
|
12
|
+
constructor(fixedWidthLandscape, fixedHeightPortrait) {
|
|
13
|
+
super();
|
|
14
|
+
assertValidPositiveNumber(fixedWidthLandscape, "UIResizePolicyCross.constructor.fixedWidthLandscape");
|
|
15
|
+
assertValidPositiveNumber(fixedHeightPortrait, "UIResizePolicyCross.constructor.fixedHeightPortrait");
|
|
16
|
+
this._private_fixedWidthLandscapeInternal = fixedWidthLandscape;
|
|
17
|
+
this._private_fixedHeightPortraitInternal = fixedHeightPortrait;
|
|
18
|
+
}
|
|
19
|
+
/** Target width when landscape */
|
|
20
|
+
get fixedWidthLandscape() {
|
|
21
|
+
return this._private_fixedWidthLandscapeInternal;
|
|
22
|
+
}
|
|
23
|
+
/** Target height when portrait */
|
|
24
|
+
get fixedHeightPortrait() {
|
|
25
|
+
return this._private_fixedHeightPortraitInternal;
|
|
26
|
+
}
|
|
27
|
+
/** Target width when landscape */
|
|
28
|
+
set fixedWidthLandscape(value) {
|
|
29
|
+
assertValidPositiveNumber(value, "UIResizePolicyCross.fixedWidthLandscape");
|
|
30
|
+
if (value !== this._private_fixedWidthLandscapeInternal) {
|
|
31
|
+
this._private_fixedWidthLandscapeInternal = value;
|
|
32
|
+
this.dirty = true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/** Target height when portrait */
|
|
36
|
+
set fixedHeightPortrait(value) {
|
|
37
|
+
assertValidPositiveNumber(value, "UIResizePolicyCross.fixedHeightPortrait");
|
|
38
|
+
if (value !== this._private_fixedHeightPortraitInternal) {
|
|
39
|
+
this._private_fixedHeightPortraitInternal = value;
|
|
40
|
+
this.dirty = true;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
calculateScale(width, height) {
|
|
44
|
+
assertValidPositiveNumber(width, "UIResizePolicyCross.calculateScale.width");
|
|
45
|
+
assertValidPositiveNumber(height, "UIResizePolicyCross.calculateScale.height");
|
|
46
|
+
return width > height
|
|
47
|
+
? this._private_fixedWidthLandscapeInternal / width
|
|
48
|
+
: this._private_fixedHeightPortraitInternal / height;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { UIResizePolicyCross };
|