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