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,86 +1,85 @@
1
- import { assertValidPositiveNumber, assertValidNumber, assertValidNonNegativeNumber } from '../asserts.js';
2
- import { TEXT_STYLE_DEFAULT_FONT_SIZE, TEXT_STYLE_DEFAULT_STROKE_THICKNESS, TEXT_STYLE_DEFAULT_STROKE_COLOR, TEXT_STYLE_DEFAULT_ENABLE_STROKE, TEXT_STYLE_DEFAULT_SHADOW_COLOR, TEXT_STYLE_DEFAULT_SHADOW_BLUR, TEXT_STYLE_DEFAULT_SHADOW_OFFSET_Y, TEXT_STYLE_DEFAULT_SHADOW_OFFSET_X, TEXT_STYLE_DEFAULT_ENABLE_SHADOW, TEXT_STYLE_DEFAULT_FONT_WEIGHT, TEXT_STYLE_DEFAULT_FONT_STYLE, TEXT_STYLE_DEFAULT_FONT_FAMILY, TEXT_STYLE_DEFAULT_ALIGN, TEXT_STYLE_DEFAULT_COLOR, TEXT_STYLE_DEFAULT_LINE_HEIGHT } from './UITextStyle.Internal.js';
3
-
1
+ import { assertValidNonNegativeNumber, assertValidNumber, assertValidPositiveNumber, } from "../asserts.js";
2
+ import { TEXT_STYLE_DEFAULT_ALIGN, TEXT_STYLE_DEFAULT_COLOR, TEXT_STYLE_DEFAULT_ENABLE_SHADOW, TEXT_STYLE_DEFAULT_ENABLE_STROKE, TEXT_STYLE_DEFAULT_FONT_FAMILY, TEXT_STYLE_DEFAULT_FONT_SIZE, TEXT_STYLE_DEFAULT_FONT_STYLE, TEXT_STYLE_DEFAULT_FONT_WEIGHT, TEXT_STYLE_DEFAULT_LINE_HEIGHT, TEXT_STYLE_DEFAULT_SHADOW_BLUR, TEXT_STYLE_DEFAULT_SHADOW_COLOR, TEXT_STYLE_DEFAULT_SHADOW_OFFSET_X, TEXT_STYLE_DEFAULT_SHADOW_OFFSET_Y, TEXT_STYLE_DEFAULT_STROKE_COLOR, TEXT_STYLE_DEFAULT_STROKE_THICKNESS, } from "./UITextStyle.Internal.js";
4
3
  /** Text style configuration for UI text rendering */
