laymur 0.22.0 → 0.25.0

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 (314) hide show
  1. package/README.md +1 -1
  2. package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.d.ts +1 -1
  3. package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.js +1 -0
  4. package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.d.ts +3 -3
  5. package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.js +14 -16
  6. package/dist/core/constraints/UIConstraint.d.ts +22 -2
  7. package/dist/core/constraints/UIConstraint.js +26 -3
  8. package/dist/core/constraints/UICustomConstraint.d.ts +4 -4
  9. package/dist/core/constraints/UICustomConstraint.js +15 -15
  10. package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.d.ts +1 -1
  11. package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.js +1 -0
  12. package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.d.ts +3 -3
  13. package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.js +11 -13
  14. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.d.ts +1 -1
  15. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.js +1 -3
  16. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.d.ts +3 -3
  17. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.js +30 -30
  18. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.d.ts +1 -1
  19. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.js +2 -4
  20. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.d.ts +3 -3
  21. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.js +40 -39
  22. package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.d.ts +1 -1
  23. package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.js +1 -0
  24. package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.d.ts +3 -3
  25. package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.js +13 -15
  26. package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.d.ts +3 -3
  27. package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.js +1 -0
  28. package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.d.ts +13 -7
  29. package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.js +37 -30
  30. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.d.ts +1 -1
  31. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.js +1 -3
  32. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.d.ts +3 -3
  33. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.js +30 -30
  34. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.d.ts +1 -1
  35. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.js +2 -4
  36. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.d.ts +3 -3
  37. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.js +40 -39
  38. package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.d.ts +1 -1
  39. package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.js +1 -0
  40. package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.d.ts +3 -3
  41. package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.js +13 -15
  42. package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.d.ts +1 -1
  43. package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.js +1 -0
  44. package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.d.ts +3 -3
  45. package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.js +11 -13
  46. package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.d.ts +3 -3
  47. package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.js +1 -3
  48. package/dist/core/constraints/builders/UIConstraint2DBuilder.d.ts +11 -11
  49. package/dist/core/constraints/builders/UIConstraint2DBuilder.js +10 -13
  50. package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.d.ts +1 -1
  51. package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.js +1 -3
  52. package/dist/core/constraints/builders/UICoverConstraintBuilder.d.ts +7 -7
  53. package/dist/core/constraints/builders/UICoverConstraintBuilder.js +10 -13
  54. package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.d.ts +1 -1
  55. package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.js +1 -3
  56. package/dist/core/constraints/builders/UIFitConstraintBuilder.d.ts +7 -7
  57. package/dist/core/constraints/builders/UIFitConstraintBuilder.js +10 -13
  58. package/dist/core/elements/UIAnchor/UIAnchor.Internal.js +3 -5
  59. package/dist/core/elements/UIAnchor/UIAnchor.d.ts +23 -5
  60. package/dist/core/elements/UIAnchor/UIAnchor.js +42 -8
  61. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.d.ts +2 -2
  62. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.js +4 -6
  63. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.d.ts +10 -10
  64. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.js +108 -111
  65. package/dist/core/elements/UIDummy/UIDummy.Internal.d.ts +4 -4
  66. package/dist/core/elements/UIDummy/UIDummy.Internal.js +5 -8
  67. package/dist/core/elements/UIDummy/UIDummy.d.ts +19 -11
  68. package/dist/core/elements/UIDummy/UIDummy.js +59 -42
  69. package/dist/core/elements/UIElement/UIElement.Internal.d.ts +5 -5
  70. package/dist/core/elements/UIElement/UIElement.Internal.js +9 -12
  71. package/dist/core/elements/UIElement/UIElement.d.ts +25 -17
  72. package/dist/core/elements/UIElement/UIElement.js +76 -69
  73. package/dist/core/elements/UIGraphics/UIGraphics.Internal.d.ts +3 -3
  74. package/dist/core/elements/UIGraphics/UIGraphics.Internal.js +4 -7
  75. package/dist/core/elements/UIGraphics/UIGraphics.d.ts +7 -7
  76. package/dist/core/elements/UIGraphics/UIGraphics.js +44 -47
  77. package/dist/core/elements/UIImage/UIImage.Internal.d.ts +2 -2
  78. package/dist/core/elements/UIImage/UIImage.Internal.js +1 -0
  79. package/dist/core/elements/UIImage/UIImage.d.ts +9 -9
  80. package/dist/core/elements/UIImage/UIImage.js +21 -24
  81. package/dist/core/elements/UINineSlice/UINineSlice.Internal.d.ts +3 -3
  82. package/dist/core/elements/UINineSlice/UINineSlice.Internal.js +3 -5
  83. package/dist/core/elements/UINineSlice/UINineSlice.d.ts +12 -12
  84. package/dist/core/elements/UINineSlice/UINineSlice.js +71 -73
  85. package/dist/core/elements/UIProgress/UIProgress.Internal.d.ts +3 -4
  86. package/dist/core/elements/UIProgress/UIProgress.Internal.js +1 -3
  87. package/dist/core/elements/UIProgress/UIProgress.d.ts +10 -8
  88. package/dist/core/elements/UIProgress/UIProgress.js +60 -58
  89. package/dist/core/elements/UIScene/UIScene.Internal.d.ts +3 -3
  90. package/dist/core/elements/UIScene/UIScene.Internal.js +11 -14
  91. package/dist/core/elements/UIScene/UIScene.d.ts +8 -8
  92. package/dist/core/elements/UIScene/UIScene.js +68 -69
  93. package/dist/core/elements/UIText/UIText.Bidi.d.ts +2 -2
  94. package/dist/core/elements/UIText/UIText.Bidi.js +3 -5
  95. package/dist/core/elements/UIText/UIText.Interfaces.d.ts +6 -2
  96. package/dist/core/elements/UIText/UIText.Interfaces.js +1 -0
  97. package/dist/core/elements/UIText/UIText.Internal.d.ts +4 -4
  98. package/dist/core/elements/UIText/UIText.Internal.js +5 -7
  99. package/dist/core/elements/UIText/UIText.Measuring.d.ts +14 -7
  100. package/dist/core/elements/UIText/UIText.Measuring.js +115 -55
  101. package/dist/core/elements/UIText/UIText.Rendering.d.ts +3 -3
  102. package/dist/core/elements/UIText/UIText.Rendering.js +6 -9
  103. package/dist/core/elements/UIText/UIText.d.ts +28 -14
  104. package/dist/core/elements/UIText/UIText.js +181 -141
  105. package/dist/core/index.d.ts +55 -54
  106. package/dist/core/index.js +53 -0
  107. package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.d.ts +4 -4
  108. package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.js +2 -5
  109. package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.d.ts +4 -4
  110. package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.js +43 -42
  111. package/dist/core/layers/UILayer/UILayer.Internal.d.ts +2 -2
  112. package/dist/core/layers/UILayer/UILayer.Internal.js +4 -7
  113. package/dist/core/layers/UILayer/UILayer.d.ts +19 -4
  114. package/dist/core/layers/UILayer/UILayer.js +125 -62
  115. package/dist/core/miscellaneous/UIBlendMode.js +1 -3
  116. package/dist/core/miscellaneous/UIExpression.js +16 -19
  117. package/dist/core/miscellaneous/UIMode.js +3 -5
  118. package/dist/core/miscellaneous/UIOrientation.js +2 -4
  119. package/dist/core/miscellaneous/UIPriority.js +5 -8
  120. package/dist/core/miscellaneous/UIRelation.js +5 -8
  121. package/dist/core/miscellaneous/UITransparencyMode.js +1 -3
  122. package/dist/core/miscellaneous/area/UIArea.js +1 -3
  123. package/dist/core/miscellaneous/area/UIAreaCircle.d.ts +1 -1
  124. package/dist/core/miscellaneous/area/UIAreaCircle.js +3 -6
  125. package/dist/core/miscellaneous/area/UIAreaPolygon.d.ts +2 -2
  126. package/dist/core/miscellaneous/area/UIAreaPolygon.js +3 -6
  127. package/dist/core/miscellaneous/area/UIAreaRectangle.d.ts +1 -1
  128. package/dist/core/miscellaneous/area/UIAreaRectangle.js +3 -6
  129. package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.d.ts +1 -1
  130. package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.js +3 -6
  131. package/dist/core/miscellaneous/asserts.d.ts +20 -1
  132. package/dist/core/miscellaneous/asserts.js +71 -19
  133. package/dist/core/miscellaneous/canvas.js +13 -7
  134. package/dist/core/miscellaneous/color/UIColor.Internal.d.ts +1 -1
  135. package/dist/core/miscellaneous/color/UIColor.Internal.js +1 -3
  136. package/dist/core/miscellaneous/color/UIColor.d.ts +1 -1
  137. package/dist/core/miscellaneous/color/UIColor.js +202 -205
  138. package/dist/core/miscellaneous/computeTransform.d.ts +1 -1
  139. package/dist/core/miscellaneous/computeTransform.js +4 -7
  140. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.d.ts +2 -2
  141. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.js +13 -16
  142. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.js +115 -118
  143. package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.d.ts +3 -3
  144. package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.js +1 -0
  145. package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.js +208 -114
  146. package/dist/core/miscellaneous/generic-plane/shared.d.ts +2 -2
  147. package/dist/core/miscellaneous/generic-plane/shared.js +16 -19
  148. package/dist/core/miscellaneous/insets/UIInsets.Internal.js +1 -3
  149. package/dist/core/miscellaneous/insets/UIInsets.d.ts +1 -1
  150. package/dist/core/miscellaneous/insets/UIInsets.js +96 -99
  151. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.js +1 -3
  152. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.d.ts +1 -1
  153. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.js +14 -17
  154. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.d.ts +2 -2
  155. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.js +14 -17
  156. package/dist/core/miscellaneous/math.js +3 -5
  157. package/dist/core/miscellaneous/micro/UIMicro.Internal.js +6 -8
  158. package/dist/core/miscellaneous/micro/UIMicro.d.ts +1 -1
  159. package/dist/core/miscellaneous/micro/UIMicro.js +91 -94
  160. package/dist/core/miscellaneous/resize-policy/UIResizePolicy.js +1 -3
  161. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.d.ts +1 -1
  162. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.js +12 -15
  163. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.d.ts +1 -1
  164. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.js +13 -16
  165. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.d.ts +1 -1
  166. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.js +13 -16
  167. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.d.ts +1 -1
  168. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.js +12 -15
  169. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.d.ts +1 -1
  170. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.js +13 -16
  171. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.d.ts +1 -1
  172. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.js +13 -16
  173. package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.d.ts +1 -1
  174. package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.js +3 -6
  175. package/dist/core/miscellaneous/shared.d.ts +1 -1
  176. package/dist/core/miscellaneous/shared.js +4 -7
  177. package/dist/core/miscellaneous/text-span/UITextSpan.Internal.d.ts +1 -1
  178. package/dist/core/miscellaneous/text-span/UITextSpan.Internal.js +1 -0
  179. package/dist/core/miscellaneous/text-span/UITextSpan.d.ts +2 -2
  180. package/dist/core/miscellaneous/text-span/UITextSpan.js +10 -13
  181. package/dist/core/miscellaneous/text-style/UITextStyle.Internal.js +15 -17
  182. package/dist/core/miscellaneous/text-style/UITextStyle.d.ts +13 -2
  183. package/dist/core/miscellaneous/text-style/UITextStyle.js +222 -207
  184. package/dist/core/miscellaneous/texture/UITextureView.Internal.d.ts +7 -0
  185. package/dist/core/miscellaneous/texture/UITextureView.Internal.js +16 -6
  186. package/dist/core/miscellaneous/texture/UITextureView.d.ts +3 -3
  187. package/dist/core/miscellaneous/texture/UITextureView.js +114 -118
  188. package/dist/core/miscellaneous/webglCapabilities.js +3 -4
  189. package/dist/core/shaders/UIImage.d.ts +9 -0
  190. package/dist/core/shaders/UIImage.js +14 -0
  191. package/dist/core/shaders/UINineSlice.d.ts +11 -0
  192. package/dist/core/shaders/UINineSlice.js +57 -0
  193. package/dist/core/shaders/UIProgress.d.ts +14 -0
  194. package/dist/core/shaders/UIProgress.js +21 -0
  195. package/dist/core/shaders/UIProgressMaskFunctionCircular.d.ts +2 -0
  196. package/dist/core/shaders/UIProgressMaskFunctionCircular.js +16 -0
  197. package/dist/core/shaders/UIProgressMaskFunctionDirectional.d.ts +2 -0
  198. package/dist/core/shaders/UIProgressMaskFunctionDirectional.js +15 -0
  199. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.d.ts +4 -0
  200. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.js +1 -0
  201. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.d.ts +7 -1
  202. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.js +50 -47
  203. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.d.ts +5 -2
  204. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.js +1 -0
  205. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.d.ts +11 -3
  206. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.js +42 -26
  207. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.d.ts +5 -3
  208. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.js +1 -0
  209. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.d.ts +27 -4
  210. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.js +162 -123
  211. package/dist/debug/UIAspectDebug.d.ts +3 -3
  212. package/dist/debug/UIAspectDebug.js +64 -68
  213. package/dist/debug/UIConstraintDebug.d.ts +1 -1
  214. package/dist/debug/UIConstraintDebug.js +1 -0
  215. package/dist/debug/UIHeightDebug.d.ts +3 -3
  216. package/dist/debug/UIHeightDebug.js +63 -67
  217. package/dist/debug/UIHorizontalDistanceDebug.d.ts +3 -3
  218. package/dist/debug/UIHorizontalDistanceDebug.js +76 -81
  219. package/dist/debug/UIHorizontalInterpolationDebug.d.ts +3 -3
  220. package/dist/debug/UIHorizontalInterpolationDebug.js +74 -78
  221. package/dist/debug/UILayerDebug.d.ts +1 -1
  222. package/dist/debug/UILayerDebug.js +55 -64
  223. package/dist/debug/UIVerticalDistanceDebug.d.ts +3 -3
  224. package/dist/debug/UIVerticalDistanceDebug.js +76 -81
  225. package/dist/debug/UIVerticalInterpolationDebug.d.ts +3 -3
  226. package/dist/debug/UIVerticalInterpolationDebug.js +74 -78
  227. package/dist/debug/UIWidthDebug.d.ts +3 -3
  228. package/dist/debug/UIWidthDebug.js +63 -67
  229. package/dist/debug/index.d.ts +8 -8
  230. package/dist/debug/index.js +8 -8
  231. package/dist/debug/miscellaneous.js +8 -11
  232. package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.d.ts +3 -3
  233. package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.js +13 -16
  234. package/dist/particles/behaviorModules/UIBehaviorModule.d.ts +1 -1
  235. package/dist/particles/behaviorModules/UIBehaviorModule.js +1 -3
  236. package/dist/particles/behaviorModules/UIBehaviorPointGravity.d.ts +3 -3
  237. package/dist/particles/behaviorModules/UIBehaviorPointGravity.js +37 -40
  238. package/dist/particles/behaviorModules/UIBehaviorScaleOscillation.d.ts +41 -0
  239. package/dist/particles/behaviorModules/UIBehaviorScaleOscillation.js +87 -0
  240. package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.d.ts +2 -2
  241. package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.js +17 -20
  242. package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.d.ts +2 -2
  243. package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.js +13 -16
  244. package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.d.ts +2 -2
  245. package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.js +21 -24
  246. package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.d.ts +2 -2
  247. package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.js +13 -16
  248. package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.d.ts +2 -2
  249. package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.js +21 -24
  250. package/dist/particles/elements/UIEmitter.Internal.d.ts +2 -2
  251. package/dist/particles/elements/UIEmitter.Internal.js +6 -9
  252. package/dist/particles/elements/UIEmitter.d.ts +17 -11
  253. package/dist/particles/elements/UIEmitter.js +100 -88
  254. package/dist/particles/index.d.ts +20 -18
  255. package/dist/particles/index.js +19 -18
  256. package/dist/particles/instancedParticle/UIInstancedParticle.Internal.d.ts +1 -1
  257. package/dist/particles/instancedParticle/UIInstancedParticle.Internal.js +14 -15
  258. package/dist/particles/instancedParticle/UIInstancedParticle.d.ts +1 -1
  259. package/dist/particles/instancedParticle/UIInstancedParticle.js +29 -32
  260. package/dist/particles/miscellaneous/miscellaneous.d.ts +3 -3
  261. package/dist/particles/miscellaneous/miscellaneous.js +26 -27
  262. package/dist/particles/renderingModules/UIRenderingColorOverLife.d.ts +2 -2
  263. package/dist/particles/renderingModules/UIRenderingColorOverLife.js +5 -8
  264. package/dist/particles/renderingModules/UIRenderingColorOverVelocity.d.ts +2 -2
  265. package/dist/particles/renderingModules/UIRenderingColorOverVelocity.js +6 -9
  266. package/dist/particles/renderingModules/UIRenderingModule.js +1 -3
  267. package/dist/particles/renderingModules/UIRenderingTexture.d.ts +2 -2
  268. package/dist/particles/renderingModules/UIRenderingTexture.js +4 -7
  269. package/dist/particles/shaders/UIRenderingColorOverLife.d.ts +2 -0
  270. package/dist/particles/shaders/UIRenderingColorOverLife.js +7 -0
  271. package/dist/particles/shaders/UIRenderingColorOverVelocity.d.ts +9 -0
  272. package/dist/particles/shaders/UIRenderingColorOverVelocity.js +16 -0
  273. package/dist/particles/shaders/UIRenderingTexture.d.ts +2 -0
  274. package/dist/particles/shaders/UIRenderingTexture.js +7 -0
  275. package/dist/particles/spawnModules/UISpawnModule.d.ts +1 -1
  276. package/dist/particles/spawnModules/UISpawnModule.js +1 -3
  277. package/dist/particles/spawnModules/UISpawnOffset.d.ts +3 -3
  278. package/dist/particles/spawnModules/UISpawnOffset.js +12 -15
  279. package/dist/particles/spawnModules/UISpawnRandomLifetime.d.ts +2 -2
  280. package/dist/particles/spawnModules/UISpawnRandomLifetime.js +13 -16
  281. package/dist/particles/spawnModules/UISpawnRandomRotation.d.ts +2 -2
  282. package/dist/particles/spawnModules/UISpawnRandomRotation.js +13 -16
  283. package/dist/particles/spawnModules/UISpawnRandomScale.d.ts +2 -2
  284. package/dist/particles/spawnModules/UISpawnRandomScale.js +19 -22
  285. package/dist/particles/spawnModules/UISpawnRandomTorque.d.ts +2 -2
  286. package/dist/particles/spawnModules/UISpawnRandomTorque.js +13 -16
  287. package/dist/particles/spawnModules/UISpawnRandomVelocity.d.ts +2 -2
  288. package/dist/particles/spawnModules/UISpawnRandomVelocity.js +21 -24
  289. package/dist/particles/spawnModules/UISpawnRectangle.d.ts +3 -3
  290. package/dist/particles/spawnModules/UISpawnRectangle.js +21 -24
  291. package/package.json +13 -17
  292. package/dist/_virtual/2d.js +0 -3
  293. package/dist/_virtual/3d.js +0 -3
  294. package/dist/_virtual/4d.js +0 -3
  295. package/dist/_virtual/mod.js +0 -5
  296. package/dist/_virtual/mod2.js +0 -3
  297. package/dist/core/shaders/UIImage.glsl.js +0 -3
  298. package/dist/core/shaders/UINineSlice.glsl.js +0 -3
  299. package/dist/core/shaders/UIProgress.glsl.js +0 -3
  300. package/dist/core/shaders/UIProgressMaskFunctionCircular.glsl.js +0 -3
  301. package/dist/core/shaders/UIProgressMaskFunctionDirectional.glsl.js +0 -3
  302. package/dist/index.js +0 -52
  303. package/dist/node_modules/fast-simplex-noise/lib/2d.js +0 -93
  304. package/dist/node_modules/fast-simplex-noise/lib/3d.js +0 -142
  305. package/dist/node_modules/fast-simplex-noise/lib/4d.js +0 -196
  306. package/dist/node_modules/fast-simplex-noise/lib/mod.js +0 -24
  307. package/dist/node_modules/three/examples/jsm/lines/Line2.js +0 -56
  308. package/dist/node_modules/three/examples/jsm/lines/LineGeometry.js +0 -157
  309. package/dist/node_modules/three/examples/jsm/lines/LineMaterial.js +0 -691
  310. package/dist/node_modules/three/examples/jsm/lines/LineSegments2.js +0 -415
  311. package/dist/node_modules/three/examples/jsm/lines/LineSegmentsGeometry.js +0 -289
  312. package/dist/particles/shaders/UIRenderingColorOverLife.glsl.js +0 -3
  313. package/dist/particles/shaders/UIRenderingColorOverVelocity.glsl.js +0 -3
  314. package/dist/particles/shaders/UIRenderingTexture.glsl.js +0 -3
