laymur 0.11.5 → 0.13.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 (72) hide show
  1. package/README.md +33 -29
  2. package/dist/constraints/UIAspectConstraint/UIAspectConstraint.Internal.d.ts +1 -1
  3. package/dist/constraints/UIAspectConstraint/UIAspectConstraint.d.ts +1 -1
  4. package/dist/constraints/UIConstraint.d.ts +3 -3
  5. package/dist/constraints/UICustomConstraint.d.ts +3 -3
  6. package/dist/constraints/UIHeightConstraint/UIHeightConstraint.Internal.d.ts +1 -1
  7. package/dist/constraints/UIHeightConstraint/UIHeightConstraint.d.ts +1 -1
  8. package/dist/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.d.ts +1 -1
  9. package/dist/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.d.ts +1 -1
  10. package/dist/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.d.ts +1 -1
  11. package/dist/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.d.ts +1 -1
  12. package/dist/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.d.ts +1 -1
  13. package/dist/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.d.ts +1 -1
  14. package/dist/constraints/{UISingleParameterConstraint.Internal.d.ts → UISingleParameterConstraint/UISingleParameterConstraint.Internal.d.ts} +5 -3
  15. package/dist/constraints/{UISingleParameterConstraint.d.ts → UISingleParameterConstraint/UISingleParameterConstraint.d.ts} +5 -5
  16. package/dist/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.d.ts +1 -1
  17. package/dist/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.d.ts +1 -1
  18. package/dist/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.d.ts +1 -1
  19. package/dist/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.d.ts +1 -1
  20. package/dist/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.d.ts +1 -1
  21. package/dist/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.d.ts +1 -1
  22. package/dist/constraints/UIWidthConstraint/UIWidthConstraint.Internal.d.ts +1 -1
  23. package/dist/constraints/UIWidthConstraint/UIWidthConstraint.d.ts +1 -1
  24. package/dist/elements/UIAnchor/UIAnchor.d.ts +2 -2
  25. package/dist/elements/UIAnimatedImage/UIAnimatedImage.Internal.d.ts +15 -3
  26. package/dist/elements/UIAnimatedImage/UIAnimatedImage.d.ts +23 -13
  27. package/dist/elements/UIElement/UIElement.Internal.d.ts +1 -1
  28. package/dist/elements/UIElement/UIElement.d.ts +5 -5
  29. package/dist/elements/UIGraphics/UIGraphics.Internal.d.ts +4 -0
  30. package/dist/elements/UIGraphics/UIGraphics.d.ts +12 -8
  31. package/dist/elements/UIImage/UIImage.d.ts +7 -3
  32. package/dist/elements/UIInputDummy/UIInputDummy.Internal.d.ts +1 -1
  33. package/dist/elements/UIInputDummy/UIInputDummy.d.ts +4 -4
  34. package/dist/elements/UINineSlice/UINineSlice.d.ts +26 -11
  35. package/dist/elements/UIProgress/UIProgress.d.ts +14 -6
  36. package/dist/elements/UIScene/UIScene.Internal.d.ts +1 -1
  37. package/dist/elements/UIScene/UIScene.d.ts +19 -12
  38. package/dist/elements/UIText/UIText.d.ts +14 -6
  39. package/dist/index.d.ts +3 -2
  40. package/dist/index.js +994 -627
  41. package/dist/index.js.map +1 -1
  42. package/dist/index.min.js +1 -1
  43. package/dist/index.min.js.map +1 -1
  44. package/dist/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.d.ts +9 -0
  45. package/dist/layers/{UIFullscreenLayer.d.ts → UIFullscreenLayer/UIFullscreenLayer.d.ts} +8 -10
  46. package/dist/layers/UILayer/UILayer.Internal.d.ts +29 -0
  47. package/dist/layers/{UILayer.d.ts → UILayer/UILayer.d.ts} +4 -9
  48. package/dist/miscellaneous/asserts.d.ts +1 -1
  49. package/dist/miscellaneous/color/UIColor.d.ts +37 -1
  50. package/dist/miscellaneous/generic-plane/{UIGenericInstancedPlane.Internal.d.ts → UIGenericInstancedPlane/UIGenericInstancedPlane.Internal.d.ts} +6 -6
  51. package/dist/miscellaneous/generic-plane/UIGenericInstancedPlane/UIGenericInstancedPlane.d.ts +1 -0
  52. package/dist/miscellaneous/generic-plane/UIGenericPlane/UIGenericPlane.Internal.d.ts +6 -0
  53. package/dist/miscellaneous/generic-plane/UIGenericPlane/UIGenericPlane.d.ts +1 -0
  54. package/dist/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.Internal.d.ts +12 -0
  55. package/dist/miscellaneous/generic-plane/UIGenericPlaneRegistry/UIGenericPlaneRegistry.d.ts +1 -0
  56. package/dist/miscellaneous/generic-plane/shared.d.ts +21 -10
  57. package/dist/miscellaneous/insets/UIInsets.Internal.d.ts +1 -1
  58. package/dist/miscellaneous/insets/UIInsets.d.ts +2 -0
  59. package/dist/miscellaneous/shared.d.ts +1 -1
  60. package/dist/wrappers/{UISceneWrapper.Internal.d.ts → UISceneWrapper/UISceneWrapper.Internal.d.ts} +4 -4
  61. package/dist/wrappers/{UISceneWrapper.d.ts → UISceneWrapper/UISceneWrapper.d.ts} +7 -6
  62. package/dist/wrappers/{UISolverWrapper.Internal.d.ts → UISolverWrapper/UISolverWrapper.Internal.d.ts} +3 -3
  63. package/dist/wrappers/{UISolverWrapper.d.ts → UISolverWrapper/UISolverWrapper.d.ts} +3 -3
  64. package/package.json +1 -1
  65. package/dist/layers/UILayer.Internal.d.ts +0 -15
  66. package/dist/miscellaneous/generic-plane/UIGenericInstancedPlane.d.ts +0 -36
  67. package/dist/miscellaneous/generic-plane/UIGenericPlane.Internal.d.ts +0 -5
  68. package/dist/miscellaneous/generic-plane/UIGenericPlane.d.ts +0 -23
  69. package/dist/miscellaneous/generic-plane/UIGenericPlaneRegistry.Internal.d.ts +0 -6
  70. package/dist/miscellaneous/generic-plane/UIGenericPlaneRegistry.d.ts +0 -27
  71. /package/dist/wrappers/{UIInputWrapper.Internal.d.ts → UIInputWrapper/UIInputWrapper.Internal.d.ts} +0 -0
  72. /package/dist/wrappers/{UIInputWrapper.d.ts → UIInputWrapper/UIInputWrapper.d.ts} +0 -0