5
- class UITextStyle {
4
+ export class UITextStyle {
6
5
  /** @param config Partial style configuration. Unspecified properties remain undefined. */
7
6
  constructor(config) {
8
- this._private_dirtyInternal = true;
9
- this._private_colorInternal = config?.color;
10
- this._private_alignInternal = config?.align;
11
- this._private_fontFamilyInternal = config?.fontFamily;
12
- this._private_fontSizeInternal = config?.fontSize;
13
- this._private_fontStyleInternal = config?.fontStyle;
14
- this._private_fontWeightInternal = config?.fontWeight;
15
- this._private_lineHeightInternal = config?.lineHeight;
16
- this._private_enableShadowInternal = config?.enableShadow;
17
- this._private_shadowOffsetXInternal = config?.shadowOffsetX;
18
- this._private_shadowOffsetYInternal = config?.shadowOffsetY;
19
- this._private_shadowBlurInternal = config?.shadowBlur;
20
- this._private_shadowColorInternal = config?.shadowColor;
21
- this._private_enableStrokeInternal = config?.enableStroke;
22
- this._private_strokeColorInternal = config?.strokeColor;
23
- this._private_strokeThicknessInternal = config?.strokeThickness;
7
+ this.dirtyInternal = true;
8
+ this.colorInternal = config?.color;
9
+ this.alignInternal = config?.align;
10
+ this.fontFamilyInternal = config?.fontFamily;
11
+ this.fontSizeInternal = config?.fontSize;
12
+ this.fontStyleInternal = config?.fontStyle;
13
+ this.fontWeightInternal = config?.fontWeight;
14
+ this.lineHeightInternal = config?.lineHeight;
15
+ this.enableShadowInternal = config?.enableShadow;
16
+ this.shadowOffsetXInternal = config?.shadowOffsetX;
17
+ this.shadowOffsetYInternal = config?.shadowOffsetY;
18
+ this.shadowBlurInternal = config?.shadowBlur;
19
+ this.shadowColorInternal = config?.shadowColor;
20
+ this.enableStrokeInternal = config?.enableStroke;
21
+ this.strokeColorInternal = config?.strokeColor;
22
+ this.strokeThicknessInternal = config?.strokeThickness;
24
23
  }
25
24
  /** Text color */
26
25
  get color() {
27
- return this._private_colorInternal;
26
+ return this.colorInternal;
28
27
  }
29
28
  /** Text alignment */
30
29
  get align() {
31
- return this._private_alignInternal;
30
+ return this.alignInternal;
32
31
  }
33
32
  /** Font family name */
34
33
  get fontFamily() {
35
- return this._private_fontFamilyInternal;
34
+ return this.fontFamilyInternal;
36
35
  }
37
36
  /** Font size in pixels */
38
37
  get fontSize() {
39
- return this._private_fontSizeInternal;
38
+ return this.fontSizeInternal;
40
39
  }
41
40
  /** Font style */
42
41
  get fontStyle() {
43
- return this._private_fontStyleInternal;
42
+ return this.fontStyleInternal;
44
43
  }
45
44
  /** Font weight */
46
45
  get fontWeight() {
47
- return this._private_fontWeightInternal;
46
+ return this.fontWeightInternal;
48
47
  }
49
48
  /** Line height in pixels */
50
49
  get lineHeight() {
51
- return this._private_lineHeightInternal;
50
+ return this.lineHeightInternal;
52
51
  }
53
52
  /** Whether shadow is enabled */
54
53
  get enableShadow() {
55
- return this._private_enableShadowInternal;
54
+ return this.enableShadowInternal;
56
55
  }
57
56
  /** Shadow horizontal offset in pixels */
58
57
  get shadowOffsetX() {
59
- return this._private_shadowOffsetXInternal;
58
+ return this.shadowOffsetXInternal;
60
59
  }
61
60
  /** Shadow vertical offset in pixels */
62
61
  get shadowOffsetY() {
63
- return this._private_shadowOffsetYInternal;
62
+ return this.shadowOffsetYInternal;
64
63
  }
65
64
  /** Shadow blur radius in pixels */
66
65
  get shadowBlur() {
67
- return this._private_shadowBlurInternal;
66
+ return this.shadowBlurInternal;
68
67
  }
69
68
  /** Shadow color */
70
69
  get shadowColor() {
71
- return this._private_shadowColorInternal;
70
+ return this.shadowColorInternal;
72
71
  }
73
72
  /** Whether stroke is enabled */
74
73
  get enableStroke() {
75
- return this._private_enableStrokeInternal;
74
+ return this.enableStrokeInternal;
76
75
  }
77
76
  /** Stroke color */
78
77
  get strokeColor() {
79
- return this._private_strokeColorInternal;
78
+ return this.strokeColorInternal;
80
79
  }
81
80
  /** Stroke thickness in pixels */
82
81
  get strokeThickness() {
83
- return this._private_strokeThicknessInternal;
82
+ return this.strokeThicknessInternal;
84
83
  }
85
84
  /**
86
85
  * Indicates whether any property has been modified.
@@ -88,117 +87,117 @@ class UITextStyle {
88
87
  * @internal
89
88
  */
90
89
  get dirty() {
91
- return this._private_dirtyInternal;
90
+ return this.dirtyInternal;
92
91
  }
93
92
  set color(value) {
94
- if (value !== this._private_colorInternal) {
95
- this._private_colorInternal = value;
96
- this._private_dirtyInternal = true;
93
+ if (value !== this.colorInternal) {
94
+ this.colorInternal = value;
95
+ this.dirtyInternal = true;
97
96
  }
98
97
  }
99
98
  set align(value) {
100
- if (value !== this._private_alignInternal) {
101
- this._private_alignInternal = value;
102
- this._private_dirtyInternal = true;
99
+ if (value !== this.alignInternal) {
100
+ this.alignInternal = value;
101
+ this.dirtyInternal = true;
103
102
  }
104
103
  }
105
104
  set fontFamily(value) {
106
- if (value !== this._private_fontFamilyInternal) {
107
- this._private_fontFamilyInternal = value;
108
- this._private_dirtyInternal = true;
105
+ if (value !== this.fontFamilyInternal) {
106
+ this.fontFamilyInternal = value;
107
+ this.dirtyInternal = true;
109
108
  }
110
109
  }
111
110
  set fontSize(value) {
112
111
  if (value !== undefined) {
113
112
  assertValidPositiveNumber(value, "UITextStyle.fontSize");
114
113
  }
115
- if (value !== this._private_fontSizeInternal) {
116
- this._private_fontSizeInternal = value;
117
- this._private_dirtyInternal = true;
114
+ if (value !== this.fontSizeInternal) {
115
+ this.fontSizeInternal = value;
116
+ this.dirtyInternal = true;
118
117
  }
119
118
  }
120
119
  set fontStyle(value) {
121
- if (value !== this._private_fontStyleInternal) {
122
- this._private_fontStyleInternal = value;
123
- this._private_dirtyInternal = true;
120
+ if (value !== this.fontStyleInternal) {
121
+ this.fontStyleInternal = value;
122
+ this.dirtyInternal = true;
124
123
  }
125
124
  }
126
125
  set fontWeight(value) {
127
126
  if (typeof value === "number") {
128
127
  assertValidPositiveNumber(value, "UITextStyle.fontWeight");
129
128
  }
130
- if (value !== this._private_fontWeightInternal) {
131
- this._private_fontWeightInternal = value;
132
- this._private_dirtyInternal = true;
129
+ if (value !== this.fontWeightInternal) {
130
+ this.fontWeightInternal = value;
131
+ this.dirtyInternal = true;
133
132
  }
134
133
  }
135
134
  set lineHeight(value) {
136
135
  if (value !== undefined) {
137
136
  assertValidNumber(value, "UITextStyle.lineHeight");
138
137
  }
139
- if (value !== this._private_lineHeightInternal) {
140
- this._private_lineHeightInternal = value;
141
- this._private_dirtyInternal = true;
138
+ if (value !== this.lineHeightInternal) {
139
+ this.lineHeightInternal = value;
140
+ this.dirtyInternal = true;
142
141
  }
143
142
  }
144
143
  set enableShadow(value) {
145
- if (value !== this._private_enableShadowInternal) {
146
- this._private_enableShadowInternal = value;
147
- this._private_dirtyInternal = true;
144
+ if (value !== this.enableShadowInternal) {
145
+ this.enableShadowInternal = value;
146
+ this.dirtyInternal = true;
148
147
  }
149
148
  }
150
149
  set shadowOffsetX(value) {
151
150
  if (value !== undefined) {
152
151
  assertValidNonNegativeNumber(value, "UITextStyle.shadowOffsetX");
153
152
  }
154
- if (value !== this._private_shadowOffsetXInternal) {
155
- this._private_shadowOffsetXInternal = value;
156
- this._private_dirtyInternal = true;
153
+ if (value !== this.shadowOffsetXInternal) {
154
+ this.shadowOffsetXInternal = value;
155
+ this.dirtyInternal = true;
157
156
  }
158
157
  }
159
158
  set shadowOffsetY(value) {
160
159
  if (value !== undefined) {
161
160
  assertValidNonNegativeNumber(value, "UITextStyle.shadowOffsetY");
162
161
  }
163
- if (value !== this._private_shadowOffsetYInternal) {
164
- this._private_shadowOffsetYInternal = value;
165
- this._private_dirtyInternal = true;
162
+ if (value !== this.shadowOffsetYInternal) {
163
+ this.shadowOffsetYInternal = value;
164
+ this.dirtyInternal = true;
166
165
  }
167
166
  }
168
167
  set shadowBlur(value) {
169
168
  if (value !== undefined) {
170
169
  assertValidNonNegativeNumber(value, "UITextStyle.shadowBlur");
171
170
  }
172
- if (value !== this._private_shadowBlurInternal) {
173
- this._private_shadowBlurInternal = value;
174
- this._private_dirtyInternal = true;
171
+ if (value !== this.shadowBlurInternal) {
172
+ this.shadowBlurInternal = value;
173
+ this.dirtyInternal = true;
175
174
  }
176
175
  }
177
176
  set shadowColor(value) {
178
- if (value !== this._private_shadowColorInternal) {
179
- this._private_shadowColorInternal = value;
180
- this._private_dirtyInternal = true;
177
+ if (value !== this.shadowColorInternal) {
178
+ this.shadowColorInternal = value;
179
+ this.dirtyInternal = true;
181
180
  }
182
181
  }
183
182
  set enableStroke(value) {
184
- if (value !== this._private_enableStrokeInternal) {
185
- this._private_enableStrokeInternal = value;
186
- this._private_dirtyInternal = true;
183
+ if (value !== this.enableStrokeInternal) {
184
+ this.enableStrokeInternal = value;
185
+ this.dirtyInternal = true;
187
186
  }
188
187
  }
189
188
  set strokeColor(value) {
190
- if (value !== this._private_strokeColorInternal) {
191
- this._private_strokeColorInternal = value;
192
- this._private_dirtyInternal = true;
189
+ if (value !== this.strokeColorInternal) {
190
+ this.strokeColorInternal = value;
191
+ this.dirtyInternal = true;
193
192
  }
194
193
  }
195
194
  set strokeThickness(value) {
196
195
  if (value !== undefined) {
197
196
  assertValidNonNegativeNumber(value, "UITextStyle.strokeThickness");
198
197
  }
199
- if (value !== this._private_strokeThicknessInternal) {
200
- this._private_strokeThicknessInternal = value;
201
- this._private_dirtyInternal = true;
198
+ if (value !== this.strokeThicknessInternal) {
199
+ this.strokeThicknessInternal = value;
200
+ this.dirtyInternal = true;
202
201
  }
203
202
  }
204
203
  /**
@@ -208,165 +207,181 @@ class UITextStyle {
208
207
  * @returns Complete style configuration with all defaults applied
209
208
  */
210
209
  static resolve(primary, fallback) {
211
- const fontSize = primary._private_fontSizeInternal ?? fallback._private_fontSizeInternal ?? TEXT_STYLE_DEFAULT_FONT_SIZE;
210
+ const fontSize = primary?.fontSizeInternal ?? fallback?.fontSizeInternal ?? TEXT_STYLE_DEFAULT_FONT_SIZE;
212
211
  return {
213
- color: primary._private_colorInternal ?? fallback._private_colorInternal ?? TEXT_STYLE_DEFAULT_COLOR,
214
- align: primary._private_alignInternal ?? fallback._private_alignInternal ?? TEXT_STYLE_DEFAULT_ALIGN,
215
- fontFamily: primary._private_fontFamilyInternal ?? fallback._private_fontFamilyInternal ??
212
+ color: primary?.colorInternal ?? fallback?.colorInternal ?? TEXT_STYLE_DEFAULT_COLOR,
213
+ align: primary?.alignInternal ?? fallback?.alignInternal ?? TEXT_STYLE_DEFAULT_ALIGN,
214
+ fontFamily: primary?.fontFamilyInternal ??
215
+ fallback?.fontFamilyInternal ??
216
216
  TEXT_STYLE_DEFAULT_FONT_FAMILY,
217
217
  fontSize,
218
- fontStyle: primary._private_fontStyleInternal ?? fallback._private_fontStyleInternal ?? TEXT_STYLE_DEFAULT_FONT_STYLE,
219
- fontWeight: primary._private_fontWeightInternal ?? fallback._private_fontWeightInternal ??
218
+ fontStyle: primary?.fontStyleInternal ?? fallback?.fontStyleInternal ?? TEXT_STYLE_DEFAULT_FONT_STYLE,
219
+ fontWeight: primary?.fontWeightInternal ??
220
+ fallback?.fontWeightInternal ??
220
221
  TEXT_STYLE_DEFAULT_FONT_WEIGHT,
221
- lineHeight: primary._private_lineHeightInternal ?? fallback._private_lineHeightInternal ??
222
+ lineHeight: primary?.lineHeightInternal ??
223
+ fallback?.lineHeightInternal ??
222
224
  fontSize * TEXT_STYLE_DEFAULT_LINE_HEIGHT,
223
- enableShadow: primary._private_enableShadowInternal ?? fallback._private_enableShadowInternal ??
225
+ enableShadow: primary?.enableShadowInternal ??
226
+ fallback?.enableShadowInternal ??
224
227
  TEXT_STYLE_DEFAULT_ENABLE_SHADOW,
225
- shadowOffsetX: primary._private_shadowOffsetXInternal ?? fallback._private_shadowOffsetXInternal ??
228
+ shadowOffsetX: primary?.shadowOffsetXInternal ??
229
+ fallback?.shadowOffsetXInternal ??
226
230
  TEXT_STYLE_DEFAULT_SHADOW_OFFSET_X,
227
- shadowOffsetY: primary._private_shadowOffsetYInternal ?? fallback._private_shadowOffsetYInternal ??
231
+ shadowOffsetY: primary?.shadowOffsetYInternal ??
232
+ fallback?.shadowOffsetYInternal ??
228
233
  TEXT_STYLE_DEFAULT_SHADOW_OFFSET_Y,
229
- shadowBlur: primary._private_shadowBlurInternal ?? fallback._private_shadowBlurInternal ??
234
+ shadowBlur: primary?.shadowBlurInternal ??
235
+ fallback?.shadowBlurInternal ??
230
236
  TEXT_STYLE_DEFAULT_SHADOW_BLUR,
231
- shadowColor: primary._private_shadowColorInternal ?? fallback._private_shadowColorInternal ??
237
+ shadowColor: primary?.shadowColorInternal ??
238
+ fallback?.shadowColorInternal ??
232
239
  TEXT_STYLE_DEFAULT_SHADOW_COLOR,
233
- enableStroke: primary._private_enableStrokeInternal ?? fallback._private_enableStrokeInternal ??
240
+ enableStroke: primary?.enableStrokeInternal ??
241
+ fallback?.enableStrokeInternal ??
234
242
  TEXT_STYLE_DEFAULT_ENABLE_STROKE,
235
- strokeColor: primary._private_strokeColorInternal ?? fallback._private_strokeColorInternal ??
243
+ strokeColor: primary?.strokeColorInternal ??
244
+ fallback?.strokeColorInternal ??
236
245
  TEXT_STYLE_DEFAULT_STROKE_COLOR,
237
- strokeThickness: primary._private_strokeThicknessInternal ?? fallback._private_strokeThicknessInternal ??
246
+ strokeThickness: primary?.strokeThicknessInternal ??
247
+ fallback?.strokeThicknessInternal ??
238
248
  TEXT_STYLE_DEFAULT_STROKE_THICKNESS,
239
249
  };
240
250
  }
251
+ /**
252
+ * Calculates maximum padding required for stroke and shadow of a resolved style.
253
+ * The stroke is centered on the glyph outline, so only half of it is outside.
254
+ * The shadow is cast by the stroke as well as by the fill.
255
+ * @param style Resolved style
256
+ * @returns Padding in pixels needed on all sides
257
+ */
258
+ static calculatePadding(style) {
259
+ let padding = style.enableStroke ? style.strokeThickness / 2 : 0;
260
+ if (style.enableShadow) {
261
+ const shadowSpread = style.shadowBlur * 2;
262
+ const shadowMaxX = Math.abs(style.shadowOffsetX) + shadowSpread;
263
+ const shadowMaxY = Math.abs(style.shadowOffsetY) + shadowSpread;
264
+ padding += Math.max(shadowMaxX, shadowMaxY);
265
+ }
266
+ return Math.ceil(padding);
267
+ }
241
268
  /** @internal */
242
269
  setDirtyFalse() {
243
- this._private_dirtyInternal = false;
270
+ this.dirtyInternal = false;
244
271
  }
245
272
  /** Sets all properties to default values */
246
273
  setDefaults() {
247
- if (this._private_colorInternal !== TEXT_STYLE_DEFAULT_COLOR ||
248
- this._private_alignInternal !== TEXT_STYLE_DEFAULT_ALIGN ||
249
- this._private_fontFamilyInternal !== TEXT_STYLE_DEFAULT_FONT_FAMILY ||
250
- this._private_fontSizeInternal !== TEXT_STYLE_DEFAULT_FONT_SIZE ||
251
- this._private_fontStyleInternal !== TEXT_STYLE_DEFAULT_FONT_STYLE ||
252
- this._private_fontWeightInternal !== TEXT_STYLE_DEFAULT_FONT_WEIGHT ||
253
- this._private_lineHeightInternal !== TEXT_STYLE_DEFAULT_FONT_SIZE * TEXT_STYLE_DEFAULT_LINE_HEIGHT ||
254
- this._private_enableShadowInternal !== TEXT_STYLE_DEFAULT_ENABLE_SHADOW ||
255
- this._private_shadowOffsetXInternal !== TEXT_STYLE_DEFAULT_SHADOW_OFFSET_X ||
256
- this._private_shadowOffsetYInternal !== TEXT_STYLE_DEFAULT_SHADOW_OFFSET_Y ||
257
- this._private_shadowBlurInternal !== TEXT_STYLE_DEFAULT_SHADOW_BLUR ||
258
- this._private_shadowColorInternal !== TEXT_STYLE_DEFAULT_SHADOW_COLOR ||
259
- this._private_enableStrokeInternal !== TEXT_STYLE_DEFAULT_ENABLE_STROKE ||
260
- this._private_strokeColorInternal !== TEXT_STYLE_DEFAULT_STROKE_COLOR ||
261
- this._private_strokeThicknessInternal !== TEXT_STYLE_DEFAULT_STROKE_THICKNESS) {
262
- this._private_colorInternal = TEXT_STYLE_DEFAULT_COLOR;
263
- this._private_alignInternal = TEXT_STYLE_DEFAULT_ALIGN;
264
- this._private_fontFamilyInternal = TEXT_STYLE_DEFAULT_FONT_FAMILY;
265
- this._private_fontSizeInternal = TEXT_STYLE_DEFAULT_FONT_SIZE;
266
- this._private_fontStyleInternal = TEXT_STYLE_DEFAULT_FONT_STYLE;
267
- this._private_fontWeightInternal = TEXT_STYLE_DEFAULT_FONT_WEIGHT;
268
- this._private_lineHeightInternal = TEXT_STYLE_DEFAULT_FONT_SIZE * TEXT_STYLE_DEFAULT_LINE_HEIGHT;
269
- this._private_enableShadowInternal = TEXT_STYLE_DEFAULT_ENABLE_SHADOW;
270
- this._private_shadowOffsetXInternal = TEXT_STYLE_DEFAULT_SHADOW_OFFSET_X;
271
- this._private_shadowOffsetYInternal = TEXT_STYLE_DEFAULT_SHADOW_OFFSET_Y;
272
- this._private_shadowBlurInternal = TEXT_STYLE_DEFAULT_SHADOW_BLUR;
273
- this._private_shadowColorInternal = TEXT_STYLE_DEFAULT_SHADOW_COLOR;
274
- this._private_enableStrokeInternal = TEXT_STYLE_DEFAULT_ENABLE_STROKE;
275
- this._private_strokeColorInternal = TEXT_STYLE_DEFAULT_STROKE_COLOR;
276
- this._private_strokeThicknessInternal = TEXT_STYLE_DEFAULT_STROKE_THICKNESS;
277
- this._private_dirtyInternal = true;
274
+ if (this.colorInternal !== TEXT_STYLE_DEFAULT_COLOR ||
275
+ this.alignInternal !== TEXT_STYLE_DEFAULT_ALIGN ||
276
+ this.fontFamilyInternal !== TEXT_STYLE_DEFAULT_FONT_FAMILY ||
277
+ this.fontSizeInternal !== TEXT_STYLE_DEFAULT_FONT_SIZE ||
278
+ this.fontStyleInternal !== TEXT_STYLE_DEFAULT_FONT_STYLE ||
279
+ this.fontWeightInternal !== TEXT_STYLE_DEFAULT_FONT_WEIGHT ||
280
+ this.lineHeightInternal !== TEXT_STYLE_DEFAULT_FONT_SIZE * TEXT_STYLE_DEFAULT_LINE_HEIGHT ||
281
+ this.enableShadowInternal !== TEXT_STYLE_DEFAULT_ENABLE_SHADOW ||
282
+ this.shadowOffsetXInternal !== TEXT_STYLE_DEFAULT_SHADOW_OFFSET_X ||
283
+ this.shadowOffsetYInternal !== TEXT_STYLE_DEFAULT_SHADOW_OFFSET_Y ||
284
+ this.shadowBlurInternal !== TEXT_STYLE_DEFAULT_SHADOW_BLUR ||
285
+ this.shadowColorInternal !== TEXT_STYLE_DEFAULT_SHADOW_COLOR ||
286
+ this.enableStrokeInternal !== TEXT_STYLE_DEFAULT_ENABLE_STROKE ||
287
+ this.strokeColorInternal !== TEXT_STYLE_DEFAULT_STROKE_COLOR ||
288
+ this.strokeThicknessInternal !== TEXT_STYLE_DEFAULT_STROKE_THICKNESS) {
289
+ this.colorInternal = TEXT_STYLE_DEFAULT_COLOR;
290
+ this.alignInternal = TEXT_STYLE_DEFAULT_ALIGN;
291
+ this.fontFamilyInternal = TEXT_STYLE_DEFAULT_FONT_FAMILY;
292
+ this.fontSizeInternal = TEXT_STYLE_DEFAULT_FONT_SIZE;
293
+ this.fontStyleInternal = TEXT_STYLE_DEFAULT_FONT_STYLE;
294
+ this.fontWeightInternal = TEXT_STYLE_DEFAULT_FONT_WEIGHT;
295
+ this.lineHeightInternal = TEXT_STYLE_DEFAULT_FONT_SIZE * TEXT_STYLE_DEFAULT_LINE_HEIGHT;
296
+ this.enableShadowInternal = TEXT_STYLE_DEFAULT_ENABLE_SHADOW;
297
+ this.shadowOffsetXInternal = TEXT_STYLE_DEFAULT_SHADOW_OFFSET_X;
298
+ this.shadowOffsetYInternal = TEXT_STYLE_DEFAULT_SHADOW_OFFSET_Y;
299
+ this.shadowBlurInternal = TEXT_STYLE_DEFAULT_SHADOW_BLUR;
300
+ this.shadowColorInternal = TEXT_STYLE_DEFAULT_SHADOW_COLOR;
301
+ this.enableStrokeInternal = TEXT_STYLE_DEFAULT_ENABLE_STROKE;
302
+ this.strokeColorInternal = TEXT_STYLE_DEFAULT_STROKE_COLOR;
303
+ this.strokeThicknessInternal = TEXT_STYLE_DEFAULT_STROKE_THICKNESS;
304
+ this.dirtyInternal = true;
278
305
  }
279
306
  }
280
307
  /** Sets all properties to undefined */
281
308
  clear() {
282
- if (this._private_colorInternal !== undefined ||
283
- this._private_alignInternal !== undefined ||
284
- this._private_fontFamilyInternal !== undefined ||
285
- this._private_fontSizeInternal !== undefined ||
286
- this._private_fontStyleInternal !== undefined ||
287
- this._private_fontWeightInternal !== undefined ||
288
- this._private_lineHeightInternal !== undefined ||
289
- this._private_enableShadowInternal !== undefined ||
290
- this._private_shadowOffsetXInternal !== undefined ||
291
- this._private_shadowOffsetYInternal !== undefined ||
292
- this._private_shadowBlurInternal !== undefined ||
293
- this._private_shadowColorInternal !== undefined ||
294
- this._private_enableStrokeInternal !== undefined ||
295
- this._private_strokeColorInternal !== undefined ||
296
- this._private_strokeThicknessInternal !== undefined) {
297
- this._private_colorInternal = undefined;
298
- this._private_alignInternal = undefined;
299
- this._private_fontFamilyInternal = undefined;
300
- this._private_fontSizeInternal = undefined;
301
- this._private_fontStyleInternal = undefined;
302
- this._private_fontWeightInternal = undefined;
303
- this._private_lineHeightInternal = undefined;
304
- this._private_enableShadowInternal = undefined;
305
- this._private_shadowOffsetXInternal = undefined;
306
- this._private_shadowOffsetYInternal = undefined;
307
- this._private_shadowBlurInternal = undefined;
308
- this._private_shadowColorInternal = undefined;
309
- this._private_enableStrokeInternal = undefined;
310
- this._private_strokeColorInternal = undefined;
311
- this._private_strokeThicknessInternal = undefined;
312
- this._private_dirtyInternal = true;
309
+ if (this.colorInternal !== undefined ||
310
+ this.alignInternal !== undefined ||
311
+ this.fontFamilyInternal !== undefined ||
312
+ this.fontSizeInternal !== undefined ||
313
+ this.fontStyleInternal !== undefined ||
314
+ this.fontWeightInternal !== undefined ||
315
+ this.lineHeightInternal !== undefined ||
316
+ this.enableShadowInternal !== undefined ||
317
+ this.shadowOffsetXInternal !== undefined ||
318
+ this.shadowOffsetYInternal !== undefined ||
319
+ this.shadowBlurInternal !== undefined ||
320
+ this.shadowColorInternal !== undefined ||
321
+ this.enableStrokeInternal !== undefined ||
322
+ this.strokeColorInternal !== undefined ||
323
+ this.strokeThicknessInternal !== undefined) {
324
+ this.colorInternal = undefined;
325
+ this.alignInternal = undefined;
326
+ this.fontFamilyInternal = undefined;
327
+ this.fontSizeInternal = undefined;
328
+ this.fontStyleInternal = undefined;
329
+ this.fontWeightInternal = undefined;
330
+ this.lineHeightInternal = undefined;
331
+ this.enableShadowInternal = undefined;
332
+ this.shadowOffsetXInternal = undefined;
333
+ this.shadowOffsetYInternal = undefined;
334
+ this.shadowBlurInternal = undefined;
335
+ this.shadowColorInternal = undefined;
336
+ this.enableStrokeInternal = undefined;
337
+ this.strokeColorInternal = undefined;
338
+ this.strokeThicknessInternal = undefined;
339
+ this.dirtyInternal = true;
313
340
  }
314
341
  }
315
342
  /** Copies from another style instance */
316
343
  copy(value) {
317
- if (this._private_colorInternal !== value._private_colorInternal ||
318
- this._private_alignInternal !== value._private_alignInternal ||
319
- this._private_fontFamilyInternal !== value._private_fontFamilyInternal ||
320
- this._private_fontSizeInternal !== value._private_fontSizeInternal ||
321
- this._private_fontStyleInternal !== value._private_fontStyleInternal ||
322
- this._private_fontWeightInternal !== value._private_fontWeightInternal ||
323
- this._private_lineHeightInternal !== value._private_lineHeightInternal ||
324
- this._private_enableShadowInternal !== value._private_enableShadowInternal ||
325
- this._private_shadowOffsetXInternal !== value._private_shadowOffsetXInternal ||
326
- this._private_shadowOffsetYInternal !== value._private_shadowOffsetYInternal ||
327
- this._private_shadowBlurInternal !== value._private_shadowBlurInternal ||
328
- this._private_shadowColorInternal !== value._private_shadowColorInternal ||
329
- this._private_enableStrokeInternal !== value._private_enableStrokeInternal ||
330
- this._private_strokeColorInternal !== value._private_strokeColorInternal ||
331
- this._private_strokeThicknessInternal !== value._private_strokeThicknessInternal) {
332
- this._private_colorInternal = value._private_colorInternal;
333
- this._private_alignInternal = value._private_alignInternal;
334
- this._private_fontFamilyInternal = value._private_fontFamilyInternal;
335
- this._private_fontSizeInternal = value._private_fontSizeInternal;
336
- this._private_fontStyleInternal = value._private_fontStyleInternal;
337
- this._private_fontWeightInternal = value._private_fontWeightInternal;
338
- this._private_lineHeightInternal = value._private_lineHeightInternal;
339
- this._private_enableShadowInternal = value._private_enableShadowInternal;
340
- this._private_shadowOffsetXInternal = value._private_shadowOffsetXInternal;
341
- this._private_shadowOffsetYInternal = value._private_shadowOffsetYInternal;
342
- this._private_shadowBlurInternal = value._private_shadowBlurInternal;
343
- this._private_shadowColorInternal = value._private_shadowColorInternal;
344
- this._private_enableStrokeInternal = value._private_enableStrokeInternal;
345
- this._private_strokeColorInternal = value._private_strokeColorInternal;
346
- this._private_strokeThicknessInternal = value._private_strokeThicknessInternal;
347
- this._private_dirtyInternal = true;
344
+ if (this.colorInternal !== value.colorInternal ||
345
+ this.alignInternal !== value.alignInternal ||
346
+ this.fontFamilyInternal !== value.fontFamilyInternal ||
347
+ this.fontSizeInternal !== value.fontSizeInternal ||
348
+ this.fontStyleInternal !== value.fontStyleInternal ||
349
+ this.fontWeightInternal !== value.fontWeightInternal ||
350
+ this.lineHeightInternal !== value.lineHeightInternal ||
351
+ this.enableShadowInternal !== value.enableShadowInternal ||
352
+ this.shadowOffsetXInternal !== value.shadowOffsetXInternal ||
353
+ this.shadowOffsetYInternal !== value.shadowOffsetYInternal ||
354
+ this.shadowBlurInternal !== value.shadowBlurInternal ||
355
+ this.shadowColorInternal !== value.shadowColorInternal ||
356
+ this.enableStrokeInternal !== value.enableStrokeInternal ||
357
+ this.strokeColorInternal !== value.strokeColorInternal ||
358
+ this.strokeThicknessInternal !== value.strokeThicknessInternal) {
359
+ this.colorInternal = value.colorInternal;
360
+ this.alignInternal = value.alignInternal;
361
+ this.fontFamilyInternal = value.fontFamilyInternal;
362
+ this.fontSizeInternal = value.fontSizeInternal;
363
+ this.fontStyleInternal = value.fontStyleInternal;
364
+ this.fontWeightInternal = value.fontWeightInternal;
365
+ this.lineHeightInternal = value.lineHeightInternal;
366
+ this.enableShadowInternal = value.enableShadowInternal;
367
+ this.shadowOffsetXInternal = value.shadowOffsetXInternal;
368
+ this.shadowOffsetYInternal = value.shadowOffsetYInternal;
369
+ this.shadowBlurInternal = value.shadowBlurInternal;
370
+ this.shadowColorInternal = value.shadowColorInternal;
371
+ this.enableStrokeInternal = value.enableStrokeInternal;
372
+ this.strokeColorInternal = value.strokeColorInternal;
373
+ this.strokeThicknessInternal = value.strokeThicknessInternal;
374
+ this.dirtyInternal = true;
348
375
  }
349
376
  }
350
377
  /**
351
378
  * Calculates maximum padding required for stroke and shadow.
379
+ * Properties left undefined here are taken from `fallback`, then from defaults,
380
+ * so a span style is measured with the stroke and shadow it is drawn with.
381
+ * @param fallback Style that supplies undefined properties (usually the common style)
352
382
  * @returns Padding in pixels needed on all sides
353
383
  */
354
- calculatePadding() {
355
- let padding = 0;
356
- if (this._private_enableStrokeInternal !== undefined) {
357
- padding += this._private_strokeThicknessInternal ?? 0;
358
- }
359
- if (this._private_enableShadowInternal !== undefined) {
360
- const blur = this._private_shadowBlurInternal ?? 0;
361
- const offsetX = this._private_shadowOffsetXInternal ?? 0;
362
- const offsetY = this._private_shadowOffsetYInternal ?? 0;
363
- const shadowSpread = blur * 2;
364
- const shadowMaxX = Math.abs(offsetX) + shadowSpread;
365
- const shadowMaxY = Math.abs(offsetY) + shadowSpread;
366
- padding += Math.max(shadowMaxX, shadowMaxY);
367
- }
368
- return Math.ceil(padding);
384
+ calculatePadding(fallback) {
385
+ return UITextStyle.calculatePadding(UITextStyle.resolve(this, fallback));
369
386
  }
370
387
  }
371
-
372
- export { UITextStyle };
@@ -1,6 +1,13 @@
1
1
  import { Texture } from "three";
2
2
  export declare const TEXTURE_DEFAULT_TEXTURE: Texture;
3
3
  export declare const TEXTURE_DEFAULT_SIZE = 2;
4
+ /**
5
+ * Reads the pixel size of a texture image: an image, a video, a canvas, a bitmap
6
+ * or the data of a DataTexture.
7
+ * @param texture Texture to measure
8
+ * @returns Width and height in pixels
9
+ */
10
+ export declare function getTextureImageSize(texture: Texture): UITextureSize;
4
11
  /** Rectangle coordinates and dimensions in atlas */
5
12
  export interface UITextureRect {
6
13
  /** X coordinate in pixels */
@@ -1,6 +1,16 @@
1
- import { Texture } from 'three';
2
-
3
- const TEXTURE_DEFAULT_TEXTURE = new Texture();
4
- const TEXTURE_DEFAULT_SIZE = 2;
5
-
6
- export { TEXTURE_DEFAULT_SIZE, TEXTURE_DEFAULT_TEXTURE };
1
+ import { Texture } from "three";
2
+ export const TEXTURE_DEFAULT_TEXTURE = new Texture();
3
+ export const TEXTURE_DEFAULT_SIZE = 2;
4
+ /**
5
+ * Reads the pixel size of a texture image: an image, a video, a canvas, a bitmap
6
+ * or the data of a DataTexture.
7
+ * @param texture Texture to measure
8
+ * @returns Width and height in pixels
9
+ */
10
+ export function getTextureImageSize(texture) {
11
+ const image = texture.image;
12
+ return {
13
+ w: image?.naturalWidth ?? image?.videoWidth ?? image?.width ?? TEXTURE_DEFAULT_SIZE,
14
+ h: image?.naturalHeight ?? image?.videoHeight ?? image?.height ?? TEXTURE_DEFAULT_SIZE,
15
+ };
16
+ }
@@ -1,6 +1,6 @@
1
1
  import type { FerrsignView3 } from "ferrsign";
2
2
  import { Matrix3, Texture, Vector2 } from "three";
3
- import type { UITextureConfig, UITextureTrim } from "./UITextureView.Internal";
3
+ import type { UITextureConfig, UITextureTrim } from "./UITextureView.Internal.js";
4
4
  /** Wrapper for Three.js texture with atlas and trim support. Does not own the underlying texture; user must dispose it. */
5
5
  export declare class UITextureView {
6
6
  private textureInternal;