laymur 0.17.0 → 0.17.2

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 (396) hide show
  1. package/README.md +5 -0
  2. package/{src/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.ts → dist/core/constraints/UIAspectConstraint/UIAspectConstraint.Internal.d.ts} +2 -3
  3. package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.d.ts +22 -0
  4. package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.js +41 -0
  5. package/dist/core/constraints/UIConstraint.d.ts +12 -0
  6. package/dist/core/constraints/UIConstraint.js +11 -0
  7. package/dist/core/constraints/UICustomConstraint.d.ts +28 -0
  8. package/dist/core/constraints/UICustomConstraint.js +37 -0
  9. package/{src/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.ts → dist/core/constraints/UIHeightConstraint/UIHeightConstraint.Internal.d.ts} +2 -3
  10. package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.d.ts +20 -0
  11. package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.js +34 -0
  12. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.d.ts +11 -0
  13. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.js +3 -0
  14. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.d.ts +36 -0
  15. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.js +100 -0
  16. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.d.ts +14 -0
  17. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.js +4 -0
  18. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.d.ts +44 -0
  19. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.js +136 -0
  20. package/{src/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.ts → dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.d.ts} +2 -3
  21. package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.d.ts +22 -0
  22. package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.js +40 -0
  23. package/{src/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.ts → dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.Internal.d.ts} +8 -9
  24. package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.d.ts +43 -0
  25. package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.js +71 -0
  26. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.d.ts +11 -0
  27. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.js +3 -0
  28. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.d.ts +32 -0
  29. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.js +100 -0
  30. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.d.ts +14 -0
  31. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.js +4 -0
  32. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.d.ts +44 -0
  33. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.js +136 -0
  34. package/{src/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.ts → dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.d.ts} +2 -3
  35. package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.d.ts +22 -0
  36. package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.js +40 -0
  37. package/{src/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.ts → dist/core/constraints/UIWidthConstraint/UIWidthConstraint.Internal.d.ts} +2 -3
  38. package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.d.ts +20 -0
  39. package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.js +34 -0
  40. package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.d.ts +64 -0
  41. package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.js +19 -0
  42. package/dist/core/constraints/builders/UIConstraint2DBuilder.d.ts +46 -0
  43. package/dist/core/constraints/builders/UIConstraint2DBuilder.js +138 -0
  44. package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.d.ts +13 -0
  45. package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.js +3 -0
  46. package/dist/core/constraints/builders/UICoverConstraintBuilder.d.ts +29 -0
  47. package/dist/core/constraints/builders/UICoverConstraintBuilder.js +63 -0
  48. package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.d.ts +13 -0
  49. package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.js +3 -0
  50. package/dist/core/constraints/builders/UIFitConstraintBuilder.d.ts +29 -0
  51. package/dist/core/constraints/builders/UIFitConstraintBuilder.js +63 -0
  52. package/dist/core/elements/UIAnchor/UIAnchor.Internal.d.ts +12 -0
  53. package/dist/core/elements/UIAnchor/UIAnchor.Internal.js +5 -0
  54. package/dist/core/elements/UIAnchor/UIAnchor.d.ts +32 -0
  55. package/dist/core/elements/UIAnchor/UIAnchor.js +49 -0
  56. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.d.ts +27 -0
  57. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.js +15 -0
  58. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.d.ts +77 -0
  59. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.js +259 -0
  60. package/dist/core/elements/UIDummy/UIDummy.Internal.d.ts +30 -0
  61. package/dist/core/elements/UIDummy/UIDummy.Internal.js +8 -0
  62. package/dist/core/elements/UIDummy/UIDummy.d.ts +82 -0
  63. package/dist/core/elements/UIDummy/UIDummy.js +173 -0
  64. package/{src/core/elements/UIElement/UIElement.Internal.ts → dist/core/elements/UIElement/UIElement.Internal.d.ts} +5 -7
  65. package/dist/core/elements/UIElement/UIElement.Internal.js +5 -0
  66. package/dist/core/elements/UIElement/UIElement.d.ts +38 -0
  67. package/dist/core/elements/UIElement/UIElement.js +74 -0
  68. package/{src/core/elements/UIGraphics/UIGraphics.Internal.ts → dist/core/elements/UIGraphics/UIGraphics.Internal.d.ts} +5 -7
  69. package/dist/core/elements/UIGraphics/UIGraphics.Internal.js +7 -0
  70. package/dist/core/elements/UIGraphics/UIGraphics.d.ts +51 -0
  71. package/dist/core/elements/UIGraphics/UIGraphics.js +126 -0
  72. package/{src/core/elements/UIImage/UIImage.Internal.ts → dist/core/elements/UIImage/UIImage.Internal.d.ts} +2 -3
  73. package/dist/core/elements/UIImage/UIImage.d.ts +32 -0
  74. package/dist/core/elements/UIImage/UIImage.js +85 -0
  75. package/dist/core/elements/UINineSlice/UINineSlice.Internal.d.ts +23 -0
  76. package/dist/core/elements/UINineSlice/UINineSlice.Internal.js +12 -0
  77. package/dist/core/elements/UINineSlice/UINineSlice.d.ts +60 -0
  78. package/dist/core/elements/UINineSlice/UINineSlice.js +188 -0
  79. package/dist/core/elements/UIProgress/UIProgress.Internal.d.ts +14 -0
  80. package/dist/core/elements/UIProgress/UIProgress.Internal.js +3 -0
  81. package/dist/core/elements/UIProgress/UIProgress.d.ts +45 -0
  82. package/dist/core/elements/UIProgress/UIProgress.js +165 -0
  83. package/dist/core/elements/UIScene/UIScene.Internal.d.ts +43 -0
  84. package/dist/core/elements/UIScene/UIScene.Internal.js +27 -0
  85. package/dist/core/elements/UIScene/UIScene.d.ts +59 -0
  86. package/dist/core/elements/UIScene/UIScene.js +157 -0
  87. package/{src/core/elements/UIText/UIText.Interfaces.ts → dist/core/elements/UIText/UIText.Interfaces.d.ts} +16 -21
  88. package/dist/core/elements/UIText/UIText.Internal.d.ts +26 -0
  89. package/dist/core/elements/UIText/UIText.Internal.js +12 -0
  90. package/dist/core/elements/UIText/UIText.Measuring.d.ts +50 -0
  91. package/dist/core/elements/UIText/UIText.Measuring.js +153 -0
  92. package/dist/core/elements/UIText/UIText.Rendering.d.ts +20 -0
  93. package/dist/core/elements/UIText/UIText.Rendering.js +61 -0
  94. package/dist/core/elements/UIText/UIText.d.ts +71 -0
  95. package/dist/core/elements/UIText/UIText.js +265 -0
  96. package/{src/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.ts → dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.d.ts} +11 -14
  97. package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.js +5 -0
  98. package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.d.ts +63 -0
  99. package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.js +147 -0
  100. package/{src/core/layers/UILayer/UILayer.Internal.ts → dist/core/layers/UILayer/UILayer.Internal.d.ts} +11 -15
  101. package/dist/core/layers/UILayer/UILayer.Internal.js +7 -0
  102. package/dist/core/layers/UILayer/UILayer.d.ts +49 -0
  103. package/dist/core/layers/UILayer/UILayer.js +113 -0
  104. package/dist/core/miscellaneous/UIExpression.d.ts +69 -0
  105. package/dist/core/miscellaneous/UIExpression.js +128 -0
  106. package/dist/core/miscellaneous/UIMode.d.ts +23 -0
  107. package/dist/core/miscellaneous/UIMode.js +30 -0
  108. package/dist/core/miscellaneous/UIOrientation.d.ts +15 -0
  109. package/dist/core/miscellaneous/UIOrientation.js +20 -0
  110. package/dist/core/miscellaneous/UIPriority.d.ts +32 -0
  111. package/dist/core/miscellaneous/UIPriority.js +63 -0
  112. package/dist/core/miscellaneous/UIRelation.d.ts +23 -0
  113. package/dist/core/miscellaneous/UIRelation.js +40 -0
  114. package/dist/core/miscellaneous/UITransparencyMode.d.ts +9 -0
  115. package/dist/core/miscellaneous/UITransparencyMode.js +12 -0
  116. package/dist/core/miscellaneous/area/UIArea.d.ts +3 -0
  117. package/dist/core/miscellaneous/area/UIArea.js +5 -0
  118. package/dist/core/miscellaneous/area/UIAreaCircle.d.ts +15 -0
  119. package/dist/core/miscellaneous/area/UIAreaCircle.js +32 -0
  120. package/dist/core/miscellaneous/area/UIAreaPolygon.d.ts +12 -0
  121. package/dist/core/miscellaneous/area/UIAreaPolygon.js +40 -0
  122. package/dist/core/miscellaneous/area/UIAreaRectangle.d.ts +17 -0
  123. package/dist/core/miscellaneous/area/UIAreaRectangle.js +36 -0
  124. package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.d.ts +21 -0
  125. package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.js +72 -0
  126. package/dist/core/miscellaneous/asserts.d.ts +43 -0
  127. package/dist/core/miscellaneous/asserts.js +163 -0
  128. package/dist/core/miscellaneous/canvas.d.ts +31 -0
  129. package/dist/core/miscellaneous/canvas.js +37 -0
  130. package/dist/core/miscellaneous/color/UIColor.Internal.d.ts +7 -0
  131. package/dist/core/miscellaneous/color/UIColor.Internal.js +42 -0
  132. package/dist/core/miscellaneous/color/UIColor.d.ts +234 -0
  133. package/dist/core/miscellaneous/color/UIColor.js +636 -0
  134. package/dist/core/miscellaneous/computeTransform.d.ts +18 -0
  135. package/dist/core/miscellaneous/computeTransform.js +82 -0
  136. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.d.ts +19 -0
  137. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.js +168 -0
  138. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.d.ts +1 -0
  139. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.js +349 -0
  140. package/{src/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.ts → dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.d.ts} +8 -10
  141. package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.d.ts +1 -0
  142. package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.js +357 -0
  143. package/dist/core/miscellaneous/generic-plane/shared.d.ts +38 -0
  144. package/dist/core/miscellaneous/generic-plane/shared.js +228 -0
  145. package/dist/core/miscellaneous/insets/UIInsets.Internal.d.ts +11 -0
  146. package/dist/core/miscellaneous/insets/UIInsets.Internal.js +3 -0
  147. package/dist/core/miscellaneous/insets/UIInsets.d.ts +48 -0
  148. package/dist/core/miscellaneous/insets/UIInsets.js +224 -0
  149. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.d.ts +9 -0
  150. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.js +19 -0
  151. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.d.ts +21 -0
  152. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.js +51 -0
  153. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.d.ts +16 -0
  154. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.js +48 -0
  155. package/dist/core/miscellaneous/math.d.ts +7 -0
  156. package/dist/core/miscellaneous/math.js +11 -0
  157. package/dist/core/miscellaneous/micro/UIMicro.Internal.d.ts +31 -0
  158. package/dist/core/miscellaneous/micro/UIMicro.Internal.js +15 -0
  159. package/dist/core/miscellaneous/micro/UIMicro.d.ts +59 -0
  160. package/dist/core/miscellaneous/micro/UIMicro.js +181 -0
  161. package/dist/core/miscellaneous/resize-policy/UIResizePolicy.d.ts +3 -0
  162. package/dist/core/miscellaneous/resize-policy/UIResizePolicy.js +9 -0
  163. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.d.ts +22 -0
  164. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.js +50 -0
  165. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.d.ts +22 -0
  166. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.js +52 -0
  167. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.d.ts +22 -0
  168. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.js +52 -0
  169. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.d.ts +22 -0
  170. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.js +50 -0
  171. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.d.ts +22 -0
  172. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.js +52 -0
  173. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.d.ts +22 -0
  174. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.js +52 -0
  175. package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.d.ts +5 -0
  176. package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.js +13 -0
  177. package/dist/core/miscellaneous/shared.d.ts +46 -0
  178. package/dist/core/miscellaneous/shared.js +37 -0
  179. package/{src/core/miscellaneous/text-span/UITextSpan.Internal.ts → dist/core/miscellaneous/text-span/UITextSpan.Internal.d.ts} +4 -5
  180. package/dist/core/miscellaneous/text-span/UITextSpan.d.ts +14 -0
  181. package/dist/core/miscellaneous/text-span/UITextSpan.js +36 -0
  182. package/dist/core/miscellaneous/text-style/UITextStyle.Internal.d.ts +48 -0
  183. package/dist/core/miscellaneous/text-style/UITextStyle.Internal.js +17 -0
  184. package/dist/core/miscellaneous/text-style/UITextStyle.d.ts +85 -0
  185. package/dist/core/miscellaneous/text-style/UITextStyle.js +372 -0
  186. package/dist/core/miscellaneous/texture/UITextureView.Internal.d.ts +49 -0
  187. package/dist/core/miscellaneous/texture/UITextureView.Internal.js +6 -0
  188. package/dist/core/miscellaneous/texture/UITextureView.d.ts +67 -0
  189. package/dist/core/miscellaneous/texture/UITextureView.js +234 -0
  190. package/dist/core/miscellaneous/webglCapabilities.d.ts +2 -0
  191. package/dist/core/miscellaneous/webglCapabilities.js +103 -0
  192. package/dist/core/shaders/UIImage.glsl.js +3 -0
  193. package/dist/core/shaders/UINineSlice.glsl.js +3 -0
  194. package/dist/core/shaders/UIProgress.glsl.js +3 -0
  195. package/dist/core/shaders/UIProgressMaskFunctionCircular.glsl.js +3 -0
  196. package/dist/core/shaders/UIProgressMaskFunctionDirectional.glsl.js +3 -0
  197. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.d.ts +17 -0
  198. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.d.ts +13 -0
  199. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.js +108 -0
  200. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.d.ts +13 -0
  201. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.d.ts +20 -0
  202. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.js +75 -0
  203. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.d.ts +49 -0
  204. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.d.ts +215 -0
  205. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.js +505 -0
  206. package/dist/index.js +51 -0
  207. package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.d.ts +21 -0
  208. package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.js +47 -0
  209. package/dist/particles/behaviorModules/UIBehaviorModule.d.ts +14 -0
  210. package/dist/particles/behaviorModules/UIBehaviorModule.js +9 -0
  211. package/dist/particles/behaviorModules/UIBehaviorPointGravity.d.ts +39 -0
  212. package/dist/particles/behaviorModules/UIBehaviorPointGravity.js +110 -0
  213. package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.d.ts +22 -0
  214. package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.js +66 -0
  215. package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.d.ts +20 -0
  216. package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.js +48 -0
  217. package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.d.ts +26 -0
  218. package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.js +66 -0
  219. package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.d.ts +20 -0
  220. package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.js +49 -0
  221. package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.d.ts +26 -0
  222. package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.js +70 -0
  223. package/dist/particles/elements/UIEmitter.Internal.d.ts +15 -0
  224. package/dist/particles/elements/UIEmitter.Internal.js +11 -0
  225. package/dist/particles/elements/UIEmitter.d.ts +68 -0
  226. package/dist/particles/elements/UIEmitter.js +203 -0
  227. package/dist/particles/index.js +18 -0
  228. package/dist/particles/instancedParticle/UIInstancedParticle.Internal.d.ts +13 -0
  229. package/dist/particles/instancedParticle/UIInstancedParticle.Internal.js +211 -0
  230. package/dist/particles/instancedParticle/UIInstancedParticle.d.ts +17 -0
  231. package/dist/particles/instancedParticle/UIInstancedParticle.js +93 -0
  232. package/dist/particles/miscellaneous/miscellaneous.d.ts +32 -0
  233. package/dist/particles/miscellaneous/miscellaneous.js +67 -0
  234. package/dist/particles/renderingModules/UIRenderingColorOverLife.d.ts +14 -0
  235. package/dist/particles/renderingModules/UIRenderingColorOverLife.js +32 -0
  236. package/dist/particles/renderingModules/UIRenderingColorOverVelocity.d.ts +15 -0
  237. package/dist/particles/renderingModules/UIRenderingColorOverVelocity.js +37 -0
  238. package/dist/particles/renderingModules/UIRenderingModule.d.ts +8 -0
  239. package/dist/particles/renderingModules/UIRenderingModule.js +9 -0
  240. package/dist/particles/renderingModules/UIRenderingTexture.d.ts +14 -0
  241. package/dist/particles/renderingModules/UIRenderingTexture.js +26 -0
  242. package/dist/particles/shaders/UIRenderingColorOverLife.glsl.js +3 -0
  243. package/dist/particles/shaders/UIRenderingColorOverVelocity.glsl.js +3 -0
  244. package/dist/particles/shaders/UIRenderingTexture.glsl.js +3 -0
  245. package/dist/particles/spawnModules/UISpawnModule.d.ts +9 -0
  246. package/dist/particles/spawnModules/UISpawnModule.js +9 -0
  247. package/dist/particles/spawnModules/UISpawnOffset.d.ts +21 -0
  248. package/dist/particles/spawnModules/UISpawnOffset.js +46 -0
  249. package/dist/particles/spawnModules/UISpawnRandomLifetime.d.ts +20 -0
  250. package/dist/particles/spawnModules/UISpawnRandomLifetime.js +47 -0
  251. package/dist/particles/spawnModules/UISpawnRandomRotation.d.ts +20 -0
  252. package/dist/particles/spawnModules/UISpawnRandomRotation.js +45 -0
  253. package/dist/particles/spawnModules/UISpawnRandomScale.d.ts +26 -0
  254. package/dist/particles/spawnModules/UISpawnRandomScale.js +60 -0
  255. package/dist/particles/spawnModules/UISpawnRandomTorque.d.ts +20 -0
  256. package/dist/particles/spawnModules/UISpawnRandomTorque.js +45 -0
  257. package/dist/particles/spawnModules/UISpawnRandomVelocity.d.ts +26 -0
  258. package/dist/particles/spawnModules/UISpawnRandomVelocity.js +64 -0
  259. package/dist/particles/spawnModules/UISpawnRectangle.d.ts +27 -0
  260. package/dist/particles/spawnModules/UISpawnRectangle.js +62 -0
  261. package/package.json +8 -1
  262. package/.claude/settings.local.json +0 -9
  263. package/.editorconfig +0 -14
  264. package/CLAUDE.md +0 -181
  265. package/assets/logotype.png +0 -0
  266. package/eslint.config.js +0 -111
  267. package/rollup.config.js +0 -52
  268. package/src/core/constraints/UIAspectConstraint/UIAspectConstraint.ts +0 -60
  269. package/src/core/constraints/UIConstraint.ts +0 -20
  270. package/src/core/constraints/UICustomConstraint.ts +0 -62
  271. package/src/core/constraints/UIHeightConstraint/UIHeightConstraint.ts +0 -52
  272. package/src/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.ts +0 -13
  273. package/src/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.ts +0 -139
  274. package/src/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.ts +0 -16
  275. package/src/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.ts +0 -189
  276. package/src/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.ts +0 -68
  277. package/src/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.ts +0 -94
  278. package/src/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.ts +0 -13
  279. package/src/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.ts +0 -135
  280. package/src/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.ts +0 -16
  281. package/src/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.ts +0 -189
  282. package/src/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.ts +0 -68
  283. package/src/core/constraints/UIWidthConstraint/UIWidthConstraint.ts +0 -52
  284. package/src/core/constraints/builders/UIConstraint2DBuilder.Internal.ts +0 -84
  285. package/src/core/constraints/builders/UIConstraint2DBuilder.ts +0 -168
  286. package/src/core/constraints/builders/UICoverConstraintBuilder.Internal.ts +0 -15
  287. package/src/core/constraints/builders/UICoverConstraintBuilder.ts +0 -84
  288. package/src/core/constraints/builders/UIFitConstraintBuilder.Internal.ts +0 -15
  289. package/src/core/constraints/builders/UIFitConstraintBuilder.ts +0 -84
  290. package/src/core/elements/UIAnchor/UIAnchor.Internal.ts +0 -13
  291. package/src/core/elements/UIAnchor/UIAnchor.ts +0 -70
  292. package/src/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.ts +0 -30
  293. package/src/core/elements/UIAnimatedImage/UIAnimatedImage.ts +0 -355
  294. package/src/core/elements/UIDummy/UIDummy.Internal.ts +0 -33
  295. package/src/core/elements/UIDummy/UIDummy.ts +0 -244
  296. package/src/core/elements/UIElement/UIElement.ts +0 -127
  297. package/src/core/elements/UIGraphics/UIGraphics.ts +0 -168
  298. package/src/core/elements/UIImage/UIImage.ts +0 -138
  299. package/src/core/elements/UINineSlice/UINineSlice.Internal.ts +0 -26
  300. package/src/core/elements/UINineSlice/UINineSlice.ts +0 -296
  301. package/src/core/elements/UIProgress/UIProgress.Internal.ts +0 -24
  302. package/src/core/elements/UIProgress/UIProgress.ts +0 -259
  303. package/src/core/elements/UIScene/UIScene.Internal.ts +0 -46
  304. package/src/core/elements/UIScene/UIScene.ts +0 -259
  305. package/src/core/elements/UIText/UIText.Internal.ts +0 -29
  306. package/src/core/elements/UIText/UIText.Measuring.ts +0 -183
  307. package/src/core/elements/UIText/UIText.Rendering.ts +0 -83
  308. package/src/core/elements/UIText/UIText.ts +0 -376
  309. package/src/core/layers/UIFullscreenLayer/UIFullscreenLayer.ts +0 -233
  310. package/src/core/layers/UILayer/UILayer.ts +0 -156
  311. package/src/core/miscellaneous/UIExpression.ts +0 -142
  312. package/src/core/miscellaneous/UIMode.ts +0 -29
  313. package/src/core/miscellaneous/UIOrientation.ts +0 -18
  314. package/src/core/miscellaneous/UIPriority.ts +0 -63
  315. package/src/core/miscellaneous/UIRelation.ts +0 -39
  316. package/src/core/miscellaneous/UITransparencyMode.ts +0 -9
  317. package/src/core/miscellaneous/area/UIArea.ts +0 -5
  318. package/src/core/miscellaneous/area/UIAreaCircle.ts +0 -32
  319. package/src/core/miscellaneous/area/UIAreaPolygon.ts +0 -50
  320. package/src/core/miscellaneous/area/UIAreaRectangle.ts +0 -38
  321. package/src/core/miscellaneous/area/UIAreaRoundedRectangle.ts +0 -78
  322. package/src/core/miscellaneous/asserts.ts +0 -187
  323. package/src/core/miscellaneous/canvas.ts +0 -73
  324. package/src/core/miscellaneous/color/UIColor.Internal.ts +0 -89
  325. package/src/core/miscellaneous/color/UIColor.ts +0 -844
  326. package/src/core/miscellaneous/computeTransform.ts +0 -127
  327. package/src/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.ts +0 -235
  328. package/src/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.ts +0 -524
  329. package/src/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.ts +0 -448
  330. package/src/core/miscellaneous/generic-plane/shared.ts +0 -323
  331. package/src/core/miscellaneous/insets/UIInsets.Internal.ts +0 -9
  332. package/src/core/miscellaneous/insets/UIInsets.ts +0 -248
  333. package/src/core/miscellaneous/mask-function/UIProgressMaskFunction.ts +0 -24
  334. package/src/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.ts +0 -58
  335. package/src/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.ts +0 -52
  336. package/src/core/miscellaneous/math.ts +0 -16
  337. package/src/core/miscellaneous/micro/UIMicro.Internal.ts +0 -33
  338. package/src/core/miscellaneous/micro/UIMicro.ts +0 -222
  339. package/src/core/miscellaneous/resize-policy/UIResizePolicy.ts +0 -8
  340. package/src/core/miscellaneous/resize-policy/UIResizePolicyCover.ts +0 -57
  341. package/src/core/miscellaneous/resize-policy/UIResizePolicyCross.ts +0 -65
  342. package/src/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.ts +0 -65
  343. package/src/core/miscellaneous/resize-policy/UIResizePolicyFit.ts +0 -57
  344. package/src/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.ts +0 -65
  345. package/src/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.ts +0 -65
  346. package/src/core/miscellaneous/resize-policy/UIResizePolicyNone.ts +0 -11
  347. package/src/core/miscellaneous/shared.ts +0 -73
  348. package/src/core/miscellaneous/text-span/UITextSpan.ts +0 -43
  349. package/src/core/miscellaneous/text-style/UITextStyle.Internal.ts +0 -52
  350. package/src/core/miscellaneous/text-style/UITextStyle.ts +0 -479
  351. package/src/core/miscellaneous/texture/UITextureView.Internal.ts +0 -55
  352. package/src/core/miscellaneous/texture/UITextureView.ts +0 -308
  353. package/src/core/miscellaneous/webglCapabilities.ts +0 -129
  354. package/src/core/shaders/UIImage.glsl +0 -10
  355. package/src/core/shaders/UINineSlice.glsl +0 -53
  356. package/src/core/shaders/UIProgress.glsl +0 -15
  357. package/src/core/shaders/UIProgressMaskFunctionCircular.glsl +0 -13
  358. package/src/core/shaders/UIProgressMaskFunctionDirectional.glsl +0 -12
  359. package/src/core/shaders/glsl.d.ts +0 -27
  360. package/src/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.ts +0 -23
  361. package/src/core/wrappers/UIInputWrapper/UIInputWrapper.ts +0 -124
  362. package/src/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.ts +0 -22
  363. package/src/core/wrappers/UISceneWrapper/UISceneWrapper.ts +0 -101
  364. package/src/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.ts +0 -58
  365. package/src/core/wrappers/UISolverWrapper/UISolverWrapper.ts +0 -605
  366. package/src/particles/behaviorModules/UIBehaviorDirectionalGravity.ts +0 -70
  367. package/src/particles/behaviorModules/UIBehaviorModule.ts +0 -20
  368. package/src/particles/behaviorModules/UIBehaviorPointGravity.ts +0 -173
  369. package/src/particles/behaviorModules/UIBehaviorScaleOverLife.ts +0 -104
  370. package/src/particles/behaviorModules/UIBehaviorTorqueDamping.ts +0 -75
  371. package/src/particles/behaviorModules/UIBehaviorTorqueNoise.ts +0 -115
  372. package/src/particles/behaviorModules/UIBehaviorVelocityDamping.ts +0 -77
  373. package/src/particles/behaviorModules/UIBehaviorVelocityNoise.ts +0 -118
  374. package/src/particles/elements/UIEmitter.Internal.ts +0 -22
  375. package/src/particles/elements/UIEmitter.ts +0 -313
  376. package/src/particles/instancedParticle/UIInstancedParticle.Internal.ts +0 -263
  377. package/src/particles/instancedParticle/UIInstancedParticle.ts +0 -138
  378. package/src/particles/miscellaneous/miscellaneous.ts +0 -115
  379. package/src/particles/renderingModules/UIRenderingColorOverLife.ts +0 -39
  380. package/src/particles/renderingModules/UIRenderingColorOverVelocity.ts +0 -49
  381. package/src/particles/renderingModules/UIRenderingModule.ts +0 -17
  382. package/src/particles/renderingModules/UIRenderingTexture.ts +0 -30
  383. package/src/particles/shaders/UIRenderingColorOverLife.glsl +0 -4
  384. package/src/particles/shaders/UIRenderingColorOverVelocity.glsl +0 -6
  385. package/src/particles/shaders/UIRenderingTexture.glsl +0 -4
  386. package/src/particles/spawnModules/UISpawnModule.ts +0 -22
  387. package/src/particles/spawnModules/UISpawnOffset.ts +0 -62
  388. package/src/particles/spawnModules/UISpawnRandomLifetime.ts +0 -68
  389. package/src/particles/spawnModules/UISpawnRandomRotation.ts +0 -60
  390. package/src/particles/spawnModules/UISpawnRandomScale.ts +0 -81
  391. package/src/particles/spawnModules/UISpawnRandomTorque.ts +0 -62
  392. package/src/particles/spawnModules/UISpawnRandomVelocity.ts +0 -92
  393. package/src/particles/spawnModules/UISpawnRectangle.ts +0 -81
  394. package/tsconfig.json +0 -29
  395. /package/{src/core/index.ts → dist/core/index.d.ts} +0 -0
  396. /package/{src/particles/index.ts → dist/particles/index.d.ts} +0 -0
