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.
Files changed (395) hide show
  1. package/{src/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.ts → dist/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.d.ts} +2 -3
  2. package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.d.ts +22 -0
  3. package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.js +41 -0
  4. package/dist/core/constraints/UIConstraint.d.ts +12 -0
  5. package/dist/core/constraints/UIConstraint.js +11 -0
  6. package/dist/core/constraints/UICustomConstraint.d.ts +28 -0
  7. package/dist/core/constraints/UICustomConstraint.js +37 -0
  8. package/{src/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.ts → dist/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.d.ts} +2 -3
  9. package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.d.ts +20 -0
  10. package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.js +34 -0
  11. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.d.ts +11 -0
  12. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.js +3 -0
  13. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.d.ts +36 -0
  14. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.js +100 -0
  15. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.d.ts +14 -0
  16. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.js +4 -0
  17. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.d.ts +44 -0
  18. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.js +136 -0
  19. package/{src/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.ts → dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.d.ts} +2 -3
  20. package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.d.ts +22 -0
  21. package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.js +40 -0
  22. package/{src/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.ts → dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.d.ts} +8 -9
  23. package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.d.ts +43 -0
  24. package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.js +71 -0
  25. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.d.ts +11 -0
  26. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.js +3 -0
  27. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.d.ts +32 -0
  28. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.js +100 -0
  29. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.d.ts +14 -0
  30. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.js +4 -0
  31. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.d.ts +44 -0
  32. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.js +136 -0
  33. package/{src/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.ts → dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.d.ts} +2 -3
  34. package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.d.ts +22 -0
  35. package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.js +40 -0
  36. package/{src/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.ts → dist/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.d.ts} +2 -3
  37. package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.d.ts +20 -0
  38. package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.js +34 -0
  39. package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.d.ts +64 -0
  40. package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.js +19 -0
  41. package/dist/core/constraints/builders/UIConstraint2DBuilder.d.ts +46 -0
  42. package/dist/core/constraints/builders/UIConstraint2DBuilder.js +138 -0
  43. package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.d.ts +13 -0
  44. package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.js +3 -0
  45. package/dist/core/constraints/builders/UICoverConstraintBuilder.d.ts +29 -0
  46. package/dist/core/constraints/builders/UICoverConstraintBuilder.js +63 -0
  47. package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.d.ts +13 -0
  48. package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.js +3 -0
  49. package/dist/core/constraints/builders/UIFitConstraintBuilder.d.ts +29 -0
  50. package/dist/core/constraints/builders/UIFitConstraintBuilder.js +63 -0
  51. package/dist/core/elements/UIAnchor/UIAnchor.Internal.d.ts +12 -0
  52. package/dist/core/elements/UIAnchor/UIAnchor.Internal.js +5 -0
  53. package/dist/core/elements/UIAnchor/UIAnchor.d.ts +32 -0
  54. package/dist/core/elements/UIAnchor/UIAnchor.js +49 -0
  55. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.d.ts +27 -0
  56. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.js +15 -0
  57. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.d.ts +77 -0
  58. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.js +259 -0
  59. package/dist/core/elements/UIDummy/UIDummy.Internal.d.ts +30 -0
  60. package/dist/core/elements/UIDummy/UIDummy.Internal.js +8 -0
  61. package/dist/core/elements/UIDummy/UIDummy.d.ts +82 -0
  62. package/dist/core/elements/UIDummy/UIDummy.js +173 -0
  63. package/{src/core/elements/UIElement/UIElement.Internal.ts → dist/core/elements/UIElement/UIElement.Internal.d.ts} +5 -7
  64. package/dist/core/elements/UIElement/UIElement.Internal.js +5 -0
  65. package/dist/core/elements/UIElement/UIElement.d.ts +38 -0
  66. package/dist/core/elements/UIElement/UIElement.js +74 -0
  67. package/{src/core/elements/UIGraphics/UIGraphics.Internal.ts → dist/core/elements/UIGraphics/UIGraphics.Internal.d.ts} +5 -7
  68. package/dist/core/elements/UIGraphics/UIGraphics.Internal.js +7 -0
  69. package/dist/core/elements/UIGraphics/UIGraphics.d.ts +51 -0
  70. package/dist/core/elements/UIGraphics/UIGraphics.js +126 -0
  71. package/{src/core/elements/UIImage/UIImage.Internal.ts → dist/core/elements/UIImage/UIImage.Internal.d.ts} +2 -3
  72. package/dist/core/elements/UIImage/UIImage.d.ts +32 -0
  73. package/dist/core/elements/UIImage/UIImage.js +85 -0
  74. package/dist/core/elements/UINineSlice/UINineSlice.Internal.d.ts +23 -0
  75. package/dist/core/elements/UINineSlice/UINineSlice.Internal.js +12 -0
  76. package/dist/core/elements/UINineSlice/UINineSlice.d.ts +60 -0
  77. package/dist/core/elements/UINineSlice/UINineSlice.js +188 -0
  78. package/dist/core/elements/UIProgress/UIProgress.Internal.d.ts +14 -0
  79. package/dist/core/elements/UIProgress/UIProgress.Internal.js +3 -0
  80. package/dist/core/elements/UIProgress/UIProgress.d.ts +45 -0
  81. package/dist/core/elements/UIProgress/UIProgress.js +165 -0
  82. package/dist/core/elements/UIScene/UIScene.Internal.d.ts +43 -0
  83. package/dist/core/elements/UIScene/UIScene.Internal.js +27 -0
  84. package/dist/core/elements/UIScene/UIScene.d.ts +59 -0
  85. package/dist/core/elements/UIScene/UIScene.js +157 -0
  86. package/{src/core/elements/UIText/UIText.Interfaces.ts → dist/core/elements/UIText/UIText.Interfaces.d.ts} +16 -21
  87. package/dist/core/elements/UIText/UIText.Internal.d.ts +26 -0
  88. package/dist/core/elements/UIText/UIText.Internal.js +12 -0
  89. package/dist/core/elements/UIText/UIText.Measuring.d.ts +50 -0
  90. package/dist/core/elements/UIText/UIText.Measuring.js +153 -0
  91. package/dist/core/elements/UIText/UIText.Rendering.d.ts +20 -0
  92. package/dist/core/elements/UIText/UIText.Rendering.js +61 -0
  93. package/dist/core/elements/UIText/UIText.d.ts +71 -0
  94. package/dist/core/elements/UIText/UIText.js +265 -0
  95. package/{src/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.ts → dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.d.ts} +11 -14
  96. package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.js +5 -0
  97. package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.d.ts +63 -0
  98. package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.js +147 -0
  99. package/{src/core/layers/UILayer/UILayer.Internal.ts → dist/core/layers/UILayer/UILayer.Internal.d.ts} +11 -15
  100. package/dist/core/layers/UILayer/UILayer.Internal.js +7 -0
  101. package/dist/core/layers/UILayer/UILayer.d.ts +49 -0
  102. package/dist/core/layers/UILayer/UILayer.js +113 -0
  103. package/dist/core/miscellaneous/UIExpression.d.ts +69 -0
  104. package/dist/core/miscellaneous/UIExpression.js +128 -0
  105. package/dist/core/miscellaneous/UIMode.d.ts +23 -0
  106. package/dist/core/miscellaneous/UIMode.js +30 -0
  107. package/dist/core/miscellaneous/UIOrientation.d.ts +15 -0
  108. package/dist/core/miscellaneous/UIOrientation.js +20 -0
  109. package/dist/core/miscellaneous/UIPriority.d.ts +32 -0
  110. package/dist/core/miscellaneous/UIPriority.js +63 -0
  111. package/dist/core/miscellaneous/UIRelation.d.ts +23 -0
  112. package/dist/core/miscellaneous/UIRelation.js +40 -0
  113. package/dist/core/miscellaneous/UITransparencyMode.d.ts +9 -0
  114. package/dist/core/miscellaneous/UITransparencyMode.js +12 -0
  115. package/dist/core/miscellaneous/area/UIArea.d.ts +3 -0
  116. package/dist/core/miscellaneous/area/UIArea.js +5 -0
  117. package/dist/core/miscellaneous/area/UIAreaCircle.d.ts +15 -0
  118. package/dist/core/miscellaneous/area/UIAreaCircle.js +32 -0
  119. package/dist/core/miscellaneous/area/UIAreaPolygon.d.ts +12 -0
  120. package/dist/core/miscellaneous/area/UIAreaPolygon.js +40 -0
  121. package/dist/core/miscellaneous/area/UIAreaRectangle.d.ts +17 -0
  122. package/dist/core/miscellaneous/area/UIAreaRectangle.js +36 -0
  123. package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.d.ts +21 -0
  124. package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.js +72 -0
  125. package/dist/core/miscellaneous/asserts.d.ts +43 -0
  126. package/dist/core/miscellaneous/asserts.js +163 -0
  127. package/dist/core/miscellaneous/canvas.d.ts +31 -0
  128. package/dist/core/miscellaneous/canvas.js +37 -0
  129. package/dist/core/miscellaneous/color/UIColor.Internal.d.ts +7 -0
  130. package/dist/core/miscellaneous/color/UIColor.Internal.js +42 -0
  131. package/dist/core/miscellaneous/color/UIColor.d.ts +234 -0
  132. package/dist/core/miscellaneous/color/UIColor.js +636 -0
  133. package/dist/core/miscellaneous/computeTransform.d.ts +18 -0
  134. package/dist/core/miscellaneous/computeTransform.js +82 -0
  135. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.d.ts +19 -0
  136. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.js +168 -0
  137. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.d.ts +1 -0
  138. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.js +349 -0
  139. package/{src/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.ts → dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.d.ts} +8 -10
  140. package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.d.ts +1 -0
  141. package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.js +357 -0
  142. package/dist/core/miscellaneous/generic-plane/shared.d.ts +38 -0
  143. package/dist/core/miscellaneous/generic-plane/shared.js +228 -0
  144. package/dist/core/miscellaneous/insets/UIInsets.Internal.d.ts +11 -0
  145. package/dist/core/miscellaneous/insets/UIInsets.Internal.js +3 -0
  146. package/dist/core/miscellaneous/insets/UIInsets.d.ts +48 -0
  147. package/dist/core/miscellaneous/insets/UIInsets.js +224 -0
  148. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.d.ts +9 -0
  149. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.js +19 -0
  150. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.d.ts +21 -0
  151. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.js +51 -0
  152. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.d.ts +16 -0
  153. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.js +48 -0
  154. package/dist/core/miscellaneous/math.d.ts +7 -0
  155. package/dist/core/miscellaneous/math.js +11 -0
  156. package/dist/core/miscellaneous/micro/UIMicro.Internal.d.ts +31 -0
  157. package/dist/core/miscellaneous/micro/UIMicro.Internal.js +15 -0
  158. package/dist/core/miscellaneous/micro/UIMicro.d.ts +59 -0
  159. package/dist/core/miscellaneous/micro/UIMicro.js +181 -0
  160. package/dist/core/miscellaneous/resize-policy/UIResizePolicy.d.ts +3 -0
  161. package/dist/core/miscellaneous/resize-policy/UIResizePolicy.js +9 -0
  162. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.d.ts +22 -0
  163. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.js +50 -0
  164. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.d.ts +22 -0
  165. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.js +52 -0
  166. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.d.ts +22 -0
  167. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.js +52 -0
  168. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.d.ts +22 -0
  169. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.js +50 -0
  170. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.d.ts +22 -0
  171. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.js +52 -0
  172. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.d.ts +22 -0
  173. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.js +52 -0
  174. package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.d.ts +5 -0
  175. package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.js +13 -0
  176. package/dist/core/miscellaneous/shared.d.ts +46 -0
  177. package/dist/core/miscellaneous/shared.js +37 -0
  178. package/{src/core/miscellaneous/text-span/UITextSpan.Internal.ts → dist/core/miscellaneous/text-span/UITextSpan.Internal.d.ts} +4 -5
  179. package/dist/core/miscellaneous/text-span/UITextSpan.d.ts +14 -0
  180. package/dist/core/miscellaneous/text-span/UITextSpan.js +36 -0
  181. package/dist/core/miscellaneous/text-style/UITextStyle.Internal.d.ts +48 -0
  182. package/dist/core/miscellaneous/text-style/UITextStyle.Internal.js +17 -0
  183. package/dist/core/miscellaneous/text-style/UITextStyle.d.ts +85 -0
  184. package/dist/core/miscellaneous/text-style/UITextStyle.js +372 -0
  185. package/dist/core/miscellaneous/texture/UITextureView.Internal.d.ts +49 -0
  186. package/dist/core/miscellaneous/texture/UITextureView.Internal.js +6 -0
  187. package/dist/core/miscellaneous/texture/UITextureView.d.ts +67 -0
  188. package/dist/core/miscellaneous/texture/UITextureView.js +234 -0
  189. package/dist/core/miscellaneous/webglCapabilities.d.ts +2 -0
  190. package/dist/core/miscellaneous/webglCapabilities.js +103 -0
  191. package/dist/core/shaders/UIImage.glsl.js +3 -0
  192. package/dist/core/shaders/UINineSlice.glsl.js +3 -0
  193. package/dist/core/shaders/UIProgress.glsl.js +3 -0
  194. package/dist/core/shaders/UIProgressMaskFunctionCircular.glsl.js +3 -0
  195. package/dist/core/shaders/UIProgressMaskFunctionDirectional.glsl.js +3 -0
  196. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.d.ts +17 -0
  197. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.d.ts +13 -0
  198. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.js +108 -0
  199. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.d.ts +13 -0
  200. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.d.ts +20 -0
  201. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.js +75 -0
  202. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.d.ts +49 -0
  203. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.d.ts +215 -0
  204. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.js +505 -0
  205. package/dist/index.js +51 -0
  206. package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.d.ts +21 -0
  207. package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.js +47 -0
  208. package/dist/particles/behaviorModules/UIBehaviorModule.d.ts +14 -0
  209. package/dist/particles/behaviorModules/UIBehaviorModule.js +9 -0
  210. package/dist/particles/behaviorModules/UIBehaviorPointGravity.d.ts +39 -0
  211. package/dist/particles/behaviorModules/UIBehaviorPointGravity.js +110 -0
  212. package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.d.ts +22 -0
  213. package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.js +66 -0
  214. package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.d.ts +20 -0
  215. package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.js +48 -0
  216. package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.d.ts +26 -0
  217. package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.js +66 -0
  218. package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.d.ts +20 -0
  219. package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.js +49 -0
  220. package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.d.ts +26 -0
  221. package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.js +70 -0
  222. package/dist/particles/elements/UIEmitter.Internal.d.ts +15 -0
  223. package/dist/particles/elements/UIEmitter.Internal.js +11 -0
  224. package/dist/particles/elements/UIEmitter.d.ts +68 -0
  225. package/dist/particles/elements/UIEmitter.js +203 -0
  226. package/dist/particles/index.js +18 -0
  227. package/dist/particles/instancedParticle/UIInstancedParticle.Internal.d.ts +13 -0
  228. package/dist/particles/instancedParticle/UIInstancedParticle.Internal.js +211 -0
  229. package/dist/particles/instancedParticle/UIInstancedParticle.d.ts +17 -0
  230. package/dist/particles/instancedParticle/UIInstancedParticle.js +93 -0
  231. package/dist/particles/miscellaneous/miscellaneous.d.ts +32 -0
  232. package/dist/particles/miscellaneous/miscellaneous.js +67 -0
  233. package/dist/particles/renderingModules/UIRenderingColorOverLife.d.ts +14 -0
  234. package/dist/particles/renderingModules/UIRenderingColorOverLife.js +32 -0
  235. package/dist/particles/renderingModules/UIRenderingColorOverVelocity.d.ts +15 -0
  236. package/dist/particles/renderingModules/UIRenderingColorOverVelocity.js +37 -0
  237. package/dist/particles/renderingModules/UIRenderingModule.d.ts +8 -0
  238. package/dist/particles/renderingModules/UIRenderingModule.js +9 -0
  239. package/dist/particles/renderingModules/UIRenderingTexture.d.ts +14 -0
  240. package/dist/particles/renderingModules/UIRenderingTexture.js +26 -0
  241. package/dist/particles/shaders/UIRenderingColorOverLife.glsl.js +3 -0
  242. package/dist/particles/shaders/UIRenderingColorOverVelocity.glsl.js +3 -0
  243. package/dist/particles/shaders/UIRenderingTexture.glsl.js +3 -0
  244. package/dist/particles/spawnModules/UISpawnModule.d.ts +9 -0
  245. package/dist/particles/spawnModules/UISpawnModule.js +9 -0
  246. package/dist/particles/spawnModules/UISpawnOffset.d.ts +21 -0
  247. package/dist/particles/spawnModules/UISpawnOffset.js +46 -0
  248. package/dist/particles/spawnModules/UISpawnRandomLifetime.d.ts +20 -0
  249. package/dist/particles/spawnModules/UISpawnRandomLifetime.js +47 -0
  250. package/dist/particles/spawnModules/UISpawnRandomRotation.d.ts +20 -0
  251. package/dist/particles/spawnModules/UISpawnRandomRotation.js +45 -0
  252. package/dist/particles/spawnModules/UISpawnRandomScale.d.ts +26 -0
  253. package/dist/particles/spawnModules/UISpawnRandomScale.js +60 -0
  254. package/dist/particles/spawnModules/UISpawnRandomTorque.d.ts +20 -0
  255. package/dist/particles/spawnModules/UISpawnRandomTorque.js +45 -0
  256. package/dist/particles/spawnModules/UISpawnRandomVelocity.d.ts +26 -0
  257. package/dist/particles/spawnModules/UISpawnRandomVelocity.js +64 -0
  258. package/dist/particles/spawnModules/UISpawnRectangle.d.ts +27 -0
  259. package/dist/particles/spawnModules/UISpawnRectangle.js +62 -0
  260. package/package.json +8 -1
  261. package/.claude/settings.local.json +0 -9
  262. package/.editorconfig +0 -14
  263. package/CLAUDE.md +0 -181
  264. package/assets/logotype.png +0 -0
  265. package/eslint.config.js +0 -111
  266. package/rollup.config.js +0 -52
  267. package/src/core/constraints/UIAspectConstraint/UIAspectConstraint.ts +0 -60
  268. package/src/core/constraints/UIConstraint.ts +0 -20
  269. package/src/core/constraints/UICustomConstraint.ts +0 -62
  270. package/src/core/constraints/UIHeightConstraint/UIHeightConstraint.ts +0 -52
  271. package/src/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.ts +0 -13
  272. package/src/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.ts +0 -139
  273. package/src/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.ts +0 -16
  274. package/src/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.ts +0 -189
  275. package/src/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.ts +0 -68
  276. package/src/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.ts +0 -94
  277. package/src/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.ts +0 -13
  278. package/src/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.ts +0 -135
  279. package/src/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.ts +0 -16
  280. package/src/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.ts +0 -189
  281. package/src/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.ts +0 -68
  282. package/src/core/constraints/UIWidthConstraint/UIWidthConstraint.ts +0 -52
  283. package/src/core/constraints/builders/UIConstraint2DBuilder.Internal.ts +0 -84
  284. package/src/core/constraints/builders/UIConstraint2DBuilder.ts +0 -168
  285. package/src/core/constraints/builders/UICoverConstraintBuilder.Internal.ts +0 -15
  286. package/src/core/constraints/builders/UICoverConstraintBuilder.ts +0 -84
  287. package/src/core/constraints/builders/UIFitConstraintBuilder.Internal.ts +0 -15
  288. package/src/core/constraints/builders/UIFitConstraintBuilder.ts +0 -84
  289. package/src/core/elements/UIAnchor/UIAnchor.Internal.ts +0 -13
  290. package/src/core/elements/UIAnchor/UIAnchor.ts +0 -70
  291. package/src/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.ts +0 -30
  292. package/src/core/elements/UIAnimatedImage/UIAnimatedImage.ts +0 -355
  293. package/src/core/elements/UIDummy/UIDummy.Internal.ts +0 -33
  294. package/src/core/elements/UIDummy/UIDummy.ts +0 -244
  295. package/src/core/elements/UIElement/UIElement.ts +0 -127
  296. package/src/core/elements/UIGraphics/UIGraphics.ts +0 -168
  297. package/src/core/elements/UIImage/UIImage.ts +0 -138
  298. package/src/core/elements/UINineSlice/UINineSlice.Internal.ts +0 -26
  299. package/src/core/elements/UINineSlice/UINineSlice.ts +0 -296
  300. package/src/core/elements/UIProgress/UIProgress.Internal.ts +0 -24
  301. package/src/core/elements/UIProgress/UIProgress.ts +0 -259
  302. package/src/core/elements/UIScene/UIScene.Internal.ts +0 -46
  303. package/src/core/elements/UIScene/UIScene.ts +0 -259
  304. package/src/core/elements/UIText/UIText.Internal.ts +0 -29
  305. package/src/core/elements/UIText/UIText.Measuring.ts +0 -183
  306. package/src/core/elements/UIText/UIText.Rendering.ts +0 -83
  307. package/src/core/elements/UIText/UIText.ts +0 -376
  308. package/src/core/layers/UIFullscreenLayer/UIFullscreenLayer.ts +0 -233
  309. package/src/core/layers/UILayer/UILayer.ts +0 -156
  310. package/src/core/miscellaneous/UIExpression.ts +0 -142
  311. package/src/core/miscellaneous/UIMode.ts +0 -29
  312. package/src/core/miscellaneous/UIOrientation.ts +0 -18
  313. package/src/core/miscellaneous/UIPriority.ts +0 -63
  314. package/src/core/miscellaneous/UIRelation.ts +0 -39
  315. package/src/core/miscellaneous/UITransparencyMode.ts +0 -9
  316. package/src/core/miscellaneous/area/UIArea.ts +0 -5
  317. package/src/core/miscellaneous/area/UIAreaCircle.ts +0 -32
  318. package/src/core/miscellaneous/area/UIAreaPolygon.ts +0 -50
  319. package/src/core/miscellaneous/area/UIAreaRectangle.ts +0 -38
  320. package/src/core/miscellaneous/area/UIAreaRoundedRectangle.ts +0 -78
  321. package/src/core/miscellaneous/asserts.ts +0 -187
  322. package/src/core/miscellaneous/canvas.ts +0 -73
  323. package/src/core/miscellaneous/color/UIColor.Internal.ts +0 -89
  324. package/src/core/miscellaneous/color/UIColor.ts +0 -844
  325. package/src/core/miscellaneous/computeTransform.ts +0 -127
  326. package/src/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.ts +0 -235
  327. package/src/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.ts +0 -524
  328. package/src/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.ts +0 -448
  329. package/src/core/miscellaneous/generic-plane/shared.ts +0 -323
  330. package/src/core/miscellaneous/insets/UIInsets.Internal.ts +0 -9
  331. package/src/core/miscellaneous/insets/UIInsets.ts +0 -248
  332. package/src/core/miscellaneous/mask-function/UIProgressMaskFunction.ts +0 -24
  333. package/src/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.ts +0 -58
  334. package/src/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.ts +0 -52
  335. package/src/core/miscellaneous/math.ts +0 -16
  336. package/src/core/miscellaneous/micro/UIMicro.Internal.ts +0 -33
  337. package/src/core/miscellaneous/micro/UIMicro.ts +0 -222
  338. package/src/core/miscellaneous/resize-policy/UIResizePolicy.ts +0 -8
  339. package/src/core/miscellaneous/resize-policy/UIResizePolicyCover.ts +0 -57
  340. package/src/core/miscellaneous/resize-policy/UIResizePolicyCross.ts +0 -65
  341. package/src/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.ts +0 -65
  342. package/src/core/miscellaneous/resize-policy/UIResizePolicyFit.ts +0 -57
  343. package/src/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.ts +0 -65
  344. package/src/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.ts +0 -65
  345. package/src/core/miscellaneous/resize-policy/UIResizePolicyNone.ts +0 -11
  346. package/src/core/miscellaneous/shared.ts +0 -73
  347. package/src/core/miscellaneous/text-span/UITextSpan.ts +0 -43
  348. package/src/core/miscellaneous/text-style/UITextStyle.Internal.ts +0 -52
  349. package/src/core/miscellaneous/text-style/UITextStyle.ts +0 -479
  350. package/src/core/miscellaneous/texture/UITextureView.Internal.ts +0 -55
  351. package/src/core/miscellaneous/texture/UITextureView.ts +0 -308
  352. package/src/core/miscellaneous/webglCapabilities.ts +0 -129
  353. package/src/core/shaders/UIImage.glsl +0 -10
  354. package/src/core/shaders/UINineSlice.glsl +0 -53
  355. package/src/core/shaders/UIProgress.glsl +0 -15
  356. package/src/core/shaders/UIProgressMaskFunctionCircular.glsl +0 -13
  357. package/src/core/shaders/UIProgressMaskFunctionDirectional.glsl +0 -12
  358. package/src/core/shaders/glsl.d.ts +0 -27
  359. package/src/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.ts +0 -23
  360. package/src/core/wrappers/UIInputWrapper/UIInputWrapper.ts +0 -124
  361. package/src/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.ts +0 -22
  362. package/src/core/wrappers/UISceneWrapper/UISceneWrapper.ts +0 -101
  363. package/src/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.ts +0 -58
  364. package/src/core/wrappers/UISolverWrapper/UISolverWrapper.ts +0 -605
  365. package/src/particles/behaviorModules/UIBehaviorDirectionalGravity.ts +0 -70
  366. package/src/particles/behaviorModules/UIBehaviorModule.ts +0 -20
  367. package/src/particles/behaviorModules/UIBehaviorPointGravity.ts +0 -173
  368. package/src/particles/behaviorModules/UIBehaviorScaleOverLife.ts +0 -104
  369. package/src/particles/behaviorModules/UIBehaviorTorqueDamping.ts +0 -75
  370. package/src/particles/behaviorModules/UIBehaviorTorqueNoise.ts +0 -115
  371. package/src/particles/behaviorModules/UIBehaviorVelocityDamping.ts +0 -77
  372. package/src/particles/behaviorModules/UIBehaviorVelocityNoise.ts +0 -118
  373. package/src/particles/elements/UIEmitter.Internal.ts +0 -22
  374. package/src/particles/elements/UIEmitter.ts +0 -313
  375. package/src/particles/instancedParticle/UIInstancedParticle.Internal.ts +0 -263
  376. package/src/particles/instancedParticle/UIInstancedParticle.ts +0 -138
  377. package/src/particles/miscellaneous/miscellaneous.ts +0 -115
  378. package/src/particles/renderingModules/UIRenderingColorOverLife.ts +0 -39
  379. package/src/particles/renderingModules/UIRenderingColorOverVelocity.ts +0 -49
  380. package/src/particles/renderingModules/UIRenderingModule.ts +0 -17
  381. package/src/particles/renderingModules/UIRenderingTexture.ts +0 -30
  382. package/src/particles/shaders/UIRenderingColorOverLife.glsl +0 -4
  383. package/src/particles/shaders/UIRenderingColorOverVelocity.glsl +0 -6
  384. package/src/particles/shaders/UIRenderingTexture.glsl +0 -4
  385. package/src/particles/spawnModules/UISpawnModule.ts +0 -22
  386. package/src/particles/spawnModules/UISpawnOffset.ts +0 -62
  387. package/src/particles/spawnModules/UISpawnRandomLifetime.ts +0 -68
  388. package/src/particles/spawnModules/UISpawnRandomRotation.ts +0 -60
  389. package/src/particles/spawnModules/UISpawnRandomScale.ts +0 -81
  390. package/src/particles/spawnModules/UISpawnRandomTorque.ts +0 -62
  391. package/src/particles/spawnModules/UISpawnRandomVelocity.ts +0 -92
  392. package/src/particles/spawnModules/UISpawnRectangle.ts +0 -81
  393. package/tsconfig.json +0 -29
  394. /package/{src/core/index.ts → dist/core/index.d.ts} +0 -0
  395. /package/{src/particles/index.ts → dist/particles/index.d.ts} +0 -0