package/README.md CHANGED
@@ -39,11 +39,11 @@ Requires Three.js >=0.175.0 <0.180.0 as a peer dependency.
39
39
  ## Quick Example
40
40
 
41
41
  ```typescript
42
- import { UIFullscreenLayer, UIImage, UIText, UIWidthConstraint } from 'laymur';
42
+ import { UIFullscreenLayer, UIImage, UIText } from 'laymur';
43
43
  import { WebGLRenderer, TextureLoader, Clock } from 'three';
44
44
 
45
45
  const renderer = new WebGLRenderer();
46
- const layer = new UIFullscreenLayer(1920, 1920);
46
+ const layer = new UIFullscreenLayer();
47
47
  const clock = new Clock();
48
48
 
49
49
  const texture = new TextureLoader().load('background.jpg');
@@ -51,7 +51,7 @@ const background = new UIImage(layer, texture, { x: 0, y: 0 });
51
51
  const title = new UIText(layer, 'Mobile Ad Title', {
52
52
  x: 100,
53
53
  y: 100,
54
- maxWidth: 800
54
+ maxLineWidth: 800
55
55
  });
56
56
 
57
57
  function animate() {
@@ -66,7 +66,6 @@ animate();
66
66
 
67
67
  ### Layers
68
68
  - **UIFullscreenLayer** - Handles browser window scaling
69
- - **UILayer** - Base layer for custom setups
70
69
 
71
70
  ### Elements
72
71
  - **UIImage** - Display textures
@@ -83,6 +82,7 @@ animate();
83
82
  - **UIAspectConstraint** - Maintain aspect ratios
84
83
  - **UIHorizontalDistanceConstraint** / **UIVerticalDistanceConstraint** - Spacing between elements
85
84
  - **UIHorizontalProportionConstraint** / **UIVerticalProportionConstraint** - Proportional sizing
85
+ - **UIHorizontalInterpolationConstraint** / **UIVerticalInterpolationConstraint** - Position element between two anchors
86
86
  - **UICustomConstraint** - Custom constraint expressions
87
87
  - **UIFitConstraintBuilder** - Fit element inside container (like CSS object-fit: contain)
88
88
  - **UICoverConstraintBuilder** - Cover container with element (like CSS object-fit: cover)
@@ -108,25 +108,6 @@ new UIHorizontalDistanceConstraint(sidebar, content, {
108
108
  });
109
109
  ```
110
110
 
111
- ## Responsive Design
112
-
113
- Handle different orientations:
114
-
115
- ```typescript
116
- import { UIOrientation } from 'laymur';
117
-
118
- // Different widths for landscape vs portrait
119
- new UIWidthConstraint(sidebar, {
120
- width: 300,
121
- orientation: UIOrientation.HORIZONTAL
122
- });
123
-
124
- new UIWidthConstraint(sidebar, {
125
- width: 200,
126
- orientation: UIOrientation.VERTICAL
127
- });
128
- ```
129
-
130
111
  ## Text Rendering
131
112
 
132
113
  Text supports styled spans with different fonts, sizes, and colors:
@@ -140,7 +121,7 @@ const text = new UIText(layer, [
140
121
  ], {
141
122
  x: 100,
142
123
  y: 100,
143
- maxLineWidth: 600,
124
+ maxLineWidth: 600
144
125
  });