@@ -1,13 +1,11 @@
1
1
  import type { UIMicroConfig } from "../../miscellaneous/micro/UIMicro.Internal";
2
2
  import { UITransparencyMode } from "../../miscellaneous/UITransparencyMode";
3
3
  import type { UIDummyOptions } from "../UIDummy/UIDummy.Internal";
4
-
5
4
  /** Configuration options for UIElement */
6
5
  export interface UIElementOptions extends UIDummyOptions {
7
- /** Transforms that don't affect constraints */
8
- micro: Partial<UIMicroConfig>;
9
- /** Alpha blending mode */
10
- transparencyMode: UITransparencyMode;
6
+ /** Transforms that don't affect constraints */
7
+ micro: Partial<UIMicroConfig>;
8
+ /** Alpha blending mode */
9
+ transparencyMode: UITransparencyMode;
11
10
  }
12
-
13
- export const ELEMENT_DEFAULT_TRANSPARENCY_MODE = UITransparencyMode.BLEND;
11
+ export declare const ELEMENT_DEFAULT_TRANSPARENCY_MODE = UITransparencyMode.BLEND;
@@ -0,0 +1,5 @@
1
+ import { UITransparencyMode } from '../../miscellaneous/UITransparencyMode.js';
2
+
3
+ const ELEMENT_DEFAULT_TRANSPARENCY_MODE = UITransparencyMode.BLEND;
4
+
5
+ export { ELEMENT_DEFAULT_TRANSPARENCY_MODE };
@@ -0,0 +1,38 @@
1
+ import type { WebGLRenderer } from "three";
2
+ import type { UILayer } from "../../layers/UILayer/UILayer";
3
+ import type { UIProperty } from "../../miscellaneous/generic-plane/shared";
4
+ import { UIMicro } from "../../miscellaneous/micro/UIMicro";
5
+ import type { UIMode } from "../../miscellaneous/UIMode";
6
+ import type { UITransparencyMode } from "../../miscellaneous/UITransparencyMode";
7
+ import type { UISceneWrapperView } from "../../wrappers/UISceneWrapper/UISceneWrapper.Internal";
8
+ import { UIDummy } from "../UIDummy/UIDummy";
9
+ import type { UIElementOptions } from "./UIElement.Internal";
10
+ /** Base class for renderable UI elements */
11
+ export declare abstract class UIElement extends UIDummy {
12
+ /** Transforms that don't affect constraints */
13
+ readonly micro: UIMicro;
14
+ protected readonly sceneWrapper: UISceneWrapperView;
15
+ protected planeHandler: number;
16
+ private transparencyModeInternal;
17
+ private transparencyModeDirty;
18
+ private visibilityDirty;
19
+ /**
20
+ * Creates a new UIElement instance.
21
+ *
22
+ * @param layer - Layer containing this element
23
+ * @param source - GLSL shader source code
24
+ * @param properties - Shader uniform properties
25
+ * @param options - Configuration options
26
+ */
27
+ constructor(layer: UILayer, source: string, properties: Record<string, UIProperty>, options?: Partial<UIElementOptions>);
28
+ /** Alpha blending mode */
29
+ get transparencyMode(): UITransparencyMode;
30
+ /** Alpha blending mode */
31
+ set transparencyMode(value: UITransparencyMode);
32
+ set mode(value: UIMode);
33
+ /** Removes element and frees resources */
34
+ destroy(): void;
35
+ protected setPlaneTransform(): void;
36
+ protected onWillRender(renderer: WebGLRenderer, deltaTime: number): void;
37
+ private readonly handleWillRender;
38
+ }
@@ -0,0 +1,74 @@
1
+ import { Matrix4 } from 'three';
2
+ import { computeTransformMatrix } from '../../miscellaneous/computeTransform.js';
3
+ import { UIMicro } from '../../miscellaneous/micro/UIMicro.js';
4
+ import { isUIModeVisible } from '../../miscellaneous/UIMode.js';
5
+ import { UIDummy } from '../UIDummy/UIDummy.js';
6
+ import { ELEMENT_DEFAULT_TRANSPARENCY_MODE } from './UIElement.Internal.js';
7
+
8
+ /** Base class for renderable UI elements */
9
+ class UIElement extends UIDummy {
10
+ /**
11
+ * Creates a new UIElement instance.
12
+ *
13
+ * @param layer - Layer containing this element
14
+ * @param source - GLSL shader source code
15
+ * @param properties - Shader uniform properties
16
+ * @param options - Configuration options
17
+ */
18
+ constructor(layer, source, properties, options) {
19
+ super(layer, options);
20
+ this._private_transparencyModeDirty = false;
21
+ this._private_visibilityDirty = false;
22
+ this._private_handleWillRender = (renderer, deltaTime) => {
23
+ this.onWillRender(renderer, deltaTime);
24
+ };
25
+ this.micro = new UIMicro(options?.micro);
26
+ this._private_transparencyModeInternal = options?.transparencyMode ?? ELEMENT_DEFAULT_TRANSPARENCY_MODE;
27
+ this.sceneWrapper = this.layer.sceneWrapper;
28
+ this.planeHandler = this.sceneWrapper.createPlane(source, properties, new Matrix4().identity(), isUIModeVisible(options?.mode ?? this.mode), this._private_transparencyModeInternal);
29
+ this.layer.signalRendering.on(this._private_handleWillRender);
30
+ }
31
+ /** Alpha blending mode */
32
+ get transparencyMode() {
33
+ return this._private_transparencyModeInternal;
34
+ }
35
+ /** Alpha blending mode */
36
+ set transparencyMode(value) {
37
+ if (this._private_transparencyModeInternal !== value) {
38
+ this._private_transparencyModeInternal = value;
39
+ this._private_transparencyModeDirty = true;
40
+ }
41
+ }
42
+ set mode(value) {
43
+ if (this.modeInternal !== value) {
44
+ this._private_visibilityDirty = isUIModeVisible(this.modeInternal) !== isUIModeVisible(value);
45
+ super.mode = value;
46
+ }
47
+ }
48
+ /** Removes element and frees resources */
49
+ destroy() {
50
+ this.layer.signalRendering.off(this._private_handleWillRender);
51
+ this.sceneWrapper.destroyPlane(this.planeHandler);
52
+ super.destroy();
53
+ }
54
+ setPlaneTransform() {
55
+ if (this.micro.dirty || this.inputWrapper.dirty || this.solverWrapper.dirty) {
56
+ this.sceneWrapper.setTransform(this.planeHandler, computeTransformMatrix(this.x, this.y, this.width, this.height, this.zIndex, this.micro.x, this.micro.y, this.micro.anchorX, this.micro.anchorY, this.micro.scaleX, this.micro.scaleY, this.micro.rotation, this.micro.anchorMode));
57
+ this.micro.setDirtyFalse();
58
+ }
59
+ }
60
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- Required by UILayer event interface but not used in base implementation
61
+ onWillRender(renderer, deltaTime) {
62
+ if (this._private_transparencyModeDirty) {
63
+ this.sceneWrapper.setTransparency(this.planeHandler, this._private_transparencyModeInternal);
64
+ this._private_transparencyModeDirty = false;
65
+ }
66
+ if (this._private_visibilityDirty) {
67
+ this.sceneWrapper.setVisibility(this.planeHandler, isUIModeVisible(this.modeInternal));
68
+ this._private_visibilityDirty = false;
69
+ }
70
+ this.setPlaneTransform();
71
+ }
72
+ }
73
+
74
+ export { UIElement };
@@ -1,13 +1,11 @@
1
1
  import { UIColor } from "../../miscellaneous/color/UIColor";