@@ -0,0 +1,188 @@
1
+ import { Vector4 } from 'three';
2
+ import { UIColor } from '../../miscellaneous/color/UIColor.js';
3
+ import { computeTrimmedTransformMatrix } from '../../miscellaneous/computeTransform.js';
4
+ import { UIInsets } from '../../miscellaneous/insets/UIInsets.js';
5
+ import { UITextureView } from '../../miscellaneous/texture/UITextureView.js';
6
+ import source from '../../shaders/UINineSlice.glsl.js';
7
+ import { UIElement } from '../UIElement/UIElement.js';
8
+ import { NINE_SLICE_DEFAULT_BORDER, NINE_SLICE_DEFAULT_REGION_MODE, UINineSliceRegionMode } from './UINineSlice.Internal.js';
9
+
10
+ /** Scalable textured image preserving border regions */
11
+ class UINineSlice extends UIElement {
12
+ /**
13
+ * Creates a new UINineSlice instance.
14
+ *
15
+ * Defaults size to texture dimensions if width and height not provided.
16
+ *
17
+ * @param layer - Layer containing this element
18
+ * @param texture - Texture to display
19
+ * @param options - Configuration options
20
+ */
21
+ constructor(layer, texture, options = {}) {
22
+ const color = new UIColor(options.color);
23
+ const textureView = new UITextureView(texture);
24
+ const textureTransform = textureView.calculateUVTransform();
25
+ options.width = options.width ?? textureView.width;
26
+ options.height = options.height ?? textureView.height;
27
+ const sliceBorders = new UIInsets(options.sliceBorders ?? NINE_SLICE_DEFAULT_BORDER);
28
+ const sliceRegions = new UIInsets(options.sliceRegions ?? NINE_SLICE_DEFAULT_BORDER);
29
+ const regionMode = options.regionMode ?? NINE_SLICE_DEFAULT_REGION_MODE;
30
+ const sliceBordersVector = new Vector4();
31
+ const sliceRegionsVector = new Vector4();
32
+ super(layer, source, {
33
+ texture: textureView.texture,
34
+ textureTransform: textureTransform,
35
+ color,
36
+ sliceBorders: sliceBordersVector,
37
+ sliceRegions: sliceRegionsVector,
38
+ }, options);
39
+ this._private_regionModeDirty = true;
40
+ this._private_sliceBordersVector = new Vector4();
41
+ this._private_sliceRegionsVector = new Vector4();
42
+ this._private_textureDimensionsDirty = true;
43
+ this._private_onTextureDimensionsChanged = () => {
44
+ this._private_textureDimensionsDirty = true;
45
+ };
46
+ this.texture = textureView;
47
+ this._private_textureTransform = textureTransform;
48
+ this._private_colorInternal = color;
49
+ this._private_sliceBordersInternal = sliceBorders;
50
+ this._private_sliceRegionsInternal = sliceRegions;
51
+ this._private_regionModeInternal = regionMode;
52
+ this._private_sliceBordersVector = sliceBordersVector;
53
+ this._private_sliceRegionsVector = sliceRegionsVector;
54
+ this._private_lastElementWidth = this.width;
55
+ this._private_lastElementHeight = this.height;
56
+ this.texture.signalDiminsionsChanged.on(this._private_onTextureDimensionsChanged);
57
+ }
58
+ /** Multiplicative tint. Alpha channel controls opacity. */
59
+ get color() {
60
+ return this._private_colorInternal;
61
+ }
62
+ /** Controls how sliceRegions values are interpreted */
63
+ get regionMode() {
64
+ return this._private_regionModeInternal;
65
+ }
66
+ /** Border size in normalized texture coordinates (0 to 1) */
67
+ get sliceBorders() {
68
+ return this._private_sliceBordersInternal;
69
+ }
70
+ /** Region size. Interpretation depends on regionMode. */
71
+ get sliceRegions() {
72
+ return this._private_sliceRegionsInternal;
73
+ }
74
+ /** Multiplicative tint. Alpha channel controls opacity. */
75
+ set color(value) {
76
+ this._private_colorInternal.set(value);
77
+ }
78
+ /** Controls how sliceRegions values are interpreted */
79
+ set regionMode(value) {
80
+ if (this._private_regionModeInternal !== value) {
81
+ this._private_regionModeInternal = value;
82
+ this._private_regionModeDirty = true;
83
+ }
84
+ }
85
+ /** Border size in normalized texture coordinates (0 to 1) */
86
+ set sliceBorders(value) {
87
+ this._private_sliceBordersInternal.set(value);
88
+ }
89
+ /** Region size. Interpretation depends on regionMode. */
90
+ set sliceRegions(value) {
91
+ this._private_sliceRegionsInternal.set(value);
92
+ }
93
+ /** Removes nine slice and frees resources */
94
+ destroy() {
95
+ this.texture.signalDiminsionsChanged.off(this._private_onTextureDimensionsChanged);
96
+ super.destroy();
97
+ }
98
+ setPlaneTransform() {
99
+ let properties;
100
+ const sliceBordersDirty = this._private_textureDimensionsDirty || this._private_sliceBordersInternal.dirty || this.texture.trimDirty;
101
+ if (sliceBordersDirty) {
102
+ properties ?? (properties = {});
103
+ properties["sliceBorders"] = this._private_calculateSliceBordersForShader(this._private_sliceBordersVector);
104
+ this._private_sliceBordersInternal.setDirtyFalse();
105
+ this._private_textureDimensionsDirty = false;
106
+ }
107
+ const sliceRegionsDirty = this._private_sliceRegionsInternal.dirty || this._private_regionModeDirty ||
108
+ (this._private_regionModeInternal === UINineSliceRegionMode.WORLD &&
109
+ this._private_checkElementDimensionsDirty());
110
+ if (sliceRegionsDirty) {
111
+ properties ?? (properties = {});
112
+ properties["sliceRegions"] = this._private_calculateSliceRegionsForShader(this._private_sliceRegionsVector);
113
+ this._private_sliceRegionsInternal.setDirtyFalse();
114
+ this._private_regionModeDirty = false;
115
+ this._private_setElementDimensionsDirtyFalse();
116
+ }
117
+ if (this._private_colorInternal.dirty) {
118
+ properties ?? (properties = {});
119
+ properties["color"] = this._private_colorInternal;
120
+ this._private_colorInternal.setDirtyFalse();
121
+ }
122
+ if (this.texture.textureDirty) {
123
+ properties ?? (properties = {});
124
+ properties["texture"] = this.texture.texture;
125
+ this.texture.setTextureDirtyFalse();
126
+ }
127
+ if (this.texture.uvTransformDirty) {
128
+ properties ?? (properties = {});
129
+ properties["textureTransform"] = this.texture.calculateUVTransform(this._private_textureTransform);
130
+ this.texture.setUVTransformDirtyFalse();
131
+ }
132
+ if (properties) {
133
+ this.sceneWrapper.setProperties(this.planeHandler, properties);
134
+ }
135
+ const isTransformDirty = this.micro.dirty ||
136
+ this.texture.trimDirty ||
137
+ this.inputWrapper.dirty ||
138
+ this.solverWrapper.dirty;
139
+ if (isTransformDirty) {
140
+ const micro = this.micro;
141
+ const textureTrim = this.texture.trim;
142
+ this.sceneWrapper.setTransform(this.planeHandler, computeTrimmedTransformMatrix(this.x, this.y, this.width, this.height, this.zIndex, micro.x, micro.y, micro.anchorX, micro.anchorY, micro.scaleX, micro.scaleY, micro.rotation, micro.anchorMode, textureTrim.left, textureTrim.right, textureTrim.top, textureTrim.bottom));
143
+ this.micro.setDirtyFalse();
144
+ this.texture.setTrimDirtyFalse();
145
+ }
146
+ }
147
+ _private_calculateSliceBordersForShader(result) {
148
+ const sourceWidth = this.texture.width;
149
+ const sourceHeight = this.texture.height;
150
+ const trim = this.texture.trim;
151
+ const trimmedWidth = sourceWidth - trim.left - trim.right;
152
+ const trimmedHeight = sourceHeight - trim.top - trim.bottom;
153
+ const trimNLeft = trim.left / sourceWidth;
154
+ const trimNRight = trim.right / sourceWidth;
155
+ const trimNTop = trim.top / sourceHeight;
156
+ const trimNBottom = trim.bottom / sourceHeight;
157
+ const trimmedWidthNorm = trimmedWidth / sourceWidth;
158
+ const trimmedHeightNorm = trimmedHeight / sourceHeight;
159
+ const srcLeft = this._private_sliceBordersInternal.left;
160
+ const srcRight = this._private_sliceBordersInternal.right;
161
+ const srcTop = this._private_sliceBordersInternal.top;
162
+ const srcBottom = this._private_sliceBordersInternal.bottom;
163
+ const left = Math.max(0, srcLeft - trimNLeft) / trimmedWidthNorm;
164
+ const right = Math.max(0, srcRight - trimNRight) / trimmedWidthNorm;
165
+ const top = Math.max(0, srcTop - trimNTop) / trimmedHeightNorm;
166
+ const bottom = Math.max(0, srcBottom - trimNBottom) / trimmedHeightNorm;
167
+ return result.set(Math.min(1, left), Math.min(1, right), Math.min(1, top), Math.min(1, bottom));
168
+ }
169
+ _private_calculateSliceRegionsForShader(result) {
170
+ if (this._private_regionModeInternal === UINineSliceRegionMode.NORMALIZED) {
171
+ return result.set(this._private_sliceRegionsInternal.left, this._private_sliceRegionsInternal.right, this._private_sliceRegionsInternal.top, this._private_sliceRegionsInternal.bottom);
172
+ }
173
+ const width = this.width;
174
+ const height = this.height;
175
+ return result.set(this._private_sliceRegionsInternal.left / width, this._private_sliceRegionsInternal.right / width, this._private_sliceRegionsInternal.top / height, this._private_sliceRegionsInternal.bottom / height);
176
+ }
177
+ _private_checkElementDimensionsDirty() {
178
+ return (this.solverWrapper.dirty &&
179
+ (this._private_lastElementWidth !== Math.round(this.width) ||
180
+ this._private_lastElementHeight !== Math.round(this.height)));
181
+ }
182
+ _private_setElementDimensionsDirtyFalse() {
183
+ this._private_lastElementWidth = Math.round(this.width);
184
+ this._private_lastElementHeight = Math.round(this.height);
185
+ }
186
+ }
187
+
188
+ export { UINineSlice };
@@ -0,0 +1,14 @@
1
+ import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
2
+ import type { UIProgressMaskFunction } from "../../miscellaneous/mask-function/UIProgressMaskFunction";
3
+ import type { UIElementOptions } from "../UIElement/UIElement.Internal";
4
+ /** Configuration options for UIProgress */
5
+ export interface UIProgressOptions extends UIElementOptions {
6
+ /** Multiplicative tint */
7
+ color: UIColorConfig;
8
+ /** Function controlling fill direction and shape */
9
+ maskFunction: UIProgressMaskFunction;
10
+ /** Progress from 0 (empty) to 1 (full) */
11
+ progress: number;
12
+ }
13
+ export declare const PROGRESS_DEFAULT_VALUE = 1;
14
+ export declare function simplifyGLSLSource(source: string): string;
@@ -0,0 +1,3 @@
1
+ const PROGRESS_DEFAULT_VALUE = 1;
2
+
3
+ export { PROGRESS_DEFAULT_VALUE };
@@ -0,0 +1,45 @@
1
+ import type { Texture } from "three";
2
+ import type { UILayer } from "../../layers/UILayer/UILayer";
3
+ import { UIColor } from "../../miscellaneous/color/UIColor";
4
+ import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
5
+ import type { UIProgressMaskFunction } from "../../miscellaneous/mask-function/UIProgressMaskFunction";
6
+ import { UITextureView } from "../../miscellaneous/texture/UITextureView";
7
+ import { UIElement } from "../UIElement/UIElement";
8
+ import type { UIProgressOptions } from "./UIProgress.Internal";
9
+ /** Progress bar with customizable fill direction */
10
+ export declare class UIProgress extends UIElement {
11
+ /** Texture displayed by this element */
12
+ readonly texture: UITextureView;
13
+ private readonly colorInternal;
14
+ private readonly textureTransform;
15
+ private readonly textureResolution;
16
+ private maskFunctionInternal;
17
+ private progressInternal;
18
+ private progressDirty;
19
+ private textureResolutionDirty;
20
+ /**
21
+ * Creates a new UIProgress instance.
22
+ *
23
+ * Defaults size to texture dimensions if width and height not provided.
24
+ *
25
+ * @param layer - Layer containing this element
26
+ * @param texture - Texture to display
27
+ * @param options - Configuration options
28
+ */
29
+ constructor(layer: UILayer, texture: Texture, options?: Partial<UIProgressOptions>);
30
+ /** Multiplicative tint. Alpha channel controls opacity. */
31
+ get color(): UIColor;
32
+ /** Function controlling fill direction and shape */
33
+ get maskFunction(): UIProgressMaskFunction;
34
+ /** Progress from 0 (empty) to 1 (full) */
35
+ get progress(): number;
36
+ /** Multiplicative tint. Alpha channel controls opacity. */
37
+ set color(value: UIColorConfig);
38
+ /** Function controlling fill direction and shape */
39
+ set maskFunction(value: UIProgressMaskFunction);
40
+ /** Progress from 0 (empty) to 1 (full). Clamped. */
41
+ set progress(value: number);
42
+ protected setPlaneTransform(): void;
43
+ private readonly onTextureDimensionsChanged;
44
+ private rebuildPlane;
45
+ }
@@ -0,0 +1,165 @@
1
+ import { MathUtils } from 'three';
2
+ import { assertValidNumber } from '../../miscellaneous/asserts.js';
3
+ import { UIColor } from '../../miscellaneous/color/UIColor.js';
4
+ import { computeTrimmedTransformMatrix } from '../../miscellaneous/computeTransform.js';
5
+ import { UIProgressMaskFunctionDirectional } from '../../miscellaneous/mask-function/UIProgressMaskFunctionDirectional.js';
6
+ import { UITextureView } from '../../miscellaneous/texture/UITextureView.js';
7
+ import { isUIModeVisible } from '../../miscellaneous/UIMode.js';
8
+ import source from '../../shaders/UIProgress.glsl.js';
9
+ import { UIElement } from '../UIElement/UIElement.js';
10
+ import { PROGRESS_DEFAULT_VALUE } from './UIProgress.Internal.js';
11
+
12
+ /** Progress bar with customizable fill direction */
13
+ class UIProgress extends UIElement {
14
+ /**
15
+ * Creates a new UIProgress instance.
16
+ *
17
+ * Defaults size to texture dimensions if width and height not provided.
18
+ *
19
+ * @param layer - Layer containing this element
20
+ * @param texture - Texture to display
21
+ * @param options - Configuration options
22
+ */
23
+ constructor(layer, texture, options = {}) {
24
+ if (options.progress !== undefined) {
25
+ assertValidNumber(options.progress, "UIProgress.constructor.options.progress");
26
+ }
27
+ const color = new UIColor(options.color);
28
+ const textureView = new UITextureView(texture);
29
+ const textureTransform = textureView.calculateUVTransform();
30
+ const textureResolution = textureView.getResolution();
31
+ options.width = options.width ?? textureView.width;
32
+ options.height = options.height ?? textureView.height;
33
+ const progress = MathUtils.clamp(options.progress ?? PROGRESS_DEFAULT_VALUE, 0, 1);
34
+ const maskFunction = options.maskFunction ?? new UIProgressMaskFunctionDirectional();
35
+ super(layer, maskFunction.source + source, {
36
+ texture: textureView.texture,
37
+ textureTransform,
38
+ textureResolution,
39
+ color,
40
+ progress,
41
+ ...maskFunction.enumerateProperties(),
42
+ }, options);
43
+ this._private_progressDirty = false;
44
+ this._private_textureResolutionDirty = false;
45
+ this._private_onTextureDimensionsChanged = (width, height) => {
46
+ if (this.width !== width || this.height !== height) {
47
+ this.width = width;
48
+ this.height = height;
49
+ this._private_textureResolutionDirty = true;
50
+ }
51
+ };
52
+ this.texture = textureView;
53
+ this._private_textureTransform = textureTransform;
54
+ this._private_textureResolution = textureResolution;
55
+ this._private_colorInternal = color;
56
+ this._private_progressInternal = progress;
57
+ this._private_maskFunctionInternal = maskFunction;
58
+ this.texture.signalDiminsionsChanged.on(this._private_onTextureDimensionsChanged);
59
+ }
60
+ /** Multiplicative tint. Alpha channel controls opacity. */
61
+ get color() {
62
+ return this._private_colorInternal;
63
+ }
64
+ /** Function controlling fill direction and shape */
65
+ get maskFunction() {
66
+ return this._private_maskFunctionInternal;
67
+ }
68
+ /** Progress from 0 (empty) to 1 (full) */
69
+ get progress() {
70
+ return this._private_progressInternal;
71
+ }
72
+ /** Multiplicative tint. Alpha channel controls opacity. */
73
+ set color(value) {
74
+ this._private_colorInternal.set(value);
75
+ }
76
+ /** Function controlling fill direction and shape */
77
+ set maskFunction(value) {
78
+ if (this._private_maskFunctionInternal !== value) {
79
+ this._private_maskFunctionInternal = value;
80
+ this._private_rebuildPlane();
81
+ }
82
+ }
83
+ /** Progress from 0 (empty) to 1 (full). Clamped. */
84
+ set progress(value) {
85
+ assertValidNumber(value, "UIProgress.progress");
86
+ value = MathUtils.clamp(value, 0, 1);
87
+ if (this._private_progressInternal !== value) {
88
+ this._private_progressInternal = value;
89
+ this._private_progressDirty = true;
90
+ }
91
+ }
92
+ setPlaneTransform() {
93
+ let properties;
94
+ if (this._private_colorInternal.dirty) {
95
+ properties ?? (properties = {});
96
+ properties["color"] = this._private_colorInternal;
97
+ this._private_colorInternal.setDirtyFalse();
98
+ }
99
+ if (this.texture.textureDirty) {
100
+ properties ?? (properties = {});
101
+ properties["texture"] = this.texture.texture;
102
+ this.texture.setTextureDirtyFalse();
103
+ }
104
+ if (this.texture.uvTransformDirty) {
105
+ properties ?? (properties = {});
106
+ properties["textureTransform"] = this.texture.calculateUVTransform(this._private_textureTransform);
107
+ this.texture.setUVTransformDirtyFalse();
108
+ }
109
+ if (this._private_progressDirty) {
110
+ properties ?? (properties = {});
111
+ properties["progress"] = this._private_progressInternal;
112
+ this._private_progressDirty = false;
113
+ }
114
+ if (this._private_textureResolutionDirty) {
115
+ properties ?? (properties = {});
116
+ properties["textureResolution"] = this.texture.getResolution(this._private_textureResolution);
117
+ this._private_textureResolutionDirty = false;
118
+ }
119
+ if (this.maskFunction.dirty) {
120
+ properties ?? (properties = {});
121
+ const maskProperties = this.maskFunction.enumerateProperties();
122
+ for (const key in maskProperties) {
123
+ properties[key] = maskProperties[key];
124
+ }
125
+ this.maskFunction.setDirtyFalse();
126
+ }
127
+ if (properties) {
128
+ this.sceneWrapper.setProperties(this.planeHandler, properties);
129
+ }
130
+ const isTransformDirty = this.micro.dirty ||
131
+ this.texture.trimDirty ||
132
+ this.inputWrapper.dirty ||
133
+ this.solverWrapper.dirty;
134
+ if (isTransformDirty) {
135
+ const micro = this.micro;
136
+ const textureTrim = this.texture.trim;
137
+ this.sceneWrapper.setTransform(this.planeHandler, computeTrimmedTransformMatrix(this.x, this.y, this.width, this.height, this.zIndex, micro.x, micro.y, micro.anchorX, micro.anchorY, micro.scaleX, micro.scaleY, micro.rotation, micro.anchorMode, textureTrim.left, textureTrim.right, textureTrim.top, textureTrim.bottom));
138
+ this.micro.setDirtyFalse();
139
+ this.texture.setTrimDirtyFalse();
140
+ }
141
+ }
142
+ _private_rebuildPlane() {
143
+ this.sceneWrapper.destroyPlane(this.planeHandler);
144
+ const micro = this.micro;
145
+ const textureTrim = this.texture.trim;
146
+ this.planeHandler = this.sceneWrapper.createPlane(this._private_maskFunctionInternal.source + source, {
147
+ texture: this.texture.texture,
148
+ textureTransform: this.texture.calculateUVTransform(this._private_textureTransform),
149
+ textureResolution: this.texture.getResolution(this._private_textureResolution),
150
+ color: this._private_colorInternal,
151
+ progress: this._private_progressInternal,
152
+ ...this._private_maskFunctionInternal.enumerateProperties(),
153
+ }, computeTrimmedTransformMatrix(this.x, this.y, this.width, this.height, this.zIndex, micro.x, micro.y, micro.anchorX, micro.anchorY, micro.scaleX, micro.scaleY, micro.rotation, micro.anchorMode, textureTrim.left, textureTrim.right, textureTrim.top, textureTrim.bottom), isUIModeVisible(this.mode), this.transparencyMode);
154
+ this._private_colorInternal.setDirtyFalse();
155
+ this.texture.setTextureDirtyFalse();
156
+ this.texture.setUVTransformDirtyFalse();
157
+ this.texture.setTrimDirtyFalse();
158
+ this._private_progressDirty = false;
159
+ this._private_textureResolutionDirty = false;
160
+ this._private_maskFunctionInternal.setDirtyFalse();
161
+ this.micro.setDirtyFalse();
162
+ }
163
+ }
164
+
165
+ export { UIProgress };
@@ -0,0 +1,43 @@
1
+ import type { Camera, Scene } from "three";
2
+ import { UIColor } from "../../miscellaneous/color/UIColor";
3
+ import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
4
+ import type { UIElementOptions } from "../UIElement/UIElement.Internal";
5
+ /** Controls when scene re-renders */
6
+ export declare enum UISceneUpdateMode {
7
+ /** Re-render every frame */
8
+ EVERY_FRAME = 1,
9
+ /** Re-render every other frame */
10
+ EVERY_SECOND_FRAME = 2,
11
+ /** Re-render when scene, camera, or updateMode changes */
12
+ ON_PROPERTIES_CHANGE = 3,
13
+ /** Re-render when dimensions or resolutionFactor changes */
14
+ ON_DIMENSIONS_CHANGE = 4,
15
+ /** Re-render only via requestUpdate() */
16
+ MANUAL = 5
17
+ }
18
+ /** Configuration options for UIScene */
19
+ export interface UISceneOptions extends UIElementOptions {
20
+ /** Multiplicative tint */
21
+ color: UIColorConfig;
22
+ /** Three.js scene to render */
23
+ scene: Scene;
24
+ /** Camera used for rendering */
25
+ camera: Camera;
26
+ /** When to re-render */
27
+ updateMode: UISceneUpdateMode;
28
+ /** Render target resolution multiplier. Range 0.1 to 2.0. */
29
+ resolutionFactor: number;
30
+ /** Background color */
31
+ clearColor: UIColorConfig;
32
+ /** Whether to use depth buffer */
33
+ enableDepthBuffer: boolean;
34
+ }
35
+ export declare const SCENE_DEFAULT_RESOLUTION_FACTOR = 0.5;
36
+ export declare const SCENE_MIN_RESOLUTION_FACTOR = 0.1;
37
+ export declare const SCENE_MAX_RESOLUTION_FACTOR = 2;
38
+ export declare const SCENE_DEFAULT_CAMERA_FOV = 60;
39
+ export declare const SCENE_DEFAULT_CAMERA_NEAR = 0.1;
40
+ export declare const SCENE_DEFAULT_CAMERA_FAR = 100;
41
+ export declare const SCENE_DEFAULT_UPDATE_MODE = UISceneUpdateMode.ON_PROPERTIES_CHANGE;
42
+ export declare const SCENE_DEFAULT_CLEAR_COLOR: UIColor;
43
+ export declare const SCENE_DEFAULT_USE_DEPTH = true;
@@ -0,0 +1,27 @@
1
+ import { UIColor } from '../../miscellaneous/color/UIColor.js';
2
+
3
+ /** Controls when scene re-renders */
4
+ var UISceneUpdateMode;
5
+ (function (UISceneUpdateMode) {
6
+ /** Re-render every frame */
7
+ UISceneUpdateMode[UISceneUpdateMode["EVERY_FRAME"] = 1] = "EVERY_FRAME";
8
+ /** Re-render every other frame */
9
+ UISceneUpdateMode[UISceneUpdateMode["EVERY_SECOND_FRAME"] = 2] = "EVERY_SECOND_FRAME";
10
+ /** Re-render when scene, camera, or updateMode changes */
11
+ UISceneUpdateMode[UISceneUpdateMode["ON_PROPERTIES_CHANGE"] = 3] = "ON_PROPERTIES_CHANGE";
12
+ /** Re-render when dimensions or resolutionFactor changes */
13
+ UISceneUpdateMode[UISceneUpdateMode["ON_DIMENSIONS_CHANGE"] = 4] = "ON_DIMENSIONS_CHANGE";
14
+ /** Re-render only via requestUpdate() */
15
+ UISceneUpdateMode[UISceneUpdateMode["MANUAL"] = 5] = "MANUAL";
16
+ })(UISceneUpdateMode || (UISceneUpdateMode = {}));
17
+ const SCENE_DEFAULT_RESOLUTION_FACTOR = 0.5;
18
+ const SCENE_MIN_RESOLUTION_FACTOR = 0.1;
19
+ const SCENE_MAX_RESOLUTION_FACTOR = 2;
20
+ const SCENE_DEFAULT_CAMERA_FOV = 60;
21
+ const SCENE_DEFAULT_CAMERA_NEAR = 0.1;
22
+ const SCENE_DEFAULT_CAMERA_FAR = 100;
23
+ const SCENE_DEFAULT_UPDATE_MODE = UISceneUpdateMode.ON_PROPERTIES_CHANGE;
24
+ const SCENE_DEFAULT_CLEAR_COLOR = new UIColor(0, 0, 0, 1);
25
+ const SCENE_DEFAULT_USE_DEPTH = true;
26
+
27
+ export { SCENE_DEFAULT_CAMERA_FAR, SCENE_DEFAULT_CAMERA_FOV, SCENE_DEFAULT_CAMERA_NEAR, SCENE_DEFAULT_CLEAR_COLOR, SCENE_DEFAULT_RESOLUTION_FACTOR, SCENE_DEFAULT_UPDATE_MODE, SCENE_DEFAULT_USE_DEPTH, SCENE_MAX_RESOLUTION_FACTOR, SCENE_MIN_RESOLUTION_FACTOR, UISceneUpdateMode };
@@ -0,0 +1,59 @@
1
+ import type { Camera, WebGLRenderer } from "three";
2
+ import { Scene } from "three";
3
+ import type { UILayer } from "../../layers/UILayer/UILayer";
4
+ import { UIColor } from "../../miscellaneous/color/UIColor";
5
+ import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
6
+ import { UIElement } from "../UIElement/UIElement";
7
+ import type { UISceneOptions } from "./UIScene.Internal";
8
+ import { UISceneUpdateMode } from "./UIScene.Internal";
9
+ /** Renders Three.js scene to texture */
10
+ export declare class UIScene extends UIElement {
11
+ private readonly colorInternal;
12
+ private readonly clearColorInternal;
13
+ private readonly renderTarget;
14
+ private sceneInternal;
15
+ private cameraInternal;
16
+ private updateModeInternal;
17
+ private resolutionFactorInternal;
18
+ private evenFrame;
19
+ private updateRequired;
20
+ private resolutionFactorDirty;
21
+ private propertyDirty;
22
+ /**
23
+ * Creates a new UIScene instance.
24
+ *
25
+ * @param layer - Layer containing this element
26
+ * @param options - Configuration options
27
+ * @throws If resolutionFactor outside range 0.1 to 2.0
28
+ */
29
+ constructor(layer: UILayer, options?: Partial<UISceneOptions>);
30
+ /** Camera used for rendering */
31
+ get camera(): Camera;
32
+ /** Background color for render target */
33
+ get clearColor(): UIColor;
34
+ /** Multiplicative tint. Alpha channel controls opacity. */
35
+ get color(): UIColor;
36
+ /** Render target resolution multiplier. Range 0.1 to 2.0. */
37
+ get resolutionFactor(): number;
38
+ /** Three.js scene to render */
39
+ get scene(): Scene;
40
+ /** Controls when scene re-renders */
41
+ get updateMode(): UISceneUpdateMode;
42
+ /** Camera used for rendering */
43
+ set camera(value: Camera);
44
+ /** Background color for render target */
45
+ set clearColor(value: UIColorConfig);
46
+ /** Multiplicative tint. Alpha channel controls opacity. */
47
+ set color(value: UIColorConfig);
48
+ /** Render target resolution multiplier. Range 0.1 to 2.0. */
49
+ set resolutionFactor(value: number);
50
+ /** Three.js scene to render */
51
+ set scene(value: Scene);
52
+ /** Controls when scene re-renders */
53
+ set updateMode(value: UISceneUpdateMode);
54
+ /** Removes element and frees resources */
55
+ destroy(): void;
56
+ /** Triggers re-render on next frame. Useful in MANUAL mode. */
57
+ requestUpdate(): void;
58
+ protected onWillRender(renderer: WebGLRenderer, deltaTime: number): void;
59
+ }