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,97 +1,96 @@
1
- import { Ferrsign3 } from 'ferrsign';
2
- import { Matrix3, Vector2, Texture } from 'three';
3
- import { assertValidPositiveNumber, assertValidNonNegativeNumber } from '../asserts.js';
4
- import { TEXTURE_DEFAULT_TEXTURE, TEXTURE_DEFAULT_SIZE } from './UITextureView.Internal.js';
5
-
1
+ import { Ferrsign3 } from "ferrsign";
2
+ import { Matrix3, Texture, Vector2 } from "three";
3
+ import { assertValidNonNegativeNumber, assertValidPositiveNumber } from "../asserts.js";
4
+ import { getTextureImageSize, TEXTURE_DEFAULT_SIZE, TEXTURE_DEFAULT_TEXTURE, } from "./UITextureView.Internal.js";
6
5
  /** Wrapper for Three.js texture with atlas and trim support. Does not own the underlying texture; user must dispose it. */
7
- class UITextureView {
6
+ export class UITextureView {
8
7
  /** @param config Texture or atlas configuration */
9
8
  constructor(config) {
10
- this._private_textureInternal = TEXTURE_DEFAULT_TEXTURE;
11
- this._private_sourceWidth = TEXTURE_DEFAULT_SIZE;
12
- this._private_sourceHeight = TEXTURE_DEFAULT_SIZE;
13
- this._private_frameX = 0;
14
- this._private_frameY = 0;
15
- this._private_frameWidth = TEXTURE_DEFAULT_SIZE;
16
- this._private_frameHeight = TEXTURE_DEFAULT_SIZE;
17
- this._private_rotatedInternal = false;
18
- this._private_scaleInternal = 1;
19
- this._private_trimLeft = 0;
20
- this._private_trimRight = 0;
21
- this._private_trimTop = 0;
22
- this._private_trimBottom = 0;
23
- this._private_textureDirtyInternal = false;
24
- this._private_uvTransformDirtyInternal = false;
25
- this._private_trimDirtyInternal = false;
26
- this._private_signalDimensionsChangedInternal = new Ferrsign3();
9
+ this.textureInternal = TEXTURE_DEFAULT_TEXTURE;
10
+ this.sourceWidth = TEXTURE_DEFAULT_SIZE;
11
+ this.sourceHeight = TEXTURE_DEFAULT_SIZE;
12
+ this.frameX = 0;
13
+ this.frameY = 0;
14
+ this.frameWidth = TEXTURE_DEFAULT_SIZE;
15
+ this.frameHeight = TEXTURE_DEFAULT_SIZE;
16
+ this.rotatedInternal = false;
17
+ this.scaleInternal = 1;
18
+ this.trimLeft = 0;
19
+ this.trimRight = 0;
20
+ this.trimTop = 0;
21
+ this.trimBottom = 0;
22
+ this.textureDirtyInternal = false;
23
+ this.uvTransformDirtyInternal = false;
24
+ this.trimDirtyInternal = false;
25
+ this.signalDimensionsChangedInternal = new Ferrsign3();
27
26
  if (config !== undefined) {
28
27
  this.set(config);
29
28
  }
30
29
  }
31
30
  /** Original width before trimming in world units */
32
31
  get width() {
33
- return this._private_sourceWidth / this._private_scaleInternal;
32
+ return this.sourceWidth / this.scaleInternal;
34
33
  }
35
34
  /** Original height before trimming in world units */
36
35
  get height() {
37
- return this._private_sourceHeight / this._private_scaleInternal;
36
+ return this.sourceHeight / this.scaleInternal;
38
37
  }
39
38
  /** Visible width after trimming in world units */
40
39
  get trimmedWidth() {
41
- const frameSize = this._private_rotatedInternal ? this._private_frameHeight : this._private_frameWidth;
42
- return frameSize / this._private_scaleInternal;
40
+ const frameSize = this.rotatedInternal ? this.frameHeight : this.frameWidth;
41
+ return frameSize / this.scaleInternal;
43
42
  }
44
43
  /** Visible height after trimming in world units */
45
44
  get trimmedHeight() {
46
- const frameSize = this._private_rotatedInternal ? this._private_frameWidth : this._private_frameHeight;
47
- return frameSize / this._private_scaleInternal;
45
+ const frameSize = this.rotatedInternal ? this.frameWidth : this.frameHeight;
46
+ return frameSize / this.scaleInternal;
48
47
  }
49
48
  /** Underlying Three.js texture */
50
49
  get texture() {
51
- return this._private_textureInternal;
50
+ return this.textureInternal;
52
51
  }
53
52
  /** Whether sprite is rotated in atlas */
54
53
  get rotated() {
55
- return this._private_rotatedInternal;
54
+ return this.rotatedInternal;
56
55
  }
57
56
  /** Scale factor for resolution independence */
58
57
  get scale() {
59
- return this._private_scaleInternal;
58
+ return this.scaleInternal;
60
59
  }
61
60
  /** Transparent padding around visible content */
62
61
  get trim() {
63
- const scale = this._private_scaleInternal;
62
+ const scale = this.scaleInternal;
64
63
  return {
65
- left: this._private_trimLeft / scale,
66
- right: this._private_trimRight / scale,
67
- top: this._private_trimTop / scale,
68
- bottom: this._private_trimBottom / scale,
64
+ left: this.trimLeft / scale,
65
+ right: this.trimRight / scale,
66
+ top: this.trimTop / scale,
67
+ bottom: this.trimBottom / scale,
69
68
  };
70
69
  }
71
70
  get textureDirty() {
72
- return this._private_textureDirtyInternal;
71
+ return this.textureDirtyInternal;
73
72
  }
74
73
  /** Whether UV transform inputs changed since last check */
75
74
  get uvTransformDirty() {
76
- return this._private_uvTransformDirtyInternal;
75
+ return this.uvTransformDirtyInternal;
77
76
  }
78
77
  /** Whether trim values changed since last check */
79
78
  get trimDirty() {
80
- return this._private_trimDirtyInternal;
79
+ return this.trimDirtyInternal;
81
80
  }
82
81
  get signalDimensionsChanged() {
83
- return this._private_signalDimensionsChangedInternal;
82
+ return this.signalDimensionsChangedInternal;
84
83
  }
85
84
  setTextureDirtyFalse() {
86
- this._private_textureDirtyInternal = false;
85
+ this.textureDirtyInternal = false;
87
86
  }
88
87
  /** Marks UV transform as clean. @internal */
89
88
  setUVTransformDirtyFalse() {
90
- this._private_uvTransformDirtyInternal = false;
89
+ this.uvTransformDirtyInternal = false;
91
90
  }
92
91
  /** Marks trim as clean. @internal */
93
92
  setTrimDirtyFalse() {
94
- this._private_trimDirtyInternal = false;
93
+ this.trimDirtyInternal = false;
95
94
  }
96
95
  /**
97
96
  * Calculates UV transform matrix for shader sampling.
@@ -99,22 +98,21 @@ class UITextureView {
99
98
  * @returns UV transform matrix
100
99
  */
101
100
  calculateUVTransform(result = new Matrix3()) {
102
- const atlasWidth = this._private_textureInternal.image?.naturalWidth ?? TEXTURE_DEFAULT_SIZE;
103
- const atlasHeight = this._private_textureInternal.image?.naturalHeight ?? TEXTURE_DEFAULT_SIZE;
104
- if (this._private_rotatedInternal) {
105
- const physicalWidth = this._private_frameHeight;
106
- const physicalHeight = this._private_frameWidth;
107
- const u0 = this._private_frameX / atlasWidth;
108
- const v0 = (atlasHeight - this._private_frameY - physicalHeight) / atlasHeight;
101
+ const { w: atlasWidth, h: atlasHeight } = getTextureImageSize(this.textureInternal);
102
+ if (this.rotatedInternal) {
103
+ const physicalWidth = this.frameHeight;
104
+ const physicalHeight = this.frameWidth;
105
+ const u0 = this.frameX / atlasWidth;
106
+ const v0 = (atlasHeight - this.frameY - physicalHeight) / atlasHeight;
109
107
  const uSize = physicalWidth / atlasWidth;
110
108
  const vSize = physicalHeight / atlasHeight;
111
109
  result.set(0, uSize, u0, -vSize, 0, v0 + vSize, 0, 0, 1);
112
110
  }
113
111
  else {
114
- const u0 = this._private_frameX / atlasWidth;
115
- const v0 = (atlasHeight - this._private_frameY - this._private_frameHeight) / atlasHeight;
116
- const uSize = this._private_frameWidth / atlasWidth;
117
- const vSize = this._private_frameHeight / atlasHeight;
112
+ const u0 = this.frameX / atlasWidth;
113
+ const v0 = (atlasHeight - this.frameY - this.frameHeight) / atlasHeight;
114
+ const uSize = this.frameWidth / atlasWidth;
115
+ const vSize = this.frameHeight / atlasHeight;
118
116
  result.set(uSize, 0, u0, 0, vSize, v0, 0, 0, 1);
119
117
  }
120
118
  return result;
@@ -135,49 +133,49 @@ class UITextureView {
135
133
  const lastWidth = this.width;
136
134
  const lastHeight = this.height;
137
135
  if (config instanceof Texture) {
138
- this._private_setFromTexture(config);
136
+ this.setFromTexture(config);
139
137
  }
140
138
  else {
141
- this._private_setFromAtlasConfig(config);
139
+ this.setFromAtlasConfig(config);
142
140
  }
143
141
  if (this.width !== lastWidth || this.height !== lastHeight) {
144
- this._private_signalDimensionsChangedInternal.emit(this.width, this.height, this);
142
+ this.signalDimensionsChangedInternal.emit(this.width, this.height, this);
145
143
  }
146
144
  }
147
- _private_setFromTexture(texture) {
148
- const width = texture.image?.naturalWidth ?? TEXTURE_DEFAULT_SIZE;
149
- const height = texture.image?.naturalHeight ?? TEXTURE_DEFAULT_SIZE;
150
- this._private_sourceWidth = width;
151
- this._private_sourceHeight = height;
145
+ setFromTexture(texture) {
146
+ const { w: width, h: height } = getTextureImageSize(texture);
147
+ this.sourceWidth = width;
148
+ this.sourceHeight = height;
152
149
  if (this.texture !== texture) {
153
- this._private_textureInternal = texture;
154
- this._private_textureDirtyInternal = true;
150
+ this.textureInternal = texture;
151
+ this.textureDirtyInternal = true;
155
152
  }
156
- if (this._private_frameX !== 0 ||
157
- this._private_frameY !== 0 ||
158
- this._private_frameWidth !== width ||
159
- this._private_frameHeight !== height ||
160
- this._private_scaleInternal !== 1 || this._private_rotatedInternal) {
161
- this._private_frameX = 0;
162
- this._private_frameY = 0;
163
- this._private_frameWidth = width;
164
- this._private_frameHeight = height;
165
- this._private_rotatedInternal = false;
166
- this._private_scaleInternal = 1;
167
- this._private_uvTransformDirtyInternal = true;
153
+ if (this.frameX !== 0 ||
154
+ this.frameY !== 0 ||
155
+ this.frameWidth !== width ||
156
+ this.frameHeight !== height ||
157
+ this.scaleInternal !== 1 ||
158
+ this.rotatedInternal) {
159
+ this.frameX = 0;
160
+ this.frameY = 0;
161
+ this.frameWidth = width;
162
+ this.frameHeight = height;
163
+ this.rotatedInternal = false;
164
+ this.scaleInternal = 1;
165
+ this.uvTransformDirtyInternal = true;
168
166
  }
169
- if (this._private_trimLeft !== 0 ||
170
- this._private_trimRight !== 0 ||
171
- this._private_trimTop !== 0 ||
172
- this._private_trimBottom !== 0) {
173
- this._private_trimLeft = 0;
174
- this._private_trimRight = 0;
175
- this._private_trimTop = 0;
176
- this._private_trimBottom = 0;
177
- this._private_trimDirtyInternal = true;
167
+ if (this.trimLeft !== 0 ||
168
+ this.trimRight !== 0 ||
169
+ this.trimTop !== 0 ||
170
+ this.trimBottom !== 0) {
171
+ this.trimLeft = 0;
172
+ this.trimRight = 0;
173
+ this.trimTop = 0;
174
+ this.trimBottom = 0;
175
+ this.trimDirtyInternal = true;
178
176
  }
179
177
  }
180
- _private_setFromAtlasConfig(config) {
178
+ setFromAtlasConfig(config) {
181
179
  assertValidPositiveNumber(config.sourceSize.w, "UITextureView.setFromAtlasConfig.config.sourceSize.w");
182
180
  assertValidPositiveNumber(config.sourceSize.h, "UITextureView.setFromAtlasConfig.config.sourceSize.h");
183
181
  assertValidNonNegativeNumber(config.frame.x, "UITextureView.setFromAtlasConfig.config.frame.x");
@@ -191,44 +189,42 @@ class UITextureView {
191
189
  if (config.scale !== undefined) {
192
190
  assertValidPositiveNumber(config.scale, "UITextureView.setFromAtlasConfig.config.scale");
193
191
  }
194
- this._private_sourceWidth = config.sourceSize.w;
195
- this._private_sourceHeight = config.sourceSize.h;
192
+ this.sourceWidth = config.sourceSize.w;
193
+ this.sourceHeight = config.sourceSize.h;
196
194
  if (this.texture !== config.texture) {
197
- this._private_textureInternal = config.texture;
198
- this._private_textureDirtyInternal = true;
195
+ this.textureInternal = config.texture;
196
+ this.textureDirtyInternal = true;
199
197
  }
200
198
  const scale = config.scale ?? 1;
201
199
  const rotated = config.rotated ?? false;
202
- if (this._private_frameX !== 0 ||
203
- this._private_frameY !== 0 ||
204
- this._private_frameWidth !== config.frame.w ||
205
- this._private_frameHeight !== config.frame.h ||
206
- this._private_scaleInternal !== scale ||
207
- this._private_rotatedInternal !== rotated) {
208
- this._private_frameX = config.frame.x;
209
- this._private_frameY = config.frame.y;
210
- this._private_frameWidth = config.frame.w;
211
- this._private_frameHeight = config.frame.h;
212
- this._private_scaleInternal = scale;
213
- this._private_rotatedInternal = rotated;
214
- this._private_uvTransformDirtyInternal = true;
200
+ if (this.frameX !== 0 ||
201
+ this.frameY !== 0 ||
202
+ this.frameWidth !== config.frame.w ||
203
+ this.frameHeight !== config.frame.h ||
204
+ this.scaleInternal !== scale ||
205
+ this.rotatedInternal !== rotated) {
206
+ this.frameX = config.frame.x;
207
+ this.frameY = config.frame.y;
208
+ this.frameWidth = config.frame.w;
209
+ this.frameHeight = config.frame.h;
210
+ this.scaleInternal = scale;
211
+ this.rotatedInternal = rotated;
212
+ this.uvTransformDirtyInternal = true;
215
213
  }
216
214
  const spriteSource = config.spriteSourceSize;
217
215
  const trimLeft = spriteSource.x;
218
216
  const trimTop = spriteSource.y;
219
- const trimRight = this._private_sourceWidth - spriteSource.x - spriteSource.w;
220
- const trimBottom = this._private_sourceHeight - spriteSource.y - spriteSource.h;
221
- if (this._private_trimLeft !== trimLeft ||
222
- this._private_trimRight !== trimRight ||
223
- this._private_trimTop !== trimTop ||
224
- this._private_trimBottom !== trimBottom) {
225
- this._private_trimLeft = trimLeft;
226
- this._private_trimRight = trimRight;
227
- this._private_trimTop = trimTop;
228
- this._private_trimBottom = trimBottom;
229
- this._private_trimDirtyInternal = true;
217
+ const trimRight = this.sourceWidth - spriteSource.x - spriteSource.w;
218
+ const trimBottom = this.sourceHeight - spriteSource.y - spriteSource.h;
219
+ if (this.trimLeft !== trimLeft ||
220
+ this.trimRight !== trimRight ||
221
+ this.trimTop !== trimTop ||
222
+ this.trimBottom !== trimBottom) {
223
+ this.trimLeft = trimLeft;
224
+ this.trimRight = trimRight;
225
+ this.trimTop = trimTop;
226
+ this.trimBottom = trimBottom;
227
+ this.trimDirtyInternal = true;
230
228
  }
231
229
  }
232
230
  }
233
-
234
- export { UITextureView };
@@ -47,6 +47,7 @@ function checkOffscreenCanvasSupportInternal() {
47
47
  return true;
48
48
  }
49
49
  catch (error) {
50
+ void error;
50
51
  return false;
51
52
  }
52
53
  }
@@ -90,13 +91,11 @@ function checkSRGBSupportInternal() {
90
91
  }
91
92
  let OFFSCREEN_CANVAS_SUPPORTED_INTERNAL;
92
93
  let SRGB_SUPPORTED_INTERNAL;
93
- const checkOffscreenCanvasSupport = () => {
94
+ export const checkOffscreenCanvasSupport = () => {
94
95
  OFFSCREEN_CANVAS_SUPPORTED_INTERNAL ?? (OFFSCREEN_CANVAS_SUPPORTED_INTERNAL = checkOffscreenCanvasSupportInternal());
95
96
  return OFFSCREEN_CANVAS_SUPPORTED_INTERNAL;
96
97
  };
97
- const checkSRGBSupport = () => {
98
+ export const checkSRGBSupport = () => {
98
99
  SRGB_SUPPORTED_INTERNAL ?? (SRGB_SUPPORTED_INTERNAL = checkSRGBSupportInternal());
99
100
  return SRGB_SUPPORTED_INTERNAL;
100
101
  };
101
-
102
- export { checkOffscreenCanvasSupport, checkSRGBSupport };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Required properties:
3
+ * - p_uv: vec2 (builtin)
4
+ * - p_texture: sampler2D
5
+ * - p_textureTransform: mat3
6
+ * - p_color: vec4
7
+ */
8
+ declare const source: string;
9
+ export default source;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Required properties:
3
+ * - p_uv: vec2 (builtin)
4
+ * - p_texture: sampler2D
5
+ * - p_textureTransform: mat3
6
+ * - p_color: vec4
7
+ */
8
+ const source = `
9
+ vec4 draw() {
10
+ vec2 transformedUV = (p_textureTransform * vec3(p_uv, 1.0)).xy;
11
+ return srgbTexture2D(p_texture, transformedUV) * p_color;
12
+ }
13
+ `;
14
+ export default source;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Required properties:
3
+ * - p_uv: vec2 (builtin)
4
+ * - p_texture: sampler2D
5
+ * - p_textureTransform: mat3
6
+ * - p_color: vec4
7
+ * - p_sliceBorders: vec4
8
+ * - p_sliceRegions: vec4
9
+ */
10
+ declare const source: string;
11
+ export default source;
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Required properties:
3
+ * - p_uv: vec2 (builtin)
4
+ * - p_texture: sampler2D
5
+ * - p_textureTransform: mat3
6
+ * - p_color: vec4
7
+ * - p_sliceBorders: vec4
8
+ * - p_sliceRegions: vec4
9
+ */
10
+ const source = `
11
+ vec4 draw() {
12
+ vec2 localUV = p_uv;
13
+
14
+ float left = p_sliceBorders.x;
15
+ float right = p_sliceBorders.y;
16
+ float top = p_sliceBorders.z;
17
+ float bottom = p_sliceBorders.w;
18
+
19
+ float leftFill = p_sliceRegions.x;
20
+ float rightFill = p_sliceRegions.y;
21
+ float topFill = p_sliceRegions.z;
22
+ float bottomFill = p_sliceRegions.w;
23
+
24
+ float lB = leftFill;
25
+ float rB = 1.0 - rightFill;
26
+ float bB = bottomFill;
27
+ float tB = 1.0 - topFill;
28
+
29
+ {
30
+ float regionL = step(p_uv.x, lB);
31
+ float regionR = step(rB, p_uv.x);
32
+ float regionM = 1.0 - regionL - regionR;
33
+
34
+ float xL = (p_uv.x / lB) * left;
35
+ float xR = 1.0 - right + ((p_uv.x - rB) / rightFill) * right;
36
+ float xM = left + ((p_uv.x - lB) / (rB - lB)) * (1.0 - left - right);
37
+
38
+ localUV.x = regionL * xL + regionM * xM + regionR * xR;
39
+ }
40
+
41
+ {
42
+ float regionB = step(p_uv.y, bB);
43
+ float regionT = step(tB, p_uv.y);
44
+ float regionC = 1.0 - regionB - regionT;
45
+
46
+ float yB = (p_uv.y / bB) * bottom;
47
+ float yT = 1.0 - top + ((p_uv.y - tB) / topFill) * top;
48
+ float yC = bottom + ((p_uv.y - bB) / (tB - bB)) * (1.0 - bottom - top);
49
+
50
+ localUV.y = regionB * yB + regionC * yC + regionT * yT;
51
+ }
52
+
53
+ vec2 transformedUV = (p_textureTransform * vec3(localUV, 1.0)).xy;
54
+ return srgbTexture2D(p_texture, transformedUV) * p_color;
55
+ }
56
+ `;
57
+ export default source;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Concatenated after a mask function source, which must define calculateMask().
3
+ *
4
+ * Required properties:
5
+ * - p_uv: vec2 (builtin)
6
+ * - p_texture: sampler2D
7
+ * - p_textureTransform: mat3
8
+ * - p_textureResolution: vec2
9
+ * - p_color: vec4
10
+ * - p_progress: float
11
+ * - p_direction: float
12
+ */
13
+ declare const source: string;
14
+ export default source;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Concatenated after a mask function source, which must define calculateMask().
3
+ *
4
+ * Required properties:
5
+ * - p_uv: vec2 (builtin)
6
+ * - p_texture: sampler2D
7
+ * - p_textureTransform: mat3
8
+ * - p_textureResolution: vec2
9
+ * - p_color: vec4
10
+ * - p_progress: float
11
+ * - p_direction: float
12
+ */
13
+ const source = `
14
+ vec4 draw() {
15
+ vec2 transformedUV = (p_textureTransform * vec3(p_uv, 1.0)).xy;
16
+ vec4 diffuseColor = srgbTexture2D(p_texture, transformedUV) * p_color;
17
+ diffuseColor.a *= calculateMask();
18
+ return diffuseColor;
19
+ }
20
+ `;
21
+ export default source;
@@ -0,0 +1,2 @@
1
+ declare const source: string;
2
+ export default source;
@@ -0,0 +1,16 @@
1
+ const source = `
2
+ float calculateMask() {
3
+ float aspect = p_textureResolution.x / p_textureResolution.y;
4
+ vec2 p = (p_uv - 0.5) * vec2(aspect, 1.0);
5
+
6
+ float angle = atan(p.y, p.x);
7
+ angle = (angle + PI) / (2.0 * PI);
8
+
9
+ float adjusted = angle - p_startAngle;
10
+ adjusted = p_direction > 0.0 ? adjusted : -adjusted;
11
+ adjusted = fract(adjusted);
12
+
13
+ return step(adjusted, p_progress);
14
+ }
15
+ `;
16
+ export default source;
@@ -0,0 +1,2 @@
1
+ declare const source: string;
2
+ export default source;
@@ -0,0 +1,15 @@
1
+ const source = `
2
+ float calculateMask() {
3
+ float aspect = p_textureResolution.x / p_textureResolution.y;
4
+ vec2 halfExtents = vec2(aspect, 1.0) * 0.5;
5
+
6
+ float maxProjection = dot(halfExtents, abs(p_direction));
7
+
8
+ vec2 correctedUV = (p_uv - 0.5) * vec2(aspect, 1.0);
9
+ float projection = dot(correctedUV, p_direction);
10
+
11
+ float offset = (projection / maxProjection + 1.0) * 0.5;
12
+ return step(offset, p_progress);
13
+ }
14
+ `;
15
+ export default source;
@@ -3,6 +3,7 @@ export interface UIInputWrapperView {
3
3
  createInputCatcher(catchPointerDown: (x: number, y: number, identifier: number) => boolean, catchPointerMove: (x: number, y: number, identifier: number) => boolean, catchPointerUp: (x: number, y: number, identifier: number) => boolean, zIndex: number): number;
4
4
  destroyInputCatcher(handler: number): void;
5
5
  getZIndex(handler: number): number;
6
+ getDepth(handler: number): number;
6
7
  setZIndex(handler: number, zIndex: number): void;
7
8
  getActive(handler: number): boolean;
8
9
  setActive(handler: number, active: boolean): void;
@@ -12,6 +13,9 @@ export interface UIInputWrapperCatcher {
12
13
  catchPointerDown: (x: number, y: number, identifier: number) => boolean;
13
14
  catchPointerMove: (x: number, y: number, identifier: number) => boolean;
14
15
  catchPointerUp: (x: number, y: number, identifier: number) => boolean;
16
+ /** Order requested by the user; equal values keep the order of creation */
15
17
  zIndex: number;
18
+ /** Unique position in the sorted order, used as the rendering depth */
19
+ depth: number;
16
20
  active: boolean;
17
21
  }
@@ -1,4 +1,4 @@
1
- import type { UIInputWrapperView } from "./UIInputWrapper.Internal";
1
+ import type { UIInputWrapperView } from "./UIInputWrapper.Internal.js";
2
2
  export declare class UIInputWrapper implements UIInputWrapperView {
3
3
  private zIndicesDirty;
4
4
  private readonly catchers;
@@ -6,8 +6,14 @@ export declare class UIInputWrapper implements UIInputWrapperView {
6
6
  createInputCatcher(catchPointerDown: (x: number, y: number, identifier: number) => boolean, catchPointerMove: (x: number, y: number, identifier: number) => boolean, catchPointerUp: (x: number, y: number, identifier: number) => boolean, zIndex: number): number;
7
7
  destroyInputCatcher(handler: number): void;
8
8
  getZIndex(handler: number): number;
9
+ getDepth(handler: number): number;
9
10
  setZIndex(handler: number, zIndex: number): void;
10
11
  getActive(handler: number): boolean;
11
12
  setActive(handler: number, active: boolean): void;
13
+ /**
14
+ * Passes a pointer event from the top catcher down until one catches it. A handler may
15
+ * destroy elements, so the catchers are walked over a copy and a destroyed one is skipped.
16
+ */
17
+ private dispatch;
12
18
  private ensureSorted;
13
19
  }