2
2
  import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
3
3
  import type { UIElementOptions } from "../UIElement/UIElement.Internal";
4
-
5
4
  /** Configuration options for UIGraphics */
6
5
  export interface UIGraphicsOptions extends UIElementOptions {
7
- /** Multiplicative tint */
8
- color: UIColorConfig;
6
+ /** Multiplicative tint */
7
+ color: UIColorConfig;
9
8
  }
10
-
11
- export const GRAPHICS_DEFAULT_WIDTH = 2;
12
- export const GRAPHICS_DEFAULT_HEIGHT = 2;
13
- export const GRAPHICS_TEMP_COLOR = new UIColor();
9
+ export declare const GRAPHICS_DEFAULT_WIDTH = 2;
10
+ export declare const GRAPHICS_DEFAULT_HEIGHT = 2;
11
+ export declare const GRAPHICS_TEMP_COLOR: UIColor;
@@ -0,0 +1,7 @@
1
+ import { UIColor } from '../../miscellaneous/color/UIColor.js';
2
+
3
+ const GRAPHICS_DEFAULT_WIDTH = 2;
4
+ const GRAPHICS_DEFAULT_HEIGHT = 2;
5
+ const GRAPHICS_TEMP_COLOR = new UIColor();
6
+
7
+ export { GRAPHICS_DEFAULT_HEIGHT, GRAPHICS_DEFAULT_WIDTH, GRAPHICS_TEMP_COLOR };
@@ -0,0 +1,51 @@
1
+ import type { WebGLRenderer } from "three";
2
+ import type { UILayer } from "../../layers/UILayer/UILayer";
3
+ import { UIColor } from "../../miscellaneous/color/UIColor";
4
+ import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
5
+ import { UIElement } from "../UIElement/UIElement";
6
+ import type { UIGraphicsOptions } from "./UIGraphics.Internal";
7
+ /** Canvas-based 2D drawing element */
8
+ export declare class UIGraphics extends UIElement {
9
+ private readonly colorInternal;
10
+ private readonly canvas;
11
+ private readonly context;
12
+ private readonly texture;
13
+ /**
14
+ * Creates a new UIGraphics instance.
15
+ *
16
+ * @param layer - Layer containing this element
17
+ * @param options - Configuration options
18
+ */
19
+ constructor(layer: UILayer, options?: Partial<UIGraphicsOptions>);
20
+ /** Multiplicative tint. Alpha channel controls opacity. */
21
+ get color(): UIColor;
22
+ /** Multiplicative tint. Alpha channel controls opacity. */
23
+ set color(value: UIColorConfig);
24
+ /**
25
+ * Clears canvas. Optionally fills with color.
26
+ *
27
+ * @param color - Fill color after clearing
28
+ */
29
+ clear(color?: UIColorConfig): this;
30
+ /** Draws filled rectangle */
31
+ drawRect(x: number, y: number, width: number, height: number, color: UIColorConfig): this;
32
+ /** Draws filled circle */
33
+ drawCircle(x: number, y: number, radius: number, color: UIColorConfig): this;
34
+ /**
35
+ * Draws filled arc.
36
+ *
37
+ * @param startAngle - Start angle in radians
38
+ * @param endAngle - End angle in radians
39
+ */
40
+ drawArc(x: number, y: number, radius: number, startAngle: number, endAngle: number, color: UIColorConfig): this;
41
+ /**
42
+ * Draws connected line segments.
43
+ *
44
+ * @param points - Array of [x, y] pairs
45
+ * @param lineWidth - Line width in pixels
46
+ */
47
+ drawPolyline(points: [number, number][], color: UIColor, lineWidth?: number): this;
48
+ /** Removes element and frees resources */
49
+ destroy(): void;
50
+ protected onWillRender(renderer: WebGLRenderer, deltaTime: number): void;
51
+ }
@@ -0,0 +1,126 @@
1
+ import { Matrix3 } from 'three';
2
+ import { createCanvas, createCanvasTexture } from '../../miscellaneous/canvas.js';
3
+ import { UIColor } from '../../miscellaneous/color/UIColor.js';
4
+ import source from '../../shaders/UIImage.glsl.js';
5
+ import { UIElement } from '../UIElement/UIElement.js';
6
+ import { GRAPHICS_DEFAULT_WIDTH, GRAPHICS_DEFAULT_HEIGHT, GRAPHICS_TEMP_COLOR } from './UIGraphics.Internal.js';
7
+
8
+ /** Canvas-based 2D drawing element */
9
+ class UIGraphics extends UIElement {
10
+ /**
11
+ * Creates a new UIGraphics instance.
12
+ *
13
+ * @param layer - Layer containing this element
14
+ * @param options - Configuration options
15
+ */
16
+ constructor(layer, options) {
17
+ const w = options?.width ?? GRAPHICS_DEFAULT_WIDTH;
18
+ const h = options?.height ?? GRAPHICS_DEFAULT_HEIGHT;
19
+ const color = new UIColor(options?.color);
20
+ const canvas = createCanvas(w, h);
21
+ const context = canvas.getContext("2d");
22
+ if (!context) {
23
+ throw new Error("UIGraphics.constructor: failed to get 2D context from canvas");
24
+ }
25
+ const texture = createCanvasTexture(canvas);
26
+ texture.needsUpdate = true;
27
+ super(layer, source, {
28
+ texture: texture,
29
+ textureTransform: new Matrix3(),
30
+ color,
31
+ }, options);
32
+ this._private_canvas = canvas;
33
+ this._private_context = context;
34
+ this._private_texture = texture;
35
+ this._private_colorInternal = color;
36
+ }
37
+ /** Multiplicative tint. Alpha channel controls opacity. */
38
+ get color() {
39
+ return this._private_colorInternal;
40
+ }
41
+ /** Multiplicative tint. Alpha channel controls opacity. */
42
+ set color(value) {
43
+ this._private_colorInternal.set(value);
44
+ }
45
+ /**
46
+ * Clears canvas. Optionally fills with color.
47
+ *
48
+ * @param color - Fill color after clearing
49
+ */
50
+ clear(color) {
51
+ this._private_context.clearRect(0, 0, this._private_canvas.width, this._private_canvas.height);
52
+ if (color !== undefined) {
53
+ this._private_context.fillStyle = GRAPHICS_TEMP_COLOR.set(color).toCSSColor();
54
+ this._private_context.fillRect(0, 0, this._private_canvas.width, this._private_canvas.height);
55
+ }
56
+ this._private_texture.needsUpdate = true;
57
+ return this;
58
+ }
59
+ /** Draws filled rectangle */
60
+ drawRect(x, y, width, height, color) {
61
+ this._private_context.fillStyle = GRAPHICS_TEMP_COLOR.set(color).toCSSColor();
62
+ this._private_context.fillRect(x, y, width, height);
63
+ this._private_texture.needsUpdate = true;
64
+ return this;
65
+ }
66
+ /** Draws filled circle */
67
+ drawCircle(x, y, radius, color) {
68
+ this._private_context.fillStyle = GRAPHICS_TEMP_COLOR.set(color).toCSSColor();
69
+ this._private_context.beginPath();
70
+ this._private_context.arc(x, y, radius, 0, Math.PI * 2);
71
+ this._private_context.fill();
72
+ this._private_texture.needsUpdate = true;
73
+ return this;
74
+ }
75
+ /**
76
+ * Draws filled arc.
77
+ *
78
+ * @param startAngle - Start angle in radians
79
+ * @param endAngle - End angle in radians
80
+ */
81
+ drawArc(x, y, radius, startAngle, endAngle, color) {
82
+ this._private_context.fillStyle = GRAPHICS_TEMP_COLOR.set(color).toCSSColor();
83
+ this._private_context.beginPath();
84
+ this._private_context.arc(x, y, radius, startAngle, endAngle);
85
+ this._private_context.fill();
86
+ this._private_texture.needsUpdate = true;
87
+ return this;
88
+ }
89
+ /**
90
+ * Draws connected line segments.
91
+ *
92
+ * @param points - Array of [x, y] pairs
93
+ * @param lineWidth - Line width in pixels
94
+ */
95
+ drawPolyline(points, color, lineWidth = 1) {
96
+ if (points.length < 2) {
97
+ return this;
98
+ }
99
+ this._private_context.strokeStyle = GRAPHICS_TEMP_COLOR.set(color).toCSSColor();
100
+ this._private_context.lineWidth = lineWidth;
101
+ this._private_context.beginPath();
102
+ this._private_context.moveTo(points[0][0], points[0][1]);
103
+ for (let i = 1; i < points.length; i++) {
104
+ this._private_context.lineTo(points[i][0], points[i][1]);
105
+ }
106
+ this._private_context.stroke();
107
+ this._private_texture.needsUpdate = true;
108
+ return this;
109
+ }
110
+ /** Removes element and frees resources */
111
+ destroy() {
112
+ this._private_texture.dispose();
113
+ super.destroy();
114
+ }
115
+ onWillRender(renderer, deltaTime) {
116
+ if (this._private_colorInternal.dirty) {
117
+ this.sceneWrapper.setProperties(this.planeHandler, {
118
+ color: this._private_colorInternal,
119
+ });
120
+ this._private_colorInternal.setDirtyFalse();
121
+ }
122
+ super.onWillRender(renderer, deltaTime);
123
+ }
124
+ }
125
+
126
+ export { UIGraphics };
@@ -1,8 +1,7 @@
1
1
  import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