145
126
  ```
146
127
 
@@ -149,7 +130,7 @@ const text = new UIText(layer, [
149
130
  Apply visual transformations without affecting the constraint layout:
150
131
 
151
132
  ```typescript
152
- const element = new UIImage(layer, texture);
133
+ const element = new UIImage(layer, texture, { x: 0, y: 0 });
153
134
 
154
135
  // Apply transformations for animations
155
136
  element.micro.x = 10;
@@ -163,14 +144,37 @@ element.micro.reset();
163
144
 
164
145
  ## Event Handling
165
146
 
147
+ UI elements with area (width and height) can emit input events. Layers can also emit input events.
148
+
166
149
  ```typescript
167
150
  import { UIInputEvent, UIMode } from 'laymur';
168
151
 
169
- const button = new UIImage(layer, buttonTexture);
170
- button.mode = UIMode.INTERACTIVE;
152
+ // Element events
153
+ const button = new UIImage(layer, buttonTexture, {
154
+ x: 0,
155
+ y: 0,
156
+ mode: UIMode.INTERACTIVE
157
+ });
158
+
159
+ button.on(UIInputEvent.PRESSED, (x, y, element) => {
160
+ console.log('Button pressed at', x, y);
161
+ });
162
+
163
+ button.on(UIInputEvent.RELEASED, (x, y, element) => {
164
+ console.log('Button released');
165
+ });
166
+
167
+ button.on(UIInputEvent.ENTERED, (x, y, element) => {
168
+ console.log('Pointer entered button');
169
+ });
170
+
171
+ // Layer events
172
+ layer.on(UIInputEvent.PRESSED, (x, y) => {
173
+ console.log('Layer pressed at', x, y);
174
+ });
171
175
 
172
- button.on(UIInputEvent.CLICK, (x, y, element) => {
173
- console.log('Button clicked');
176
+ layer.on(UIInputEvent.MOVED, (x, y) => {
177
+ console.log('Pointer moved to', x, y);
174
178
  });
175
179
  ```
176
180
 
@@ -1,4 +1,4 @@
1
- import type { UISingleParameterConstraintOptions } from "../UISingleParameterConstraint.Internal";
1
+ import type { UISingleParameterConstraintOptions } from "../UISingleParameterConstraint/UISingleParameterConstraint.Internal";
2
2
  /** Aspect constraint options */
