laymur 0.25.1 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/README.md +41 -5
  2. package/dist/core/elements/UIAnchor/UIAnchor.d.ts +2 -2
  3. package/dist/core/elements/UIAnchor/UIAnchor.js +3 -2
  4. package/dist/core/elements/UIDummy/UIDummy.Internal.d.ts +3 -0
  5. package/dist/core/elements/UIDummy/UIDummy.d.ts +32 -0
  6. package/dist/core/elements/UIDummy/UIDummy.js +101 -2
  7. package/dist/core/elements/UIElement/UIElement.d.ts +23 -1
  8. package/dist/core/elements/UIElement/UIElement.js +50 -3
  9. package/dist/core/elements/UIGraphics/UIGraphics.js +2 -2
  10. package/dist/core/elements/UIProgress/UIProgress.js +2 -5
  11. package/dist/core/elements/UIScene/UIScene.js +3 -2
  12. package/dist/core/elements/UIText/UIText.js +2 -2
  13. package/dist/core/index.d.ts +53 -4
  14. package/dist/core/index.js +15 -2
  15. package/dist/core/layers/UILayer/UILayer.d.ts +11 -1
  16. package/dist/core/layers/UILayer/UILayer.js +37 -2
  17. package/dist/core/miscellaneous/UIAffineMatrix3.d.ts +13 -0
  18. package/dist/core/miscellaneous/UIAffineMatrix3.js +13 -0
  19. package/dist/core/miscellaneous/area/UIArea.d.ts +10 -1
  20. package/dist/core/miscellaneous/area/UIArea.js +4 -1
  21. package/dist/core/miscellaneous/area/UIAreaCircle.d.ts +1 -0
  22. package/dist/core/miscellaneous/area/UIAreaCircle.js +0 -1
  23. package/dist/core/miscellaneous/area/UIAreaPolygon.d.ts +1 -0
  24. package/dist/core/miscellaneous/area/UIAreaPolygon.js +0 -1
  25. package/dist/core/miscellaneous/area/UIAreaRectangle.d.ts +1 -0
  26. package/dist/core/miscellaneous/area/UIAreaRectangle.js +0 -1
  27. package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.d.ts +1 -0
  28. package/dist/core/miscellaneous/area/UIAreaRoundedRectangle.js +0 -1
  29. package/dist/core/miscellaneous/asserts.d.ts +9 -0
  30. package/dist/core/miscellaneous/asserts.js +16 -0
  31. package/dist/core/miscellaneous/color/UIColor.js +1 -0
  32. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.d.ts +17 -3
  33. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.js +88 -26
  34. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Layout.d.ts +9 -0
  35. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.Layout.js +29 -6
  36. package/dist/core/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.js +51 -11
  37. package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.d.ts +2 -0
  38. package/dist/core/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.js +47 -6
  39. package/dist/core/miscellaneous/generic-plane/shared.d.ts +15 -3
  40. package/dist/core/miscellaneous/generic-plane/shared.js +38 -7
  41. package/dist/core/miscellaneous/generic-plane/varyingPacking.d.ts +46 -0
  42. package/dist/core/miscellaneous/generic-plane/varyingPacking.js +170 -0
  43. package/dist/core/miscellaneous/mask/UIMask.Internal.d.ts +61 -0
  44. package/dist/core/miscellaneous/mask/UIMask.Internal.js +56 -0
  45. package/dist/core/miscellaneous/mask/UIMask.d.ts +84 -0
  46. package/dist/core/miscellaneous/mask/UIMask.js +265 -0
  47. package/dist/core/miscellaneous/mask/UIMaskMaterialPatch.d.ts +50 -0
  48. package/dist/core/miscellaneous/mask/UIMaskMaterialPatch.js +233 -0
  49. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.d.ts +10 -1
  50. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunction.js +7 -1
  51. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.d.ts +2 -0
  52. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionCircular.js +0 -1
  53. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.d.ts +2 -0
  54. package/dist/core/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.js +0 -1
  55. package/dist/core/miscellaneous/micro/UIMicro.Internal.d.ts +3 -0
  56. package/dist/core/miscellaneous/micro/UIMicro.Internal.js +1 -0
  57. package/dist/core/miscellaneous/micro/UIMicro.d.ts +18 -1
  58. package/dist/core/miscellaneous/micro/UIMicro.js +23 -2
  59. package/dist/core/miscellaneous/resize-policy/UIResizePolicy.d.ts +16 -1
  60. package/dist/core/miscellaneous/resize-policy/UIResizePolicy.js +8 -2
  61. package/dist/core/miscellaneous/texture/UITextureView.d.ts +2 -1
  62. package/dist/core/miscellaneous/texture/UITextureView.js +3 -2
  63. package/dist/core/shaders/UIMask.d.ts +15 -0
  64. package/dist/core/shaders/UIMask.js +45 -0
  65. package/dist/core/wrappers/UIInputWrapper/UIInputWrapper.Internal.d.ts +0 -1
  66. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.Internal.d.ts +2 -0
  67. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.d.ts +1 -0
  68. package/dist/core/wrappers/UISceneWrapper/UISceneWrapper.js +3 -0
  69. package/dist/core/wrappers/UISolverWrapper/UISolverWrapper.Internal.d.ts +0 -1
  70. package/dist/debug/index.d.ts +2 -0
  71. package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.d.ts +7 -0
  72. package/dist/particles/behaviorModules/UIBehaviorDirectionalGravity.js +0 -2
  73. package/dist/particles/behaviorModules/UIBehaviorModule.d.ts +7 -1
  74. package/dist/particles/behaviorModules/UIBehaviorModule.js +2 -1
  75. package/dist/particles/behaviorModules/UIBehaviorPointGravity.d.ts +7 -0
  76. package/dist/particles/behaviorModules/UIBehaviorPointGravity.js +0 -2
  77. package/dist/particles/behaviorModules/UIBehaviorScaleOscillation.d.ts +7 -0
  78. package/dist/particles/behaviorModules/UIBehaviorScaleOscillation.js +0 -2
  79. package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.d.ts +7 -0
  80. package/dist/particles/behaviorModules/UIBehaviorScaleOverLife.js +0 -2
  81. package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.d.ts +7 -0
  82. package/dist/particles/behaviorModules/UIBehaviorTorqueDamping.js +0 -2
  83. package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.d.ts +7 -0
  84. package/dist/particles/behaviorModules/UIBehaviorTorqueNoise.js +0 -2
  85. package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.d.ts +7 -0
  86. package/dist/particles/behaviorModules/UIBehaviorVelocityDamping.js +0 -2
  87. package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.d.ts +7 -0
  88. package/dist/particles/behaviorModules/UIBehaviorVelocityNoise.js +0 -2
  89. package/dist/particles/elements/UIEmitter.Internal.d.ts +7 -0
  90. package/dist/particles/elements/UIEmitter.d.ts +1 -8
  91. package/dist/particles/index.d.ts +5 -0
  92. package/dist/particles/index.js +3 -0
  93. package/dist/particles/instancedParticle/UIInstancedParticle.Internal.d.ts +11 -2
  94. package/dist/particles/instancedParticle/UIInstancedParticle.Internal.js +101 -72
  95. package/dist/particles/instancedParticle/UIInstancedParticle.d.ts +1 -0
  96. package/dist/particles/instancedParticle/UIInstancedParticle.js +4 -2
  97. package/dist/particles/renderingModules/UIRenderingColorOverLife.d.ts +4 -0
  98. package/dist/particles/renderingModules/UIRenderingColorOverLife.js +0 -2
  99. package/dist/particles/renderingModules/UIRenderingColorOverVelocity.d.ts +4 -0
  100. package/dist/particles/renderingModules/UIRenderingColorOverVelocity.js +0 -2
  101. package/dist/particles/renderingModules/UIRenderingModule.d.ts +10 -1
  102. package/dist/particles/renderingModules/UIRenderingModule.js +3 -1
  103. package/dist/particles/renderingModules/UIRenderingTexture.d.ts +4 -0
  104. package/dist/particles/spawnModules/UISpawnModule.d.ts +13 -1
  105. package/dist/particles/spawnModules/UISpawnModule.js +3 -1
  106. package/dist/particles/spawnModules/UISpawnOffset.d.ts +7 -0
  107. package/dist/particles/spawnModules/UISpawnOffset.js +0 -2
  108. package/dist/particles/spawnModules/UISpawnRandomLifetime.d.ts +7 -0
  109. package/dist/particles/spawnModules/UISpawnRandomLifetime.js +0 -2
  110. package/dist/particles/spawnModules/UISpawnRandomRotation.d.ts +7 -0
  111. package/dist/particles/spawnModules/UISpawnRandomRotation.js +0 -2
  112. package/dist/particles/spawnModules/UISpawnRandomScale.d.ts +7 -0
  113. package/dist/particles/spawnModules/UISpawnRandomScale.js +0 -2
  114. package/dist/particles/spawnModules/UISpawnRandomTorque.d.ts +7 -0
  115. package/dist/particles/spawnModules/UISpawnRandomTorque.js +0 -2
  116. package/dist/particles/spawnModules/UISpawnRandomVelocity.d.ts +7 -0
  117. package/dist/particles/spawnModules/UISpawnRandomVelocity.js +0 -2
  118. package/dist/particles/spawnModules/UISpawnRectangle.d.ts +7 -0
  119. package/dist/particles/spawnModules/UISpawnRectangle.js +0 -2
  120. package/package.json +1 -1