@@ -1,11 +1,10 @@
1
- import { UIColor } from '../../miscellaneous/color/UIColor.js';
2
- import { computeTrimmedTransformMatrix } from '../../miscellaneous/computeTransform.js';
3
- import { UITextureView } from '../../miscellaneous/texture/UITextureView.js';
4
- import source from '../../shaders/UIImage.glsl.js';
5
- import { UIElement } from '../UIElement/UIElement.js';
6
-
1
+ import { UIColor } from "../../miscellaneous/color/UIColor.js";
2
+ import { computeTrimmedTransformMatrix } from "../../miscellaneous/computeTransform.js";
3
+ import { UITextureView } from "../../miscellaneous/texture/UITextureView.js";
4
+ import source from "../../shaders/UIImage.js";
5
+ import { UIElement } from "../UIElement/UIElement.js";
7
6
  /** Textured image element */
8
- class UIImage extends UIElement {
7
+ export class UIImage extends UIElement {
9
8
  /**
10
9
  * Creates a new UIImage instance.
11
10
  *
@@ -26,34 +25,34 @@ class UIImage extends UIElement {
26
25
  textureTransform: textureTransform,
27
26
  color,
28
27
  }, options);
29
- this._private_onTextureDimensionsChanged = (width, height) => {
28
+ this.onTextureDimensionsChanged = (width, height) => {
30
29
  this.width = width;
31
30
  this.height = height;
32
31
  };
33
32
  this.texture = textureView;
34
- this._private_textureTransform = textureTransform;
35
- this._private_colorInternal = color;
36
- this.texture.signalDiminsionsChanged.on(this._private_onTextureDimensionsChanged);
33
+ this.textureTransform = textureTransform;
34
+ this.colorInternal = color;
35
+ this.texture.signalDimensionsChanged.on(this.onTextureDimensionsChanged);
37
36
  }
38
37
  /** Multiplicative tint. Alpha channel controls opacity. */
39
38
  get color() {
40
- return this._private_colorInternal;
39
+ return this.colorInternal;
41
40
  }
42
41
  /** Multiplicative tint. Alpha channel controls opacity. */
43
42
  set color(value) {
44
- this._private_colorInternal.set(value);
43
+ this.colorInternal.set(value);
45
44
  }
46
- /** Removes image and frees resources */
47
- destroy() {
48
- this.texture.signalDiminsionsChanged.off(this._private_onTextureDimensionsChanged);
49
- super.destroy();
45
+ /** Frees resources of the image */
46
+ destroyInternal() {
47
+ this.texture.signalDimensionsChanged.off(this.onTextureDimensionsChanged);
48
+ super.destroyInternal();
50
49
  }
51
50
  setPlaneTransform() {
52
51
  let properties;
53
- if (this._private_colorInternal.dirty) {
52
+ if (this.colorInternal.dirty) {
54
53
  properties ?? (properties = {});
55
- properties["color"] = this._private_colorInternal;
56
- this._private_colorInternal.setDirtyFalse();
54
+ properties["color"] = this.colorInternal;
55
+ this.colorInternal.setDirtyFalse();
57
56
  }
58
57
  if (this.texture.textureDirty) {
59
58
  properties ?? (properties = {});
@@ -62,7 +61,7 @@ class UIImage extends UIElement {
62
61
  }
63
62
  if (this.texture.uvTransformDirty) {
64
63
  properties ?? (properties = {});
65
- properties["textureTransform"] = this.texture.calculateUVTransform(this._private_textureTransform);
64
+ properties["textureTransform"] = this.texture.calculateUVTransform(this.textureTransform);
66
65
  this.texture.setUVTransformDirtyFalse();
67
66
  }
68
67
  if (properties) {
@@ -75,11 +74,9 @@ class UIImage extends UIElement {
75
74
  if (isTransformDirty) {
76
75
  const micro = this.micro;
77
76
  const textureTrim = this.texture.trim;
78
- 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));
77
+ this.sceneWrapper.setTransform(this.planeHandler, computeTrimmedTransformMatrix(this.x, this.y, this.width, this.height, this.renderDepth, micro.x, micro.y, micro.anchorX, micro.anchorY, micro.scaleX, micro.scaleY, micro.rotation, micro.anchorMode, textureTrim.left, textureTrim.right, textureTrim.top, textureTrim.bottom));
79
78
  this.micro.setDirtyFalse();
80
79
  this.texture.setTrimDirtyFalse();
81
80
  }
82
81
  }
83
82
  }
84
-
85
- export { UIImage };
@@ -1,6 +1,6 @@
1
- import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
2
- import type { UIInsetsConfig } from "../../miscellaneous/insets/UIInsets.Internal";
3
- import type { UIElementOptions } from "../UIElement/UIElement.Internal";
1
+ import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal.js";
2
+ import type { UIInsetsConfig } from "../../miscellaneous/insets/UIInsets.Internal.js";
3
+ import type { UIElementOptions } from "../UIElement/UIElement.Internal.js";
4
4
  /** Controls how sliceRegions values are interpreted */
5
5
  export declare enum UINineSliceRegionMode {
6
6
  /** sliceRegions in normalized coordinates (0 to 1) */
@@ -1,12 +1,10 @@
1
1
  /** Controls how sliceRegions values are interpreted */
2
- var UINineSliceRegionMode;
2
+ export var UINineSliceRegionMode;
3
3
  (function (UINineSliceRegionMode) {
4
4
  /** sliceRegions in normalized coordinates (0 to 1) */
5
5
  UINineSliceRegionMode[UINineSliceRegionMode["NORMALIZED"] = 0] = "NORMALIZED";
6
6
  /** sliceRegions in world units */
7
7
  UINineSliceRegionMode[UINineSliceRegionMode["WORLD"] = 1] = "WORLD";
8
8
  })(UINineSliceRegionMode || (UINineSliceRegionMode = {}));
9
- const NINE_SLICE_DEFAULT_BORDER = 0.1;
10
- const NINE_SLICE_DEFAULT_REGION_MODE = UINineSliceRegionMode.WORLD;
11
-
12
- export { NINE_SLICE_DEFAULT_BORDER, NINE_SLICE_DEFAULT_REGION_MODE, UINineSliceRegionMode };
9
+ export const NINE_SLICE_DEFAULT_BORDER = 0.1;
10
+ export const NINE_SLICE_DEFAULT_REGION_MODE = UINineSliceRegionMode.WORLD;
@@ -1,13 +1,13 @@
1
- import type { UILayer } from "../../layers/UILayer/UILayer";
2
- import { UIColor } from "../../miscellaneous/color/UIColor";
3
- import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
4
- import { UIInsets } from "../../miscellaneous/insets/UIInsets";
5
- import type { UIInsetsConfig } from "../../miscellaneous/insets/UIInsets.Internal";
6
- import { UITextureView } from "../../miscellaneous/texture/UITextureView";
7
- import type { UITextureConfig } from "../../miscellaneous/texture/UITextureView.Internal";
8
- import { UIElement } from "../UIElement/UIElement";
9
- import type { UINineSliceOptions } from "./UINineSlice.Internal";
10
- import { UINineSliceRegionMode } from "./UINineSlice.Internal";
1
+ import type { UILayer } from "../../layers/UILayer/UILayer.js";
2
+ import { UIColor } from "../../miscellaneous/color/UIColor.js";
3
+ import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal.js";
4
+ import { UIInsets } from "../../miscellaneous/insets/UIInsets.js";
5
+ import type { UIInsetsConfig } from "../../miscellaneous/insets/UIInsets.Internal.js";
6
+ import { UITextureView } from "../../miscellaneous/texture/UITextureView.js";
7
+ import type { UITextureConfig } from "../../miscellaneous/texture/UITextureView.Internal.js";
8
+ import { UIElement } from "../UIElement/UIElement.js";
9
+ import type { UINineSliceOptions } from "./UINineSlice.Internal.js";
10
+ import { UINineSliceRegionMode } from "./UINineSlice.Internal.js";
11
11
  /** Scalable textured image preserving border regions */
12
12
  export declare class UINineSlice extends UIElement {
13
13
  /** Texture displayed by this element */
@@ -49,8 +49,8 @@ export declare class UINineSlice extends UIElement {
49
49
  set sliceBorders(value: UIInsetsConfig);
50
50
  /** Region size. Interpretation depends on regionMode. */
51
51
  set sliceRegions(value: UIInsetsConfig);
52
- /** Removes nine slice and frees resources */
53
- destroy(): void;
52
+ /** Frees resources of the nine slice */
53
+ protected destroyInternal(): void;
54
54
  protected setPlaneTransform(): void;
55
55
  private calculateSliceBordersForShader;
56
56
  private calculateSliceRegionsForShader;
@@ -1,14 +1,13 @@
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
-
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.js";
7
+ import { UIElement } from "../UIElement/UIElement.js";
8
+ import { NINE_SLICE_DEFAULT_BORDER, NINE_SLICE_DEFAULT_REGION_MODE, UINineSliceRegionMode, } from "./UINineSlice.Internal.js";
10
9
  /** Scalable textured image preserving border regions */
11
- class UINineSlice extends UIElement {
10
+ export class UINineSlice extends UIElement {
12
11
  /**
13
12
  * Creates a new UINineSlice instance.
14
13
  *
@@ -36,88 +35,89 @@ class UINineSlice extends UIElement {
36
35
  sliceBorders: sliceBordersVector,
37
36
  sliceRegions: sliceRegionsVector,
38
37
  }, 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;
38
+ this.regionModeDirty = true;
39
+ this.sliceBordersVector = new Vector4();
40
+ this.sliceRegionsVector = new Vector4();
41
+ this.textureDimensionsDirty = true;
42
+ this.onTextureDimensionsChanged = () => {
43
+ this.textureDimensionsDirty = true;
45
44
  };
46
45
  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);
46
+ this.textureTransform = textureTransform;
47
+ this.colorInternal = color;
48
+ this.sliceBordersInternal = sliceBorders;
49
+ this.sliceRegionsInternal = sliceRegions;
50
+ this.regionModeInternal = regionMode;
51
+ this.sliceBordersVector = sliceBordersVector;
52
+ this.sliceRegionsVector = sliceRegionsVector;
53
+ this.lastElementWidth = this.width;
54
+ this.lastElementHeight = this.height;
55
+ this.texture.signalDimensionsChanged.on(this.onTextureDimensionsChanged);
57
56
  }
58
57
  /** Multiplicative tint. Alpha channel controls opacity. */
59
58
  get color() {
60
- return this._private_colorInternal;
59
+ return this.colorInternal;
61
60
  }
62
61
  /** Controls how sliceRegions values are interpreted */
63
62
  get regionMode() {
64
- return this._private_regionModeInternal;
63
+ return this.regionModeInternal;
65
64
  }
66
65
  /** Border size in normalized texture coordinates (0 to 1) */
67
66
  get sliceBorders() {
68
- return this._private_sliceBordersInternal;
67
+ return this.sliceBordersInternal;
69
68
  }
70
69
  /** Region size. Interpretation depends on regionMode. */
71
70
  get sliceRegions() {
72
- return this._private_sliceRegionsInternal;
71
+ return this.sliceRegionsInternal;
73
72
  }
74
73
  /** Multiplicative tint. Alpha channel controls opacity. */
75
74
  set color(value) {
76
- this._private_colorInternal.set(value);
75
+ this.colorInternal.set(value);
77
76
  }
78
77
  /** Controls how sliceRegions values are interpreted */
79
78
  set regionMode(value) {
80
- if (this._private_regionModeInternal !== value) {
81
- this._private_regionModeInternal = value;
82
- this._private_regionModeDirty = true;
79
+ if (this.regionModeInternal !== value) {
80
+ this.regionModeInternal = value;
81
+ this.regionModeDirty = true;
83
82
  }
84
83
  }
85
84
  /** Border size in normalized texture coordinates (0 to 1) */
86
85
  set sliceBorders(value) {
87
- this._private_sliceBordersInternal.set(value);
86
+ this.sliceBordersInternal.set(value);
88
87
  }
89
88
  /** Region size. Interpretation depends on regionMode. */
90
89
  set sliceRegions(value) {
91
- this._private_sliceRegionsInternal.set(value);
90
+ this.sliceRegionsInternal.set(value);
92
91
  }
93
- /** Removes nine slice and frees resources */
94
- destroy() {
95
- this.texture.signalDiminsionsChanged.off(this._private_onTextureDimensionsChanged);
96
- super.destroy();
92
+ /** Frees resources of the nine slice */
93
+ destroyInternal() {
94
+ this.texture.signalDimensionsChanged.off(this.onTextureDimensionsChanged);
95
+ super.destroyInternal();
97
96
  }
98
97
  setPlaneTransform() {
99
98
  let properties;
100
- const sliceBordersDirty = this._private_textureDimensionsDirty || this._private_sliceBordersInternal.dirty || this.texture.trimDirty;
99
+ const sliceBordersDirty = this.textureDimensionsDirty || this.sliceBordersInternal.dirty || this.texture.trimDirty;
101
100
  if (sliceBordersDirty) {
102
101
  properties ?? (properties = {});
103
- properties["sliceBorders"] = this._private_calculateSliceBordersForShader(this._private_sliceBordersVector);
104
- this._private_sliceBordersInternal.setDirtyFalse();
105
- this._private_textureDimensionsDirty = false;
102
+ properties["sliceBorders"] = this.calculateSliceBordersForShader(this.sliceBordersVector);
103
+ this.sliceBordersInternal.setDirtyFalse();
104
+ this.textureDimensionsDirty = false;
106
105
  }
107
- const sliceRegionsDirty = this._private_sliceRegionsInternal.dirty || this._private_regionModeDirty ||
108
- (this._private_regionModeInternal === UINineSliceRegionMode.WORLD &&
109
- this._private_checkElementDimensionsDirty());
106
+ const sliceRegionsDirty = this.sliceRegionsInternal.dirty ||
107
+ this.regionModeDirty ||
108
+ (this.regionModeInternal === UINineSliceRegionMode.WORLD &&
109
+ this.checkElementDimensionsDirty());
110
110
  if (sliceRegionsDirty) {
111
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();
112
+ properties["sliceRegions"] = this.calculateSliceRegionsForShader(this.sliceRegionsVector);
113
+ this.sliceRegionsInternal.setDirtyFalse();
114
+ this.regionModeDirty = false;
115
+ this.setElementDimensionsDirtyFalse();
116
116
  }
117
- if (this._private_colorInternal.dirty) {
117
+ if (this.colorInternal.dirty) {
118
118
  properties ?? (properties = {});
119
- properties["color"] = this._private_colorInternal;
120
- this._private_colorInternal.setDirtyFalse();
119
+ properties["color"] = this.colorInternal;
120
+ this.colorInternal.setDirtyFalse();
121
121
  }
122
122
  if (this.texture.textureDirty) {
123
123
  properties ?? (properties = {});
@@ -126,7 +126,7 @@ class UINineSlice extends UIElement {
126
126
  }
127
127
  if (this.texture.uvTransformDirty) {
128
128
  properties ?? (properties = {});
129
- properties["textureTransform"] = this.texture.calculateUVTransform(this._private_textureTransform);
129
+ properties["textureTransform"] = this.texture.calculateUVTransform(this.textureTransform);
130
130
  this.texture.setUVTransformDirtyFalse();
131
131
  }
132
132
  if (properties) {
@@ -139,12 +139,12 @@ class UINineSlice extends UIElement {
139
139
  if (isTransformDirty) {
140
140
  const micro = this.micro;
141
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));
142
+ this.sceneWrapper.setTransform(this.planeHandler, computeTrimmedTransformMatrix(this.x, this.y, this.width, this.height, this.renderDepth, 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
143
  this.micro.setDirtyFalse();
144
144
  this.texture.setTrimDirtyFalse();
145
145
  }
146
146
  }
147
- _private_calculateSliceBordersForShader(result) {
147
+ calculateSliceBordersForShader(result) {
148
148
  const sourceWidth = this.texture.width;
149
149
  const sourceHeight = this.texture.height;
150
150
  const trim = this.texture.trim;
@@ -156,33 +156,31 @@ class UINineSlice extends UIElement {
156
156
  const trimNBottom = trim.bottom / sourceHeight;
157
157
  const trimmedWidthNorm = trimmedWidth / sourceWidth;
158
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;
159
+ const srcLeft = this.sliceBordersInternal.left;
160
+ const srcRight = this.sliceBordersInternal.right;
161
+ const srcTop = this.sliceBordersInternal.top;
162
+ const srcBottom = this.sliceBordersInternal.bottom;
163
163
  const left = Math.max(0, srcLeft - trimNLeft) / trimmedWidthNorm;
164
164
  const right = Math.max(0, srcRight - trimNRight) / trimmedWidthNorm;
165
165
  const top = Math.max(0, srcTop - trimNTop) / trimmedHeightNorm;
166
166
  const bottom = Math.max(0, srcBottom - trimNBottom) / trimmedHeightNorm;
167
167
  return result.set(Math.min(1, left), Math.min(1, right), Math.min(1, top), Math.min(1, bottom));
168
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);
169
+ calculateSliceRegionsForShader(result) {
170
+ if (this.regionModeInternal === UINineSliceRegionMode.NORMALIZED) {
171
+ return result.set(this.sliceRegionsInternal.left, this.sliceRegionsInternal.right, this.sliceRegionsInternal.top, this.sliceRegionsInternal.bottom);
172
172
  }
173
173
  const width = this.width;
174
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);
175
+ return result.set(this.sliceRegionsInternal.left / width, this.sliceRegionsInternal.right / width, this.sliceRegionsInternal.top / height, this.sliceRegionsInternal.bottom / height);
176
176
  }
177
- _private_checkElementDimensionsDirty() {
177
+ checkElementDimensionsDirty() {
178
178
  return (this.solverWrapper.dirty &&
179
- (this._private_lastElementWidth !== Math.round(this.width) ||
180
- this._private_lastElementHeight !== Math.round(this.height)));
179
+ (this.lastElementWidth !== Math.round(this.width) ||
180
+ this.lastElementHeight !== Math.round(this.height)));
181
181
  }
182
- _private_setElementDimensionsDirtyFalse() {
183
- this._private_lastElementWidth = Math.round(this.width);
184
- this._private_lastElementHeight = Math.round(this.height);
182
+ setElementDimensionsDirtyFalse() {
183
+ this.lastElementWidth = Math.round(this.width);
184
+ this.lastElementHeight = Math.round(this.height);
185
185
  }
186
186
  }
187
-
188
- export { UINineSlice };
@@ -1,6 +1,6 @@
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";
1
+ import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal.js";
2
+ import type { UIProgressMaskFunction } from "../../miscellaneous/mask-function/UIProgressMaskFunction.js";
3
+ import type { UIElementOptions } from "../UIElement/UIElement.Internal.js";
4
4
  /** Configuration options for UIProgress */
5
5
  export interface UIProgressOptions extends UIElementOptions {
6
6
  /** Multiplicative tint */
@@ -11,4 +11,3 @@ export interface UIProgressOptions extends UIElementOptions {
11
11
  progress: number;
12
12
  }
13
13
  export declare const PROGRESS_DEFAULT_VALUE = 1;
14
- export declare function simplifyGLSLSource(source: string): string;
@@ -1,3 +1 @@
1
- const PROGRESS_DEFAULT_VALUE = 1;
2
-
3
- export { PROGRESS_DEFAULT_VALUE };
1
+ export const PROGRESS_DEFAULT_VALUE = 1;
@@ -1,11 +1,11 @@
1
- import type { UILayer } from "../../layers/UILayer/UILayer";
2
- import { UIColor } from "../../miscellaneous/color/UIColor";
3
- import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
4
- import type { UIProgressMaskFunction } from "../../miscellaneous/mask-function/UIProgressMaskFunction";
5
- import { UITextureView } from "../../miscellaneous/texture/UITextureView";
6
- import type { UITextureConfig } from "../../miscellaneous/texture/UITextureView.Internal";
7
- import { UIElement } from "../UIElement/UIElement";
8
- import type { UIProgressOptions } from "./UIProgress.Internal";
1
+ import type { UILayer } from "../../layers/UILayer/UILayer.js";
2
+ import { UIColor } from "../../miscellaneous/color/UIColor.js";
3
+ import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal.js";
4
+ import type { UIProgressMaskFunction } from "../../miscellaneous/mask-function/UIProgressMaskFunction.js";
5
+ import { UITextureView } from "../../miscellaneous/texture/UITextureView.js";
6
+ import type { UITextureConfig } from "../../miscellaneous/texture/UITextureView.Internal.js";
7
+ import { UIElement } from "../UIElement/UIElement.js";
8
+ import type { UIProgressOptions } from "./UIProgress.Internal.js";
9
9
  /** Progress bar with customizable fill direction */
10
10
  export declare class UIProgress extends UIElement {
11
11
  /** Texture displayed by this element */
@@ -39,6 +39,8 @@ export declare class UIProgress extends UIElement {
39
39
  set maskFunction(value: UIProgressMaskFunction);
40
40
  /** Progress from 0 (empty) to 1 (full). Clamped. */
41
41
  set progress(value: number);
42
+ /** Frees resources of the progress bar */
43
+ protected destroyInternal(): void;
42
44
  protected setPlaneTransform(): void;
43
45
  private readonly onTextureDimensionsChanged;
44
46
  private rebuildPlane;
@@ -1,17 +1,16 @@
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 { blendModeToFactor, packHSL } from '../UIElement/UIElement.Internal.js';
11
- import { PROGRESS_DEFAULT_VALUE } from './UIProgress.Internal.js';
12
-
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.js";
9
+ import { UIElement } from "../UIElement/UIElement.js";
10
+ import { blendModeToFactor, packHSL } from "../UIElement/UIElement.Internal.js";
11
+ import { PROGRESS_DEFAULT_VALUE } from "./UIProgress.Internal.js";
13
12
  /** Progress bar with customizable fill direction */
14
- class UIProgress extends UIElement {
13
+ export class UIProgress extends UIElement {
15
14
  /**
16
15
  * Creates a new UIProgress instance.
17
16
  *
@@ -41,61 +40,66 @@ class UIProgress extends UIElement {
41
40
  progress,
42
41
  ...maskFunction.enumerateProperties(),
43
42
  }, options);
44
- this._private_progressDirty = false;
45
- this._private_textureResolutionDirty = false;
46
- this._private_onTextureDimensionsChanged = (width, height) => {
43
+ this.progressDirty = false;
44
+ this.textureResolutionDirty = false;
45
+ this.onTextureDimensionsChanged = (width, height) => {
47
46
  if (this.width !== width || this.height !== height) {
48
47
  this.width = width;
49
48
  this.height = height;
50
- this._private_textureResolutionDirty = true;
49
+ this.textureResolutionDirty = true;
51
50
  }
52
51
  };
53
52
  this.texture = textureView;
54
- this._private_textureTransform = textureTransform;
55
- this._private_textureResolution = textureResolution;
56
- this._private_colorInternal = color;
57
- this._private_progressInternal = progress;
58
- this._private_maskFunctionInternal = maskFunction;
59
- this.texture.signalDiminsionsChanged.on(this._private_onTextureDimensionsChanged);
53
+ this.textureTransform = textureTransform;
54
+ this.textureResolution = textureResolution;
55
+ this.colorInternal = color;
56
+ this.progressInternal = progress;
57
+ this.maskFunctionInternal = maskFunction;
58
+ this.texture.signalDimensionsChanged.on(this.onTextureDimensionsChanged);
60
59
  }
61
60
  /** Multiplicative tint. Alpha channel controls opacity. */
62
61
  get color() {
63
- return this._private_colorInternal;
62
+ return this.colorInternal;
64
63
  }
65
64
  /** Function controlling fill direction and shape */
66
65
  get maskFunction() {
67
- return this._private_maskFunctionInternal;
66
+ return this.maskFunctionInternal;
68
67
  }
69
68
  /** Progress from 0 (empty) to 1 (full) */
70
69
  get progress() {
71
- return this._private_progressInternal;
70
+ return this.progressInternal;
72
71
  }
73
72
  /** Multiplicative tint. Alpha channel controls opacity. */
74
73
  set color(value) {
75
- this._private_colorInternal.set(value);
74
+ this.colorInternal.set(value);
76
75
  }
77
76
  /** Function controlling fill direction and shape */
78
77
  set maskFunction(value) {
79
- if (this._private_maskFunctionInternal !== value) {
80
- this._private_maskFunctionInternal = value;
81
- this._private_rebuildPlane();
78
+ if (this.maskFunctionInternal !== value) {
79
+ this.maskFunctionInternal = value;
80
+ this.rebuildPlane();
82
81
  }
83
82
  }
84
83
  /** Progress from 0 (empty) to 1 (full). Clamped. */
85
84
  set progress(value) {
86
85
  assertValidNumber(value, "UIProgress.progress");
87
86
  value = MathUtils.clamp(value, 0, 1);
88
- if (this._private_progressInternal !== value) {
89
- this._private_progressInternal = value;
90
- this._private_progressDirty = true;
87
+ if (this.progressInternal !== value) {
88
+ this.progressInternal = value;
89
+ this.progressDirty = true;
91
90
  }
92
91
  }
92
+ /** Frees resources of the progress bar */
93
+ destroyInternal() {
94
+ this.texture.signalDimensionsChanged.off(this.onTextureDimensionsChanged);
95
+ super.destroyInternal();
96
+ }
93
97
  setPlaneTransform() {
94
98
  let properties;
95
- if (this._private_colorInternal.dirty) {
99
+ if (this.colorInternal.dirty) {
96
100
  properties ?? (properties = {});
97
- properties["color"] = this._private_colorInternal;
98
- this._private_colorInternal.setDirtyFalse();
101
+ properties["color"] = this.colorInternal;
102
+ this.colorInternal.setDirtyFalse();
99
103
  }
100
104
  if (this.texture.textureDirty) {
101
105
  properties ?? (properties = {});
@@ -104,18 +108,18 @@ class UIProgress extends UIElement {
104
108
  }
105
109
  if (this.texture.uvTransformDirty) {
106
110
  properties ?? (properties = {});
107
- properties["textureTransform"] = this.texture.calculateUVTransform(this._private_textureTransform);
111
+ properties["textureTransform"] = this.texture.calculateUVTransform(this.textureTransform);
108
112
  this.texture.setUVTransformDirtyFalse();
109
113
  }
110
- if (this._private_progressDirty) {
114
+ if (this.progressDirty) {
111
115
  properties ?? (properties = {});
112
- properties["progress"] = this._private_progressInternal;
113
- this._private_progressDirty = false;
116
+ properties["progress"] = this.progressInternal;
117
+ this.progressDirty = false;
114
118
  }
115
- if (this._private_textureResolutionDirty) {
119
+ if (this.textureResolutionDirty) {
116
120
  properties ?? (properties = {});
117
- properties["textureResolution"] = this.texture.getResolution(this._private_textureResolution);
118
- this._private_textureResolutionDirty = false;
121
+ properties["textureResolution"] = this.texture.getResolution(this.textureResolution);
122
+ this.textureResolutionDirty = false;
119
123
  }
120
124
  if (this.maskFunction.dirty) {
121
125
  properties ?? (properties = {});
@@ -135,32 +139,30 @@ class UIProgress extends UIElement {
135
139
  if (isTransformDirty) {
136
140
  const micro = this.micro;
137
141
  const textureTrim = this.texture.trim;
138
- 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));
142
+ this.sceneWrapper.setTransform(this.planeHandler, computeTrimmedTransformMatrix(this.x, this.y, this.width, this.height, this.renderDepth, micro.x, micro.y, micro.anchorX, micro.anchorY, micro.scaleX, micro.scaleY, micro.rotation, micro.anchorMode, textureTrim.left, textureTrim.right, textureTrim.top, textureTrim.bottom));
139
143
  this.micro.setDirtyFalse();
140
144
  this.texture.setTrimDirtyFalse();
141
145
  }
142
146
  }
143
- _private_rebuildPlane() {
147
+ rebuildPlane() {
144
148
  this.sceneWrapper.destroyPlane(this.planeHandler);
145
149
  const micro = this.micro;
146
150
  const textureTrim = this.texture.trim;
147
- this.planeHandler = this.sceneWrapper.createPlane(this._private_maskFunctionInternal.source + source, {
151
+ this.planeHandler = this.sceneWrapper.createPlane(this.maskFunctionInternal.source + source, {
148
152
  texture: this.texture.texture,
149
- textureTransform: this.texture.calculateUVTransform(this._private_textureTransform),
150
- textureResolution: this.texture.getResolution(this._private_textureResolution),
151
- color: this._private_colorInternal,
152
- progress: this._private_progressInternal,
153
- ...this._private_maskFunctionInternal.enumerateProperties(),
154
- }, 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, blendModeToFactor(this.blendMode), packHSL({ h: 0, s: 0, l: 0 }, this.hue, this.saturation, this.lightness));
155
- this._private_colorInternal.setDirtyFalse();
153
+ textureTransform: this.texture.calculateUVTransform(this.textureTransform),
154
+ textureResolution: this.texture.getResolution(this.textureResolution),
155
+ color: this.colorInternal,
156
+ progress: this.progressInternal,
157
+ ...this.maskFunctionInternal.enumerateProperties(),
158
+ }, computeTrimmedTransformMatrix(this.x, this.y, this.width, this.height, this.renderDepth, 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, blendModeToFactor(this.blendMode), packHSL({ h: 0, s: 0, l: 0 }, this.hue, this.saturation, this.lightness));
159
+ this.colorInternal.setDirtyFalse();
156
160
  this.texture.setTextureDirtyFalse();
157
161
  this.texture.setUVTransformDirtyFalse();
158
162
  this.texture.setTrimDirtyFalse();
159
- this._private_progressDirty = false;
160
- this._private_textureResolutionDirty = false;
161
- this._private_maskFunctionInternal.setDirtyFalse();
163
+ this.progressDirty = false;
164
+ this.textureResolutionDirty = false;
165
+ this.maskFunctionInternal.setDirtyFalse();
162
166
  this.micro.setDirtyFalse();
163
167
  }
164
168
  }
165
-
166
- export { UIProgress };