3
3
  export interface UIAspectConstraintOptions extends UISingleParameterConstraintOptions {
4
4
  /** Target aspect ratio (width/height) */
@@ -1,5 +1,5 @@
1
1
  import type { UILayerElement, UIPlaneElement } from "../../miscellaneous/shared";
2
- import { UISingleParameterConstraint } from "../UISingleParameterConstraint";
2
+ import { UISingleParameterConstraint } from "../UISingleParameterConstraint/UISingleParameterConstraint";
3
3
  import type { UIAspectConstraintOptions } from "./UIAspectConstraint.Internal";
4
4
  /** Maintains element aspect ratio (width = height * aspect) */
5
5
  export declare class UIAspectConstraint extends UISingleParameterConstraint {
@@ -1,5 +1,5 @@
1
- import type { UILayer } from "../layers/UILayer";
2
- import type { UISolverWrapperInterface } from "../wrappers/UISolverWrapper.Internal";
1
+ import type { UILayer } from "../layers/UILayer/UILayer";
2
+ import type { UISolverWrapperInterface } from "../wrappers/UISolverWrapper/UISolverWrapper.Internal";
3
3
  /** Base class for layout constraints */
4
4
  export declare abstract class UIConstraint {
5
5
  readonly layer: UILayer;
@@ -8,5 +8,5 @@ export declare abstract class UIConstraint {
8
8
  /** Constraint solver wrapper */
9
9
  protected readonly solverWrapper: UISolverWrapperInterface;
10
10
  /** @param layer Layer containing this constraint */
11
- constructor(layer: UILayer);
11
+ constructor(layer: UILayer, name?: string);
12
12
  }
@@ -1,7 +1,7 @@
1
- import type { UILayer } from "../layers/UILayer";
1
+ import type { UILayer } from "../layers/UILayer/UILayer";
2
2
  import type { UIExpression } from "../miscellaneous/UIExpression";
3
- import { UISingleParameterConstraint } from "./UISingleParameterConstraint";
4
- import type { UISingleParameterConstraintOptions } from "./UISingleParameterConstraint.Internal";
3
+ import { UISingleParameterConstraint } from "./UISingleParameterConstraint/UISingleParameterConstraint";
4
+ import type { UISingleParameterConstraintOptions } from "./UISingleParameterConstraint/UISingleParameterConstraint.Internal";
5
5
  /** Constraint with custom LHS and RHS expressions */
6
6
  export declare class UICustomConstraint extends UISingleParameterConstraint {
7
7
  /** Solver constraint descriptor */
@@ -1,4 +1,4 @@
1
- import type { UISingleParameterConstraintOptions } from "../UISingleParameterConstraint.Internal";
1
+ import type { UISingleParameterConstraintOptions } from "../UISingleParameterConstraint/UISingleParameterConstraint.Internal";
2
2
  /** Height constraint options */
3
3
  export interface UIHeightConstraintOptions extends UISingleParameterConstraintOptions {
4
4
  /** Target height in world units */
@@ -1,5 +1,5 @@
1
1
  import type { UILayerElement, UIPlaneElement } from "../../miscellaneous/shared";
2
- import { UISingleParameterConstraint } from "../UISingleParameterConstraint";
2
+ import { UISingleParameterConstraint } from "../UISingleParameterConstraint/UISingleParameterConstraint";
3
3
  import type { UIHeightConstraintOptions } from "./UIHeightConstraint.Internal";
4
4
  /** Fixes element height to constant value */
5
5
  export declare class UIHeightConstraint extends UISingleParameterConstraint {
@@ -1,4 +1,4 @@
1
- import type { UISingleParameterConstraintOptions } from "../UISingleParameterConstraint.Internal";
1
+ import type { UISingleParameterConstraintOptions } from "../UISingleParameterConstraint/UISingleParameterConstraint.Internal";
2
2
  export declare const DEFAULT_ANCHOR = 0.5;
3
3
  /** Horizontal distance constraint options */
4
4
  export interface UIHorizontalDistanceConstraintOptions extends UISingleParameterConstraintOptions {
@@ -1,5 +1,5 @@
1
1
  import type { UIPlaneElement, UIPointElement } from "../../miscellaneous/shared";
2
- import { UISingleParameterConstraint } from "../UISingleParameterConstraint";
2
+ import { UISingleParameterConstraint } from "../UISingleParameterConstraint/UISingleParameterConstraint";
3
3
  import type { UIHorizontalDistanceConstraintOptions } from "./UIHorizontalDistanceConstraint.Internal";
4
4
  /** Maintains horizontal distance between elements with configurable anchors */
5
5
  export declare class UIHorizontalDistanceConstraint extends UISingleParameterConstraint {
@@ -1,4 +1,4 @@
1
- import type { UISingleParameterConstraintOptions } from "../UISingleParameterConstraint.Internal";
1
+ import type { UISingleParameterConstraintOptions } from "../UISingleParameterConstraint/UISingleParameterConstraint.Internal";
2
2
  export declare const DEFAULT_ANCHOR = 0.5;
3
3
  export declare const DEFAULT_T = 0.5;
4
4
  /** Horizontal interpolation constraint options */
@@ -1,5 +1,5 @@
1
1
  import type { UIPlaneElement, UIPointElement } from "../../miscellaneous/shared";
2
- import { UISingleParameterConstraint } from "../UISingleParameterConstraint";
2
+ import { UISingleParameterConstraint } from "../UISingleParameterConstraint/UISingleParameterConstraint";
3
3
  import type { UIHorizontalInterpolationConstraintOptions } from "./UIHorizontalInterpolationConstraint.Internal";
4
4
  /** Positions element C horizontally between A and B based on interpolation factor */
5
5
  export declare class UIHorizontalInterpolationConstraint extends UISingleParameterConstraint {
@@ -1,4 +1,4 @@
1
- import type { UISingleParameterConstraintOptions } from "../UISingleParameterConstraint.Internal";
1
+ import type { UISingleParameterConstraintOptions } from "../UISingleParameterConstraint/UISingleParameterConstraint.Internal";
2
2
  /** Horizontal proportion constraint options */
3
3
  export interface UIHorizontalProportionConstraintOptions extends UISingleParameterConstraintOptions {
4
4
  /** Proportion multiplier (A.width * proportion = B.width) */
@@ -1,5 +1,5 @@
1
1
  import type { UIPlaneElement } from "../../miscellaneous/shared";
2
- import { UISingleParameterConstraint } from "../UISingleParameterConstraint";
2
+ import { UISingleParameterConstraint } from "../UISingleParameterConstraint/UISingleParameterConstraint";
3
3
  import type { UIHorizontalProportionConstraintOptions } from "./UIHorizontalProportionConstraint.Internal";
4
4
  /** Maintains proportional width relationship (A.width * proportion = B.width) */
5
5
  export declare class UIHorizontalProportionConstraint extends UISingleParameterConstraint {
@@ -1,8 +1,10 @@
1
- import type { UIOrientation } from "../miscellaneous/UIOrientation";
2
- import type { UIPriority } from "../miscellaneous/UIPriority";
3
- import type { UIRelation } from "../miscellaneous/UIRelation";
1
+ import type { UIOrientation } from "../../miscellaneous/UIOrientation";
2
+ import type { UIPriority } from "../../miscellaneous/UIPriority";
3
+ import type { UIRelation } from "../../miscellaneous/UIRelation";
4
4
  /** Single parameter constraint options */
5
5
  export interface UISingleParameterConstraintOptions {
6
+ /** Constraint name */
7
+ name: string;
6
8
  /** Constraint priority */
7
9
  priority: UIPriority;
8
10
  /** Constraint relation */
@@ -1,8 +1,8 @@
1
- import type { UILayer } from "../layers/UILayer";
2
- import { UIOrientation } from "../miscellaneous/UIOrientation";
3
- import type { UIPriority } from "../miscellaneous/UIPriority";
4
- import type { UIRelation } from "../miscellaneous/UIRelation";
5
- import { UIConstraint } from "./UIConstraint";
1
+ import type { UILayer } from "../../layers/UILayer/UILayer";
2
+ import { UIOrientation } from "../../miscellaneous/UIOrientation";
3
+ import type { UIPriority } from "../../miscellaneous/UIPriority";
4
+ import type { UIRelation } from "../../miscellaneous/UIRelation";
5
+ import { UIConstraint } from "../UIConstraint";
6
6
  import type { UISingleParameterConstraintOptions } from "./UISingleParameterConstraint.Internal";
7
7
  /** Base class for constraints with priority, relation, and orientation */
8
8
  export declare abstract class UISingleParameterConstraint extends UIConstraint {
@@ -1,4 +1,4 @@
1
- import type { UISingleParameterConstraintOptions } from "../UISingleParameterConstraint.Internal";
1
+ import type { UISingleParameterConstraintOptions } from "../UISingleParameterConstraint/UISingleParameterConstraint.Internal";
2
2
  export declare const DEFAULT_ANCHOR = 0.5;
3
3
  /** Vertical distance constraint options */
4
4
  export interface UIVerticalDistanceConstraintOptions extends UISingleParameterConstraintOptions {
@@ -1,5 +1,5 @@
1
1
  import type { UIPlaneElement, UIPointElement } from "../../miscellaneous/shared";
2
- import { UISingleParameterConstraint } from "../UISingleParameterConstraint";
2
+ import { UISingleParameterConstraint } from "../UISingleParameterConstraint/UISingleParameterConstraint";
3
3
  import type { UIVerticalDistanceConstraintOptions } from "./UIVerticalDistanceConstraint.Internal";
4
4
  /** Maintains vertical distance between elements with configurable anchors */
5
5
  export declare class UIVerticalDistanceConstraint extends UISingleParameterConstraint {
@@ -1,4 +1,4 @@
1
- import type { UISingleParameterConstraintOptions } from "../UISingleParameterConstraint.Internal";
1
+ import type { UISingleParameterConstraintOptions } from "../UISingleParameterConstraint/UISingleParameterConstraint.Internal";
2
2
  export declare const DEFAULT_ANCHOR = 0.5;
3
3
  export declare const DEFAULT_T = 0.5;
4
4
  /** Vertical interpolation constraint options */
@@ -1,5 +1,5 @@
1
1
  import type { UIPlaneElement, UIPointElement } from "../../miscellaneous/shared";
2
- import { UISingleParameterConstraint } from "../UISingleParameterConstraint";
2
+ import { UISingleParameterConstraint } from "../UISingleParameterConstraint/UISingleParameterConstraint";
3
3
  import type { UIVerticalInterpolationConstraintOptions } from "./UIVerticalInterpolationConstraint.Internal";
4
4
  /** Positions element C vertically between A and B based on interpolation factor */
5
5
  export declare class UIVerticalInterpolationConstraint extends UISingleParameterConstraint {
@@ -1,4 +1,4 @@
1
- import type { UISingleParameterConstraintOptions } from "../UISingleParameterConstraint.Internal";
1
+ import type { UISingleParameterConstraintOptions } from "../UISingleParameterConstraint/UISingleParameterConstraint.Internal";
2
2
  /** Vertical proportion constraint options */
3
3
  export interface UIVerticalProportionConstraintOptions extends UISingleParameterConstraintOptions {
4
4
  /** Proportion multiplier (A.height * proportion = B.height) */
@@ -1,5 +1,5 @@
1
1
  import type { UIPlaneElement } from "../../miscellaneous/shared";
2
- import { UISingleParameterConstraint } from "../UISingleParameterConstraint";
2
+ import { UISingleParameterConstraint } from "../UISingleParameterConstraint/UISingleParameterConstraint";
3
3
  import type { UIVerticalProportionConstraintOptions } from "./UIVerticalProportionConstraint.Internal";
4
4
  /** Maintains proportional height relationship (A.height * proportion = B.height) */
5
5
  export declare class UIVerticalProportionConstraint extends UISingleParameterConstraint {
@@ -1,4 +1,4 @@
1
- import type { UISingleParameterConstraintOptions } from "../UISingleParameterConstraint.Internal";
1
+ import type { UISingleParameterConstraintOptions } from "../UISingleParameterConstraint/UISingleParameterConstraint.Internal";
2
2
  /** Width constraint options */
3
3
  export interface UIWidthConstraintOptions extends UISingleParameterConstraintOptions {
4
4
  /** Target width in world units */
@@ -1,5 +1,5 @@
1
1
  import type { UILayerElement, UIPlaneElement } from "../../miscellaneous/shared";
2
- import { UISingleParameterConstraint } from "../UISingleParameterConstraint";
2
+ import { UISingleParameterConstraint } from "../UISingleParameterConstraint/UISingleParameterConstraint";
3
3
  import type { UIWidthConstraintOptions } from "./UIWidthConstraint.Internal";
4
4
  /** Fixes element width to constant value */
5
5
  export declare class UIWidthConstraint extends UISingleParameterConstraint {
@@ -1,7 +1,7 @@
1
1
  import { Eventail } from "eventail";
2
- import type { UILayer } from "../../layers/UILayer";
2
+ import type { UILayer } from "../../layers/UILayer/UILayer";
3
3
  import type { UILayerElement, UIPointElement } from "../../miscellaneous/shared";
4
- import type { UISolverWrapperInterface } from "../../wrappers/UISolverWrapper.Internal";
4
+ import type { UISolverWrapperInterface } from "../../wrappers/UISolverWrapper/UISolverWrapper.Internal";
5
5
  import type { UIAnchorOptions } from "./UIAnchor.Internal";
6
6
  /** Point in 2D space with constraint-based positioning */
7
7
  export declare class UIAnchor extends Eventail implements UILayerElement, UIPointElement {
@@ -9,16 +9,28 @@ export declare enum UIAnimatedImageEvent {
9
9
  /** Animation stopped and reset */
10
10
  STOPPED = 2
11
11
  }
12
+ /** Animation loop behavior */
13
+ export declare enum UIAnimatedImageLoopMode {
14
+ /** No looping, stops at boundary frame */
15
+ NONE = 0,
16
+ /** Loops back to opposite frame */
17
+ LOOP = 1,
18
+ /** Reverses direction at boundaries */
19
+ PING_PONG = 2
20
+ }
12
21
  /** Configuration options for UIAnimatedImage */
13
22
  export interface UIAnimatedImageOptions extends UIElementOptions {
14
23
  /** Multiplicative tint */
15
24
  color: UIColorConfig;
16
25
  /** Animation speed in frames per second */
17
26
  frameRate: number;
18
- /** Whether animation repeats after completion */
19
- loop: boolean;
27
+ /** Playback speed multiplier. Can be negative for reverse playback. */
28
+ timeScale: number;
29
+ /** Loop behavior */
30
+ loopMode: UIAnimatedImageLoopMode;
20
31
  /** Whether to start playing immediately */
21
32
  playByDefault: boolean;
22
33
  }
23
34
  export declare const ANIMATED_IMAGE_DEFAULT_FRAME_RATE = 24;
24
- export declare const ANIMATED_IMAGE_DEFAULT_LOOP = true;
35
+ export declare const ANIMATED_IMAGE_DEFAULT_TIME_SCALE = 1;
36
+ export declare const ANIMATED_IMAGE_DEFAULT_LOOP_MODE = UIAnimatedImageLoopMode.LOOP;
@@ -1,17 +1,19 @@
1
1
  import type { WebGLRenderer } from "three";
2
- import type { UILayer } from "../../layers/UILayer";
2
+ import type { UILayer } from "../../layers/UILayer/UILayer";
3
3
  import { UIColor } from "../../miscellaneous/color/UIColor";
4
+ import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
4
5
  import { UITextureView } from "../../miscellaneous/texture/UITextureView";
5
6
  import type { UITextureConfig } from "../../miscellaneous/texture/UITextureView.Internal";
6
7
  import { UIElement } from "../UIElement/UIElement";
7
8
  import type { UIAnimatedImageOptions } from "./UIAnimatedImage.Internal";
9
+ import { UIAnimatedImageLoopMode } from "./UIAnimatedImage.Internal";
8
10
  /** Frame-based texture animation element */
9
11
  export declare class UIAnimatedImage extends UIElement {
10
- /** Multiplicative tint. Alpha channel controls opacity. */
11
- readonly color: UIColor;
12
+ private readonly colorInternal;
12
13
  private readonly sequenceInternal;
13
14
  private frameRateInternal;
14
- private loopInternal;
15
+ private timeScaleInternal;
16
+ private loopModeInternal;
15
17
  private readonly textureTransform;
16
18
  private isPlaying;
17
19
  private sequenceFrameIndex;
@@ -27,20 +29,28 @@ export declare class UIAnimatedImage extends UIElement {
27
29
  * @param options - Configuration options
28
30
  */
29
31
  constructor(layer: UILayer, sequence: UITextureConfig[], options?: Partial<UIAnimatedImageOptions>);
32
+ /** Multiplicative tint. Alpha channel controls opacity. */
33
+ get color(): UIColor;
34
+ /** Total animation duration in seconds */
35
+ get duration(): number;
36
+ /** Animation speed in frames per second */
37
+ get frameRate(): number;
38
+ /** Loop behavior */
39
+ get loopMode(): UIAnimatedImageLoopMode;
30
40
  /** Animation frames as readonly array */
31
41
  get sequence(): readonly UITextureView[];
42
+ /** Playback speed multiplier. Can be negative for reverse playback. */
43
+ get timeScale(): number;
44
+ /** Multiplicative tint. Alpha channel controls opacity. */
45
+ set color(value: UIColorConfig);
32
46
  /** Animation speed in frames per second */
33
- get frameRate(): number;
34
- /** Whether animation repeats after completion */
35
- get loop(): boolean;
36
- /** Total animation duration in seconds */
37
- get duration(): number;
47
+ set frameRate(value: number);
48
+ /** Loop behavior */
49
+ set loopMode(value: UIAnimatedImageLoopMode);
38
50
  /** Replaces animation frames. Stops playback. */
39
51
  set sequence(sequence: UITextureConfig[]);
40
- /** Animation speed in frames per second */
41
- set frameRate(value: number);
42
- /** Whether animation repeats after completion */
43
- set loop(value: boolean);
52
+ /** Playback speed multiplier. Can be negative for reverse playback. */
53
+ set timeScale(value: number);
44
54
  /** Removes element and frees resources */
45
55
  destroy(): void;
46
56
  /** Starts or resumes animation playback */
@@ -4,7 +4,7 @@ import type { UIInputDummyOptions } from "../UIInputDummy/UIInputDummy.Internal"
4
4
  /** Configuration options for UIElement */
5
5
  export interface UIElementOptions extends UIInputDummyOptions {
6
6
  /** Transforms that don't affect constraints */
7
- micro: UIMicroConfig;
7
+ micro: Partial<UIMicroConfig>;
8
8
  /** Alpha blending mode */
9
9
  transparencyMode: UITransparencyMode;
10
10
  }
@@ -1,10 +1,10 @@
1
1
  import type { WebGLRenderer } from "three";
2
- import type { UILayer } from "../../layers/UILayer";
3
- import type { UIPropertyType } from "../../miscellaneous/generic-plane/shared";
2
+ import type { UILayer } from "../../layers/UILayer/UILayer";
3
+ import type { UIProperty } from "../../miscellaneous/generic-plane/shared";
4
4
  import { UIMicro } from "../../miscellaneous/micro/UIMicro";
5
5
  import type { UIMode } from "../../miscellaneous/UIMode";
6
6
  import type { UITransparencyMode } from "../../miscellaneous/UITransparencyMode";
7
- import type { UISceneWrapperInterface } from "../../wrappers/UISceneWrapper.Internal";
7
+ import type { UISceneWrapperInterface } from "../../wrappers/UISceneWrapper/UISceneWrapper.Internal";
8
8
  import { UIInputDummy } from "../UIInputDummy/UIInputDummy";
9
9
  import type { UIElementOptions } from "./UIElement.Internal";
10
10
  /** Base class for renderable UI elements */
@@ -12,7 +12,7 @@ export declare abstract class UIElement extends UIInputDummy {
12
12
  /** Transforms that don't affect constraints */
13
13
  readonly micro: UIMicro;
14
14
  protected readonly sceneWrapper: UISceneWrapperInterface;
15
- protected readonly planeHandler: number;
15
+ protected planeHandler: number;
16
16
  private transparencyModeInternal;
17
17
  private transparencyModeDirty;
18
18
  private visibilityDirty;
@@ -24,7 +24,7 @@ export declare abstract class UIElement extends UIInputDummy {
24
24
  * @param properties - Shader uniform properties
25
25
  * @param options - Configuration options
26
26
  */
27
- constructor(layer: UILayer, source: string, properties: Record<string, UIPropertyType>, options?: Partial<UIElementOptions>);
27
+ constructor(layer: UILayer, source: string, properties: Record<string, UIProperty>, options?: Partial<UIElementOptions>);
28
28
  /** Alpha blending mode */
29
29
  get transparencyMode(): UITransparencyMode;
30
30
  /** Alpha blending mode */
@@ -1,3 +1,4 @@
1
+ import { UIColor } from "../../miscellaneous/color/UIColor";
1
2
  import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
2
3
  import type { UIElementOptions } from "../UIElement/UIElement.Internal";
3
4
  /** Configuration options for UIGraphics */
@@ -5,3 +6,6 @@ export interface UIGraphicsOptions extends UIElementOptions {
5
6
  /** Multiplicative tint */
6
7
  color: UIColorConfig;
7
8
  }
9
+ export declare const GRAPHICS_DEFAULT_WIDTH = 2;
10
+ export declare const GRAPHICS_DEFAULT_HEIGHT = 2;
11
+ export declare const GRAPHICS_TEMP_COLOR: UIColor;
@@ -1,12 +1,12 @@
1
1
  import type { WebGLRenderer } from "three";
2
- import type { UILayer } from "../../layers/UILayer";
2
+ import type { UILayer } from "../../layers/UILayer/UILayer";
3
3
  import { UIColor } from "../../miscellaneous/color/UIColor";
4
+ import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
4
5
  import { UIElement } from "../UIElement/UIElement";
5
- import type { UIGraphicsOptions } from "./UIGraphics.Internal";
6
+ import { type UIGraphicsOptions } from "./UIGraphics.Internal";
6
7
  /** Canvas-based 2D drawing element */
7
8
  export declare class UIGraphics extends UIElement {
8
- /** Multiplicative tint. Alpha channel controls opacity. */
9
- readonly color: UIColor;
9
+ private readonly colorInternal;
10
10
  private readonly canvas;
11
11
  private readonly context;
12
12
  private readonly texture;
@@ -17,23 +17,27 @@ export declare class UIGraphics extends UIElement {
17
17
  * @param options - Configuration options
18
18
  */
19
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);
20
24
  /**
21
25
  * Clears canvas. Optionally fills with color.
22
26
  *
23
27
  * @param color - Fill color after clearing
24
28
  */
25
- clear(color?: UIColor): this;
29
+ clear(color?: UIColorConfig): this;
26
30
  /** Draws filled rectangle */
27
- drawRect(x: number, y: number, width: number, height: number, color: UIColor): this;
31
+ drawRect(x: number, y: number, width: number, height: number, color: UIColorConfig): this;
28
32
  /** Draws filled circle */
29
- drawCircle(x: number, y: number, radius: number, color: UIColor): this;
33
+ drawCircle(x: number, y: number, radius: number, color: UIColorConfig): this;
30
34
  /**
31
35
  * Draws filled arc.
32
36
  *
33
37
  * @param startAngle - Start angle in radians
34
38
  * @param endAngle - End angle in radians
35
39
  */
36
- drawArc(x: number, y: number, radius: number, startAngle: number, endAngle: number, color: UIColor): this;
40
+ drawArc(x: number, y: number, radius: number, startAngle: number, endAngle: number, color: UIColorConfig): this;
37
41
  /**
38
42
  * Draws connected line segments.
39
43
  *
@@ -1,5 +1,6 @@
1
- import type { UILayer } from "../../layers/UILayer";
1
+ import type { UILayer } from "../../layers/UILayer/UILayer";
2
2
  import { UIColor } from "../../miscellaneous/color/UIColor";
3
+ import type { UIColorConfig } from "../../miscellaneous/color/UIColor.Internal";
3
4
  import { UITextureView } from "../../miscellaneous/texture/UITextureView";
4
5
  import type { UITextureConfig } from "../../miscellaneous/texture/UITextureView.Internal";
5
6
  import { UIElement } from "../UIElement/UIElement";
@@ -8,8 +9,7 @@ import type { UIImageOptions } from "./UIImage.Internal";
8
9
  export declare class UIImage extends UIElement {
9
10
  /** Texture displayed by this image */
10
11
  readonly texture: UITextureView;
11
- /** Multiplicative tint. Alpha channel controls opacity. */
12
- readonly color: UIColor;
12
+ private readonly colorInternal;
13
13
  private readonly textureTransform;
14
14
  /**
15
15
  * Creates a new UIImage instance.
@@ -21,6 +21,10 @@ export declare class UIImage extends UIElement {
21
21
  * @param options - Configuration options
22
22
  */
23
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);
24
28
  /** Removes image and frees resources */
25
29
  destroy(): void;
26
30
  protected setPlaneTransform(): void;
@@ -7,7 +7,7 @@ export interface UIInputDummyOptions extends UIAnchorOptions {
7
7
  width: number;
8
8
  /** Height in world units */
9
9
  height: number;
10
- /** Shape defining interactive region in normalized coordinates */
10
+ /** Shape defining interactive region in element-local space (0,0 = bottom-left, 1,1 = top-right) */
11
11
  interactionArea: UIArea;
12
12
  /** Controls visibility and interactivity */
13
13
  mode: UIMode;
@@ -1,14 +1,14 @@
1
- import type { UILayer } from "../../layers/UILayer";
1
+ import type { UILayer } from "../../layers/UILayer/UILayer";
2
2
  import type { UIArea } from "../../miscellaneous/area/UIArea";
3
3
  import type { UIPlaneElement } from "../../miscellaneous/shared";
4
4
  import { UIInputEvent } from "../../miscellaneous/UIInputEvent";
5
5
  import { UIMode } from "../../miscellaneous/UIMode";
6
- import type { UIInputWrapperInterface } from "../../wrappers/UIInputWrapper.Internal";
6
+ import type { UIInputWrapperInterface } from "../../wrappers/UIInputWrapper/UIInputWrapper.Internal";
7
7
  import { UIAnchor } from "../UIAnchor/UIAnchor";
8
8
  import type { UIInputDummyOptions } from "./UIInputDummy.Internal";
9
9
  /** Rectangular area with dimensions but no rendering */
10
10
  export declare class UIInputDummy extends UIAnchor implements UIPlaneElement {
11
- /** Shape defining interactive region in normalized coordinates */
11
+ /** Shape defining interactive region in element-local space (0,0 = bottom-left, 1,1 = top-right) */
12
12
  interactionArea: UIArea;
13
13
  /** Solver variable for width */
14
14
  readonly wVariable: number;
@@ -17,7 +17,7 @@ export declare class UIInputDummy extends UIAnchor implements UIPlaneElement {
17
17
  protected modeInternal: UIMode;
18
18
  protected readonly inputWrapper: UIInputWrapperInterface;
19
19
  private readonly catcherHandler;
20
- private lastPointerInside;
20
+ private wasPointerInside;
21
21
  /**
22
22
  * Creates a new UIInputDummy instance.
23
23
  *