laymur 0.23.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 +11 -11
  72. package/dist/core/elements/UIElement/UIElement.js +57 -60
  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 -10
  88. package/dist/core/elements/UIProgress/UIProgress.js +59 -62
  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 +13 -16
  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 +1 -1
  187. package/dist/core/miscellaneous/texture/UITextureView.js +113 -117
  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 +20 -4
  210. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.js +138 -117
  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,51 +1,49 @@
1
- import { Object3D, Vector3, CanvasTexture, SpriteMaterial, Sprite } from 'three';
2
- import { Line2 } from '../node_modules/three/examples/jsm/lines/Line2.js';
3
- import { LineGeometry } from '../node_modules/three/examples/jsm/lines/LineGeometry.js';
4
- import { LineMaterial } from '../node_modules/three/examples/jsm/lines/LineMaterial.js';
5
- import { isUIPlaneElement } from '../core/miscellaneous/shared.js';
6
- import { DEBUG_LINE_WIDTH, debugResolutionVector, DEBUG_RENDER_ORDER, DEBUG_BADGE_SIZE, DEBUG_BADGE_BACKGROUND_COLOR, DEBUG_BADGE_FONT_SIZE, DEBUG_BADGE_FONT_FAMILY } from './miscellaneous.js';
7
- import { UIColor } from '../core/miscellaneous/color/UIColor.js';
8
- import { UIOrientation } from '../core/miscellaneous/UIOrientation.js';
9
-
10
- class UIHorizontalInterpolationDebug {
1
+ import { CanvasTexture, Object3D, Sprite, SpriteMaterial, Vector3 } from "three";
2
+ import { Line2 } from "three/addons/lines/Line2.js";
3
+ import { LineGeometry } from "three/addons/lines/LineGeometry.js";
4
+ import { LineMaterial } from "three/addons/lines/LineMaterial.js";
5
+ import { UIColor, UIOrientation } from "../core/index.js";
6
+ import { isUIPlaneElement } from "../core/miscellaneous/shared.js";
7
+ import { DEBUG_BADGE_BACKGROUND_COLOR, DEBUG_BADGE_FONT_FAMILY, DEBUG_BADGE_FONT_SIZE, DEBUG_BADGE_SIZE, DEBUG_LINE_WIDTH, DEBUG_RENDER_ORDER, debugResolutionVector, } from "./miscellaneous.js";
8
+ export class UIHorizontalInterpolationDebug {
11
9
  constructor(constraint) {
12
10
  this.constraint = constraint;
13
11
  this.tint = new UIColor("cyan");
14
- this._private_container = new Object3D();
15
- this._private_baseLineMaterial = new LineMaterial({
12
+ this.container = new Object3D();
13
+ this.baseLineMaterial = new LineMaterial({
16
14
  linewidth: DEBUG_LINE_WIDTH,
17
15
  transparent: true,
18
16
  depthTest: false,
19
17
  depthWrite: false,
20
18
  });
21
- this._private_baseLineGeometry = new LineGeometry();
22
- this._private_baseLine = new Line2(this._private_baseLineGeometry, this._private_baseLineMaterial);
23
- this._private_markerMaterial = new LineMaterial({
19
+ this.baseLineGeometry = new LineGeometry();
20
+ this.baseLine = new Line2(this.baseLineGeometry, this.baseLineMaterial);
21
+ this.markerMaterial = new LineMaterial({
24
22
  linewidth: DEBUG_LINE_WIDTH,
25
23
  transparent: true,
26
24
  depthTest: false,
27
25
  depthWrite: false,
28
26
  });
29
- this._private_markerGeometry = new LineGeometry();
30
- this._private_markerLine = new Line2(this._private_markerGeometry, this._private_markerMaterial);
31
- this._private_visibleInternal = true;
32
- this._private_lastRenderedText = "";
33
- this._private_onOrientationChanged = () => {
34
- this._private_updateContainerVisibility();
27
+ this.markerGeometry = new LineGeometry();
28
+ this.markerLine = new Line2(this.markerGeometry, this.markerMaterial);
29
+ this.visibleInternal = true;
30
+ this.lastRenderedText = "";
31
+ this.onOrientationChanged = () => {
32
+ this.updateContainerVisibility();
35
33
  };
36
- this._private_onRendering = (renderer) => {
34
+ this.onRendering = (renderer) => {
37
35
  const tintDirty = this.tint.dirty;
38
36
  if (tintDirty) {
39
- this.tint.toThreeColor(this._private_baseLineMaterial.color);
40
- this._private_baseLineMaterial.opacity = this.tint.a;
41
- this.tint.toThreeColor(this._private_markerMaterial.color);
42
- this._private_markerMaterial.opacity = this.tint.a;
43
- this._private_spriteMaterial.opacity = this.tint.a;
37
+ this.tint.toThreeColor(this.baseLineMaterial.color);
38
+ this.baseLineMaterial.opacity = this.tint.a;
39
+ this.tint.toThreeColor(this.markerMaterial.color);
40
+ this.markerMaterial.opacity = this.tint.a;
41
+ this.spriteMaterial.opacity = this.tint.a;
44
42
  this.tint.setDirtyFalse();
45
43
  }
46
44
  renderer.getDrawingBufferSize(debugResolutionVector);
47
- this._private_baseLineMaterial.resolution.copy(debugResolutionVector);
48
- this._private_markerMaterial.resolution.copy(debugResolutionVector);
45
+ this.baseLineMaterial.resolution.copy(debugResolutionVector);
46
+ this.markerMaterial.resolution.copy(debugResolutionVector);
49
47
  const elementA = this.constraint.a;
50
48
  const elementB = this.constraint.b;
51
49
  const elementC = this.constraint.c;
@@ -61,85 +59,83 @@ class UIHorizontalInterpolationDebug {
61
59
  ? elementC.x + elementC.width * this.constraint.anchorC
62
60
  : elementC.x;
63
61
  const midY = (anchorAY + anchorBY) / 2;
64
- this._private_baseLineGeometry.setFromPoints([
62
+ this.baseLineGeometry.setFromPoints([
65
63
  new Vector3(anchorAX, midY, 0),
66
64
  new Vector3(anchorBX, midY, 0),
67
65
  ]);
68
66
  const markerSize = 12;
69
- this._private_markerGeometry.setFromPoints([
67
+ this.markerGeometry.setFromPoints([
70
68
  new Vector3(anchorCX, midY - markerSize, 0),
71
69
  new Vector3(anchorCX, midY + markerSize, 0),
72
70
  ]);
73
71
  const nextText = "hi: " + this.constraint.t.toFixed(2);
74
- if (nextText !== this._private_lastRenderedText || tintDirty) {
75
- this._private_drawText(nextText);
76
- this._private_textTexture.needsUpdate = true;
77
- this._private_lastRenderedText = nextText;
72
+ if (nextText !== this.lastRenderedText || tintDirty) {
73
+ this.drawText(nextText);
74
+ this.textTexture.needsUpdate = true;
75
+ this.lastRenderedText = nextText;
78
76
  }
79
- this._private_textSprite.position.set(anchorCX, midY + 20, 0);
77
+ this.textSprite.position.set(anchorCX, midY + 20, 0);
80
78
  };
81
- this._private_baseLine.renderOrder = DEBUG_RENDER_ORDER;
82
- this._private_markerLine.renderOrder = DEBUG_RENDER_ORDER;
83
- this._private_container.add(this._private_baseLine);
84
- this._private_container.add(this._private_markerLine);
79
+ this.baseLine.renderOrder = DEBUG_RENDER_ORDER;
80
+ this.markerLine.renderOrder = DEBUG_RENDER_ORDER;
81
+ this.container.add(this.baseLine);
82
+ this.container.add(this.markerLine);
85
83
  const canvas = document.createElement("canvas");
86
84
  canvas.width = 256;
87
85
  canvas.height = 64;
88
86
  const context = canvas.getContext("2d");
89
87
  if (context === null) {
90
- throw new Error("Failed to get 2D context for debug text");
88
+ throw new Error("UIHorizontalInterpolationDebug.constructor: failed to get 2D context for debug text");
91
89
  }
92
- this._private_canvas = canvas;
93
- this._private_context = context;
94
- this._private_drawText("");
95
- this._private_textTexture = new CanvasTexture(canvas);
96
- this._private_spriteMaterial = new SpriteMaterial({
97
- map: this._private_textTexture,
90
+ this.canvas = canvas;
91
+ this.context = context;
92
+ this.drawText("");
93
+ this.textTexture = new CanvasTexture(canvas);
94
+ this.spriteMaterial = new SpriteMaterial({
95
+ map: this.textTexture,
98
96
  transparent: true,
99
97
  depthTest: false,
100
98
  depthWrite: false,
101
99
  });
102
- this._private_textSprite = new Sprite(this._private_spriteMaterial);
103
- this._private_textSprite.renderOrder = DEBUG_RENDER_ORDER;
104
- this._private_textSprite.scale.set(DEBUG_BADGE_SIZE, DEBUG_BADGE_SIZE * 0.25, 1);
105
- this._private_container.add(this._private_textSprite);
106
- this.constraint.layer.signalRendering.on(this._private_onRendering);
107
- this.constraint.layer.signalOrientationChanged.on(this._private_onOrientationChanged);
108
- this.constraint.layer.sceneWrapper.insertCustomObject(this._private_container);
109
- this._private_updateContainerVisibility();
100
+ this.textSprite = new Sprite(this.spriteMaterial);
101
+ this.textSprite.renderOrder = DEBUG_RENDER_ORDER;
102
+ this.textSprite.scale.set(DEBUG_BADGE_SIZE, DEBUG_BADGE_SIZE * 0.25, 1);
103
+ this.container.add(this.textSprite);
104
+ this.constraint.layer.signalRendering.on(this.onRendering);
105
+ this.constraint.layer.signalOrientationChanged.on(this.onOrientationChanged);
106
+ this.constraint.layer.sceneWrapper.insertCustomObject(this.container);
107
+ this.updateContainerVisibility();
110
108
  }
111
109
  get visible() {
112
- return this._private_visibleInternal;
110
+ return this.visibleInternal;
113
111
  }
114
112
  set visible(value) {
115
- if (value !== this._private_visibleInternal) {
116
- this._private_visibleInternal = value;
117
- this._private_updateContainerVisibility();
113
+ if (value !== this.visibleInternal) {
114
+ this.visibleInternal = value;
115
+ this.updateContainerVisibility();
118
116
  }
119
117
  }
120
118
  destroy() {
121
- this.constraint.layer.signalRendering.off(this._private_onRendering);
122
- this.constraint.layer.signalOrientationChanged.off(this._private_onOrientationChanged);
123
- this.constraint.layer.sceneWrapper.removeCustomObject(this._private_container);
124
- this._private_baseLineGeometry.dispose();
125
- this._private_markerGeometry.dispose();
126
- this._private_textTexture.dispose();
119
+ this.constraint.layer.signalRendering.off(this.onRendering);
120
+ this.constraint.layer.signalOrientationChanged.off(this.onOrientationChanged);
121
+ this.constraint.layer.sceneWrapper.removeCustomObject(this.container);
122
+ this.baseLineGeometry.dispose();
123
+ this.markerGeometry.dispose();
124
+ this.textTexture.dispose();
127
125
  }
128
- _private_updateContainerVisibility() {
126
+ updateContainerVisibility() {
129
127
  const orientationActive = this.constraint.orientation === UIOrientation.ALWAYS ||
130
128
  this.constraint.orientation === this.constraint.layer.orientation;
131
- this._private_container.visible = this._private_visibleInternal && orientationActive;
129
+ this.container.visible = this.visibleInternal && orientationActive;
132
130
  }
133
- _private_drawText(text) {
134
- this._private_context.clearRect(0, 0, this._private_canvas.width, this._private_canvas.height);
135
- this._private_context.fillStyle = DEBUG_BADGE_BACKGROUND_COLOR;
136
- this._private_context.fillRect(0, 0, this._private_canvas.width, this._private_canvas.height);
137
- this._private_context.fillStyle = this.tint.getHexStringRGB();
138
- this._private_context.font = `${DEBUG_BADGE_FONT_SIZE}px ${DEBUG_BADGE_FONT_FAMILY}`;
139
- this._private_context.textAlign = "center";
140
- this._private_context.textBaseline = "middle";
141
- this._private_context.fillText(text, this._private_canvas.width / 2, this._private_canvas.height / 2);
131
+ drawText(text) {
132
+ this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);
133
+ this.context.fillStyle = DEBUG_BADGE_BACKGROUND_COLOR;
134
+ this.context.fillRect(0, 0, this.canvas.width, this.canvas.height);
135
+ this.context.fillStyle = this.tint.getHexStringRGB();
136
+ this.context.font = `${DEBUG_BADGE_FONT_SIZE}px ${DEBUG_BADGE_FONT_FAMILY}`;
137
+ this.context.textAlign = "center";
138
+ this.context.textBaseline = "middle";
139
+ this.context.fillText(text, this.canvas.width / 2, this.canvas.height / 2);
142
140
  }
143
141
  }
144
-
145
- export { UIHorizontalInterpolationDebug };
@@ -1,4 +1,4 @@
1
- import type { UILayer } from "../core";
1
+ import type { UILayer } from "../core/index.js";
2
2
  export interface UILayerDebugOptions {
3
3
  showAspect: boolean;
4
4
  showHeight: boolean;
@@ -1,124 +1,115 @@
1
- import { UIAspectDebug } from './UIAspectDebug.js';
2
- import { UIHeightDebug } from './UIHeightDebug.js';
3
- import { UIHorizontalDistanceDebug } from './UIHorizontalDistanceDebug.js';
4
- import { UIHorizontalInterpolationDebug } from './UIHorizontalInterpolationDebug.js';
5
- import { UIVerticalDistanceDebug } from './UIVerticalDistanceDebug.js';
6
- import { UIVerticalInterpolationDebug } from './UIVerticalInterpolationDebug.js';
7
- import { UIWidthDebug } from './UIWidthDebug.js';
8
- import { UIAspectConstraint } from '../core/constraints/UIAspectConstraint/UIAspectConstraint.js';
9
- import { UIHeightConstraint } from '../core/constraints/UIHeightConstraint/UIHeightConstraint.js';
10
- import { UIWidthConstraint } from '../core/constraints/UIWidthConstraint/UIWidthConstraint.js';
11
- import { UIHorizontalDistanceConstraint } from '../core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.js';
12
- import { UIHorizontalInterpolationConstraint } from '../core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.js';
13
- import { UIVerticalDistanceConstraint } from '../core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.js';
14
- import { UIVerticalInterpolationConstraint } from '../core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.js';
15
-
16
- class UILayerDebug {
1
+ import { UIAspectConstraint, UIHeightConstraint, UIHorizontalDistanceConstraint, UIHorizontalInterpolationConstraint, UIVerticalDistanceConstraint, UIVerticalInterpolationConstraint, UIWidthConstraint, } from "../core/index.js";
2
+ import { UIAspectDebug } from "./UIAspectDebug.js";
3
+ import { UIHeightDebug } from "./UIHeightDebug.js";
4
+ import { UIHorizontalDistanceDebug } from "./UIHorizontalDistanceDebug.js";
5
+ import { UIHorizontalInterpolationDebug } from "./UIHorizontalInterpolationDebug.js";
6
+ import { UIVerticalDistanceDebug } from "./UIVerticalDistanceDebug.js";
7
+ import { UIVerticalInterpolationDebug } from "./UIVerticalInterpolationDebug.js";
8
+ import { UIWidthDebug } from "./UIWidthDebug.js";
9
+ export class UILayerDebug {
17
10
  constructor(layer, options) {
18
11
  this.layer = layer;
19
- this._private_debug = [];
20
- this._private_onConstraintAdded = (layer, constraint) => {
21
- this._private_addDebug(constraint);
12
+ this.debug = [];
13
+ this.onConstraintAdded = (layer, constraint) => {
14
+ this.addDebug(constraint);
22
15
  };
23
- this._private_onConstraintRemoved = (layer, constraint) => {
24
- const index = this._private_debug.findIndex((d) => d.constraint === constraint);
16
+ this.onConstraintRemoved = (layer, constraint) => {
17
+ const index = this.debug.findIndex((d) => d.constraint === constraint);
25
18
  if (index !== -1) {
26
- this._private_debug[index].destroy();
27
- this._private_debug.splice(index, 1);
19
+ this.debug[index].destroy();
20
+ this.debug.splice(index, 1);
28
21
  }
29
22
  };
30
- this._private_showAspectInternal = options?.showAspect ?? true;
31
- this._private_showHeightInternal = options?.showHeight ?? true;
32
- this._private_showWidthInternal = options?.showWidth ?? true;
33
- this._private_showHorizontalDistanceInternal = options?.showHorizontalDistance ?? true;
34
- this._private_showHorizontalInterpolationInternal = options?.showHorizontalInterpolation ?? true;
35
- this._private_showVerticalDistanceInternal = options?.showVerticalDistance ?? true;
36
- this._private_showVerticalInterpolationInternal = options?.showVerticalInterpolation ?? true;
23
+ this.showAspectInternal = options?.showAspect ?? true;
24
+ this.showHeightInternal = options?.showHeight ?? true;
25
+ this.showWidthInternal = options?.showWidth ?? true;
26
+ this.showHorizontalDistanceInternal = options?.showHorizontalDistance ?? true;
27
+ this.showHorizontalInterpolationInternal = options?.showHorizontalInterpolation ?? true;
28
+ this.showVerticalDistanceInternal = options?.showVerticalDistance ?? true;
29
+ this.showVerticalInterpolationInternal = options?.showVerticalInterpolation ?? true;
37
30
  for (const constraint of this.layer.constraintRegistry) {
38
- this._private_addDebug(constraint);
31
+ this.addDebug(constraint);
39
32
  }
40
- this.layer.signalConstraintAdded.on(this._private_onConstraintAdded);
41
- this.layer.signalConstraintRemoved.on(this._private_onConstraintRemoved);
33
+ this.layer.signalConstraintAdded.on(this.onConstraintAdded);
34
+ this.layer.signalConstraintRemoved.on(this.onConstraintRemoved);
42
35
  }
43
36
  set showAspect(value) {
44
- this._private_showAspectInternal = value;
45
- this._private_setVisibility(UIAspectConstraint, value);
37
+ this.showAspectInternal = value;
38
+ this.setVisibility(UIAspectConstraint, value);
46
39
  }
47
40
  set showHeight(value) {
48
- this._private_showHeightInternal = value;
49
- this._private_setVisibility(UIHeightConstraint, value);
41
+ this.showHeightInternal = value;
42
+ this.setVisibility(UIHeightConstraint, value);
50
43
  }
51
44
  set showWidth(value) {
52
- this._private_showWidthInternal = value;
53
- this._private_setVisibility(UIWidthConstraint, value);
45
+ this.showWidthInternal = value;
46
+ this.setVisibility(UIWidthConstraint, value);
54
47
  }
55
48
  set showHorizontalDistance(value) {
56
- this._private_showHorizontalDistanceInternal = value;
57
- this._private_setVisibility(UIHorizontalDistanceConstraint, value);
49
+ this.showHorizontalDistanceInternal = value;
50
+ this.setVisibility(UIHorizontalDistanceConstraint, value);
58
51
  }
59
52
  set showHorizontalInterpolation(value) {
60
- this._private_showHorizontalInterpolationInternal = value;
61
- this._private_setVisibility(UIHorizontalInterpolationConstraint, value);
53
+ this.showHorizontalInterpolationInternal = value;
54
+ this.setVisibility(UIHorizontalInterpolationConstraint, value);
62
55
  }
63
56
  set showVerticalDistance(value) {
64
- this._private_showVerticalDistanceInternal = value;
65
- this._private_setVisibility(UIVerticalDistanceConstraint, value);
57
+ this.showVerticalDistanceInternal = value;
58
+ this.setVisibility(UIVerticalDistanceConstraint, value);
66
59
  }
67
60
  set showVerticalInterpolation(value) {
68
- this._private_showVerticalInterpolationInternal = value;
69
- this._private_setVisibility(UIVerticalInterpolationConstraint, value);
61
+ this.showVerticalInterpolationInternal = value;
62
+ this.setVisibility(UIVerticalInterpolationConstraint, value);
70
63
  }
71
64
  destroy() {
72
- this.layer.signalConstraintAdded.off(this._private_onConstraintAdded);
73
- this.layer.signalConstraintRemoved.off(this._private_onConstraintRemoved);
74
- for (const debug of this._private_debug) {
65
+ this.layer.signalConstraintAdded.off(this.onConstraintAdded);
66
+ this.layer.signalConstraintRemoved.off(this.onConstraintRemoved);
67
+ for (const debug of this.debug) {
75
68
  debug.destroy();
76
69
  }
77
- this._private_debug.length = 0;
70
+ this.debug.length = 0;
78
71
  }
79
- _private_addDebug(constraint) {
72
+ addDebug(constraint) {
80
73
  let debug = null;
81
74
  if (constraint instanceof UIAspectConstraint) {
82
75
  debug = new UIAspectDebug(constraint);
83
- debug.visible = this._private_showAspectInternal;
76
+ debug.visible = this.showAspectInternal;
84
77
  }
85
78
  else if (constraint instanceof UIHeightConstraint) {
86
79
  debug = new UIHeightDebug(constraint);
87
- debug.visible = this._private_showHeightInternal;
80
+ debug.visible = this.showHeightInternal;
88
81
  }
89
82
  else if (constraint instanceof UIWidthConstraint) {
90
83
  debug = new UIWidthDebug(constraint);
91
- debug.visible = this._private_showWidthInternal;
84
+ debug.visible = this.showWidthInternal;
92
85
  }
93
86
  else if (constraint instanceof UIHorizontalDistanceConstraint) {
94
87
  debug = new UIHorizontalDistanceDebug(constraint);
95
- debug.visible = this._private_showHorizontalDistanceInternal;
88
+ debug.visible = this.showHorizontalDistanceInternal;
96
89
  }
97
90
  else if (constraint instanceof UIHorizontalInterpolationConstraint) {
98
91
  debug = new UIHorizontalInterpolationDebug(constraint);
99
- debug.visible = this._private_showHorizontalInterpolationInternal;
92
+ debug.visible = this.showHorizontalInterpolationInternal;
100
93
  }
101
94
  else if (constraint instanceof UIVerticalDistanceConstraint) {
102
95
  debug = new UIVerticalDistanceDebug(constraint);
103
- debug.visible = this._private_showVerticalDistanceInternal;
96
+ debug.visible = this.showVerticalDistanceInternal;
104
97
  }
105
98
  else if (constraint instanceof UIVerticalInterpolationConstraint) {
106
99
  debug = new UIVerticalInterpolationDebug(constraint);
107
- debug.visible = this._private_showVerticalInterpolationInternal;
100
+ debug.visible = this.showVerticalInterpolationInternal;
108
101
  }
109
102
  if (debug) {
110
- this._private_debug.push(debug);
103
+ this.debug.push(debug);
111
104
  }
112
105
  }
113
- _private_setVisibility(
106
+ setVisibility(
114
107
  // eslint-disable-next-line @typescript-eslint/no-explicit-any -- any is necessary here because the constraint class constructor signature is unknown
115
108
  constraintClass, visible) {
116
- for (const debug of this._private_debug) {
109
+ for (const debug of this.debug) {
117
110
  if (debug.constraint instanceof constraintClass) {
118
111
  debug.visible = visible;
119
112
  }
120
113
  }
121
114
  }
122
115
  }
123
-
124
- export { UILayerDebug };
@@ -1,6 +1,6 @@
1
- import type { UIVerticalDistanceConstraint } from "../core";
2
- import { UIColor } from "../core";
3
- import type { UIConstraintDebug } from "./UIConstraintDebug";
1
+ import type { UIVerticalDistanceConstraint } from "../core/index.js";
2
+ import { UIColor } from "../core/index.js";
3
+ import type { UIConstraintDebug } from "./UIConstraintDebug.js";
4
4
  export declare class UIVerticalDistanceDebug implements UIConstraintDebug {
5
5
  readonly constraint: UIVerticalDistanceConstraint;
6
6
  readonly tint: UIColor;
@@ -1,54 +1,51 @@
1
- import { Object3D, Vector3, CanvasTexture, SpriteMaterial, Sprite } from 'three';
2
- import { Line2 } from '../node_modules/three/examples/jsm/lines/Line2.js';
3
- import { LineGeometry } from '../node_modules/three/examples/jsm/lines/LineGeometry.js';
4
- import { LineMaterial } from '../node_modules/three/examples/jsm/lines/LineMaterial.js';
5
- import { LineSegments2 } from '../node_modules/three/examples/jsm/lines/LineSegments2.js';
6
- import { LineSegmentsGeometry } from '../node_modules/three/examples/jsm/lines/LineSegmentsGeometry.js';
7
- import { isUIPlaneElement } from '../core/miscellaneous/shared.js';
8
- import { DEBUG_LINE_WIDTH, debugResolutionVector, DEBUG_RENDER_ORDER, DEBUG_BADGE_SIZE, DEBUG_BADGE_BACKGROUND_COLOR, DEBUG_BADGE_FONT_SIZE, DEBUG_BADGE_FONT_FAMILY } from './miscellaneous.js';
9
- import { UIColor } from '../core/miscellaneous/color/UIColor.js';
10
- import { UIOrientation } from '../core/miscellaneous/UIOrientation.js';
11
- import { UILayer } from '../core/layers/UILayer/UILayer.js';
12
-
13
- class UIVerticalDistanceDebug {
1
+ import { CanvasTexture, Object3D, Sprite, SpriteMaterial, Vector3 } from "three";
2
+ import { Line2 } from "three/addons/lines/Line2.js";
3
+ import { LineGeometry } from "three/addons/lines/LineGeometry.js";
4
+ import { LineMaterial } from "three/addons/lines/LineMaterial.js";
5
+ import { LineSegments2 } from "three/addons/lines/LineSegments2.js";
6
+ import { LineSegmentsGeometry } from "three/addons/lines/LineSegmentsGeometry.js";
7
+ import { UIColor, UILayer, UIOrientation } from "../core/index.js";
8
+ import { isUIPlaneElement } from "../core/miscellaneous/shared.js";
9
+ import { DEBUG_BADGE_BACKGROUND_COLOR, DEBUG_BADGE_FONT_FAMILY, DEBUG_BADGE_FONT_SIZE, DEBUG_BADGE_SIZE, DEBUG_LINE_WIDTH, DEBUG_RENDER_ORDER, debugResolutionVector, } from "./miscellaneous.js";
10
+ export class UIVerticalDistanceDebug {
14
11
  constructor(constraint) {
15
12
  this.constraint = constraint;
16
13
  this.tint = new UIColor("cyan");
17
- this._private_container = new Object3D();
18
- this._private_lineMaterial = new LineMaterial({
14
+ this.container = new Object3D();
15
+ this.lineMaterial = new LineMaterial({
19
16
  linewidth: DEBUG_LINE_WIDTH,
20
17
  transparent: true,
21
18
  depthTest: false,
22
19
  depthWrite: false,
23
20
  });
24
- this._private_lineGeometry = new LineGeometry();
25
- this._private_line = new Line2(this._private_lineGeometry, this._private_lineMaterial);
26
- this._private_tickMaterial = new LineMaterial({
21
+ this.lineGeometry = new LineGeometry();
22
+ this.line = new Line2(this.lineGeometry, this.lineMaterial);
23
+ this.tickMaterial = new LineMaterial({
27
24
  linewidth: DEBUG_LINE_WIDTH,
28
25
  transparent: true,
29
26
  depthTest: false,
30
27
  depthWrite: false,
31
28
  });
32
- this._private_tickGeometry = new LineSegmentsGeometry();
33
- this._private_tickLine = new LineSegments2(this._private_tickGeometry, this._private_tickMaterial);
34
- this._private_visibleInternal = true;
35
- this._private_lastRenderedText = "";
36
- this._private_onOrientationChanged = () => {
37
- this._private_updateContainerVisibility();
29
+ this.tickGeometry = new LineSegmentsGeometry();
30
+ this.tickLine = new LineSegments2(this.tickGeometry, this.tickMaterial);
31
+ this.visibleInternal = true;
32
+ this.lastRenderedText = "";
33
+ this.onOrientationChanged = () => {
34
+ this.updateContainerVisibility();
38
35
  };
39
- this._private_onRendering = (renderer) => {
36
+ this.onRendering = (renderer) => {
40
37
  const tintDirty = this.tint.dirty;
41
38
  if (tintDirty) {
42
- this.tint.toThreeColor(this._private_lineMaterial.color);
43
- this._private_lineMaterial.opacity = this.tint.a;
44
- this.tint.toThreeColor(this._private_tickMaterial.color);
45
- this._private_tickMaterial.opacity = this.tint.a;
46
- this._private_spriteMaterial.opacity = this.tint.a;
39
+ this.tint.toThreeColor(this.lineMaterial.color);
40
+ this.lineMaterial.opacity = this.tint.a;
41
+ this.tint.toThreeColor(this.tickMaterial.color);
42
+ this.tickMaterial.opacity = this.tint.a;
43
+ this.spriteMaterial.opacity = this.tint.a;
47
44
  this.tint.setDirtyFalse();
48
45
  }
49
46
  renderer.getDrawingBufferSize(debugResolutionVector);
50
- this._private_lineMaterial.resolution.copy(debugResolutionVector);
51
- this._private_tickMaterial.resolution.copy(debugResolutionVector);
47
+ this.lineMaterial.resolution.copy(debugResolutionVector);
48
+ this.tickMaterial.resolution.copy(debugResolutionVector);
52
49
  const elementA = this.constraint.a;
53
50
  const elementB = this.constraint.b;
54
51
  const anchorAY = isUIPlaneElement(elementA)
@@ -64,12 +61,12 @@ class UIVerticalDistanceDebug {
64
61
  : elementB instanceof UILayer
65
62
  ? anchorAX
66
63
  : (anchorAX + anchorBX) / 2;
67
- this._private_lineGeometry.setFromPoints([
64
+ this.lineGeometry.setFromPoints([
68
65
  new Vector3(midX, anchorAY, 0),
69
66
  new Vector3(midX, anchorBY, 0),
70
67
  ]);
71
68
  const tickSize = 10;
72
- this._private_tickGeometry.setPositions([
69
+ this.tickGeometry.setPositions([
73
70
  midX - tickSize,
74
71
  anchorAY,
75
72
  0,
@@ -84,75 +81,73 @@ class UIVerticalDistanceDebug {
84
81
  0,
85
82
  ]);
86
83
  const nextText = "VD: " + this.constraint.distance.toFixed(0);
87
- if (nextText !== this._private_lastRenderedText || tintDirty) {
88
- this._private_drawText(nextText);
89
- this._private_textTexture.needsUpdate = true;
90
- this._private_lastRenderedText = nextText;
84
+ if (nextText !== this.lastRenderedText || tintDirty) {
85
+ this.drawText(nextText);
86
+ this.textTexture.needsUpdate = true;
87
+ this.lastRenderedText = nextText;
91
88
  }
92
- this._private_textSprite.position.set(midX + 20, (anchorAY + anchorBY) / 2, 0);
89
+ this.textSprite.position.set(midX + 20, (anchorAY + anchorBY) / 2, 0);
93
90
  };
94
- this._private_line.renderOrder = DEBUG_RENDER_ORDER;
95
- this._private_tickLine.renderOrder = DEBUG_RENDER_ORDER;
96
- this._private_container.add(this._private_line);
97
- this._private_container.add(this._private_tickLine);
91
+ this.line.renderOrder = DEBUG_RENDER_ORDER;
92
+ this.tickLine.renderOrder = DEBUG_RENDER_ORDER;
93
+ this.container.add(this.line);
94
+ this.container.add(this.tickLine);
98
95
  const canvas = document.createElement("canvas");
99
96
  canvas.width = 256;
100
97
  canvas.height = 64;
101
98
  const context = canvas.getContext("2d");
102
99
  if (context === null) {
103
- throw new Error("Failed to get 2D context for debug text");
100
+ throw new Error("UIVerticalDistanceDebug.constructor: failed to get 2D context for debug text");
104
101
  }
105
- this._private_canvas = canvas;
106
- this._private_context = context;
107
- this._private_drawText("");
108
- this._private_textTexture = new CanvasTexture(canvas);
109
- this._private_spriteMaterial = new SpriteMaterial({
110
- map: this._private_textTexture,
102
+ this.canvas = canvas;
103
+ this.context = context;
104
+ this.drawText("");
105
+ this.textTexture = new CanvasTexture(canvas);
106
+ this.spriteMaterial = new SpriteMaterial({
107
+ map: this.textTexture,
111
108
  transparent: true,
112
109
  depthTest: false,
113
110
  depthWrite: false,
114
111
  });
115
- this._private_textSprite = new Sprite(this._private_spriteMaterial);
116
- this._private_textSprite.renderOrder = DEBUG_RENDER_ORDER;
117
- this._private_textSprite.scale.set(DEBUG_BADGE_SIZE, DEBUG_BADGE_SIZE * 0.25, 1);
118
- this._private_container.add(this._private_textSprite);
119
- this.constraint.layer.signalRendering.on(this._private_onRendering);
120
- this.constraint.layer.signalOrientationChanged.on(this._private_onOrientationChanged);
121
- this.constraint.layer.sceneWrapper.insertCustomObject(this._private_container);
122
- this._private_updateContainerVisibility();
112
+ this.textSprite = new Sprite(this.spriteMaterial);
113
+ this.textSprite.renderOrder = DEBUG_RENDER_ORDER;
114
+ this.textSprite.scale.set(DEBUG_BADGE_SIZE, DEBUG_BADGE_SIZE * 0.25, 1);
115
+ this.container.add(this.textSprite);
116
+ this.constraint.layer.signalRendering.on(this.onRendering);
117
+ this.constraint.layer.signalOrientationChanged.on(this.onOrientationChanged);
118
+ this.constraint.layer.sceneWrapper.insertCustomObject(this.container);
119
+ this.updateContainerVisibility();
123
120
  }
124
121
  get visible() {
125
- return this._private_visibleInternal;
122
+ return this.visibleInternal;
126
123
  }
127
124
  set visible(value) {
128
- if (value !== this._private_visibleInternal) {
129
- this._private_visibleInternal = value;
130
- this._private_updateContainerVisibility();
125
+ if (value !== this.visibleInternal) {
126
+ this.visibleInternal = value;
127
+ this.updateContainerVisibility();
131
128
  }
132
129
  }
133
130
  destroy() {
134
- this.constraint.layer.signalRendering.off(this._private_onRendering);
135
- this.constraint.layer.signalOrientationChanged.off(this._private_onOrientationChanged);
136
- this.constraint.layer.sceneWrapper.removeCustomObject(this._private_container);
137
- this._private_lineGeometry.dispose();
138
- this._private_tickGeometry.dispose();
139
- this._private_textTexture.dispose();
131
+ this.constraint.layer.signalRendering.off(this.onRendering);
132
+ this.constraint.layer.signalOrientationChanged.off(this.onOrientationChanged);
133
+ this.constraint.layer.sceneWrapper.removeCustomObject(this.container);
134
+ this.lineGeometry.dispose();
135
+ this.tickGeometry.dispose();
136
+ this.textTexture.dispose();
140
137
  }
141
- _private_updateContainerVisibility() {
138
+ updateContainerVisibility() {
142
139
  const orientationActive = this.constraint.orientation === UIOrientation.ALWAYS ||
143
140
  this.constraint.orientation === this.constraint.layer.orientation;
144
- this._private_container.visible = this._private_visibleInternal && orientationActive;
141
+ this.container.visible = this.visibleInternal && orientationActive;
145
142
  }
146
- _private_drawText(text) {
147
- this._private_context.clearRect(0, 0, this._private_canvas.width, this._private_canvas.height);
148
- this._private_context.fillStyle = DEBUG_BADGE_BACKGROUND_COLOR;
149
- this._private_context.fillRect(0, 0, this._private_canvas.width, this._private_canvas.height);
150
- this._private_context.fillStyle = this.tint.getHexStringRGB();
151
- this._private_context.font = `${DEBUG_BADGE_FONT_SIZE}px ${DEBUG_BADGE_FONT_FAMILY}`;
152
- this._private_context.textAlign = "center";
153
- this._private_context.textBaseline = "middle";
154
- this._private_context.fillText(text, this._private_canvas.width / 2, this._private_canvas.height / 2);
143
+ drawText(text) {
144
+ this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);
145
+ this.context.fillStyle = DEBUG_BADGE_BACKGROUND_COLOR;
146
+ this.context.fillRect(0, 0, this.canvas.width, this.canvas.height);
147
+ this.context.fillStyle = this.tint.getHexStringRGB();
148
+ this.context.font = `${DEBUG_BADGE_FONT_SIZE}px ${DEBUG_BADGE_FONT_FAMILY}`;
149
+ this.context.textAlign = "center";
150
+ this.context.textBaseline = "middle";
151
+ this.context.fillText(text, this.canvas.width / 2, this.canvas.height / 2);
155
152
  }
156
153
  }
157
-
158
- export { UIVerticalDistanceDebug };