2
2
  import type { UIElementOptions } from "../UIElement/UIElement.Internal";
3
-
4
3
  /** Configuration options for UIImage */
5
4
  export interface UIImageOptions extends UIElementOptions {
6
- /** Multiplicative tint */
7
- color: UIColorConfig;
5
+ /** Multiplicative tint */
6
+ color: UIColorConfig;
8
7
  }
@@ -0,0 +1,32 @@
1
+ import type { UILayer } from "../../layers/UILayer/UILayer";
2
+ import { UIColor } from "../../miscellaneous/color/UIColor";
3
+ import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
4
+ import { UITextureView } from "../../miscellaneous/texture/UITextureView";
5
+ import type { UITextureConfig } from "../../miscellaneous/texture/UITextureView.Internal";
6
+ import { UIElement } from "../UIElement/UIElement";
7
+ import type { UIImageOptions } from "./UIImage.Internal";
8
+ /** Textured image element */
9
+ export declare class UIImage extends UIElement {
10
+ /** Texture displayed by this image */
11
+ readonly texture: UITextureView;
12
+ private readonly colorInternal;
13
+ private readonly textureTransform;
14
+ /**
15
+ * Creates a new UIImage instance.
16
+ *
17
+ * Defaults size to texture dimensions if width and height not provided.
18
+ *
19
+ * @param layer - Layer containing this image
20
+ * @param texture - Texture to display
21
+ * @param options - Configuration options
22
+ */
23
+ constructor(layer: UILayer, texture: UITextureConfig, options?: Partial<UIImageOptions>);
24
+ /** Multiplicative tint. Alpha channel controls opacity. */
25
+ get color(): UIColor;
26
+ /** Multiplicative tint. Alpha channel controls opacity. */
27
+ set color(value: UIColorConfig);
28
+ /** Removes image and frees resources */
29
+ destroy(): void;
30
+ protected setPlaneTransform(): void;
31
+ private readonly onTextureDimensionsChanged;
32
+ }
@@ -0,0 +1,85 @@
1
+ import { UIColor } from '../../miscellaneous/color/UIColor.js';
2
+ import { computeTrimmedTransformMatrix } from '../../miscellaneous/computeTransform.js';
3
+ import { UITextureView } from '../../miscellaneous/texture/UITextureView.js';
4
+ import source from '../../shaders/UIImage.glsl.js';
5
+ import { UIElement } from '../UIElement/UIElement.js';
6
+
7
+ /** Textured image element */
8
+ class UIImage extends UIElement {
9
+ /**
10
+ * Creates a new UIImage instance.
11
+ *
12
+ * Defaults size to texture dimensions if width and height not provided.
13
+ *
14
+ * @param layer - Layer containing this image
15
+ * @param texture - Texture to display
16
+ * @param options - Configuration options
17
+ */
18
+ constructor(layer, texture, options = {}) {
19
+ const color = new UIColor(options.color);
20
+ const textureView = new UITextureView(texture);
21
+ const textureTransform = textureView.calculateUVTransform();
22
+ options.width = options.width ?? textureView.width;
23
+ options.height = options.height ?? textureView.height;
24
+ super(layer, source, {
25
+ texture: textureView.texture,
26
+ textureTransform: textureTransform,
27
+ color,
28
+ }, options);
29
+ this._private_onTextureDimensionsChanged = (width, height) => {
30
+ this.width = width;
31
+ this.height = height;
32
+ };
33
+ this.texture = textureView;
34
+ this._private_textureTransform = textureTransform;
35
+ this._private_colorInternal = color;
36
+ this.texture.signalDiminsionsChanged.on(this._private_onTextureDimensionsChanged);
37
+ }
38
+ /** Multiplicative tint. Alpha channel controls opacity. */
39
+ get color() {
40
+ return this._private_colorInternal;
41
+ }
42
+ /** Multiplicative tint. Alpha channel controls opacity. */
43
+ set color(value) {
44
+ this._private_colorInternal.set(value);
45
+ }
46
+ /** Removes image and frees resources */
47
+ destroy() {
48
+ this.texture.signalDiminsionsChanged.off(this._private_onTextureDimensionsChanged);
49
+ super.destroy();
50
+ }
51
+ setPlaneTransform() {
52
+ let properties;
53
+ if (this._private_colorInternal.dirty) {
54
+ properties ?? (properties = {});
55
+ properties["color"] = this._private_colorInternal;
56
+ this._private_colorInternal.setDirtyFalse();
57
+ }
58
+ if (this.texture.textureDirty) {
59
+ properties ?? (properties = {});
60
+ properties["texture"] = this.texture.texture;
61
+ this.texture.setTextureDirtyFalse();
62
+ }
63
+ if (this.texture.uvTransformDirty) {
64
+ properties ?? (properties = {});
65
+ properties["textureTransform"] = this.texture.calculateUVTransform(this._private_textureTransform);
66
+ this.texture.setUVTransformDirtyFalse();
67
+ }
68
+ if (properties) {
69
+ this.sceneWrapper.setProperties(this.planeHandler, properties);
70
+ }
71
+ const isTransformDirty = this.micro.dirty ||
72
+ this.texture.trimDirty ||
73
+ this.inputWrapper.dirty ||
74
+ this.solverWrapper.dirty;
75
+ if (isTransformDirty) {
76
+ const micro = this.micro;
77
+ const textureTrim = this.texture.trim;
78
+ this.sceneWrapper.setTransform(this.planeHandler, computeTrimmedTransformMatrix(this.x, this.y, this.width, this.height, this.zIndex, micro.x, micro.y, micro.anchorX, micro.anchorY, micro.scaleX, micro.scaleY, micro.rotation, micro.anchorMode, textureTrim.left, textureTrim.right, textureTrim.top, textureTrim.bottom));
79
+ this.micro.setDirtyFalse();
80
+ this.texture.setTrimDirtyFalse();
81
+ }
82
+ }
83
+ }
84
+
85
+ export { UIImage };
@@ -0,0 +1,23 @@
1
+ import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
2
+ import type { UIInsetsConfig } from "../../miscellaneous/insets/UIInsets.Internal";
3
+ import type { UIElementOptions } from "../UIElement/UIElement.Internal";
4
+ /** Controls how sliceRegions values are interpreted */
5
+ export declare enum UINineSliceRegionMode {
6
+ /** sliceRegions in normalized coordinates (0 to 1) */
7
+ NORMALIZED = 0,
8
+ /** sliceRegions in world units */
9
+ WORLD = 1
10
+ }
11
+ /** Configuration options for UINineSlice */
12
+ export interface UINineSliceOptions extends UIElementOptions {
13
+ /** Multiplicative tint */
14
+ color: UIColorConfig;
15
+ /** Border size in normalized texture coordinates (0 to 1) */
16
+ sliceBorders: UIInsetsConfig;
17
+ /** Region size. Interpretation depends on regionMode. */
18
+ sliceRegions: UIInsetsConfig;
19
+ /** How sliceRegions values are interpreted */
20
+ regionMode: UINineSliceRegionMode;
21
+ }
22
+ export declare const NINE_SLICE_DEFAULT_BORDER = 0.1;
23
+ export declare const NINE_SLICE_DEFAULT_REGION_MODE = UINineSliceRegionMode.WORLD;
@@ -0,0 +1,12 @@
1
+ /** Controls how sliceRegions values are interpreted */
2
+ var UINineSliceRegionMode;
3
+ (function (UINineSliceRegionMode) {
4
+ /** sliceRegions in normalized coordinates (0 to 1) */
5
+ UINineSliceRegionMode[UINineSliceRegionMode["NORMALIZED"] = 0] = "NORMALIZED";
6
+ /** sliceRegions in world units */
7
+ UINineSliceRegionMode[UINineSliceRegionMode["WORLD"] = 1] = "WORLD";
8
+ })(UINineSliceRegionMode || (UINineSliceRegionMode = {}));
9
+ const NINE_SLICE_DEFAULT_BORDER = 0.1;
10
+ const NINE_SLICE_DEFAULT_REGION_MODE = UINineSliceRegionMode.WORLD;
11
+
12
+ export { NINE_SLICE_DEFAULT_BORDER, NINE_SLICE_DEFAULT_REGION_MODE, UINineSliceRegionMode };
@@ -0,0 +1,60 @@
1
+ import type { UILayer } from "../../layers/UILayer/UILayer";
2
+ import { UIColor } from "../../miscellaneous/color/UIColor";
3
+ import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
4
+ import { UIInsets } from "../../miscellaneous/insets/UIInsets";
5
+ import type { UIInsetsConfig } from "../../miscellaneous/insets/UIInsets.Internal";
6
+ import { UITextureView } from "../../miscellaneous/texture/UITextureView";
7
+ import type { UITextureConfig } from "../../miscellaneous/texture/UITextureView.Internal";
8
+ import { UIElement } from "../UIElement/UIElement";
9
+ import type { UINineSliceOptions } from "./UINineSlice.Internal";
10
+ import { UINineSliceRegionMode } from "./UINineSlice.Internal";
11
+ /** Scalable textured image preserving border regions */
12
+ export declare class UINineSlice extends UIElement {
13
+ /** Texture displayed by this element */
14
+ readonly texture: UITextureView;
15
+ private readonly colorInternal;
16
+ private readonly sliceBordersInternal;
17
+ private readonly sliceRegionsInternal;
18
+ private regionModeInternal;
19
+ private regionModeDirty;
20
+ private readonly textureTransform;
21
+ private readonly sliceBordersVector;
22
+ private readonly sliceRegionsVector;
23
+ private lastElementWidth;
24
+ private lastElementHeight;
25
+ private textureDimensionsDirty;
26
+ /**
27
+ * Creates a new UINineSlice instance.
28
+ *
29
+ * Defaults size to texture dimensions if width and height not provided.
30
+ *
31
+ * @param layer - Layer containing this element
32
+ * @param texture - Texture to display
33
+ * @param options - Configuration options
34
+ */
35
+ constructor(layer: UILayer, texture: UITextureConfig, options?: Partial<UINineSliceOptions>);
36
+ /** Multiplicative tint. Alpha channel controls opacity. */
37
+ get color(): UIColor;
38
+ /** Controls how sliceRegions values are interpreted */
39
+ get regionMode(): UINineSliceRegionMode;
40
+ /** Border size in normalized texture coordinates (0 to 1) */
41
+ get sliceBorders(): UIInsets;
42
+ /** Region size. Interpretation depends on regionMode. */
43
+ get sliceRegions(): UIInsets;
44
+ /** Multiplicative tint. Alpha channel controls opacity. */
45
+ set color(value: UIColorConfig);
46
+ /** Controls how sliceRegions values are interpreted */
47
+ set regionMode(value: UINineSliceRegionMode);
48
+ /** Border size in normalized texture coordinates (0 to 1) */
49
+ set sliceBorders(value: UIInsetsConfig);
50
+ /** Region size. Interpretation depends on regionMode. */
51
+ set sliceRegions(value: UIInsetsConfig);
52
+ /** Removes nine slice and frees resources */
53
+ destroy(): void;
54
+ protected setPlaneTransform(): void;
55
+ private calculateSliceBordersForShader;
56
+ private calculateSliceRegionsForShader;
57
+ private checkElementDimensionsDirty;
58
+ private setElementDimensionsDirtyFalse;
59
+ private readonly onTextureDimensionsChanged;
60
+ }