laymur 0.16.0 → 0.17.1

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 (266) hide show
  1. package/README.md +84 -208
  2. package/dist/core/constraints/UIAspectConstraint/UIAspectConstraint.js +41 -0
  3. package/dist/{constraints → core/constraints}/UIConstraint.d.ts +2 -2
  4. package/dist/core/constraints/UIConstraint.js +11 -0
  5. package/dist/core/constraints/UICustomConstraint.js +37 -0
  6. package/dist/core/constraints/UIHeightConstraint/UIHeightConstraint.js +34 -0
  7. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.js +3 -0
  8. package/dist/core/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.js +100 -0
  9. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.js +4 -0
  10. package/dist/core/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.js +136 -0
  11. package/dist/core/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.js +40 -0
  12. package/dist/core/constraints/UISingleParameterConstraint/UISingleParameterConstraint.js +71 -0
  13. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.js +3 -0
  14. package/dist/core/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.js +100 -0
  15. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.js +4 -0
  16. package/dist/core/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.js +136 -0
  17. package/dist/core/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.js +40 -0
  18. package/dist/core/constraints/UIWidthConstraint/UIWidthConstraint.js +34 -0
  19. package/dist/core/constraints/builders/UIConstraint2DBuilder.Internal.js +19 -0
  20. package/dist/core/constraints/builders/UIConstraint2DBuilder.js +138 -0
  21. package/dist/core/constraints/builders/UICoverConstraintBuilder.Internal.js +3 -0
  22. package/dist/core/constraints/builders/UICoverConstraintBuilder.js +63 -0
  23. package/dist/core/constraints/builders/UIFitConstraintBuilder.Internal.js +3 -0
  24. package/dist/core/constraints/builders/UIFitConstraintBuilder.js +63 -0
  25. package/dist/{elements → core/elements}/UIAnchor/UIAnchor.Internal.d.ts +3 -0
  26. package/dist/core/elements/UIAnchor/UIAnchor.Internal.js +5 -0
  27. package/dist/{elements → core/elements}/UIAnchor/UIAnchor.d.ts +3 -3
  28. package/dist/core/elements/UIAnchor/UIAnchor.js +49 -0
  29. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.Internal.js +15 -0
  30. package/dist/core/elements/UIAnimatedImage/UIAnimatedImage.js +259 -0
  31. package/dist/core/elements/UIDummy/UIDummy.Internal.js +8 -0
  32. package/dist/{elements → core/elements}/UIDummy/UIDummy.d.ts +2 -2
  33. package/dist/core/elements/UIDummy/UIDummy.js +173 -0
  34. package/dist/core/elements/UIElement/UIElement.Internal.js +5 -0
  35. package/dist/{elements → core/elements}/UIElement/UIElement.d.ts +2 -2
  36. package/dist/core/elements/UIElement/UIElement.js +74 -0
  37. package/dist/core/elements/UIGraphics/UIGraphics.Internal.js +7 -0
  38. package/dist/core/elements/UIGraphics/UIGraphics.js +126 -0
  39. package/dist/core/elements/UIImage/UIImage.js +85 -0
  40. package/dist/core/elements/UINineSlice/UINineSlice.Internal.js +12 -0
  41. package/dist/core/elements/UINineSlice/UINineSlice.js +188 -0
  42. package/dist/core/elements/UIProgress/UIProgress.Internal.js +3 -0
  43. package/dist/core/elements/UIProgress/UIProgress.js +165 -0
  44. package/dist/core/elements/UIScene/UIScene.Internal.js +27 -0
  45. package/dist/core/elements/UIScene/UIScene.js +157 -0
  46. package/dist/core/elements/UIText/UIText.Internal.js +12 -0
  47. package/dist/core/elements/UIText/UIText.Measuring.js +153 -0
  48. package/dist/core/elements/UIText/UIText.Rendering.js +61 -0
  49. package/dist/core/elements/UIText/UIText.js +265 -0
  50. package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.js +5 -0
  51. package/dist/core/layers/UIFullscreenLayer/UIFullscreenLayer.js +147 -0
  52. package/dist/core/layers/UILayer/UILayer.Internal.js +7 -0
  53. package/dist/core/layers/UILayer/UILayer.js +113 -0
  54. package/dist/core/miscellaneous/UIExpression.js +128 -0
  55. package/dist/core/miscellaneous/UIMode.js +30 -0
  56. package/dist/core/miscellaneous/UIOrientation.js +20 -0
  57. package/dist/core/miscellaneous/UIPriority.js +63 -0
  58. package/dist/core/miscellaneous/UIRelation.js +40 -0
  59. package/dist/core/miscellaneous/UITransparencyMode.js +12 -0
  60. package/dist/core/miscellaneous/area/UIArea.js +5 -0
  61. package/dist/core/miscellaneous/area/UIAreaCircle.js +32 -0
  62. package/dist/core/miscellaneous/area/UIAreaPolygon.js +40 -0
  63. package/dist/core/miscellaneous/area/UIAreaRectangle.js +36 -0
  64. package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.js +72 -0
  65. package/dist/core/miscellaneous/asserts.js +163 -0
  66. package/dist/core/miscellaneous/canvas.js +37 -0
  67. package/dist/core/miscellaneous/color/UIColor.Internal.js +42 -0
  68. package/dist/core/miscellaneous/color/UIColor.js +636 -0
  69. package/dist/core/miscellaneous/computeTransform.js +82 -0
  70. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.js +168 -0
  71. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.js +349 -0
  72. package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.js +357 -0
  73. package/dist/core/miscellaneous/generic-plane/shared.js +228 -0
  74. package/dist/core/miscellaneous/insets/UIInsets.Internal.js +3 -0
  75. package/dist/core/miscellaneous/insets/UIInsets.js +224 -0
  76. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.js +19 -0
  77. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.js +51 -0
  78. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.js +48 -0
  79. package/dist/{miscellaneous → core/miscellaneous}/math.d.ts +2 -0
  80. package/dist/core/miscellaneous/math.js +11 -0
  81. package/dist/core/miscellaneous/micro/UIMicro.Internal.js +15 -0
  82. package/dist/core/miscellaneous/micro/UIMicro.js +181 -0
  83. package/dist/core/miscellaneous/resize-policy/UIResizePolicy.js +9 -0
  84. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCover.js +50 -0
  85. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCross.js +52 -0
  86. package/dist/core/miscellaneous/resize-policy/UIResizePolicyCrossInverted.js +52 -0
  87. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFit.js +50 -0
  88. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedHeight.js +52 -0
  89. package/dist/core/miscellaneous/resize-policy/UIResizePolicyFixedWidth.js +52 -0
  90. package/dist/core/miscellaneous/resize-policy/UIResizePolicyNone.js +13 -0
  91. package/dist/core/miscellaneous/shared.js +37 -0
  92. package/dist/core/miscellaneous/text-span/UITextSpan.js +36 -0
  93. package/dist/core/miscellaneous/text-style/UITextStyle.Internal.js +17 -0
  94. package/dist/core/miscellaneous/text-style/UITextStyle.js +372 -0
  95. package/dist/core/miscellaneous/texture/UITextureView.Internal.js +6 -0
  96. package/dist/core/miscellaneous/texture/UITextureView.js +234 -0
  97. package/dist/core/miscellaneous/webglCapabilities.js +103 -0
  98. package/dist/core/shaders/UIImage.glsl.js +3 -0
  99. package/dist/core/shaders/UINineSlice.glsl.js +3 -0
  100. package/dist/core/shaders/UIProgress.glsl.js +3 -0
  101. package/dist/core/shaders/UIProgressMaskFunctionCircular.glsl.js +3 -0
  102. package/dist/core/shaders/UIProgressMaskFunctionDirectional.glsl.js +3 -0
  103. package/dist/{wrappers → core/wrappers}/UIInputWrapper/UIInputWrapper.Internal.d.ts +1 -1
  104. package/dist/{wrappers → core/wrappers}/UIInputWrapper/UIInputWrapper.d.ts +2 -2
  105. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.js +108 -0
  106. package/dist/{wrappers → core/wrappers}/UISceneWrapper/UISceneWrapper.Internal.d.ts +1 -1
  107. package/dist/{wrappers → core/wrappers}/UISceneWrapper/UISceneWrapper.d.ts +2 -2
  108. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.js +75 -0
  109. package/dist/{wrappers → core/wrappers}/UISolverWrapper/UISolverWrapper.Internal.d.ts +1 -1
  110. package/dist/{wrappers → core/wrappers}/UISolverWrapper/UISolverWrapper.d.ts +2 -2
  111. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.js +505 -0
  112. package/dist/index.js +51 -9246
  113. package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.d.ts +21 -0
  114. package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.js +47 -0
  115. package/dist/particles/behaviorModules/UIBehaviorModule.d.ts +14 -0
  116. package/dist/particles/behaviorModules/UIBehaviorModule.js +9 -0
  117. package/dist/particles/behaviorModules/UIBehaviorPointGravity.d.ts +39 -0
  118. package/dist/particles/behaviorModules/UIBehaviorPointGravity.js +110 -0
  119. package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.d.ts +22 -0
  120. package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.js +66 -0
  121. package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.d.ts +20 -0
  122. package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.js +48 -0
  123. package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.d.ts +26 -0
  124. package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.js +66 -0
  125. package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.d.ts +20 -0
  126. package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.js +49 -0
  127. package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.d.ts +26 -0
  128. package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.js +70 -0
  129. package/dist/particles/elements/UIEmitter.Internal.d.ts +15 -0
  130. package/dist/particles/elements/UIEmitter.Internal.js +11 -0
  131. package/dist/particles/elements/UIEmitter.d.ts +68 -0
  132. package/dist/particles/elements/UIEmitter.js +203 -0
  133. package/dist/particles/index.d.ts +18 -0
  134. package/dist/particles/index.js +18 -0
  135. package/dist/particles/instancedParticle/UIInstancedParticle.Internal.d.ts +13 -0
  136. package/dist/particles/instancedParticle/UIInstancedParticle.Internal.js +211 -0
  137. package/dist/particles/instancedParticle/UIInstancedParticle.d.ts +17 -0
  138. package/dist/particles/instancedParticle/UIInstancedParticle.js +93 -0
  139. package/dist/particles/miscellaneous/miscellaneous.d.ts +32 -0
  140. package/dist/particles/miscellaneous/miscellaneous.js +67 -0
  141. package/dist/particles/renderingModules/UIRenderingColorOverLife.d.ts +14 -0
  142. package/dist/particles/renderingModules/UIRenderingColorOverLife.js +32 -0
  143. package/dist/particles/renderingModules/UIRenderingColorOverVelocity.d.ts +15 -0
  144. package/dist/particles/renderingModules/UIRenderingColorOverVelocity.js +37 -0
  145. package/dist/particles/renderingModules/UIRenderingModule.d.ts +8 -0
  146. package/dist/particles/renderingModules/UIRenderingModule.js +9 -0
  147. package/dist/particles/renderingModules/UIRenderingTexture.d.ts +14 -0
  148. package/dist/particles/renderingModules/UIRenderingTexture.js +26 -0
  149. package/dist/particles/shaders/UIRenderingColorOverLife.glsl.js +3 -0
  150. package/dist/particles/shaders/UIRenderingColorOverVelocity.glsl.js +3 -0
  151. package/dist/particles/shaders/UIRenderingTexture.glsl.js +3 -0
  152. package/dist/particles/spawnModules/UISpawnModule.d.ts +9 -0
  153. package/dist/particles/spawnModules/UISpawnModule.js +9 -0
  154. package/dist/particles/spawnModules/UISpawnOffset.d.ts +21 -0
  155. package/dist/particles/spawnModules/UISpawnOffset.js +46 -0
  156. package/dist/particles/spawnModules/UISpawnRandomLifetime.d.ts +20 -0
  157. package/dist/particles/spawnModules/UISpawnRandomLifetime.js +47 -0
  158. package/dist/particles/spawnModules/UISpawnRandomRotation.d.ts +20 -0
  159. package/dist/particles/spawnModules/UISpawnRandomRotation.js +45 -0
  160. package/dist/particles/spawnModules/UISpawnRandomScale.d.ts +26 -0
  161. package/dist/particles/spawnModules/UISpawnRandomScale.js +60 -0
  162. package/dist/particles/spawnModules/UISpawnRandomTorque.d.ts +20 -0
  163. package/dist/particles/spawnModules/UISpawnRandomTorque.js +45 -0
  164. package/dist/particles/spawnModules/UISpawnRandomVelocity.d.ts +26 -0
  165. package/dist/particles/spawnModules/UISpawnRandomVelocity.js +64 -0
  166. package/dist/particles/spawnModules/UISpawnRectangle.d.ts +27 -0
  167. package/dist/particles/spawnModules/UISpawnRectangle.js +62 -0
  168. package/package.json +27 -36
  169. package/dist/index.js.map +0 -1
  170. package/dist/index.min.js +0 -2
  171. package/dist/index.min.js.map +0 -1
  172. /package/dist/{constraints → core/constraints}/UIAspectConstraint/UIAspectConstraint.Internal.d.ts +0 -0
  173. /package/dist/{constraints → core/constraints}/UIAspectConstraint/UIAspectConstraint.d.ts +0 -0
  174. /package/dist/{constraints → core/constraints}/UICustomConstraint.d.ts +0 -0
  175. /package/dist/{constraints → core/constraints}/UIHeightConstraint/UIHeightConstraint.Internal.d.ts +0 -0
  176. /package/dist/{constraints → core/constraints}/UIHeightConstraint/UIHeightConstraint.d.ts +0 -0
  177. /package/dist/{constraints → core/constraints}/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.d.ts +0 -0
  178. /package/dist/{constraints → core/constraints}/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.d.ts +0 -0
  179. /package/dist/{constraints → core/constraints}/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.d.ts +0 -0
  180. /package/dist/{constraints → core/constraints}/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.d.ts +0 -0
  181. /package/dist/{constraints → core/constraints}/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.d.ts +0 -0
  182. /package/dist/{constraints → core/constraints}/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.d.ts +0 -0
  183. /package/dist/{constraints → core/constraints}/UISingleParameterConstraint/UISingleParameterConstraint.Internal.d.ts +0 -0
  184. /package/dist/{constraints → core/constraints}/UISingleParameterConstraint/UISingleParameterConstraint.d.ts +0 -0
  185. /package/dist/{constraints → core/constraints}/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.d.ts +0 -0
  186. /package/dist/{constraints → core/constraints}/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.d.ts +0 -0
  187. /package/dist/{constraints → core/constraints}/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.d.ts +0 -0
  188. /package/dist/{constraints → core/constraints}/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.d.ts +0 -0
  189. /package/dist/{constraints → core/constraints}/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.d.ts +0 -0
  190. /package/dist/{constraints → core/constraints}/UIVerticalProportionConstraint/UIVerticalProportionConstraint.d.ts +0 -0
  191. /package/dist/{constraints → core/constraints}/UIWidthConstraint/UIWidthConstraint.Internal.d.ts +0 -0
  192. /package/dist/{constraints → core/constraints}/UIWidthConstraint/UIWidthConstraint.d.ts +0 -0
  193. /package/dist/{constraints → core/constraints}/builders/UIConstraint2DBuilder.Internal.d.ts +0 -0
  194. /package/dist/{constraints → core/constraints}/builders/UIConstraint2DBuilder.d.ts +0 -0
  195. /package/dist/{constraints → core/constraints}/builders/UICoverConstraintBuilder.Internal.d.ts +0 -0
  196. /package/dist/{constraints → core/constraints}/builders/UICoverConstraintBuilder.d.ts +0 -0
  197. /package/dist/{constraints → core/constraints}/builders/UIFitConstraintBuilder.Internal.d.ts +0 -0
  198. /package/dist/{constraints → core/constraints}/builders/UIFitConstraintBuilder.d.ts +0 -0
  199. /package/dist/{elements → core/elements}/UIAnimatedImage/UIAnimatedImage.Internal.d.ts +0 -0
  200. /package/dist/{elements → core/elements}/UIAnimatedImage/UIAnimatedImage.d.ts +0 -0
  201. /package/dist/{elements → core/elements}/UIDummy/UIDummy.Internal.d.ts +0 -0
  202. /package/dist/{elements → core/elements}/UIElement/UIElement.Internal.d.ts +0 -0
  203. /package/dist/{elements → core/elements}/UIGraphics/UIGraphics.Internal.d.ts +0 -0
  204. /package/dist/{elements → core/elements}/UIGraphics/UIGraphics.d.ts +0 -0
  205. /package/dist/{elements → core/elements}/UIImage/UIImage.Internal.d.ts +0 -0
  206. /package/dist/{elements → core/elements}/UIImage/UIImage.d.ts +0 -0
  207. /package/dist/{elements → core/elements}/UINineSlice/UINineSlice.Internal.d.ts +0 -0
  208. /package/dist/{elements → core/elements}/UINineSlice/UINineSlice.d.ts +0 -0
  209. /package/dist/{elements → core/elements}/UIProgress/UIProgress.Internal.d.ts +0 -0
  210. /package/dist/{elements → core/elements}/UIProgress/UIProgress.d.ts +0 -0
  211. /package/dist/{elements → core/elements}/UIScene/UIScene.Internal.d.ts +0 -0
  212. /package/dist/{elements → core/elements}/UIScene/UIScene.d.ts +0 -0
  213. /package/dist/{elements → core/elements}/UIText/UIText.Interfaces.d.ts +0 -0
  214. /package/dist/{elements → core/elements}/UIText/UIText.Internal.d.ts +0 -0
  215. /package/dist/{elements → core/elements}/UIText/UIText.Measuring.d.ts +0 -0
  216. /package/dist/{elements → core/elements}/UIText/UIText.Rendering.d.ts +0 -0
  217. /package/dist/{elements → core/elements}/UIText/UIText.d.ts +0 -0
  218. /package/dist/{index.d.ts → core/index.d.ts} +0 -0
  219. /package/dist/{layers → core/layers}/UIFullscreenLayer/UIFullscreenLayer.Internal.d.ts +0 -0
  220. /package/dist/{layers → core/layers}/UIFullscreenLayer/UIFullscreenLayer.d.ts +0 -0
  221. /package/dist/{layers → core/layers}/UILayer/UILayer.Internal.d.ts +0 -0
  222. /package/dist/{layers → core/layers}/UILayer/UILayer.d.ts +0 -0
  223. /package/dist/{miscellaneous → core/miscellaneous}/UIExpression.d.ts +0 -0
  224. /package/dist/{miscellaneous → core/miscellaneous}/UIMode.d.ts +0 -0
  225. /package/dist/{miscellaneous → core/miscellaneous}/UIOrientation.d.ts +0 -0
  226. /package/dist/{miscellaneous → core/miscellaneous}/UIPriority.d.ts +0 -0
  227. /package/dist/{miscellaneous → core/miscellaneous}/UIRelation.d.ts +0 -0
  228. /package/dist/{miscellaneous → core/miscellaneous}/UITransparencyMode.d.ts +0 -0
  229. /package/dist/{miscellaneous → core/miscellaneous}/area/UIArea.d.ts +0 -0
  230. /package/dist/{miscellaneous → core/miscellaneous}/area/UIAreaCircle.d.ts +0 -0
  231. /package/dist/{miscellaneous → core/miscellaneous}/area/UIAreaPolygon.d.ts +0 -0
  232. /package/dist/{miscellaneous → core/miscellaneous}/area/UIAreaRectangle.d.ts +0 -0
  233. /package/dist/{miscellaneous → core/miscellaneous}/area/UIAreaRoundedRectangle.d.ts +0 -0
  234. /package/dist/{miscellaneous → core/miscellaneous}/asserts.d.ts +0 -0
  235. /package/dist/{miscellaneous → core/miscellaneous}/canvas.d.ts +0 -0
  236. /package/dist/{miscellaneous → core/miscellaneous}/color/UIColor.Internal.d.ts +0 -0
  237. /package/dist/{miscellaneous → core/miscellaneous}/color/UIColor.d.ts +0 -0
  238. /package/dist/{miscellaneous → core/miscellaneous}/computeTransform.d.ts +0 -0
  239. /package/dist/{miscellaneous → core/miscellaneous}/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.d.ts +0 -0
  240. /package/dist/{miscellaneous → core/miscellaneous}/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.d.ts +0 -0
  241. /package/dist/{miscellaneous → core/miscellaneous}/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.d.ts +0 -0
  242. /package/dist/{miscellaneous → core/miscellaneous}/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.d.ts +0 -0
  243. /package/dist/{miscellaneous → core/miscellaneous}/generic-plane/shared.d.ts +0 -0
  244. /package/dist/{miscellaneous → core/miscellaneous}/insets/UIInsets.Internal.d.ts +0 -0
  245. /package/dist/{miscellaneous → core/miscellaneous}/insets/UIInsets.d.ts +0 -0
  246. /package/dist/{miscellaneous → core/miscellaneous}/mask-function/UIProgressMaskFunction.d.ts +0 -0
  247. /package/dist/{miscellaneous → core/miscellaneous}/mask-function/UIProgressMaskFunctionCircular.d.ts +0 -0
  248. /package/dist/{miscellaneous → core/miscellaneous}/mask-function/UIProgressMaskFunctionDirectional.d.ts +0 -0
  249. /package/dist/{miscellaneous → core/miscellaneous}/micro/UIMicro.Internal.d.ts +0 -0
  250. /package/dist/{miscellaneous → core/miscellaneous}/micro/UIMicro.d.ts +0 -0
  251. /package/dist/{miscellaneous → core/miscellaneous}/resize-policy/UIResizePolicy.d.ts +0 -0
  252. /package/dist/{miscellaneous → core/miscellaneous}/resize-policy/UIResizePolicyCover.d.ts +0 -0
  253. /package/dist/{miscellaneous → core/miscellaneous}/resize-policy/UIResizePolicyCross.d.ts +0 -0
  254. /package/dist/{miscellaneous → core/miscellaneous}/resize-policy/UIResizePolicyCrossInverted.d.ts +0 -0
  255. /package/dist/{miscellaneous → core/miscellaneous}/resize-policy/UIResizePolicyFit.d.ts +0 -0
  256. /package/dist/{miscellaneous → core/miscellaneous}/resize-policy/UIResizePolicyFixedHeight.d.ts +0 -0
  257. /package/dist/{miscellaneous → core/miscellaneous}/resize-policy/UIResizePolicyFixedWidth.d.ts +0 -0
  258. /package/dist/{miscellaneous → core/miscellaneous}/resize-policy/UIResizePolicyNone.d.ts +0 -0
  259. /package/dist/{miscellaneous → core/miscellaneous}/shared.d.ts +0 -0
  260. /package/dist/{miscellaneous → core/miscellaneous}/text-span/UITextSpan.Internal.d.ts +0 -0
  261. /package/dist/{miscellaneous → core/miscellaneous}/text-span/UITextSpan.d.ts +0 -0
  262. /package/dist/{miscellaneous → core/miscellaneous}/text-style/UITextStyle.Internal.d.ts +0 -0
  263. /package/dist/{miscellaneous → core/miscellaneous}/text-style/UITextStyle.d.ts +0 -0
  264. /package/dist/{miscellaneous → core/miscellaneous}/texture/UITextureView.Internal.d.ts +0 -0
  265. /package/dist/{miscellaneous → core/miscellaneous}/texture/UITextureView.d.ts +0 -0
  266. /package/dist/{miscellaneous → core/miscellaneous}/webglCapabilities.d.ts +0 -0