@@ -1,3 +1,4 @@
1
+ import type { InstancedBufferAttribute } from "three";
1
2
  import type { UIAspectConfig, UIRange, UIRangeConfig } from "../miscellaneous/miscellaneous.js";
2
3
  import { UISpawnModule } from "./UISpawnModule.js";
3
4
  /**
@@ -8,6 +9,9 @@ import { UISpawnModule } from "./UISpawnModule.js";
8
9
  export declare class UISpawnRandomScale extends UISpawnModule<{
9
10
  builtin: "Matrix4";
10
11
  }> {
12
+ requiredProperties: {
13
+ readonly builtin: "Matrix4";
14
+ };
11
15
  private scaleInternal;
12
16
  private aspectInternal;
13
17
  /**
@@ -23,4 +27,7 @@ export declare class UISpawnRandomScale extends UISpawnModule<{
23
27
  set scale(value: UIRangeConfig);
24
28
  /** Width/height aspect ratio */
25
29
  set aspect(value: UIAspectConfig);
30
+ spawn(properties: {
31
+ builtin: InstancedBufferAttribute;
32
+ }, instanceBegin: number, instanceEnd: number): void;
26
33
  }
@@ -14,7 +14,6 @@ export class UISpawnRandomScale extends UISpawnModule {
14
14
  */
15
15
  constructor(scale = { min: 50, max: 100 }, aspect = 1) {
16
16
  super();
17
- /** @internal */
18
17
  this.requiredProperties = { builtin: "Matrix4" };
19
18
  this.scaleInternal = resolveUIRangeConfig(scale);
20
19
  this.aspectInternal = resolveAspect(aspect);
@@ -41,7 +40,6 @@ export class UISpawnRandomScale extends UISpawnModule {
41
40
  this.aspectInternal = resolveAspect(value);
42
41
  assertValidPositiveNumber(this.aspectInternal, "UISpawnRandomScale.aspect");
43
42
  }
44
- /** @internal */
45
43
  spawn(properties, instanceBegin, instanceEnd) {
46
44
  const { builtin } = properties;
47
45
  const { array, itemSize } = builtin;
@@ -1,3 +1,4 @@
1
+ import type { InstancedBufferAttribute } from "three";
1
2
  import type { UIRange, UIRangeConfig } from "../miscellaneous/miscellaneous.js";
2
3
  import { UISpawnModule } from "./UISpawnModule.js";
3
4
  /**
@@ -8,6 +9,9 @@ import { UISpawnModule } from "./UISpawnModule.js";
8
9
  export declare class UISpawnRandomTorque extends UISpawnModule<{
9
10
  builtin: "Matrix4";
10
11
  }> {
12
+ readonly requiredProperties: {
13
+ readonly builtin: "Matrix4";
14
+ };
11
15
  private torqueInternal;
12
16
  /**
13
17
  * @param torque - Angular velocity range in radians/second. Accepts number, tuple, or range object
@@ -17,4 +21,7 @@ export declare class UISpawnRandomTorque extends UISpawnModule<{
17
21
  get torque(): UIRange;
18
22
  /** Angular velocity range in radians/second */
19
23
  set torque(value: UIRangeConfig);
24
+ spawn(properties: {
25
+ builtin: InstancedBufferAttribute;
26
+ }, instanceBegin: number, instanceEnd: number): void;
20
27
  }
@@ -13,7 +13,6 @@ export class UISpawnRandomTorque extends UISpawnModule {
13
13
  */
14
14
  constructor(torque = { min: -Math.PI, max: Math.PI }) {
15
15
  super();
16
- /** @internal */
17
16
  this.requiredProperties = { builtin: "Matrix4" };
18
17
  this.torqueInternal = resolveUIRangeConfig(torque);
19
18
  assertValidNumber(this.torqueInternal.min, "UISpawnRandomTorque.constructor.torque.min");
@@ -29,7 +28,6 @@ export class UISpawnRandomTorque extends UISpawnModule {
29
28
  assertValidNumber(this.torqueInternal.min, "UISpawnRandomTorque.torque.min");
30
29
  assertValidNumber(this.torqueInternal.max, "UISpawnRandomTorque.torque.max");
31
30
  }
32
- /** @internal */
33
31
  spawn(properties, instanceBegin, instanceEnd) {
34
32
  const { builtin } = properties;
35
33
  const { array, itemSize } = builtin;
@@ -1,3 +1,4 @@
1
+ import type { InstancedBufferAttribute } from "three";
1
2
  import type { UIRange, UIRangeConfig } from "../miscellaneous/miscellaneous.js";
2
3
  import { UISpawnModule } from "./UISpawnModule.js";
3
4
  /**
@@ -8,6 +9,9 @@ import { UISpawnModule } from "./UISpawnModule.js";
8
9
  export declare class UISpawnRandomVelocity extends UISpawnModule<{
9
10
  builtin: "Matrix4";
10
11
  }> {
12
+ readonly requiredProperties: {
13
+ readonly builtin: "Matrix4";
14
+ };
11
15
  private angleInternal;
12
16
  private magnitudeInternal;
13
17
  /**
@@ -23,4 +27,7 @@ export declare class UISpawnRandomVelocity extends UISpawnModule<{
23
27
  set angle(value: UIRangeConfig);
24
28
  /** Speed range in units/second */
25
29
  set magnitude(value: UIRangeConfig);
30
+ spawn(properties: {
31
+ builtin: InstancedBufferAttribute;
32
+ }, instanceBegin: number, instanceEnd: number): void;
26
33
  }
@@ -14,7 +14,6 @@ export class UISpawnRandomVelocity extends UISpawnModule {
14
14
  */
15
15
  constructor(angle = { min: -Math.PI, max: Math.PI }, magnitude = { min: -50, max: 50 }) {
16
16
  super();
17
- /** @internal */
18
17
  this.requiredProperties = { builtin: "Matrix4" };
19
18
  this.angleInternal = resolveUIRangeConfig(angle);
20
19
  this.magnitudeInternal = resolveUIRangeConfig(magnitude);
@@ -43,7 +42,6 @@ export class UISpawnRandomVelocity extends UISpawnModule {
43
42
  assertValidNumber(this.magnitudeInternal.min, "UISpawnRandomVelocity.magnitude.min");
44
43
  assertValidNumber(this.magnitudeInternal.max, "UISpawnRandomVelocity.magnitude.max");
45
44
  }
46
- /** @internal */
47
45
  spawn(properties, instanceBegin, instanceEnd) {
48
46
  const { builtin } = properties;
49
47
  const { array, itemSize } = builtin;
@@ -1,3 +1,4 @@
1
+ import type { InstancedBufferAttribute } from "three";
1
2
  import type { Vector2Like } from "../../core/miscellaneous/math.js";
2
3
  import type { UIVector2Config } from "../miscellaneous/miscellaneous.js";
3
4
  import { UISpawnModule } from "./UISpawnModule.js";
@@ -9,6 +10,9 @@ import { UISpawnModule } from "./UISpawnModule.js";
9
10
  export declare class UISpawnRectangle extends UISpawnModule<{
10
11
  builtin: "Matrix4";
11
12
  }> {
13
+ readonly requiredProperties: {
14
+ readonly builtin: "Matrix4";
15
+ };
12
16
  private minInternal;
13
17
  private maxInternal;
14
18
  /**
@@ -24,4 +28,7 @@ export declare class UISpawnRectangle extends UISpawnModule<{
24
28
  set min(value: UIVector2Config);
25
29
  /** Top-right corner of spawn area */
26
30
  set max(value: UIVector2Config);
31
+ spawn(properties: {
32
+ builtin: InstancedBufferAttribute;
33
+ }, instanceBegin: number, instanceEnd: number): void;
27
34
  }
@@ -14,7 +14,6 @@ export class UISpawnRectangle extends UISpawnModule {
14
14
  */
15
15
  constructor(min = { x: -50, y: -50 }, max = { x: 50, y: 50 }) {
16
16
  super();
17
- /** @internal */
18
17
  this.requiredProperties = { builtin: "Matrix4" };
19
18
  this.minInternal = resolveUIVector2Config(min);
20
19
  this.maxInternal = resolveUIVector2Config(max);
@@ -43,7 +42,6 @@ export class UISpawnRectangle extends UISpawnModule {
43
42
  assertValidNumber(this.maxInternal.x, "UISpawnRectangle.max.x");
44
43
  assertValidNumber(this.maxInternal.y, "UISpawnRectangle.max.y");
45
44
  }
46
- /** @internal */
47
45
  spawn(properties, instanceBegin, instanceEnd) {
48
46
  const { builtin } = properties;
49
47
  const { array, itemSize } = builtin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "laymur",
3
- "version": "0.25.1",
3
+ "version": "0.26.0",
4
4
  "description": "Constraint-based UI library for Three.js mobile advertisements",
5
5
  "keywords": [
6
6
  "ui",