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,14 +1,13 @@
1
- import { Ferrsign0 } from 'ferrsign';
2
- import { assertValidPositiveNumber, assertValidNumber } from '../../miscellaneous/asserts.js';
3
- import { UIColor } from '../../miscellaneous/color/UIColor.js';
4
- import { computeTrimmedTransformMatrix } from '../../miscellaneous/computeTransform.js';
5
- import { UITextureView } from '../../miscellaneous/texture/UITextureView.js';
6
- import source from '../../shaders/UIImage.glsl.js';
7
- import { UIElement } from '../UIElement/UIElement.js';
8
- import { ANIMATED_IMAGE_DEFAULT_FRAME_RATE, ANIMATED_IMAGE_DEFAULT_TIME_SCALE, ANIMATED_IMAGE_DEFAULT_LOOP_MODE, UIAnimatedImageLoopMode } from './UIAnimatedImage.Internal.js';
9
-
1
+ import { Ferrsign0 } from "ferrsign";
2
+ import { assertValidNumber, assertValidPositiveNumber } from "../../miscellaneous/asserts.js";
3
+ import { UIColor } from "../../miscellaneous/color/UIColor.js";
4
+ import { computeTrimmedTransformMatrix } from "../../miscellaneous/computeTransform.js";
5
+ import { UITextureView } from "../../miscellaneous/texture/UITextureView.js";
6
+ import source from "../../shaders/UIImage.js";
7
+ import { UIElement } from "../UIElement/UIElement.js";
8
+ import { ANIMATED_IMAGE_DEFAULT_FRAME_RATE, ANIMATED_IMAGE_DEFAULT_LOOP_MODE, ANIMATED_IMAGE_DEFAULT_TIME_SCALE, UIAnimatedImageLoopMode, } from "./UIAnimatedImage.Internal.js";
10
9
  /** Frame-based texture animation element */