@@ -0,0 +1,224 @@
1
+ import { Vector4 } from 'three';
2
+ import { assertValidNonNegativeNumber } from '../asserts.js';
3
+ import { INSETS_DEFAULT_VALUE } from './UIInsets.Internal.js';
4
+
5
+ /** Insets values for four sides */
6
+ class UIInsets {
7
+ /**
8
+ * Creates UIInsets instance.
9
+ *
10
+ * @param config - Insets configuration
11
+ */
12
+ constructor(config) {
13
+ this._private_lInternal = INSETS_DEFAULT_VALUE;
14
+ this._private_rInternal = INSETS_DEFAULT_VALUE;
15
+ this._private_tInternal = INSETS_DEFAULT_VALUE;
16
+ this._private_bInternal = INSETS_DEFAULT_VALUE;
17
+ this._private_dirtyInternal = false;
18
+ this.set(config);
19
+ }
20
+ /** Left inset */
21
+ get left() {
22
+ return this._private_lInternal;
23
+ }
24
+ /** Right inset */
25
+ get right() {
26
+ return this._private_rInternal;
27
+ }
28
+ /** Top inset */
29
+ get top() {
30
+ return this._private_tInternal;
31
+ }
32
+ /** Bottom inset */
33
+ get bottom() {
34
+ return this._private_bInternal;
35
+ }
36
+ /** @internal */
37
+ get dirty() {
38
+ return this._private_dirtyInternal;
39
+ }
40
+ /** Left inset */
41
+ set left(value) {
42
+ assertValidNonNegativeNumber(value, "UIInsets.left");
43
+ if (this._private_lInternal !== value) {
44
+ this._private_lInternal = value;
45
+ this._private_dirtyInternal = true;
46
+ }
47
+ }
48
+ /** Right inset */
49
+ set right(value) {
50
+ assertValidNonNegativeNumber(value, "UIInsets.right");
51
+ if (this._private_rInternal !== value) {
52
+ this._private_rInternal = value;
53
+ this._private_dirtyInternal = true;
54
+ }
55
+ }
56
+ /** Top inset */
57
+ set top(value) {
58
+ assertValidNonNegativeNumber(value, "UIInsets.top");
59
+ if (this._private_tInternal !== value) {
60
+ this._private_tInternal = value;
61
+ this._private_dirtyInternal = true;
62
+ }
63
+ }
64
+ /** Bottom inset */
65
+ set bottom(value) {
66
+ assertValidNonNegativeNumber(value, "UIInsets.bottom");
67
+ if (this._private_bInternal !== value) {
68
+ this._private_bInternal = value;
69
+ this._private_dirtyInternal = true;
70
+ }
71
+ }
72
+ /** Sets left and right to same value */
73
+ setHorizontal(value) {
74
+ assertValidNonNegativeNumber(value, "UIInsets.setHorizontal.value");
75
+ if (this._private_lInternal !== value || this._private_rInternal !== value) {
76
+ this._private_lInternal = value;
77
+ this._private_rInternal = value;
78
+ this._private_dirtyInternal = true;
79
+ }
80
+ }
81
+ /** Sets top and bottom to same value */
82
+ setVertical(value) {
83
+ assertValidNonNegativeNumber(value, "UIInsets.setVertical.value");
84
+ if (this._private_tInternal !== value || this._private_bInternal !== value) {
85
+ this._private_tInternal = value;
86
+ this._private_bInternal = value;
87
+ this._private_dirtyInternal = true;
88
+ }
89
+ }
90
+ /** Sets all sides to same value */
91
+ setUnified(value) {
92
+ assertValidNonNegativeNumber(value, "UIInsets.setUnified.value");
93
+ if (this._private_lInternal !== value ||
94
+ this._private_rInternal !== value ||
95
+ this._private_tInternal !== value ||
96
+ this._private_bInternal !== value) {
97
+ this._private_lInternal = value;
98
+ this._private_rInternal = value;
99
+ this._private_tInternal = value;
100
+ this._private_bInternal = value;
101
+ this._private_dirtyInternal = true;
102
+ }
103
+ }
104
+ /** Sets insets */
105
+ set(config) {
106
+ const lOld = this._private_lInternal;
107
+ const rOld = this._private_rInternal;
108
+ const tOld = this._private_tInternal;
109
+ const bOld = this._private_bInternal;
110
+ if (config === undefined) {
111
+ this._private_lInternal = INSETS_DEFAULT_VALUE;
112
+ this._private_rInternal = INSETS_DEFAULT_VALUE;
113
+ this._private_tInternal = INSETS_DEFAULT_VALUE;
114
+ this._private_bInternal = INSETS_DEFAULT_VALUE;
115
+ }
116
+ else if (typeof config === "number") {
117
+ assertValidNonNegativeNumber(config, "UIInsets.set.config");
118
+ this._private_lInternal = config;
119
+ this._private_rInternal = config;
120
+ this._private_tInternal = config;
121
+ this._private_bInternal = config;
122
+ }
123
+ else if (Array.isArray(config)) {
124
+ if (config.length === 2) {
125
+ const horizontal = config[0];
126
+ const vertical = config[1];
127
+ assertValidNonNegativeNumber(horizontal, "UIInsets.set.config[0]");
128
+ assertValidNonNegativeNumber(vertical, "UIInsets.set.config[1]");
129
+ this._private_lInternal = horizontal;
130
+ this._private_rInternal = horizontal;
131
+ this._private_tInternal = vertical;
132
+ this._private_bInternal = vertical;
133
+ }
134
+ else {
135
+ const left = config[0];
136
+ const right = config[1];
137
+ const top = config[2];
138
+ const bottom = config[3];
139
+ assertValidNonNegativeNumber(left, "UIInsets.set.config[0]");
140
+ assertValidNonNegativeNumber(right, "UIInsets.set.config[1]");
141
+ assertValidNonNegativeNumber(top, "UIInsets.set.config[2]");
142
+ assertValidNonNegativeNumber(bottom, "UIInsets.set.config[3]");
143
+ this._private_lInternal = left;
144
+ this._private_rInternal = right;
145
+ this._private_tInternal = top;
146
+ this._private_bInternal = bottom;
147
+ }
148
+ }
149
+ else if ("left" in config) {
150
+ const left = config.left;
151
+ const right = config.right;
152
+ const top = config.top;
153
+ const bottom = config.bottom;
154
+ assertValidNonNegativeNumber(left, "UIInsets.set.config.left");
155
+ assertValidNonNegativeNumber(right, "UIInsets.set.config.right");
156
+ assertValidNonNegativeNumber(top, "UIInsets.set.config.top");
157
+ assertValidNonNegativeNumber(bottom, "UIInsets.set.config.bottom");
158
+ this._private_lInternal = left;
159
+ this._private_rInternal = right;
160
+ this._private_tInternal = top;
161
+ this._private_bInternal = bottom;
162
+ }
163
+ else {
164
+ const horizontal = config.horizontal;
165
+ const vertical = config.vertical;
166
+ assertValidNonNegativeNumber(horizontal, "UIInsets.set.config.horizontal");
167
+ assertValidNonNegativeNumber(vertical, "UIInsets.set.config.vertical");
168
+ this._private_lInternal = horizontal;
169
+ this._private_rInternal = horizontal;
170
+ this._private_tInternal = vertical;
171
+ this._private_bInternal = vertical;
172
+ }
173
+ if (this._private_lInternal !== lOld ||
174
+ this._private_rInternal !== rOld ||
175
+ this._private_tInternal !== tOld ||
176
+ this._private_bInternal !== bOld) {
177
+ this._private_dirtyInternal = true;
178
+ }
179
+ }
180
+ /** Sets from Vector4 (x=left, y=right, z=top, w=bottom) */
181
+ setVector4(vector) {
182
+ assertValidNonNegativeNumber(vector.x, "UIInsets.setVector4.vector.x");
183
+ assertValidNonNegativeNumber(vector.y, "UIInsets.setVector4.vector.y");
184
+ assertValidNonNegativeNumber(vector.z, "UIInsets.setVector4.vector.z");
185
+ assertValidNonNegativeNumber(vector.w, "UIInsets.setVector4.vector.w");
186
+ if (this._private_lInternal !== vector.x ||
187
+ this._private_rInternal !== vector.y ||
188
+ this._private_tInternal !== vector.z ||
189
+ this._private_bInternal !== vector.w) {
190
+ this._private_lInternal = vector.x;
191
+ this._private_rInternal = vector.y;
192
+ this._private_tInternal = vector.z;
193
+ this._private_bInternal = vector.w;
194
+ this._private_dirtyInternal = true;
195
+ }
196
+ }
197
+ /** Converts to Vector4 (left, right, top, bottom) */
198
+ toVector4(result = new Vector4()) {
199
+ return result.set(this._private_lInternal, this._private_rInternal, this._private_tInternal, this._private_bInternal);
200
+ }
201
+ /** Resets all sides to 0 */
202
+ reset() {
203
+ this.setUnified(0);
204
+ }
205
+ /** Copies from another instance */
206
+ copy(other) {
207
+ if (this._private_lInternal !== other._private_lInternal ||
208
+ this._private_rInternal !== other._private_rInternal ||
209
+ this._private_tInternal !== other._private_tInternal ||
210
+ this._private_bInternal !== other._private_bInternal) {
211
+ this._private_lInternal = other._private_lInternal;
212
+ this._private_rInternal = other._private_rInternal;
213
+ this._private_tInternal = other._private_tInternal;
214
+ this._private_bInternal = other._private_bInternal;
215
+ this._private_dirtyInternal = true;
216
+ }
217
+ }
218
+ /** @internal */
219
+ setDirtyFalse() {
220
+ this._private_dirtyInternal = false;
221
+ }
222
+ }
223
+
224
+ export { UIInsets };
@@ -0,0 +1,19 @@
1
+ /** Base class for progress bar fill functions */
2
+ class UIProgressMaskFunction {
3
+ constructor(
4
+ /** GLSL shader source code defining fill behavior */
5
+ source) {
6
+ this.source = source;
7
+ this.dirtyInternal = false;
8
+ }
9
+ /** @internal */
10
+ get dirty() {
11
+ return this.dirtyInternal;
12
+ }
13
+ /** @internal */
14
+ setDirtyFalse() {
15
+ this.dirtyInternal = false;
16
+ }
17
+ }
18
+
19
+ export { UIProgressMaskFunction };
@@ -0,0 +1,51 @@
1
+ import source from '../../shaders/UIProgressMaskFunctionCircular.glsl.js';
2
+ import { assertValidNumber } from '../asserts.js';
3
+ import { UIProgressMaskFunction } from './UIProgressMaskFunction.js';
4
+
5
+ /** Circular radial progress fill */
6
+ class UIProgressMaskFunctionCircular extends UIProgressMaskFunction {
7
+ /**
8
+ * Creates circular mask function.
9
+ *
10
+ * @param startAngle - Starting angle in radians
11
+ * @param inverseDirection - Whether to fill counter-clockwise
12
+ */
13
+ constructor(startAngle = 0, inverseDirection = false) {
14
+ assertValidNumber(startAngle, "UIProgressMaskFunctionCircular.constructor.startAngle");
15
+ super(source);
16
+ this._private_startAngleInternal = startAngle;
17
+ this._private_inverseDirectionInternal = inverseDirection;
18
+ }
19
+ /** Starting angle in radians */
20
+ get startAngle() {
21
+ return this._private_startAngleInternal;
22
+ }
23
+ /** Whether fill is counter-clockwise */
24
+ get inverseDirection() {
25
+ return this._private_inverseDirectionInternal;
26
+ }
27
+ /** Starting angle in radians */
28
+ set startAngle(value) {
29
+ assertValidNumber(value, "UIProgressMaskFunctionCircular.startAngle");
30
+ if (this._private_startAngleInternal !== value) {
31
+ this._private_startAngleInternal = value;
32
+ this.dirtyInternal = true;
33
+ }
34
+ }
35
+ /** Whether fill is counter-clockwise */
36
+ set inverseDirection(value) {
37
+ if (this._private_inverseDirectionInternal !== value) {
38
+ this._private_inverseDirectionInternal = value;
39
+ this.dirtyInternal = true;
40
+ }
41
+ }
42
+ /** @internal */
43
+ enumerateProperties() {
44
+ return {
45
+ direction: this._private_inverseDirectionInternal ? -1 : 1,
46
+ startAngle: this._private_startAngleInternal,
47
+ };
48
+ }
49
+ }
50
+
51
+ export { UIProgressMaskFunctionCircular };
@@ -0,0 +1,48 @@
1
+ import { Vector2 } from 'three';
2
+ import source from '../../shaders/UIProgressMaskFunctionDirectional.glsl.js';
3
+ import { EPSILON } from '../math.js';
4
+ import { UIProgressMaskFunction } from './UIProgressMaskFunction.js';
5
+
6
+ /** Linear directional progress fill */
7
+ class UIProgressMaskFunctionDirectional extends UIProgressMaskFunction {
8
+ /**
9
+ * Creates directional mask function.
10
+ *
11
+ * @param direction - Fill direction vector. Automatically normalized.
12
+ */
13
+ constructor(direction = { x: 1, y: 0 }) {
14
+ super(source);
15
+ /** Fill direction as normalized vector */
16
+ this.direction = new Vector2();
17
+ this._private_cachedDirection = new Vector2();
18
+ this.direction.set(direction.x, direction.y).normalize();
19
+ this._private_cachedDirection.copy(this.direction);
20
+ }
21
+ /** @internal */
22
+ get dirty() {
23
+ this._private_ensureDirectionNormalized();
24
+ return this.dirtyInternal || !this._private_cachedDirection.equals(this.direction);
25
+ }
26
+ /** @internal */
27
+ setDirtyFalse() {
28
+ this._private_ensureDirectionNormalized();
29
+ this._private_cachedDirection.copy(this.direction);
30
+ super.setDirtyFalse();
31
+ }
32
+ /** @internal */
33
+ enumerateProperties() {
34
+ this._private_ensureDirectionNormalized();
35
+ return { direction: this.direction };
36
+ }
37
+ _private_ensureDirectionNormalized() {
38
+ const squaredLength = this.direction.lengthSq();
39
+ if (Math.abs(squaredLength) <= EPSILON) {
40
+ this.direction.set(1, 0);
41
+ }
42
+ else if (Math.abs(squaredLength - 1) > EPSILON) {
43
+ this.direction.divideScalar(squaredLength);
44
+ }
45
+ }
46
+ }
47
+
48
+ export { UIProgressMaskFunctionDirectional };
@@ -3,3 +3,5 @@ export interface Vector2Like {
3
3
  readonly x: number;
4
4
  readonly y: number;
5
5
  }
