laymur 0.17.0 → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{src/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.ts → dist/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.d.ts} +2 -3
- package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.d.ts +22 -0
- package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.js +41 -0
- package/dist/core/constraints/UIConstraint.d.ts +12 -0
- package/dist/core/constraints/UIConstraint.js +11 -0
- package/dist/core/constraints/UICustomConstraint.d.ts +28 -0
- package/dist/core/constraints/UICustomConstraint.js +37 -0
- package/{src/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.ts → dist/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.d.ts} +2 -3
- package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.d.ts +20 -0
- package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.js +34 -0
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.d.ts +11 -0
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.js +3 -0
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.d.ts +36 -0
- package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.js +100 -0
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.d.ts +14 -0
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.js +4 -0
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.d.ts +44 -0
- package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.js +136 -0
- package/{src/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.ts → dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.d.ts} +2 -3
- package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.d.ts +22 -0
- package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.js +40 -0
- package/{src/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.ts → dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.d.ts} +8 -9
- package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.d.ts +43 -0
- package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.js +71 -0
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.d.ts +11 -0
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.js +3 -0
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.d.ts +32 -0
- package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.js +100 -0
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.d.ts +14 -0
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.js +4 -0
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.d.ts +44 -0
- package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.js +136 -0
- package/{src/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.ts → dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.d.ts} +2 -3
- package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.d.ts +22 -0
- package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.js +40 -0
- package/{src/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.ts → dist/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.d.ts} +2 -3
- package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.d.ts +20 -0
- package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.js +34 -0
- package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.d.ts +64 -0
- package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.js +19 -0
- package/dist/core/constraints/builders/UIConstraint2DBuilder.d.ts +46 -0
- package/dist/core/constraints/builders/UIConstraint2DBuilder.js +138 -0
- package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.d.ts +13 -0
- package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.js +3 -0
- package/dist/core/constraints/builders/UICoverConstraintBuilder.d.ts +29 -0
- package/dist/core/constraints/builders/UICoverConstraintBuilder.js +63 -0
- package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.d.ts +13 -0
- package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.js +3 -0
- package/dist/core/constraints/builders/UIFitConstraintBuilder.d.ts +29 -0
- package/dist/core/constraints/builders/UIFitConstraintBuilder.js +63 -0
- package/dist/core/elements/UIAnchor/UIAnchor.Internal.d.ts +12 -0
- package/dist/core/elements/UIAnchor/UIAnchor.Internal.js +5 -0
- package/dist/core/elements/UIAnchor/UIAnchor.d.ts +32 -0
- package/dist/core/elements/UIAnchor/UIAnchor.js +49 -0
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.d.ts +27 -0
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.js +15 -0
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.d.ts +77 -0
- package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.js +259 -0
- package/dist/core/elements/UIDummy/UIDummy.Internal.d.ts +30 -0
- package/dist/core/elements/UIDummy/UIDummy.Internal.js +8 -0
- package/dist/core/elements/UIDummy/UIDummy.d.ts +82 -0
- package/dist/core/elements/UIDummy/UIDummy.js +173 -0
- package/{src/core/elements/UIElement/UIElement.Internal.ts → dist/core/elements/UIElement/UIElement.Internal.d.ts} +5 -7
- package/dist/core/elements/UIElement/UIElement.Internal.js +5 -0
- package/dist/core/elements/UIElement/UIElement.d.ts +38 -0
- package/dist/core/elements/UIElement/UIElement.js +74 -0
- package/{src/core/elements/UIGraphics/UIGraphics.Internal.ts → dist/core/elements/UIGraphics/UIGraphics.Internal.d.ts} +5 -7
- package/dist/core/elements/UIGraphics/UIGraphics.Internal.js +7 -0
- package/dist/core/elements/UIGraphics/UIGraphics.d.ts +51 -0
- package/dist/core/elements/UIGraphics/UIGraphics.js +126 -0
- package/{src/core/elements/UIImage/UIImage.Internal.ts → dist/core/elements/UIImage/UIImage.Internal.d.ts} +2 -3
- package/dist/core/elements/UIImage/UIImage.d.ts +32 -0
- package/dist/core/elements/UIImage/UIImage.js +85 -0
- package/dist/core/elements/UINineSlice/UINineSlice.Internal.d.ts +23 -0
- package/dist/core/elements/UINineSlice/UINineSlice.Internal.js +12 -0
- package/dist/core/elements/UINineSlice/UINineSlice.d.ts +60 -0
- package/dist/core/elements/UINineSlice/UINineSlice.js +188 -0
- package/dist/core/elements/UIProgress/UIProgress.Internal.d.ts +14 -0
- package/dist/core/elements/UIProgress/UIProgress.Internal.js +3 -0
- package/dist/core/elements/UIProgress/UIProgress.d.ts +45 -0
- package/dist/core/elements/UIProgress/UIProgress.js +165 -0
- package/dist/core/elements/UIScene/UIScene.Internal.d.ts +43 -0
- package/dist/core/elements/UIScene/UIScene.Internal.js +27 -0
- package/dist/core/elements/UIScene/UIScene.d.ts +59 -0
- package/dist/core/elements/UIScene/UIScene.js +157 -0
- package/{src/core/elements/UIText/UIText.Interfaces.ts → dist/core/elements/UIText/UIText.Interfaces.d.ts} +16 -21
- package/dist/core/elements/UIText/UIText.Internal.d.ts +26 -0
- package/dist/core/elements/UIText/UIText.Internal.js +12 -0
- package/dist/core/elements/UIText/UIText.Measuring.d.ts +50 -0
- package/dist/core/elements/UIText/UIText.Measuring.js +153 -0
- package/dist/core/elements/UIText/UIText.Rendering.d.ts +20 -0
- package/dist/core/elements/UIText/UIText.Rendering.js +61 -0
- package/dist/core/elements/UIText/UIText.d.ts +71 -0
- package/dist/core/elements/UIText/UIText.js +265 -0
- package/{src/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.ts → dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.d.ts} +11 -14
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.js +5 -0
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.d.ts +63 -0
- package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.js +147 -0
- package/{src/core/layers/UILayer/UILayer.Internal.ts → dist/core/layers/UILayer/UILayer.Internal.d.ts} +11 -15
- package/dist/core/layers/UILayer/UILayer.Internal.js +7 -0
- package/dist/core/layers/UILayer/UILayer.d.ts +49 -0
- package/dist/core/layers/UILayer/UILayer.js +113 -0
- package/dist/core/miscellaneous/UIExpression.d.ts +69 -0
- package/dist/core/miscellaneous/UIExpression.js +128 -0
- package/dist/core/miscellaneous/UIMode.d.ts +23 -0
- package/dist/core/miscellaneous/UIMode.js +30 -0
- package/dist/core/miscellaneous/UIOrientation.d.ts +15 -0
- package/dist/core/miscellaneous/UIOrientation.js +20 -0
- package/dist/core/miscellaneous/UIPriority.d.ts +32 -0
- package/dist/core/miscellaneous/UIPriority.js +63 -0
- package/dist/core/miscellaneous/UIRelation.d.ts +23 -0
- package/dist/core/miscellaneous/UIRelation.js +40 -0
- package/dist/core/miscellaneous/UITransparencyMode.d.ts +9 -0
- package/dist/core/miscellaneous/UITransparencyMode.js +12 -0
- package/dist/core/miscellaneous/area/UIArea.d.ts +3 -0
- package/dist/core/miscellaneous/area/UIArea.js +5 -0
- package/dist/core/miscellaneous/area/UIAreaCircle.d.ts +15 -0
- package/dist/core/miscellaneous/area/UIAreaCircle.js +32 -0
- package/dist/core/miscellaneous/area/UIAreaPolygon.d.ts +12 -0
- package/dist/core/miscellaneous/area/UIAreaPolygon.js +40 -0
- package/dist/core/miscellaneous/area/UIAreaRectangle.d.ts +17 -0
- package/dist/core/miscellaneous/area/UIAreaRectangle.js +36 -0
- package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.d.ts +21 -0
- package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.js +72 -0
- package/dist/core/miscellaneous/asserts.d.ts +43 -0
- package/dist/core/miscellaneous/asserts.js +163 -0
- package/dist/core/miscellaneous/canvas.d.ts +31 -0
- package/dist/core/miscellaneous/canvas.js +37 -0
- package/dist/core/miscellaneous/color/UIColor.Internal.d.ts +7 -0
- package/dist/core/miscellaneous/color/UIColor.Internal.js +42 -0
- package/dist/core/miscellaneous/color/UIColor.d.ts +234 -0
- package/dist/core/miscellaneous/color/UIColor.js +636 -0
- package/dist/core/miscellaneous/computeTransform.d.ts +18 -0
- package/dist/core/miscellaneous/computeTransform.js +82 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.d.ts +19 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.js +168 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.d.ts +1 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.js +349 -0
- package/{src/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.ts → dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.d.ts} +8 -10
- package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.d.ts +1 -0
- package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.js +357 -0
- package/dist/core/miscellaneous/generic-plane/shared.d.ts +38 -0
- package/dist/core/miscellaneous/generic-plane/shared.js +228 -0
- package/dist/core/miscellaneous/insets/UIInsets.Internal.d.ts +11 -0
- package/dist/core/miscellaneous/insets/UIInsets.Internal.js +3 -0
- package/dist/core/miscellaneous/insets/UIInsets.d.ts +48 -0
- package/dist/core/miscellaneous/insets/UIInsets.js +224 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.d.ts +9 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.js +19 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.d.ts +21 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.js +51 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.d.ts +16 -0
- package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.js +48 -0
- package/dist/core/miscellaneous/math.d.ts +7 -0
- package/dist/core/miscellaneous/math.js +11 -0
- package/dist/core/miscellaneous/micro/UIMicro.Internal.d.ts +31 -0
- package/dist/core/miscellaneous/micro/UIMicro.Internal.js +15 -0
- package/dist/core/miscellaneous/micro/UIMicro.d.ts +59 -0
- package/dist/core/miscellaneous/micro/UIMicro.js +181 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicy.d.ts +3 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicy.js +9 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.d.ts +22 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.js +50 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.d.ts +22 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.js +52 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.d.ts +22 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.js +52 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.d.ts +22 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.js +50 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.d.ts +22 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.js +52 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.d.ts +22 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.js +52 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.d.ts +5 -0
- package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.js +13 -0
- package/dist/core/miscellaneous/shared.d.ts +46 -0
- package/dist/core/miscellaneous/shared.js +37 -0
- package/{src/core/miscellaneous/text-span/UITextSpan.Internal.ts → dist/core/miscellaneous/text-span/UITextSpan.Internal.d.ts} +4 -5
- package/dist/core/miscellaneous/text-span/UITextSpan.d.ts +14 -0
- package/dist/core/miscellaneous/text-span/UITextSpan.js +36 -0
- package/dist/core/miscellaneous/text-style/UITextStyle.Internal.d.ts +48 -0
- package/dist/core/miscellaneous/text-style/UITextStyle.Internal.js +17 -0
- package/dist/core/miscellaneous/text-style/UITextStyle.d.ts +85 -0
- package/dist/core/miscellaneous/text-style/UITextStyle.js +372 -0
- package/dist/core/miscellaneous/texture/UITextureView.Internal.d.ts +49 -0
- package/dist/core/miscellaneous/texture/UITextureView.Internal.js +6 -0
- package/dist/core/miscellaneous/texture/UITextureView.d.ts +67 -0
- package/dist/core/miscellaneous/texture/UITextureView.js +234 -0
- package/dist/core/miscellaneous/webglCapabilities.d.ts +2 -0
- package/dist/core/miscellaneous/webglCapabilities.js +103 -0
- package/dist/core/shaders/UIImage.glsl.js +3 -0
- package/dist/core/shaders/UINineSlice.glsl.js +3 -0
- package/dist/core/shaders/UIProgress.glsl.js +3 -0
- package/dist/core/shaders/UIProgressMaskFunctionCircular.glsl.js +3 -0
- package/dist/core/shaders/UIProgressMaskFunctionDirectional.glsl.js +3 -0
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.d.ts +17 -0
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.d.ts +13 -0
- package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.js +108 -0
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.d.ts +13 -0
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.d.ts +20 -0
- package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.js +75 -0
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.d.ts +49 -0
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.d.ts +215 -0
- package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.js +505 -0
- package/dist/index.js +51 -0
- package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.d.ts +21 -0
- package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.js +47 -0
- package/dist/particles/behaviorModules/UIBehaviorModule.d.ts +14 -0
- package/dist/particles/behaviorModules/UIBehaviorModule.js +9 -0
- package/dist/particles/behaviorModules/UIBehaviorPointGravity.d.ts +39 -0
- package/dist/particles/behaviorModules/UIBehaviorPointGravity.js +110 -0
- package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.d.ts +22 -0
- package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.js +66 -0
- package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.d.ts +20 -0
- package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.js +48 -0
- package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.d.ts +26 -0
- package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.js +66 -0
- package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.d.ts +20 -0
- package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.js +49 -0
- package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.d.ts +26 -0
- package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.js +70 -0
- package/dist/particles/elements/UIEmitter.Internal.d.ts +15 -0
- package/dist/particles/elements/UIEmitter.Internal.js +11 -0
- package/dist/particles/elements/UIEmitter.d.ts +68 -0
- package/dist/particles/elements/UIEmitter.js +203 -0
- package/dist/particles/index.js +18 -0
- package/dist/particles/instancedParticle/UIInstancedParticle.Internal.d.ts +13 -0
- package/dist/particles/instancedParticle/UIInstancedParticle.Internal.js +211 -0
- package/dist/particles/instancedParticle/UIInstancedParticle.d.ts +17 -0
- package/dist/particles/instancedParticle/UIInstancedParticle.js +93 -0
- package/dist/particles/miscellaneous/miscellaneous.d.ts +32 -0
- package/dist/particles/miscellaneous/miscellaneous.js +67 -0
- package/dist/particles/renderingModules/UIRenderingColorOverLife.d.ts +14 -0
- package/dist/particles/renderingModules/UIRenderingColorOverLife.js +32 -0
- package/dist/particles/renderingModules/UIRenderingColorOverVelocity.d.ts +15 -0
- package/dist/particles/renderingModules/UIRenderingColorOverVelocity.js +37 -0
- package/dist/particles/renderingModules/UIRenderingModule.d.ts +8 -0
- package/dist/particles/renderingModules/UIRenderingModule.js +9 -0
- package/dist/particles/renderingModules/UIRenderingTexture.d.ts +14 -0
- package/dist/particles/renderingModules/UIRenderingTexture.js +26 -0
- package/dist/particles/shaders/UIRenderingColorOverLife.glsl.js +3 -0
- package/dist/particles/shaders/UIRenderingColorOverVelocity.glsl.js +3 -0
- package/dist/particles/shaders/UIRenderingTexture.glsl.js +3 -0
- package/dist/particles/spawnModules/UISpawnModule.d.ts +9 -0
- package/dist/particles/spawnModules/UISpawnModule.js +9 -0
- package/dist/particles/spawnModules/UISpawnOffset.d.ts +21 -0
- package/dist/particles/spawnModules/UISpawnOffset.js +46 -0
- package/dist/particles/spawnModules/UISpawnRandomLifetime.d.ts +20 -0
- package/dist/particles/spawnModules/UISpawnRandomLifetime.js +47 -0
- package/dist/particles/spawnModules/UISpawnRandomRotation.d.ts +20 -0
- package/dist/particles/spawnModules/UISpawnRandomRotation.js +45 -0
- package/dist/particles/spawnModules/UISpawnRandomScale.d.ts +26 -0
- package/dist/particles/spawnModules/UISpawnRandomScale.js +60 -0
- package/dist/particles/spawnModules/UISpawnRandomTorque.d.ts +20 -0
- package/dist/particles/spawnModules/UISpawnRandomTorque.js +45 -0
- package/dist/particles/spawnModules/UISpawnRandomVelocity.d.ts +26 -0
- package/dist/particles/spawnModules/UISpawnRandomVelocity.js +64 -0
- package/dist/particles/spawnModules/UISpawnRectangle.d.ts +27 -0
- package/dist/particles/spawnModules/UISpawnRectangle.js +62 -0
- package/package.json +8 -1
- package/.claude/settings.local.json +0 -9
- package/.editorconfig +0 -14
- package/CLAUDE.md +0 -181
- package/assets/logotype.png +0 -0
- package/eslint.config.js +0 -111
- package/rollup.config.js +0 -52
- package/src/core/constraints/UIAspectConstraint/UIAspectConstraint.ts +0 -60
- package/src/core/constraints/UIConstraint.ts +0 -20
- package/src/core/constraints/UICustomConstraint.ts +0 -62
- package/src/core/constraints/UIHeightConstraint/UIHeightConstraint.ts +0 -52
- package/src/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.ts +0 -13
- package/src/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.ts +0 -139
- package/src/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.ts +0 -16
- package/src/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.ts +0 -189
- package/src/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.ts +0 -68
- package/src/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.ts +0 -94
- package/src/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.ts +0 -13
- package/src/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.ts +0 -135
- package/src/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.ts +0 -16
- package/src/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.ts +0 -189
- package/src/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.ts +0 -68
- package/src/core/constraints/UIWidthConstraint/UIWidthConstraint.ts +0 -52
- package/src/core/constraints/builders/UIConstraint2DBuilder.Internal.ts +0 -84
- package/src/core/constraints/builders/UIConstraint2DBuilder.ts +0 -168
- package/src/core/constraints/builders/UICoverConstraintBuilder.Internal.ts +0 -15
- package/src/core/constraints/builders/UICoverConstraintBuilder.ts +0 -84
- package/src/core/constraints/builders/UIFitConstraintBuilder.Internal.ts +0 -15
- package/src/core/constraints/builders/UIFitConstraintBuilder.ts +0 -84
- package/src/core/elements/UIAnchor/UIAnchor.Internal.ts +0 -13
- package/src/core/elements/UIAnchor/UIAnchor.ts +0 -70
- package/src/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.ts +0 -30
- package/src/core/elements/UIAnimatedImage/UIAnimatedImage.ts +0 -355
- package/src/core/elements/UIDummy/UIDummy.Internal.ts +0 -33
- package/src/core/elements/UIDummy/UIDummy.ts +0 -244
- package/src/core/elements/UIElement/UIElement.ts +0 -127
- package/src/core/elements/UIGraphics/UIGraphics.ts +0 -168
- package/src/core/elements/UIImage/UIImage.ts +0 -138
- package/src/core/elements/UINineSlice/UINineSlice.Internal.ts +0 -26
- package/src/core/elements/UINineSlice/UINineSlice.ts +0 -296
- package/src/core/elements/UIProgress/UIProgress.Internal.ts +0 -24
- package/src/core/elements/UIProgress/UIProgress.ts +0 -259
- package/src/core/elements/UIScene/UIScene.Internal.ts +0 -46
- package/src/core/elements/UIScene/UIScene.ts +0 -259
- package/src/core/elements/UIText/UIText.Internal.ts +0 -29
- package/src/core/elements/UIText/UIText.Measuring.ts +0 -183
- package/src/core/elements/UIText/UIText.Rendering.ts +0 -83
- package/src/core/elements/UIText/UIText.ts +0 -376
- package/src/core/layers/UIFullscreenLayer/UIFullscreenLayer.ts +0 -233
- package/src/core/layers/UILayer/UILayer.ts +0 -156
- package/src/core/miscellaneous/UIExpression.ts +0 -142
- package/src/core/miscellaneous/UIMode.ts +0 -29
- package/src/core/miscellaneous/UIOrientation.ts +0 -18
- package/src/core/miscellaneous/UIPriority.ts +0 -63
- package/src/core/miscellaneous/UIRelation.ts +0 -39
- package/src/core/miscellaneous/UITransparencyMode.ts +0 -9
- package/src/core/miscellaneous/area/UIArea.ts +0 -5
- package/src/core/miscellaneous/area/UIAreaCircle.ts +0 -32
- package/src/core/miscellaneous/area/UIAreaPolygon.ts +0 -50
- package/src/core/miscellaneous/area/UIAreaRectangle.ts +0 -38
- package/src/core/miscellaneous/area/UIAreaRoundedRectangle.ts +0 -78
- package/src/core/miscellaneous/asserts.ts +0 -187
- package/src/core/miscellaneous/canvas.ts +0 -73
- package/src/core/miscellaneous/color/UIColor.Internal.ts +0 -89
- package/src/core/miscellaneous/color/UIColor.ts +0 -844
- package/src/core/miscellaneous/computeTransform.ts +0 -127
- package/src/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.ts +0 -235
- package/src/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.ts +0 -524
- package/src/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.ts +0 -448
- package/src/core/miscellaneous/generic-plane/shared.ts +0 -323
- package/src/core/miscellaneous/insets/UIInsets.Internal.ts +0 -9
- package/src/core/miscellaneous/insets/UIInsets.ts +0 -248
- package/src/core/miscellaneous/mask-function/UIProgressMaskFunction.ts +0 -24
- package/src/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.ts +0 -58
- package/src/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.ts +0 -52
- package/src/core/miscellaneous/math.ts +0 -16
- package/src/core/miscellaneous/micro/UIMicro.Internal.ts +0 -33
- package/src/core/miscellaneous/micro/UIMicro.ts +0 -222
- package/src/core/miscellaneous/resize-policy/UIResizePolicy.ts +0 -8
- package/src/core/miscellaneous/resize-policy/UIResizePolicyCover.ts +0 -57
- package/src/core/miscellaneous/resize-policy/UIResizePolicyCross.ts +0 -65
- package/src/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.ts +0 -65
- package/src/core/miscellaneous/resize-policy/UIResizePolicyFit.ts +0 -57
- package/src/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.ts +0 -65
- package/src/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.ts +0 -65
- package/src/core/miscellaneous/resize-policy/UIResizePolicyNone.ts +0 -11
- package/src/core/miscellaneous/shared.ts +0 -73
- package/src/core/miscellaneous/text-span/UITextSpan.ts +0 -43
- package/src/core/miscellaneous/text-style/UITextStyle.Internal.ts +0 -52
- package/src/core/miscellaneous/text-style/UITextStyle.ts +0 -479
- package/src/core/miscellaneous/texture/UITextureView.Internal.ts +0 -55
- package/src/core/miscellaneous/texture/UITextureView.ts +0 -308
- package/src/core/miscellaneous/webglCapabilities.ts +0 -129
- package/src/core/shaders/UIImage.glsl +0 -10
- package/src/core/shaders/UINineSlice.glsl +0 -53
- package/src/core/shaders/UIProgress.glsl +0 -15
- package/src/core/shaders/UIProgressMaskFunctionCircular.glsl +0 -13
- package/src/core/shaders/UIProgressMaskFunctionDirectional.glsl +0 -12
- package/src/core/shaders/glsl.d.ts +0 -27
- package/src/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.ts +0 -23
- package/src/core/wrappers/UIInputWrapper/UIInputWrapper.ts +0 -124
- package/src/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.ts +0 -22
- package/src/core/wrappers/UISceneWrapper/UISceneWrapper.ts +0 -101
- package/src/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.ts +0 -58
- package/src/core/wrappers/UISolverWrapper/UISolverWrapper.ts +0 -605
- package/src/particles/behaviorModules/UIBehaviorDirectionalGravity.ts +0 -70
- package/src/particles/behaviorModules/UIBehaviorModule.ts +0 -20
- package/src/particles/behaviorModules/UIBehaviorPointGravity.ts +0 -173
- package/src/particles/behaviorModules/UIBehaviorScaleOverLife.ts +0 -104
- package/src/particles/behaviorModules/UIBehaviorTorqueDamping.ts +0 -75
- package/src/particles/behaviorModules/UIBehaviorTorqueNoise.ts +0 -115
- package/src/particles/behaviorModules/UIBehaviorVelocityDamping.ts +0 -77
- package/src/particles/behaviorModules/UIBehaviorVelocityNoise.ts +0 -118
- package/src/particles/elements/UIEmitter.Internal.ts +0 -22
- package/src/particles/elements/UIEmitter.ts +0 -313
- package/src/particles/instancedParticle/UIInstancedParticle.Internal.ts +0 -263
- package/src/particles/instancedParticle/UIInstancedParticle.ts +0 -138
- package/src/particles/miscellaneous/miscellaneous.ts +0 -115
- package/src/particles/renderingModules/UIRenderingColorOverLife.ts +0 -39
- package/src/particles/renderingModules/UIRenderingColorOverVelocity.ts +0 -49
- package/src/particles/renderingModules/UIRenderingModule.ts +0 -17
- package/src/particles/renderingModules/UIRenderingTexture.ts +0 -30
- package/src/particles/shaders/UIRenderingColorOverLife.glsl +0 -4
- package/src/particles/shaders/UIRenderingColorOverVelocity.glsl +0 -6
- package/src/particles/shaders/UIRenderingTexture.glsl +0 -4
- package/src/particles/spawnModules/UISpawnModule.ts +0 -22
- package/src/particles/spawnModules/UISpawnOffset.ts +0 -62
- package/src/particles/spawnModules/UISpawnRandomLifetime.ts +0 -68
- package/src/particles/spawnModules/UISpawnRandomRotation.ts +0 -60
- package/src/particles/spawnModules/UISpawnRandomScale.ts +0 -81
- package/src/particles/spawnModules/UISpawnRandomTorque.ts +0 -62
- package/src/particles/spawnModules/UISpawnRandomVelocity.ts +0 -92
- package/src/particles/spawnModules/UISpawnRectangle.ts +0 -81
- package/tsconfig.json +0 -29
- /package/{src/core/index.ts → dist/core/index.d.ts} +0 -0
- /package/{src/particles/index.ts → dist/particles/index.d.ts} +0 -0
|
@@ -1,308 +0,0 @@
|
|
|
1
|
-
import type { FerrsignView3 } from "ferrsign";
|
|
2
|
-
import { Ferrsign3 } from "ferrsign";
|
|
3
|
-
import { Matrix3, Texture, Vector2 } from "three";
|
|
4
|
-
import { assertValidNonNegativeNumber, assertValidPositiveNumber } from "../asserts";
|
|
5
|
-
import type {
|
|
6
|
-
UITextureAtlasConfig,
|
|
7
|
-
UITextureConfig,
|
|
8
|
-
UITextureTrim,
|
|
9
|
-
} from "./UITextureView.Internal";
|
|
10
|
-
import { TEXTURE_DEFAULT_SIZE, TEXTURE_DEFAULT_TEXTURE } from "./UITextureView.Internal";
|
|
11
|
-
|
|
12
|
-
/** Wrapper for Three.js texture with atlas and trim support. Does not own the underlying texture; user must dispose it. */
|
|
13
|
-
export class UITextureView {
|
|
14
|
-
private textureInternal: Texture = TEXTURE_DEFAULT_TEXTURE;
|
|
15
|
-
|
|
16
|
-
private sourceWidth = TEXTURE_DEFAULT_SIZE;
|
|
17
|
-
private sourceHeight = TEXTURE_DEFAULT_SIZE;
|
|
18
|
-
|
|
19
|
-
private frameX = 0;
|
|
20
|
-
private frameY = 0;
|
|
21
|
-
private frameWidth = TEXTURE_DEFAULT_SIZE;
|
|
22
|
-
private frameHeight = TEXTURE_DEFAULT_SIZE;
|
|
23
|
-
|
|
24
|
-
private rotatedInternal = false;
|
|
25
|
-
private scaleInternal = 1;
|
|
26
|
-
|
|
27
|
-
private trimLeft = 0;
|
|
28
|
-
private trimRight = 0;
|
|
29
|
-
private trimTop = 0;
|
|
30
|
-
private trimBottom = 0;
|
|
31
|
-
|
|
32
|
-
private textureDirtyInternal = false;
|
|
33
|
-
private uvTransformDirtyInternal = false;
|
|
34
|
-
private trimDirtyInternal = false;
|
|
35
|
-
|
|
36
|
-
private readonly signalDiminsionsChangedInternal = new Ferrsign3<number, number, UITextureView>();
|
|
37
|
-
|
|
38
|
-
/** @param config Texture or atlas configuration */
|
|
39
|
-
constructor(config?: UITextureConfig) {
|
|
40
|
-
if (config !== undefined) {
|
|
41
|
-
this.set(config);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/** Original width before trimming in world units */
|
|
46
|
-
public get width(): number {
|
|
47
|
-
return this.sourceWidth / this.scaleInternal;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/** Original height before trimming in world units */
|
|
51
|
-
public get height(): number {
|
|
52
|
-
return this.sourceHeight / this.scaleInternal;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/** Visible width after trimming in world units */
|
|
56
|
-
public get trimmedWidth(): number {
|
|
57
|
-
const frameSize = this.rotatedInternal ? this.frameHeight : this.frameWidth;
|
|
58
|
-
return frameSize / this.scaleInternal;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/** Visible height after trimming in world units */
|
|
62
|
-
public get trimmedHeight(): number {
|
|
63
|
-
const frameSize = this.rotatedInternal ? this.frameWidth : this.frameHeight;
|
|
64
|
-
return frameSize / this.scaleInternal;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/** Underlying Three.js texture */
|
|
68
|
-
public get texture(): Texture {
|
|
69
|
-
return this.textureInternal;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/** Whether sprite is rotated in atlas */
|
|
73
|
-
public get rotated(): boolean {
|
|
74
|
-
return this.rotatedInternal;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/** Scale factor for resolution independence */
|
|
78
|
-
public get scale(): number {
|
|
79
|
-
return this.scaleInternal;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/** Transparent padding around visible content */
|
|
83
|
-
public get trim(): Readonly<UITextureTrim> {
|
|
84
|
-
const scale = this.scaleInternal;
|
|
85
|
-
return {
|
|
86
|
-
left: this.trimLeft / scale,
|
|
87
|
-
right: this.trimRight / scale,
|
|
88
|
-
top: this.trimTop / scale,
|
|
89
|
-
bottom: this.trimBottom / scale,
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
public get textureDirty(): boolean {
|
|
94
|
-
return this.textureDirtyInternal;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/** Whether UV transform inputs changed since last check */
|
|
98
|
-
public get uvTransformDirty(): boolean {
|
|
99
|
-
return this.uvTransformDirtyInternal;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/** Whether trim values changed since last check */
|
|
103
|
-
public get trimDirty(): boolean {
|
|
104
|
-
return this.trimDirtyInternal;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
public get signalDiminsionsChanged(): FerrsignView3<number, number, UITextureView> {
|
|
108
|
-
return this.signalDiminsionsChangedInternal;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
public setTextureDirtyFalse(): void {
|
|
112
|
-
this.textureDirtyInternal = false;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/** Marks UV transform as clean. @internal */
|
|
116
|
-
public setUVTransformDirtyFalse(): void {
|
|
117
|
-
this.uvTransformDirtyInternal = false;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/** Marks trim as clean. @internal */
|
|
121
|
-
public setTrimDirtyFalse(): void {
|
|
122
|
-
this.trimDirtyInternal = false;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Calculates UV transform matrix for shader sampling.
|
|
127
|
-
* @param result Matrix to store result in
|
|
128
|
-
* @returns UV transform matrix
|
|
129
|
-
*/
|
|
130
|
-
public calculateUVTransform(result = new Matrix3()): Matrix3 {
|
|
131
|
-
const atlasWidth = this.textureInternal.image?.naturalWidth ?? TEXTURE_DEFAULT_SIZE;
|
|
132
|
-
const atlasHeight = this.textureInternal.image?.naturalHeight ?? TEXTURE_DEFAULT_SIZE;
|
|
133
|
-
|
|
134
|
-
if (this.rotatedInternal) {
|
|
135
|
-
const physicalWidth = this.frameHeight;
|
|
136
|
-
const physicalHeight = this.frameWidth;
|
|
137
|
-
|
|
138
|
-
const u0 = this.frameX / atlasWidth;
|
|
139
|
-
const v0 = (atlasHeight - this.frameY - physicalHeight) / atlasHeight;
|
|
140
|
-
const uSize = physicalWidth / atlasWidth;
|
|
141
|
-
const vSize = physicalHeight / atlasHeight;
|
|
142
|
-
|
|
143
|
-
result.set(0, uSize, u0, -vSize, 0, v0 + vSize, 0, 0, 1);
|
|
144
|
-
} else {
|
|
145
|
-
const u0 = this.frameX / atlasWidth;
|
|
146
|
-
const v0 = (atlasHeight - this.frameY - this.frameHeight) / atlasHeight;
|
|
147
|
-
const uSize = this.frameWidth / atlasWidth;
|
|
148
|
-
const vSize = this.frameHeight / atlasHeight;
|
|
149
|
-
|
|
150
|
-
result.set(uSize, 0, u0, 0, vSize, v0, 0, 0, 1);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
return result;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* Gets original dimensions before trimming.
|
|
158
|
-
* @param result Vector to store result in
|
|
159
|
-
* @returns Width and height in world units
|
|
160
|
-
*/
|
|
161
|
-
public getResolution(result = new Vector2()): Vector2 {
|
|
162
|
-
return result.set(this.width, this.height);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Replaces texture with new configuration.
|
|
167
|
-
* @param config Texture or atlas configuration
|
|
168
|
-
*/
|
|
169
|
-
public set(config: UITextureConfig): void {
|
|
170
|
-
const lastWidth = this.width;
|
|
171
|
-
const lastHeight = this.height;
|
|
172
|
-
|
|
173
|
-
if (config instanceof Texture) {
|
|
174
|
-
this.setFromTexture(config);
|
|
175
|
-
} else {
|
|
176
|
-
this.setFromAtlasConfig(config);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
if (this.width !== lastWidth || this.height !== lastHeight) {
|
|
180
|
-
this.signalDiminsionsChangedInternal.emit(this.width, this.height, this);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
private setFromTexture(texture: Texture): void {
|
|
185
|
-
const width = texture.image?.naturalWidth ?? TEXTURE_DEFAULT_SIZE;
|
|
186
|
-
const height = texture.image?.naturalHeight ?? TEXTURE_DEFAULT_SIZE;
|
|
187
|
-
|
|
188
|
-
this.sourceWidth = width;
|
|
189
|
-
this.sourceHeight = height;
|
|
190
|
-
|
|
191
|
-
if (this.texture !== texture) {
|
|
192
|
-
this.textureInternal = texture;
|
|
193
|
-
this.textureDirtyInternal = true;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
if (
|
|
197
|
-
this.frameX !== 0 ||
|
|
198
|
-
this.frameY !== 0 ||
|
|
199
|
-
this.frameWidth !== width ||
|
|
200
|
-
this.frameHeight !== height ||
|
|
201
|
-
this.scaleInternal !== 1 ||
|
|
202
|
-
this.rotatedInternal
|
|
203
|
-
) {
|
|
204
|
-
this.frameX = 0;
|
|
205
|
-
this.frameY = 0;
|
|
206
|
-
this.frameWidth = width;
|
|
207
|
-
this.frameHeight = height;
|
|
208
|
-
this.rotatedInternal = false;
|
|
209
|
-
this.scaleInternal = 1;
|
|
210
|
-
this.uvTransformDirtyInternal = true;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
if (
|
|
214
|
-
this.trimLeft !== 0 ||
|
|
215
|
-
this.trimRight !== 0 ||
|
|
216
|
-
this.trimTop !== 0 ||
|
|
217
|
-
this.trimBottom !== 0
|
|
218
|
-
) {
|
|
219
|
-
this.trimLeft = 0;
|
|
220
|
-
this.trimRight = 0;
|
|
221
|
-
this.trimTop = 0;
|
|
222
|
-
this.trimBottom = 0;
|
|
223
|
-
this.trimDirtyInternal = true;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
private setFromAtlasConfig(config: UITextureAtlasConfig): void {
|
|
228
|
-
assertValidPositiveNumber(
|
|
229
|
-
config.sourceSize.w,
|
|
230
|
-
"UITextureView.setFromAtlasConfig.config.sourceSize.w",
|
|
231
|
-
);
|
|
232
|
-
assertValidPositiveNumber(
|
|
233
|
-
config.sourceSize.h,
|
|
234
|
-
"UITextureView.setFromAtlasConfig.config.sourceSize.h",
|
|
235
|
-
);
|
|
236
|
-
assertValidNonNegativeNumber(config.frame.x, "UITextureView.setFromAtlasConfig.config.frame.x");
|
|
237
|
-
assertValidNonNegativeNumber(config.frame.y, "UITextureView.setFromAtlasConfig.config.frame.y");
|
|
238
|
-
assertValidPositiveNumber(config.frame.w, "UITextureView.setFromAtlasConfig.config.frame.w");
|
|
239
|
-
assertValidPositiveNumber(config.frame.h, "UITextureView.setFromAtlasConfig.config.frame.h");
|
|
240
|
-
assertValidNonNegativeNumber(
|
|
241
|
-
config.spriteSourceSize.x,
|
|
242
|
-
"UITextureView.setFromAtlasConfig.config.spriteSourceSize.x",
|
|
243
|
-
);
|
|
244
|
-
assertValidNonNegativeNumber(
|
|
245
|
-
config.spriteSourceSize.y,
|
|
246
|
-
"UITextureView.setFromAtlasConfig.config.spriteSourceSize.y",
|
|
247
|
-
);
|
|
248
|
-
assertValidPositiveNumber(
|
|
249
|
-
config.spriteSourceSize.w,
|
|
250
|
-
"UITextureView.setFromAtlasConfig.config.spriteSourceSize.w",
|
|
251
|
-
);
|
|
252
|
-
assertValidPositiveNumber(
|
|
253
|
-
config.spriteSourceSize.h,
|
|
254
|
-
"UITextureView.setFromAtlasConfig.config.spriteSourceSize.h",
|
|
255
|
-
);
|
|
256
|
-
|
|
257
|
-
if (config.scale !== undefined) {
|
|
258
|
-
assertValidPositiveNumber(config.scale, "UITextureView.setFromAtlasConfig.config.scale");
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
this.sourceWidth = config.sourceSize.w;
|
|
262
|
-
this.sourceHeight = config.sourceSize.h;
|
|
263
|
-
|
|
264
|
-
if (this.texture !== config.texture) {
|
|
265
|
-
this.textureInternal = config.texture;
|
|
266
|
-
this.textureDirtyInternal = true;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
const scale = config.scale ?? 1;
|
|
270
|
-
const rotated = config.rotated ?? false;
|
|
271
|
-
|
|
272
|
-
if (
|
|
273
|
-
this.frameX !== 0 ||
|
|
274
|
-
this.frameY !== 0 ||
|
|
275
|
-
this.frameWidth !== config.frame.w ||
|
|
276
|
-
this.frameHeight !== config.frame.h ||
|
|
277
|
-
this.scaleInternal !== scale ||
|
|
278
|
-
this.rotatedInternal !== rotated
|
|
279
|
-
) {
|
|
280
|
-
this.frameX = config.frame.x;
|
|
281
|
-
this.frameY = config.frame.y;
|
|
282
|
-
this.frameWidth = config.frame.w;
|
|
283
|
-
this.frameHeight = config.frame.h;
|
|
284
|
-
this.scaleInternal = scale;
|
|
285
|
-
this.rotatedInternal = rotated;
|
|
286
|
-
this.uvTransformDirtyInternal = true;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
const spriteSource = config.spriteSourceSize;
|
|
290
|
-
const trimLeft = spriteSource.x;
|
|
291
|
-
const trimTop = spriteSource.y;
|
|
292
|
-
const trimRight = this.sourceWidth - spriteSource.x - spriteSource.w;
|
|
293
|
-
const trimBottom = this.sourceHeight - spriteSource.y - spriteSource.h;
|
|
294
|
-
|
|
295
|
-
if (
|
|
296
|
-
this.trimLeft !== trimLeft ||
|
|
297
|
-
this.trimRight !== trimRight ||
|
|
298
|
-
this.trimTop !== trimTop ||
|
|
299
|
-
this.trimBottom !== trimBottom
|
|
300
|
-
) {
|
|
301
|
-
this.trimLeft = trimLeft;
|
|
302
|
-
this.trimRight = trimRight;
|
|
303
|
-
this.trimTop = trimTop;
|
|
304
|
-
this.trimBottom = trimBottom;
|
|
305
|
-
this.trimDirtyInternal = true;
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
}
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Checks real OffscreenCanvas support as a texture source
|
|
3
|
-
*/
|
|
4
|
-
function checkOffscreenCanvasSupportInternal(): boolean {
|
|
5
|
-
if (typeof OffscreenCanvas === "undefined") {
|
|
6
|
-
return false;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const testCanvasElement = document.createElement("canvas");
|
|
10
|
-
testCanvasElement.width = 4;
|
|
11
|
-
testCanvasElement.height = 4;
|
|
12
|
-
|
|
13
|
-
const gl = testCanvasElement.getContext("webgl") ?? testCanvasElement.getContext("webgl2");
|
|
14
|
-
if (!gl) {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
try {
|
|
19
|
-
const offscreenCanvas = new OffscreenCanvas(4, 4);
|
|
20
|
-
const offscreenContext = offscreenCanvas.getContext("2d");
|
|
21
|
-
if (!offscreenContext) {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
offscreenContext.fillStyle = "#ff0000";
|
|
26
|
-
offscreenContext.fillRect(0, 0, 4, 4);
|
|
27
|
-
|
|
28
|
-
const texture = gl.createTexture();
|
|
29
|
-
gl.bindTexture(gl.TEXTURE_2D, texture);
|
|
30
|
-
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, offscreenCanvas);
|
|
31
|
-
|
|
32
|
-
if (gl.getError() !== gl.NO_ERROR) {
|
|
33
|
-
gl.deleteTexture(texture);
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const framebuffer = gl.createFramebuffer();
|
|
38
|
-
gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
|
|
39
|
-
gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
|
|
40
|
-
|
|
41
|
-
if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) !== gl.FRAMEBUFFER_COMPLETE) {
|
|
42
|
-
gl.deleteFramebuffer(framebuffer);
|
|
43
|
-
gl.deleteTexture(texture);
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const pixelData = new Uint8Array(4);
|
|
48
|
-
gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixelData);
|
|
49
|
-
|
|
50
|
-
gl.bindFramebuffer(gl.FRAMEBUFFER, null);
|
|
51
|
-
gl.deleteFramebuffer(framebuffer);
|
|
52
|
-
gl.deleteTexture(texture);
|
|
53
|
-
|
|
54
|
-
// Check that the read pixel is red (with tolerance)
|
|
55
|
-
const isRedPixel =
|
|
56
|
-
pixelData[0] > 200 && pixelData[1] < 50 && pixelData[2] < 50 && pixelData[3] > 200;
|
|
57
|
-
if (!isRedPixel) {
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return true;
|
|
62
|
-
} catch (error) {
|
|
63
|
-
void error;
|
|
64
|
-
return false;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Checks sRGB support
|
|
70
|
-
*/
|
|
71
|
-
function checkSRGBSupportInternal(): boolean {
|
|
72
|
-
const canvasElement = document.createElement("canvas");
|
|
73
|
-
const gl = canvasElement.getContext("webgl2") ?? canvasElement.getContext("webgl");
|
|
74
|
-
if (!gl) {
|
|
75
|
-
return false;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (gl instanceof WebGL2RenderingContext) {
|
|
79
|
-
try {
|
|
80
|
-
const texture = gl.createTexture();
|
|
81
|
-
gl.bindTexture(gl.TEXTURE_2D, texture);
|
|
82
|
-
gl.texStorage2D(gl.TEXTURE_2D, 1, gl.SRGB8_ALPHA8, 2, 2);
|
|
83
|
-
const errorCode = gl.getError();
|
|
84
|
-
gl.deleteTexture(texture);
|
|
85
|
-
return errorCode === gl.NO_ERROR;
|
|
86
|
-
} catch {
|
|
87
|
-
return false;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
const extension = gl.getExtension("EXT_sRGB");
|
|
92
|
-
if (!extension) {
|
|
93
|
-
return false;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
try {
|
|
97
|
-
const texture = gl.createTexture();
|
|
98
|
-
gl.bindTexture(gl.TEXTURE_2D, texture);
|
|
99
|
-
gl.texImage2D(
|
|
100
|
-
gl.TEXTURE_2D,
|
|
101
|
-
0,
|
|
102
|
-
extension.SRGB_ALPHA_EXT,
|
|
103
|
-
2,
|
|
104
|
-
2,
|
|
105
|
-
0,
|
|
106
|
-
extension.SRGB_ALPHA_EXT,
|
|
107
|
-
gl.UNSIGNED_BYTE,
|
|
108
|
-
null,
|
|
109
|
-
);
|
|
110
|
-
const errorCode = gl.getError();
|
|
111
|
-
gl.deleteTexture(texture);
|
|
112
|
-
return errorCode === gl.NO_ERROR;
|
|
113
|
-
} catch {
|
|
114
|
-
return false;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
let OFFSCREEN_CANVAS_SUPPORTED_INTERNAL: boolean | undefined;
|
|
119
|
-
let SRGB_SUPPORTED_INTERNAL: boolean | undefined;
|
|
120
|
-
|
|
121
|
-
export const checkOffscreenCanvasSupport = (): boolean => {
|
|
122
|
-
OFFSCREEN_CANVAS_SUPPORTED_INTERNAL ??= checkOffscreenCanvasSupportInternal();
|
|
123
|
-
return OFFSCREEN_CANVAS_SUPPORTED_INTERNAL;
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
export const checkSRGBSupport = (): boolean => {
|
|
127
|
-
SRGB_SUPPORTED_INTERNAL ??= checkSRGBSupportInternal();
|
|
128
|
-
return SRGB_SUPPORTED_INTERNAL;
|
|
129
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// Required properties:
|
|
2
|
-
// - p_uv: vec2 (builtin)
|
|
3
|
-
// - p_texture: sampler2D
|
|
4
|
-
// - p_textureTransform: mat3
|
|
5
|
-
// - p_color: vec4
|
|
6
|
-
|
|
7
|
-
vec4 draw() {
|
|
8
|
-
vec2 transformedUV = (p_textureTransform * vec3(p_uv, 1.0)).xy;
|
|
9
|
-
return srgbTexture2D(p_texture, transformedUV) * p_color;
|
|
10
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
// Required properties:
|
|
2
|
-
// - p_uv: vec2 (builtin)
|
|
3
|
-
// - p_texture: sampler2D
|
|
4
|
-
// - p_textureTransform: mat3
|
|
5
|
-
// - p_color: vec4
|
|
6
|
-
// - p_sliceBorders: vec4
|
|
7
|
-
// - p_sliceRegions: vec4
|
|
8
|
-
|
|
9
|
-
vec4 draw() {
|
|
10
|
-
vec2 localUV = p_uv;
|
|
11
|
-
|
|
12
|
-
float left = p_sliceBorders.x;
|
|
13
|
-
float right = p_sliceBorders.y;
|
|
14
|
-
float top = p_sliceBorders.z;
|
|
15
|
-
float bottom = p_sliceBorders.w;
|
|
16
|
-
|
|
17
|
-
float leftFill = p_sliceRegions.x;
|
|
18
|
-
float rightFill = p_sliceRegions.y;
|
|
19
|
-
float topFill = p_sliceRegions.z;
|
|
20
|
-
float bottomFill = p_sliceRegions.w;
|
|
21
|
-
|
|
22
|
-
float lB = leftFill;
|
|
23
|
-
float rB = 1.0 - rightFill;
|
|
24
|
-
float bB = bottomFill;
|
|
25
|
-
float tB = 1.0 - topFill;
|
|
26
|
-
|
|
27
|
-
{
|
|
28
|
-
float regionL = step(p_uv.x, lB);
|
|
29
|
-
float regionR = step(rB, p_uv.x);
|
|
30
|
-
float regionM = 1.0 - regionL - regionR;
|
|
31
|
-
|
|
32
|
-
float xL = (p_uv.x / lB) * left;
|
|
33
|
-
float xR = 1.0 - right + ((p_uv.x - rB) / rightFill) * right;
|
|
34
|
-
float xM = left + ((p_uv.x - lB) / (rB - lB)) * (1.0 - left - right);
|
|
35
|
-
|
|
36
|
-
localUV.x = regionL * xL + regionM * xM + regionR * xR;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
{
|
|
40
|
-
float regionB = step(p_uv.y, bB);
|
|
41
|
-
float regionT = step(tB, p_uv.y);
|
|
42
|
-
float regionC = 1.0 - regionB - regionT;
|
|
43
|
-
|
|
44
|
-
float yB = (p_uv.y / bB) * bottom;
|
|
45
|
-
float yT = 1.0 - top + ((p_uv.y - tB) / topFill) * top;
|
|
46
|
-
float yC = bottom + ((p_uv.y - bB) / (tB - bB)) * (1.0 - bottom - top);
|
|
47
|
-
|
|
48
|
-
localUV.y = regionB * yB + regionC * yC + regionT * yT;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
vec2 transformedUV = (p_textureTransform * vec3(localUV, 1.0)).xy;
|
|
52
|
-
return srgbTexture2D(p_texture, transformedUV) * p_color;
|
|
53
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Required properties:
|
|
2
|
-
// - p_uv: vec2 (builtin)
|
|
3
|
-
// - p_texture: sampler2D
|
|
4
|
-
// - p_textureTransform: mat3
|
|
5
|
-
// - p_textureResolution: vec2
|
|
6
|
-
// - p_color: vec4
|
|
7
|
-
// - p_progress: float
|
|
8
|
-
// - p_direction: float
|
|
9
|
-
|
|
10
|
-
vec4 draw() {
|
|
11
|
-
vec2 transformedUV = (p_textureTransform * vec3(p_uv, 1.0)).xy;
|
|
12
|
-
vec4 diffuseColor = srgbTexture2D(p_texture, transformedUV) * p_color;
|
|
13
|
-
diffuseColor.a *= calculateMask();
|
|
14
|
-
return diffuseColor;
|
|
15
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
float calculateMask() {
|
|
2
|
-
float aspect = p_textureResolution.x / p_textureResolution.y;
|
|
3
|
-
vec2 p = (p_uv - 0.5) * vec2(aspect, 1.0);
|
|
4
|
-
|
|
5
|
-
float angle = atan(p.y, p.x);
|
|
6
|
-
angle = (angle + PI) / (2.0 * PI);
|
|
7
|
-
|
|
8
|
-
float adjusted = angle - p_startAngle;
|
|
9
|
-
adjusted = p_direction > 0.0 ? adjusted : -adjusted;
|
|
10
|
-
adjusted = fract(adjusted);
|
|
11
|
-
|
|
12
|
-
return step(adjusted, p_progress);
|
|
13
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
float calculateMask() {
|
|
2
|
-
float aspect = p_textureResolution.x / p_textureResolution.y;
|
|
3
|
-
vec2 halfExtents = vec2(aspect, 1.0) * 0.5;
|
|
4
|
-
|
|
5
|
-
float maxProjection = dot(halfExtents, abs(p_direction));
|
|
6
|
-
|
|
7
|
-
vec2 correctedUV = (p_uv - 0.5) * vec2(aspect, 1.0);
|
|
8
|
-
float projection = dot(correctedUV, p_direction);
|
|
9
|
-
|
|
10
|
-
float offset = (projection / maxProjection + 1.0) * 0.5;
|
|
11
|
-
return step(offset, p_progress);
|
|
12
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type declarations for GLSL shader files imported as strings
|
|
3
|
-
*/
|
|
4
|
-
declare module "*.glsl" {
|
|
5
|
-
const content: string;
|
|
6
|
-
export default content;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
declare module "*.vert" {
|
|
10
|
-
const content: string;
|
|
11
|
-
export default content;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
declare module "*.frag" {
|
|
15
|
-
const content: string;
|
|
16
|
-
export default content;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
declare module "*.vs" {
|
|
20
|
-
const content: string;
|
|
21
|
-
export default content;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
declare module "*.fs" {
|
|
25
|
-
const content: string;
|
|
26
|
-
export default content;
|
|
27
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export interface UIInputWrapperView {
|
|
2
|
-
get dirty(): boolean;
|
|
3
|
-
createInputCatcher(
|
|
4
|
-
catchPointerDown: (x: number, y: number, identifier: number) => boolean,
|
|
5
|
-
catchPointerMove: (x: number, y: number, identifier: number) => boolean,
|
|
6
|
-
catchPointerUp: (x: number, y: number, identifier: number) => boolean,
|
|
7
|
-
zIndex: number,
|
|
8
|
-
): number;
|
|
9
|
-
destroyInputCatcher(handler: number): void;
|
|
10
|
-
getZIndex(handler: number): number;
|
|
11
|
-
setZIndex(handler: number, zIndex: number): void;
|
|
12
|
-
getActive(handler: number): boolean;
|
|
13
|
-
setActive(handler: number, active: boolean): void;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface UIInputWrapperCatcher {
|
|
17
|
-
handler: number;
|
|
18
|
-
catchPointerDown: (x: number, y: number, identifier: number) => boolean;
|
|
19
|
-
catchPointerMove: (x: number, y: number, identifier: number) => boolean;
|
|
20
|
-
catchPointerUp: (x: number, y: number, identifier: number) => boolean;
|
|
21
|
-
zIndex: number;
|
|
22
|
-
active: boolean;
|
|
23
|
-
}
|