11
- class UIAnimatedImage extends UIElement {
10
+ export class UIAnimatedImage extends UIElement {
12
11
  /**
13
12
  * Creates a new UIAnimatedImage instance.
14
13
  *
@@ -30,180 +29,180 @@ class UIAnimatedImage extends UIElement {
30
29
  textureTransform: textureTransform,
31
30
  color,
32
31
  }, options);
33
- this._private_isPlaying = false;
34
- this._private_sequenceFrameIndex = 0;
35
- this._private_currentFrameIndexDirty = false;
36
- this._private_accumulatedTime = 0;
37
- this._private_signalPlayedInternal = new Ferrsign0();
38
- this._private_signalPausedInternal = new Ferrsign0();
39
- this._private_signalStoppedInternal = new Ferrsign0();
40
- this._private_onTextureDimensionsChanged = (width, height, texture) => {
41
- if (this._private_sequenceInternal[this._private_sequenceFrameIndex] === texture) {
32
+ this.isPlaying = false;
33
+ this.sequenceFrameIndex = 0;
34
+ this.currentFrameIndexDirty = false;
35
+ this.accumulatedTime = 0;
36
+ this.signalPlayedInternal = new Ferrsign0();
37
+ this.signalPausedInternal = new Ferrsign0();
38
+ this.signalStoppedInternal = new Ferrsign0();
39
+ this.onTextureDimensionsChanged = (width, height, texture) => {
40
+ if (this.sequenceInternal[this.sequenceFrameIndex] === texture) {
42
41
  this.width = width;
43
42
  this.height = height;
44
43
  }
45
44
  };
46
- this._private_colorInternal = color;
47
- this._private_sequenceInternal = uiTextures;
48
- this._private_textureTransform = textureTransform;
49
- this._private_frameRateInternal = options.frameRate ?? ANIMATED_IMAGE_DEFAULT_FRAME_RATE;
50
- this._private_timeScaleInternal = options.timeScale ?? ANIMATED_IMAGE_DEFAULT_TIME_SCALE;
51
- this._private_loopModeInternal = options.loopMode ?? ANIMATED_IMAGE_DEFAULT_LOOP_MODE;
52
- this._private_subscribeSequenceEvents();
45
+ this.colorInternal = color;
46
+ this.sequenceInternal = uiTextures;
47
+ this.textureTransform = textureTransform;
48
+ this.frameRateInternal = options.frameRate ?? ANIMATED_IMAGE_DEFAULT_FRAME_RATE;
49
+ this.timeScaleInternal = options.timeScale ?? ANIMATED_IMAGE_DEFAULT_TIME_SCALE;
50
+ this.loopModeInternal = options.loopMode ?? ANIMATED_IMAGE_DEFAULT_LOOP_MODE;
51
+ this.subscribeSequenceEvents();
53
52
  if (options.playByDefault === true) {
54
53
  this.play();
55
54
  }
56
55
  }
57
56
  /** Multiplicative tint. Alpha channel controls opacity. */
58
57
  get color() {
59
- return this._private_colorInternal;
58
+ return this.colorInternal;
60
59
  }
61
60
  /** Total animation duration in seconds */
62
61
  get duration() {
63
- return this._private_sequenceInternal.length / this._private_frameRateInternal;
62
+ return this.sequenceInternal.length / this.frameRateInternal;
64
63
  }
65
64
  /** Animation speed in frames per second */
66
65
  get frameRate() {
67
- return this._private_frameRateInternal;
66
+ return this.frameRateInternal;
68
67
  }
69
68
  /** Loop behavior */
70
69
  get loopMode() {
71
- return this._private_loopModeInternal;
70
+ return this.loopModeInternal;
72
71
  }
73
72
  /** Animation frames as readonly array */
74
73
  get sequence() {
75
- return this._private_sequenceInternal;
74
+ return this.sequenceInternal;
76
75
  }
77
76
  /** Playback speed multiplier. Can be negative for reverse playback. */
78
77
  get timeScale() {
79
- return this._private_timeScaleInternal;
78
+ return this.timeScaleInternal;
80
79
  }
81
80
  /** Signal fired when animation starts or resumes */
82
81
  get signalPlayed() {
83
- return this._private_signalPlayedInternal;
82
+ return this.signalPlayedInternal;
84
83
  }
85
84
  /** Signal fired when animation pauses */
86
85
  get signalPaused() {
87
- return this._private_signalPausedInternal;
86
+ return this.signalPausedInternal;
88
87
  }
89
88
  /** Signal fired when animation stops and resets */
90
89
  get signalStopped() {
91
- return this._private_signalStoppedInternal;
90
+ return this.signalStoppedInternal;
92
91
  }
93
92
  /** Multiplicative tint. Alpha channel controls opacity. */
94
93
  set color(value) {
95
- this._private_colorInternal.set(value);
94
+ this.colorInternal.set(value);
96
95
  }
97
96
  /** Animation speed in frames per second */
98
97
  set frameRate(value) {
99
98
  assertValidPositiveNumber(value, "UIAnimatedImage.frameRate");
100
- this._private_frameRateInternal = value;
99
+ this.frameRateInternal = value;
101
100
  }
102
101
  /** Loop behavior */
103
102
  set loopMode(value) {
104
- this._private_loopModeInternal = value;
103
+ this.loopModeInternal = value;
105
104
  }
106
105
  /** Replaces animation frames. Stops playback. */
107
106
  set sequence(sequence) {
108
107
  this.stop();
109
- this._private_unsubscribeSequenceEvents();
108
+ this.unsubscribeSequenceEvents();
110
109
  const newLength = sequence.length;
111
- const currentLength = this._private_sequenceInternal.length;
110
+ const currentLength = this.sequenceInternal.length;
112
111
  for (let i = 0; i < Math.min(newLength, currentLength); i++) {
113
- this._private_sequenceInternal[i].set(sequence[i]);
112
+ this.sequenceInternal[i].set(sequence[i]);
114
113
  }
115
114
  if (newLength < currentLength) {
116
- this._private_sequenceInternal.length = newLength;
115
+ this.sequenceInternal.length = newLength;
117
116
  }
118
117
  else if (newLength > currentLength) {
119
118
  for (let i = currentLength; i < newLength; i++) {
120
- this._private_sequenceInternal.push(new UITextureView(sequence[i]));
119
+ this.sequenceInternal.push(new UITextureView(sequence[i]));
121
120
  }
122
121
  }
123
- this._private_subscribeSequenceEvents();
122
+ this.subscribeSequenceEvents();
124
123
  }
125
124
  /** Playback speed multiplier. Can be negative for reverse playback. */
126
125
  set timeScale(value) {
127
126
  assertValidNumber(value, "UIAnimatedImage.timeScale");
128
- this._private_timeScaleInternal = value;
129
- }
130
- /** Removes element and frees resources */
131
- destroy() {
132
- this._private_unsubscribeSequenceEvents();
133
- super.destroy();
127
+ this.timeScaleInternal = value;
134
128
  }
135
129
  /** Starts or resumes animation playback */
136
130
  play() {
137
- if (!this._private_isPlaying) {
138
- this._private_isPlaying = true;
139
- this._private_signalPlayedInternal.emit();
131
+ if (!this.isPlaying) {
132
+ this.isPlaying = true;
133
+ this.signalPlayedInternal.emit();
140
134
  }
141
135
  }
142
136
  /** Pauses animation at current frame */
143
137
  pause() {
144
- if (this._private_isPlaying) {
145
- this._private_isPlaying = false;
146
- this._private_signalPausedInternal.emit();
138
+ if (this.isPlaying) {
139
+ this.isPlaying = false;
140
+ this.signalPausedInternal.emit();
147
141
  }
148
142
  }
149
143
  /** Stops animation and resets to first frame */
150
144
  stop() {
151
- if (this._private_isPlaying || this._private_accumulatedTime > 0 || this._private_sequenceFrameIndex > 0) {
152
- this._private_isPlaying = false;
153
- this._private_accumulatedTime = 0;
154
- this._private_sequenceFrameIndex = 0;
155
- this._private_currentFrameIndexDirty = true;
156
- this._private_signalStoppedInternal.emit();
145
+ if (this.isPlaying || this.accumulatedTime > 0 || this.sequenceFrameIndex > 0) {
146
+ this.isPlaying = false;
147
+ this.accumulatedTime = 0;
148
+ this.sequenceFrameIndex = 0;
149
+ this.currentFrameIndexDirty = true;
150
+ this.signalStoppedInternal.emit();
157
151
  }
158
152
  }
153
+ /** Frees resources of the animated image */
154
+ destroyInternal() {
155
+ this.unsubscribeSequenceEvents();
156
+ super.destroyInternal();
157
+ }
159
158
  onWillRender(renderer, deltaTime) {
160
- if (this._private_isPlaying && this._private_timeScaleInternal !== 0) {
161
- this._private_accumulatedTime += deltaTime * this._private_timeScaleInternal;
162
- const frameDuration = 1 / this._private_frameRateInternal;
163
- const sequenceLength = this._private_sequenceInternal.length;
159
+ if (this.isPlaying && this.timeScaleInternal !== 0) {
160
+ this.accumulatedTime += deltaTime * this.timeScaleInternal;
161
+ const frameDuration = 1 / this.frameRateInternal;
162
+ const sequenceLength = this.sequenceInternal.length;
164
163
  const lastFrameIndex = sequenceLength - 1;
165
- if (this._private_timeScaleInternal > 0) {
166
- while (this._private_accumulatedTime >= frameDuration) {
167
- this._private_accumulatedTime -= frameDuration;
168
- this._private_sequenceFrameIndex += 1;
169
- if (this._private_sequenceFrameIndex >= sequenceLength) {
170
- if (this._private_loopModeInternal === UIAnimatedImageLoopMode.LOOP) {
171
- this._private_sequenceFrameIndex = 0;
164
+ if (this.timeScaleInternal > 0) {
165
+ while (this.accumulatedTime >= frameDuration) {
166
+ this.accumulatedTime -= frameDuration;
167
+ this.sequenceFrameIndex += 1;
168
+ if (this.sequenceFrameIndex >= sequenceLength) {
169
+ if (this.loopModeInternal === UIAnimatedImageLoopMode.LOOP) {
170
+ this.sequenceFrameIndex = 0;
172
171
  }
173
- else if (this._private_loopModeInternal === UIAnimatedImageLoopMode.PING_PONG) {
174
- this._private_sequenceFrameIndex = lastFrameIndex;
175
- this._private_timeScaleInternal = -this._private_timeScaleInternal;
172
+ else if (this.loopModeInternal === UIAnimatedImageLoopMode.PING_PONG) {
173
+ this.sequenceFrameIndex = lastFrameIndex;
174
+ this.timeScaleInternal = -this.timeScaleInternal;
176
175
  }
177
176
  else {
178
- this._private_sequenceFrameIndex = lastFrameIndex;
179
- this._private_isPlaying = false;
180
- this._private_signalPausedInternal.emit();
177
+ this.sequenceFrameIndex = lastFrameIndex;
178
+ this.isPlaying = false;
179
+ this.signalPausedInternal.emit();
181
180
  break;
182
181
  }
183
182
  }
184
- this._private_currentFrameIndexDirty = true;
183
+ this.currentFrameIndexDirty = true;
185
184
  }
186
185
  }
187
186
  else {
188
- while (this._private_accumulatedTime <= -frameDuration) {
189
- this._private_accumulatedTime += frameDuration;
190
- this._private_sequenceFrameIndex -= 1;
191
- if (this._private_sequenceFrameIndex < 0) {
192
- if (this._private_loopModeInternal === UIAnimatedImageLoopMode.LOOP) {
193
- this._private_sequenceFrameIndex = lastFrameIndex;
187
+ while (this.accumulatedTime <= -frameDuration) {
188
+ this.accumulatedTime += frameDuration;
189
+ this.sequenceFrameIndex -= 1;
190
+ if (this.sequenceFrameIndex < 0) {
191
+ if (this.loopModeInternal === UIAnimatedImageLoopMode.LOOP) {
192
+ this.sequenceFrameIndex = lastFrameIndex;
194
193
  }
195
- else if (this._private_loopModeInternal === UIAnimatedImageLoopMode.PING_PONG) {
196
- this._private_sequenceFrameIndex = 0;
197
- this._private_timeScaleInternal = -this._private_timeScaleInternal;
194
+ else if (this.loopModeInternal === UIAnimatedImageLoopMode.PING_PONG) {
195
+ this.sequenceFrameIndex = 0;
196
+ this.timeScaleInternal = -this.timeScaleInternal;
198
197
  }
199
198
  else {
200
- this._private_sequenceFrameIndex = 0;
201
- this._private_isPlaying = false;
202
- this._private_signalPausedInternal.emit();
199
+ this.sequenceFrameIndex = 0;
200
+ this.isPlaying = false;
201
+ this.signalPausedInternal.emit();
203
202
  break;
204
203
  }
205
204
  }
206
- this._private_currentFrameIndexDirty = true;
205
+ this.currentFrameIndexDirty = true;
207
206
  }
208
207
  }
209
208
  }
@@ -211,26 +210,26 @@ class UIAnimatedImage extends UIElement {
211
210
  }
212
211
  setPlaneTransform() {
213
212
  let properties;
214
- if (this._private_colorInternal.dirty) {
213
+ if (this.colorInternal.dirty) {
215
214
  properties ?? (properties = {});
216
- properties["color"] = this._private_colorInternal;
217
- this._private_colorInternal.setDirtyFalse();
215
+ properties["color"] = this.colorInternal;
216
+ this.colorInternal.setDirtyFalse();
218
217
  }
219
- const frame = this._private_sequenceInternal[this._private_sequenceFrameIndex];
220
- if (frame.textureDirty || this._private_currentFrameIndexDirty) {
218
+ const frame = this.sequenceInternal[this.sequenceFrameIndex];
219
+ if (frame.textureDirty || this.currentFrameIndexDirty) {
221
220
  properties ?? (properties = {});
222
221
  properties["texture"] = frame.texture;
223
222
  frame.setTextureDirtyFalse();
224
223
  }
225
- if (frame.uvTransformDirty || this._private_currentFrameIndexDirty) {
224
+ if (frame.uvTransformDirty || this.currentFrameIndexDirty) {
226
225
  properties ?? (properties = {});
227
- properties["textureTransform"] = frame.calculateUVTransform(this._private_textureTransform);
226
+ properties["textureTransform"] = frame.calculateUVTransform(this.textureTransform);
228
227
  frame.setUVTransformDirtyFalse();
229
228
  }
230
229
  if (properties) {
231
230
  this.sceneWrapper.setProperties(this.planeHandler, properties);
232
231
  }
233
- const isTransformDirty = this._private_currentFrameIndexDirty ||
232
+ const isTransformDirty = this.currentFrameIndexDirty ||
234
233
  this.micro.dirty ||
235
234
  frame.trimDirty ||
236
235
  this.inputWrapper.dirty ||
@@ -238,22 +237,20 @@ class UIAnimatedImage extends UIElement {
238
237
  if (isTransformDirty) {
239
238
  const micro = this.micro;
240
239
  const textureTrim = frame.trim;
241
- 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));
242
- this._private_currentFrameIndexDirty = false;
240
+ 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));
241
+ this.currentFrameIndexDirty = false;
243
242
  this.micro.setDirtyFalse();
244
243
  frame.setTrimDirtyFalse();
245
244
  }
246
245
  }
247
- _private_subscribeSequenceEvents() {
248
- for (const frame of this._private_sequenceInternal) {
249
- frame.signalDiminsionsChanged.on(this._private_onTextureDimensionsChanged);
246
+ subscribeSequenceEvents() {
247
+ for (const frame of this.sequenceInternal) {
248
+ frame.signalDimensionsChanged.on(this.onTextureDimensionsChanged);
250
249
  }
251
250
  }
252
- _private_unsubscribeSequenceEvents() {
253
- for (const frame of this._private_sequenceInternal) {
254
- frame.signalDiminsionsChanged.off(this._private_onTextureDimensionsChanged);
251
+ unsubscribeSequenceEvents() {
252
+ for (const frame of this.sequenceInternal) {
253
+ frame.signalDimensionsChanged.off(this.onTextureDimensionsChanged);
255
254
  }
256
255
  }
257
256
  }
258
-
259
- export { UIAnimatedImage };
@@ -1,7 +1,7 @@
1
- import type { UIArea } from "../../miscellaneous/area/UIArea";
2
- import { UIMode } from "../../miscellaneous/UIMode";
3
- import type { UIAnchorOptions } from "../UIAnchor/UIAnchor.Internal";
4
- import type { UIDummy } from "./UIDummy";
1
+ import type { UIArea } from "../../miscellaneous/area/UIArea.js";
2
+ import { UIMode } from "../../miscellaneous/UIMode.js";
3
+ import type { UIAnchorOptions } from "../UIAnchor/UIAnchor.Internal.js";
4
+ import type { UIDummy } from "./UIDummy.js";
5
5
  /** Input event data */
6
6
  export interface UIInputEventData {
7
7
  /** X coordinate */
@@ -1,8 +1,5 @@
1
- import { UIMode } from '../../miscellaneous/UIMode.js';
2
-
3
- const DUMMY_DEFAULT_WIDTH = 64;
4
- const DUMMY_DEFAULT_HEIGHT = 32;
5
- const DUMMY_DEFAULT_MODE = UIMode.VISIBLE;
6
- const DUMMY_DEFAULT_Z_INDEX = 0;
7
-
8
- export { DUMMY_DEFAULT_HEIGHT, DUMMY_DEFAULT_MODE, DUMMY_DEFAULT_WIDTH, DUMMY_DEFAULT_Z_INDEX };
1
+ import { UIMode } from "../../miscellaneous/UIMode.js";
2
+ export const DUMMY_DEFAULT_WIDTH = 64;
3
+ export const DUMMY_DEFAULT_HEIGHT = 32;
4
+ export const DUMMY_DEFAULT_MODE = UIMode.VISIBLE;
5
+ export const DUMMY_DEFAULT_Z_INDEX = 0;
@@ -1,12 +1,12 @@
1
1
  import type { FerrsignView1 } from "ferrsign";
2
2
  import { Ferrsign1 } from "ferrsign";
3
- import type { UILayer } from "../../layers/UILayer/UILayer";
4
- import type { UIArea } from "../../miscellaneous/area/UIArea";
5
- import type { UIPlaneElement } from "../../miscellaneous/shared";
6
- import { UIMode } from "../../miscellaneous/UIMode";
7
- import type { UIInputWrapperView } from "../../wrappers/UIInputWrapper/UIInputWrapper.Internal";
8
- import { UIAnchor } from "../UIAnchor/UIAnchor";
9
- import type { UIDummyOptions, UIInputEventData } from "./UIDummy.Internal";
3
+ import type { UILayer } from "../../layers/UILayer/UILayer.js";
4
+ import type { UIArea } from "../../miscellaneous/area/UIArea.js";
5
+ import type { UIPlaneElement } from "../../miscellaneous/shared.js";
6
+ import { UIMode } from "../../miscellaneous/UIMode.js";
7
+ import type { UIInputWrapperView } from "../../wrappers/UIInputWrapper/UIInputWrapper.Internal.js";
8
+ import { UIAnchor } from "../UIAnchor/UIAnchor.js";
9
+ import type { UIDummyOptions, UIInputEventData } from "./UIDummy.Internal.js";
10
10
  /** Rectangular area with dimensions but no rendering */
11
11
  export declare class UIDummy extends UIAnchor implements UIPlaneElement {
12
12
  /** Shape defining interactive region in element-local space (0,0 = bottom-left, 1,1 = top-right) */
@@ -45,7 +45,10 @@ export declare class UIDummy extends UIAnchor implements UIPlaneElement {
45
45
  get centerY(): number;
46
46
  /** Controls visibility and interactivity */
47
47
  get mode(): UIMode;
48
- /** Rendering and input priority. Higher values on top. */
48
+ /**
49
+ * Rendering and input priority. Higher values on top; elements with equal values keep the
50
+ * order of creation, a later one on top.
51
+ */
49
52
  get zIndex(): number;
50
53
  /** Signal fired when pointer is pressed */
51
54
  get signalPointerPressed(): FerrsignView1<UIInputEventData>;
@@ -57,6 +60,8 @@ export declare class UIDummy extends UIAnchor implements UIPlaneElement {
57
60
  get signalPointerEntered(): FerrsignView1<UIInputEventData>;
58
61
  /** Signal fired when pointer leaves element */
59
62
  get signalPointerLeft(): FerrsignView1<UIInputEventData>;
63
+ /** Unique depth of the element among the elements of the layer, derived from `zIndex` */
64
+ protected get renderDepth(): number;
60
65
  /** Width in world units */
61
66
  set width(value: number);
62
67
  /** Height in world units */
@@ -71,10 +76,13 @@ export declare class UIDummy extends UIAnchor implements UIPlaneElement {
71
76
  set centerY(value: number);
72
77
  /** Controls visibility and interactivity */
73
78
  set mode(value: UIMode);
74
- /** Rendering and input priority. Higher values on top. */
79
+ /**
80
+ * Rendering and input priority. Higher values on top; elements with equal values keep the
81
+ * order of creation, a later one on top.
82
+ */
75
83
  set zIndex(value: number);
76
- /** Removes element and frees resources */
77
- destroy(): void;
84
+ protected getSolverVariables(): number[];
85
+ protected destroyInternal(): void;
78
86
  protected readonly catchPointerDown: (x: number, y: number, identifier: number) => boolean;
79
87
  protected readonly catchPointerMove: (x: number, y: number, identifier: number) => boolean;
80
88
  protected readonly catchPointerUp: (x: number, y: number, identifier: number) => boolean;
@@ -1,14 +1,13 @@
1
- import { Ferrsign1 } from 'ferrsign';
2
- import { MathUtils } from 'three';
3
- import { UIAreaRectangle } from '../../miscellaneous/area/UIAreaRectangle.js';
4
- import { assertValidPositiveNumber, assertValidNumber } from '../../miscellaneous/asserts.js';
5
- import { isUIModeInteractive, UIMode } from '../../miscellaneous/UIMode.js';
6
- import { UIPriority } from '../../miscellaneous/UIPriority.js';
7
- import { UIAnchor } from '../UIAnchor/UIAnchor.js';
8
- import { DUMMY_DEFAULT_WIDTH, DUMMY_DEFAULT_HEIGHT, DUMMY_DEFAULT_MODE, DUMMY_DEFAULT_Z_INDEX } from './UIDummy.Internal.js';
9
-
1
+ import { Ferrsign1 } from "ferrsign";
2
+ import { MathUtils } from "three";
3
+ import { UIAreaRectangle } from "../../miscellaneous/area/UIAreaRectangle.js";
4
+ import { assertValidNumber, assertValidPositiveNumber } from "../../miscellaneous/asserts.js";
5
+ import { isUIModeInteractive, UIMode } from "../../miscellaneous/UIMode.js";
6
+ import { UIPriority } from "../../miscellaneous/UIPriority.js";
7
+ import { UIAnchor } from "../UIAnchor/UIAnchor.js";
8
+ import { DUMMY_DEFAULT_HEIGHT, DUMMY_DEFAULT_MODE, DUMMY_DEFAULT_WIDTH, DUMMY_DEFAULT_Z_INDEX, } from "./UIDummy.Internal.js";
10
9
  /** Rectangular area with dimensions but no rendering */
11
- class UIDummy extends UIAnchor {
10
+ export class UIDummy extends UIAnchor {
12
11
  /**
13
12
  * Creates a new UIDummy instance.
14
13
  *
@@ -21,28 +20,28 @@ class UIDummy extends UIAnchor {
21
20
  assertValidPositiveNumber(w, "UIDummy.constructor.width");
22
21
  assertValidPositiveNumber(h, "UIDummy.constructor.height");
23
22
  super(layer, options);
24
- this._private_wasPointerInside = false;
25
- this._private_signalPointerPressedInternal = new Ferrsign1();
26
- this._private_signalPointerMovedInternal = new Ferrsign1();
27
- this._private_signalPointerReleasedInternal = new Ferrsign1();
28
- this._private_signalPointerEnteredInternal = new Ferrsign1();
29
- this._private_signalPointerLeftInternal = new Ferrsign1();
23
+ this.wasPointerInside = false;
24
+ this.signalPointerPressedInternal = new Ferrsign1();
25
+ this.signalPointerMovedInternal = new Ferrsign1();
26
+ this.signalPointerReleasedInternal = new Ferrsign1();
27
+ this.signalPointerEnteredInternal = new Ferrsign1();
28
+ this.signalPointerLeftInternal = new Ferrsign1();
30
29
  this.catchPointerDown = (x, y, identifier) => {
31
- return this.handleInputEvent(x, y, identifier, this._private_signalPointerPressedInternal);
30
+ return this.handleInputEvent(x, y, identifier, this.signalPointerPressedInternal);
32
31
  };
33
32
  this.catchPointerMove = (x, y, identifier) => {
34
- return this.handleInputEvent(x, y, identifier, this._private_signalPointerMovedInternal);
33
+ return this.handleInputEvent(x, y, identifier, this.signalPointerMovedInternal);
35
34
  };
36
35
  this.catchPointerUp = (x, y, identifier) => {
37
- return this.handleInputEvent(x, y, identifier, this._private_signalPointerReleasedInternal);
36
+ return this.handleInputEvent(x, y, identifier, this.signalPointerReleasedInternal);
38
37
  };
39
38
  this.interactionArea = options?.interactionArea ?? new UIAreaRectangle(0, 0, 1, 1);
40
39
  this.modeInternal = options?.mode ?? DUMMY_DEFAULT_MODE;
41
40
  this.inputWrapper = this.layer.inputWrapper;
42
41
  this.wVariable = this.solverWrapper.createVariable(w, UIPriority.P6);
43
42
  this.hVariable = this.solverWrapper.createVariable(h, UIPriority.P6);
44
- this._private_catcherHandler = this.inputWrapper.createInputCatcher(this.catchPointerDown, this.catchPointerMove, this.catchPointerUp, DUMMY_DEFAULT_Z_INDEX);
45
- this.inputWrapper.setActive(this._private_catcherHandler, isUIModeInteractive(this.modeInternal));
43
+ this.catcherHandler = this.inputWrapper.createInputCatcher(this.catchPointerDown, this.catchPointerMove, this.catchPointerUp, DUMMY_DEFAULT_Z_INDEX);
44
+ this.inputWrapper.setActive(this.catcherHandler, isUIModeInteractive(this.modeInternal));
46
45
  }
47
46
  /** Width in world units */
48
47
  get width() {
@@ -72,79 +71,99 @@ class UIDummy extends UIAnchor {
72
71
  get mode() {
73
72
  return this.modeInternal;
74
73
  }
75
- /** Rendering and input priority. Higher values on top. */
74
+ /**
75
+ * Rendering and input priority. Higher values on top; elements with equal values keep the
76
+ * order of creation, a later one on top.
77
+ */
76
78
  get zIndex() {
77
- return this.inputWrapper.getZIndex(this._private_catcherHandler);
79
+ return this.inputWrapper.getZIndex(this.catcherHandler);
78
80
  }
79
81
  /** Signal fired when pointer is pressed */
80
82
  get signalPointerPressed() {
81
- return this._private_signalPointerPressedInternal;
83
+ return this.signalPointerPressedInternal;
82
84
  }
83
85
  /** Signal fired when pointer is moved */
84
86
  get signalPointerMoved() {
85
- return this._private_signalPointerMovedInternal;
87
+ return this.signalPointerMovedInternal;
86
88
  }
87
89
  /** Signal fired when pointer is released */
88
90
  get signalPointerReleased() {
89
- return this._private_signalPointerReleasedInternal;
91
+ return this.signalPointerReleasedInternal;
90
92
  }
91
93
  /** Signal fired when pointer enters element */
92
94
  get signalPointerEntered() {
93
- return this._private_signalPointerEnteredInternal;
95
+ return this.signalPointerEnteredInternal;
94
96
  }
95
97
  /** Signal fired when pointer leaves element */
96
98
  get signalPointerLeft() {
97
- return this._private_signalPointerLeftInternal;
99
+ return this.signalPointerLeftInternal;
100
+ }
101
+ /** Unique depth of the element among the elements of the layer, derived from `zIndex` */
102
+ get renderDepth() {
103
+ return this.inputWrapper.getDepth(this.catcherHandler);
98
104
  }
99
105
  /** Width in world units */
100
106
  set width(value) {
107
+ this.assertNotDestroyed("UIDummy.width");
101
108
  assertValidPositiveNumber(value, "UIDummy.width");
102
109
  this.solverWrapper.suggestVariableValue(this.wVariable, value);
103
110
  }
104
111
  /** Height in world units */
105
112
  set height(value) {
113
+ this.assertNotDestroyed("UIDummy.height");
106
114
  assertValidPositiveNumber(value, "UIDummy.height");
107
115
  this.solverWrapper.suggestVariableValue(this.hVariable, value);
108
116
  }
109
117
  /** X coordinate of right edge */
110
118
  set oppositeX(value) {
119
+ this.assertNotDestroyed("UIDummy.oppositeX");
111
120
  assertValidNumber(value, "UIDummy.oppositeX");
112
121
  this.x = value - this.width;
113
122
  }
114
123
  /** Y coordinate of top edge */
115
124
  set oppositeY(value) {
125
+ this.assertNotDestroyed("UIDummy.oppositeY");
116
126
  assertValidNumber(value, "UIDummy.oppositeY");
117
127
  this.y = value - this.height;
118
128
  }
119
129
  /** X coordinate of horizontal center */
120
130
  set centerX(value) {
131
+ this.assertNotDestroyed("UIDummy.centerX");
121
132
  assertValidNumber(value, "UIDummy.centerX");
122
133
  this.x = value - this.width / 2;
123
134
  }
124
135
  /** Y coordinate of vertical center */
125
136
  set centerY(value) {
137
+ this.assertNotDestroyed("UIDummy.centerY");
126
138
  assertValidNumber(value, "UIDummy.centerY");
127
139
  this.y = value - this.height / 2;
128
140
  }
129
141
  /** Controls visibility and interactivity */
130
142
  set mode(value) {
143
+ this.assertNotDestroyed("UIDummy.mode");
131
144
  if (this.modeInternal !== value) {
132
145
  const newInteractivity = isUIModeInteractive(value);
133
- this.inputWrapper.setActive(this._private_catcherHandler, newInteractivity);
146
+ this.inputWrapper.setActive(this.catcherHandler, newInteractivity);
134
147
  this.modeInternal = value;
135
148
  }
136
149
  }
137
- /** Rendering and input priority. Higher values on top. */
150
+ /**
151
+ * Rendering and input priority. Higher values on top; elements with equal values keep the
152
+ * order of creation, a later one on top.
153
+ */
138
154
  set zIndex(value) {
155
+ this.assertNotDestroyed("UIDummy.zIndex");
139
156
  assertValidNumber(value, "UIDummy.zIndex");
140
- this.inputWrapper.setZIndex(this._private_catcherHandler, value);
157
+ this.inputWrapper.setZIndex(this.catcherHandler, value);
158
+ }
159
+ getSolverVariables() {
160
+ return [...super.getSolverVariables(), this.wVariable, this.hVariable];
141
161
  }
142
- /** Removes element and frees resources */
143
- destroy() {
162
+ destroyInternal() {
144
163
  this.solverWrapper.removeVariable(this.hVariable);
145
164
  this.solverWrapper.removeVariable(this.wVariable);
146
- this.inputWrapper.destroyInputCatcher(this._private_catcherHandler);
147
- super.destroy();
165
+ this.inputWrapper.destroyInputCatcher(this.catcherHandler);
166
+ super.destroyInternal();
148
167
  }
149
168
  handleInputEvent(x, y, identifier, signal) {
150
169
  assertValidNumber(x, "UIDummy.handleInputEvent.x");
@@ -154,20 +173,18 @@ class UIDummy extends UIAnchor {
154
173
  if (isPointerInside) {
155
174
  signal.emit({ x, y, identifier, element: this });
156
175
  }
157
- if (this._private_wasPointerInside && !isPointerInside) {
158
- this._private_signalPointerLeftInternal.emit({ x, y, identifier, element: this });
176
+ if (this.wasPointerInside && !isPointerInside) {
177
+ this.signalPointerLeftInternal.emit({ x, y, identifier, element: this });
159
178
  }
160
- else if (!this._private_wasPointerInside && isPointerInside) {
161
- this._private_signalPointerEnteredInternal.emit({
179
+ else if (!this.wasPointerInside && isPointerInside) {
180
+ this.signalPointerEnteredInternal.emit({
162
181
  x,
163
182
  y,
164
183
  identifier,
165
184
  element: this,
166
185
  });
167
186
  }
168
- this._private_wasPointerInside = isPointerInside;
187
+ this.wasPointerInside = isPointerInside;
169
188
  return this.modeInternal !== UIMode.INTERACTIVE_TRANSPARENT && isPointerInside;
170
189
  }
171
190
  }
172
-
173
- export { UIDummy };