6
+ export declare function srgbToLinear(color: number): number;
7
+ export declare function linearToSRGB(color: number): number;
@@ -0,0 +1,11 @@
1
+ const EPSILON = 1e-6;
2
+ function srgbToLinear(color) {
3
+ return color < 0.04045
4
+ ? color * 0.0773993808
5
+ : Math.pow(color * 0.9478672986 + 0.0521327014, 2.4);
6
+ }
7
+ function linearToSRGB(color) {
8
+ return color < 0.0031308 ? color * 12.92 : 1.055 * Math.pow(color, 0.41666) - 0.055;
9
+ }
10
+
11
+ export { EPSILON, linearToSRGB, srgbToLinear };
@@ -0,0 +1,15 @@
1
+ /** Controls which transforms apply relative to anchor */
2
+ var UIMicroAnchorMode;
3
+ (function (UIMicroAnchorMode) {
4
+ /** Apply rotation and scale around anchor point */
5
+ UIMicroAnchorMode[UIMicroAnchorMode["ROTATION_SCALE"] = 0] = "ROTATION_SCALE";
6
+ /** Apply position, rotation, and scale around anchor point */
7
+ UIMicroAnchorMode[UIMicroAnchorMode["POSITION_ROTATION_SCALE"] = 1] = "POSITION_ROTATION_SCALE";
8
+ })(UIMicroAnchorMode || (UIMicroAnchorMode = {}));
9
+ const MICRO_DEFAULT_POSITION = 0;
10
+ const MICRO_DEFAULT_ANCHOR = 0.5;
11
+ const MICRO_DEFAULT_SCALE = 1;
12
+ const MICRO_DEFAULT_ROTATION = 0;
13
+ const MICRO_DEFAULT_ANCHOR_MODE = UIMicroAnchorMode.ROTATION_SCALE;
14
+
15
+ export { MICRO_DEFAULT_ANCHOR, MICRO_DEFAULT_ANCHOR_MODE, MICRO_DEFAULT_POSITION, MICRO_DEFAULT_ROTATION, MICRO_DEFAULT_SCALE, UIMicroAnchorMode };
@@ -0,0 +1,181 @@
1
+ import { MathUtils } from 'three';
2
+ import { assertValidNumber } from '../asserts.js';
3
+ import { MICRO_DEFAULT_POSITION, MICRO_DEFAULT_ANCHOR, MICRO_DEFAULT_SCALE, MICRO_DEFAULT_ROTATION, MICRO_DEFAULT_ANCHOR_MODE } from './UIMicro.Internal.js';
4
+
5
+ /** Transforms that don't affect constraints */
6
+ class UIMicro {
7
+ /**
8
+ * Creates UIMicro instance.
9
+ *
10
+ * @param config - Transform configuration
11
+ */
12
+ constructor(config) {
13
+ this._private_dirtyInternal = true;
14
+ this._private_xInternal = config?.x ?? MICRO_DEFAULT_POSITION;
15
+ this._private_yInternal = config?.y ?? MICRO_DEFAULT_POSITION;
16
+ this._private_anchorXInternal = config?.anchorX ?? MICRO_DEFAULT_ANCHOR;
17
+ this._private_anchorYInternal = config?.anchorY ?? MICRO_DEFAULT_ANCHOR;
18
+ this._private_scaleXInternal = config?.scaleX ?? MICRO_DEFAULT_SCALE;
19
+ this._private_scaleYInternal = config?.scaleY ?? MICRO_DEFAULT_SCALE;
20
+ this._private_rotationInternal = config?.rotation ?? MICRO_DEFAULT_ROTATION;
21
+ this._private_anchorModeInternal = config?.anchorMode ?? MICRO_DEFAULT_ANCHOR_MODE;
22
+ }
23
+ /** X offset in world units */
24
+ get x() {
25
+ return this._private_xInternal;
26
+ }
27
+ /** Y offset in world units */
28
+ get y() {
29
+ return this._private_yInternal;
30
+ }
31
+ /** X anchor in normalized coordinates (0 to 1) */
32
+ get anchorX() {
33
+ return this._private_anchorXInternal;
34
+ }
35
+ /** Y anchor in normalized coordinates (0 to 1) */
36
+ get anchorY() {
37
+ return this._private_anchorYInternal;
38
+ }
39
+ /** X scale multiplier */
40
+ get scaleX() {
41
+ return this._private_scaleXInternal;
42
+ }
43
+ /** Y scale multiplier */
44
+ get scaleY() {
45
+ return this._private_scaleYInternal;
46
+ }
47
+ /** Rotation in degrees */
48
+ get angle() {
49
+ return MathUtils.radToDeg(this._private_rotationInternal);
50
+ }
51
+ /** Which transforms apply relative to anchor */
52
+ get anchorMode() {
53
+ return this._private_anchorModeInternal;
54
+ }
55
+ /** Rotation in radians */
56
+ get rotation() {
57
+ return this._private_rotationInternal;
58
+ }
59
+ /** @internal */
60
+ get dirty() {
61
+ return this._private_dirtyInternal;
62
+ }
63
+ /** X offset in world units */
64
+ set x(value) {
65
+ assertValidNumber(value, "UIMicro.x");
66
+ if (value !== this._private_xInternal) {
67
+ this._private_xInternal = value;
68
+ this._private_dirtyInternal = true;
69
+ }
70
+ }
71
+ /** Y offset in world units */
72
+ set y(value) {
73
+ assertValidNumber(value, "UIMicro.y");
74
+ if (value !== this._private_yInternal) {
75
+ this._private_yInternal = value;
76
+ this._private_dirtyInternal = true;
77
+ }
78
+ }
79
+ /** X anchor in normalized coordinates (0 to 1) */
80
+ set anchorX(value) {
81
+ assertValidNumber(value, "UIMicro.anchorX");
82
+ if (value !== this._private_anchorXInternal) {
83
+ this._private_anchorXInternal = value;
84
+ this._private_dirtyInternal = true;
85
+ }
86
+ }
87
+ /** Y anchor in normalized coordinates (0 to 1) */
88
+ set anchorY(value) {
89
+ assertValidNumber(value, "UIMicro.anchorY");
90
+ if (value !== this._private_anchorYInternal) {
91
+ this._private_anchorYInternal = value;
92
+ this._private_dirtyInternal = true;
93
+ }
94
+ }
95
+ /** X scale multiplier */
96
+ set scaleX(value) {
97
+ assertValidNumber(value, "UIMicro.scaleX");
98
+ if (value !== this._private_scaleXInternal) {
99
+ this._private_scaleXInternal = value;
100
+ this._private_dirtyInternal = true;
101
+ }
102
+ }
103
+ /** Y scale multiplier */
104
+ set scaleY(value) {
105
+ assertValidNumber(value, "UIMicro.scaleY");
106
+ if (value !== this._private_scaleYInternal) {
107
+ this._private_scaleYInternal = value;
108
+ this._private_dirtyInternal = true;
109
+ }
110
+ }
111
+ /** Rotation in degrees */
112
+ set angle(value) {
113
+ assertValidNumber(value, "UIMicro.angle");
114
+ const rotation = MathUtils.degToRad(value);
115
+ if (rotation !== this._private_rotationInternal) {
116
+ this._private_rotationInternal = rotation;
117
+ this._private_dirtyInternal = true;
118
+ }
119
+ }
120
+ /** Rotation in radians */
121
+ set rotation(value) {
122
+ assertValidNumber(value, "UIMicro.rotation");
123
+ if (value !== this._private_rotationInternal) {
124
+ this._private_rotationInternal = value;
125
+ this._private_dirtyInternal = true;
126
+ }
127
+ }
128
+ /** Which transforms apply relative to anchor */
129
+ set anchorMode(value) {
130
+ if (value !== this._private_anchorModeInternal) {
131
+ this._private_anchorModeInternal = value;
132
+ this._private_dirtyInternal = true;
133
+ }
134
+ }
135
+ /** @internal */
136
+ setDirtyFalse() {
137
+ this._private_dirtyInternal = false;
138
+ }
139
+ /** Resets all transforms to defaults */
140
+ reset() {
141
+ if (this._private_xInternal !== MICRO_DEFAULT_POSITION ||
142
+ this._private_yInternal !== MICRO_DEFAULT_POSITION ||
143
+ this._private_anchorXInternal !== MICRO_DEFAULT_ANCHOR ||
144
+ this._private_anchorYInternal !== MICRO_DEFAULT_ANCHOR ||
145
+ this._private_scaleXInternal !== MICRO_DEFAULT_SCALE ||
146
+ this._private_scaleYInternal !== MICRO_DEFAULT_SCALE ||
147
+ this._private_rotationInternal !== MICRO_DEFAULT_ROTATION) {
148
+ this._private_xInternal = MICRO_DEFAULT_POSITION;
149
+ this._private_yInternal = MICRO_DEFAULT_POSITION;
150
+ this._private_anchorXInternal = MICRO_DEFAULT_ANCHOR;
151
+ this._private_anchorYInternal = MICRO_DEFAULT_ANCHOR;
152
+ this._private_scaleXInternal = MICRO_DEFAULT_SCALE;
153
+ this._private_scaleYInternal = MICRO_DEFAULT_SCALE;
154
+ this._private_rotationInternal = MICRO_DEFAULT_ROTATION;
155
+ this._private_dirtyInternal = true;
156
+ }
157
+ }
158
+ /** Copies transforms from another instance */
159
+ copy(value) {
160
+ if (this._private_xInternal !== value._private_xInternal ||
161
+ this._private_yInternal !== value._private_yInternal ||
162
+ this._private_anchorXInternal !== value._private_anchorXInternal ||
163
+ this._private_anchorYInternal !== value._private_anchorYInternal ||
164
+ this._private_scaleXInternal !== value._private_scaleXInternal ||
165
+ this._private_scaleYInternal !== value._private_scaleYInternal ||
166
+ this._private_rotationInternal !== value._private_rotationInternal ||
167
+ this._private_anchorModeInternal !== value._private_anchorModeInternal) {
168
+ this._private_xInternal = value._private_xInternal;
169
+ this._private_yInternal = value._private_yInternal;
170
+ this._private_anchorXInternal = value._private_anchorXInternal;
171
+ this._private_anchorYInternal = value._private_anchorYInternal;
172
+ this._private_scaleXInternal = value._private_scaleXInternal;
173
+ this._private_scaleYInternal = value._private_scaleYInternal;
174
+ this._private_rotationInternal = value._private_rotationInternal;
175
+ this._private_anchorModeInternal = value._private_anchorModeInternal;
176
+ this._private_dirtyInternal = true;
177
+ }
178
+ }
179
+ }
180
+
181
+ export { UIMicro };
@@ -0,0 +1,9 @@
1
+ /** Base class for viewport resize policies */
2
+ class UIResizePolicy {
3
+ constructor() {
4
+ /** @internal */
5
+ this.dirty = false;
6
+ }
7
+ }
8
+
9
+ export { UIResizePolicy };
@@ -0,0 +1,50 @@
1
+ import { assertValidPositiveNumber } from '../asserts.js';
2
+ import { UIResizePolicy } from './UIResizePolicy.js';
3
+
4
+ /** Scales area to cover rect preserving proportions */
5
+ class UIResizePolicyCover extends UIResizePolicy {
6
+ /**
7
+ * Creates cover resize policy.
8
+ *
9
+ * @param rectWidth - Target rect width
10
+ * @param rectHeight - Target rect height
11
+ */
12
+ constructor(rectWidth, rectHeight) {
13
+ super();
14
+ assertValidPositiveNumber(rectWidth, "UIResizePolicyCover.constructor.rectWidth");
15
+ assertValidPositiveNumber(rectHeight, "UIResizePolicyCover.constructor.rectHeight");
16
+ this._private_rectWidthInternal = rectWidth;
17
+ this._private_rectHeightInternal = rectHeight;
18
+ }
19
+ /** Target rect width */
20
+ get rectWidth() {
21
+ return this._private_rectWidthInternal;
22
+ }
23
+ /** Target rect height */
24
+ get rectHeight() {
25
+ return this._private_rectHeightInternal;
26
+ }
27
+ /** Target rect width */
28
+ set rectWidth(value) {
29
+ assertValidPositiveNumber(value, "UIResizePolicyCover.rectWidth");
30
+ if (value !== this._private_rectWidthInternal) {
31
+ this._private_rectWidthInternal = value;
32
+ this.dirty = true;
33
+ }
34
+ }
35
+ /** Target rect height */
36
+ set rectHeight(value) {
37
+ assertValidPositiveNumber(value, "UIResizePolicyCover.rectHeight");
38
+ if (value !== this._private_rectHeightInternal) {
39
+ this._private_rectHeightInternal = value;
40
+ this.dirty = true;
41
+ }
42
+ }
43
+ calculateScale(width, height) {
44
+ assertValidPositiveNumber(width, "UIResizePolicyCover.calculateScale.width");
45
+ assertValidPositiveNumber(height, "UIResizePolicyCover.calculateScale.height");
46
+ return Math.min(this._private_rectWidthInternal / width, this._private_rectHeightInternal / height);
47
+ }
48
+ }
49
+
50
+ export { UIResizePolicyCover };
@@ -0,0 +1,52 @@
1
+ import { assertValidPositiveNumber } from '../asserts.js';
2
+ import { UIResizePolicy } from './UIResizePolicy.js';
3
+
4
+ /** Scales by width in landscape, by height in portrait */
5
+ class UIResizePolicyCross extends UIResizePolicy {
6
+ /**
7
+ * Creates cross resize policy.
8
+ *
9
+ * @param fixedWidthLandscape - Target width when landscape
10
+ * @param fixedHeightPortrait - Target height when portrait
11
+ */
12
+ constructor(fixedWidthLandscape, fixedHeightPortrait) {
13
+ super();
14
+ assertValidPositiveNumber(fixedWidthLandscape, "UIResizePolicyCross.constructor.fixedWidthLandscape");
15
+ assertValidPositiveNumber(fixedHeightPortrait, "UIResizePolicyCross.constructor.fixedHeightPortrait");
16
+ this._private_fixedWidthLandscapeInternal = fixedWidthLandscape;
17
+ this._private_fixedHeightPortraitInternal = fixedHeightPortrait;
18
+ }
19
+ /** Target width when landscape */
20
+ get fixedWidthLandscape() {
21
+ return this._private_fixedWidthLandscapeInternal;
22
+ }
23
+ /** Target height when portrait */
24
+ get fixedHeightPortrait() {
25
+ return this._private_fixedHeightPortraitInternal;
26
+ }
27
+ /** Target width when landscape */
28
+ set fixedWidthLandscape(value) {
29
+ assertValidPositiveNumber(value, "UIResizePolicyCross.fixedWidthLandscape");
30
+ if (value !== this._private_fixedWidthLandscapeInternal) {
31
+ this._private_fixedWidthLandscapeInternal = value;
32
+ this.dirty = true;
33
+ }
34
+ }
35
+ /** Target height when portrait */
36
+ set fixedHeightPortrait(value) {
37
+ assertValidPositiveNumber(value, "UIResizePolicyCross.fixedHeightPortrait");
38
+ if (value !== this._private_fixedHeightPortraitInternal) {
39
+ this._private_fixedHeightPortraitInternal = value;
40
+ this.dirty = true;
41
+ }
42
+ }
43
+ calculateScale(width, height) {
44
+ assertValidPositiveNumber(width, "UIResizePolicyCross.calculateScale.width");
45
+ assertValidPositiveNumber(height, "UIResizePolicyCross.calculateScale.height");
46
+ return width > height
47
+ ? this._private_fixedWidthLandscapeInternal / width
48
+ : this._private_fixedHeightPortraitInternal / height;
49
+ }
50
+ }
51
+
52
+ export { UIResizePolicyCross };