laymur 0.11.5 → 0.12.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.
- package/README.md +33 -29
- package/dist/constraints/UIAspectConstraint/UIAspectConstraint.Internal.d.ts +1 -1
- package/dist/constraints/UIAspectConstraint/UIAspectConstraint.d.ts +1 -1
- package/dist/constraints/UIConstraint.d.ts +2 -2
- package/dist/constraints/UICustomConstraint.d.ts +3 -3
- package/dist/constraints/UIHeightConstraint/UIHeightConstraint.Internal.d.ts +1 -1
- package/dist/constraints/UIHeightConstraint/UIHeightConstraint.d.ts +1 -1
- package/dist/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.d.ts +1 -1
- package/dist/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.d.ts +1 -1
- package/dist/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.Internal.d.ts +1 -1
- package/dist/constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint.d.ts +1 -1
- package/dist/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.Internal.d.ts +1 -1
- package/dist/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.d.ts +1 -1
- package/dist/constraints/{UISingleParameterConstraint.Internal.d.ts → UISingleParameterConstraint/UISingleParameterConstraint.Internal.d.ts} +5 -3
- package/dist/constraints/{UISingleParameterConstraint.d.ts → UISingleParameterConstraint/UISingleParameterConstraint.d.ts} +5 -5
- package/dist/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.d.ts +1 -1
- package/dist/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.d.ts +1 -1
- package/dist/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.Internal.d.ts +1 -1
- package/dist/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.d.ts +1 -1
- package/dist/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.d.ts +1 -1
- package/dist/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.d.ts +1 -1
- package/dist/constraints/UIWidthConstraint/UIWidthConstraint.Internal.d.ts +1 -1
- package/dist/constraints/UIWidthConstraint/UIWidthConstraint.d.ts +1 -1
- package/dist/elements/UIAnchor/UIAnchor.d.ts +1 -1
- package/dist/elements/UIAnimatedImage/UIAnimatedImage.Internal.d.ts +15 -3
- package/dist/elements/UIAnimatedImage/UIAnimatedImage.d.ts +12 -6
- package/dist/elements/UIElement/UIElement.d.ts +1 -1
- package/dist/elements/UIGraphics/UIGraphics.d.ts +1 -1
- package/dist/elements/UIImage/UIImage.d.ts +1 -1
- package/dist/elements/UIInputDummy/UIInputDummy.d.ts +1 -1
- package/dist/elements/UINineSlice/UINineSlice.d.ts +10 -6
- package/dist/elements/UIProgress/UIProgress.d.ts +1 -1
- package/dist/elements/UIScene/UIScene.d.ts +1 -1
- package/dist/elements/UIText/UIText.d.ts +2 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +185 -98
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/layers/UIFullscreenLayer/UIFullscreenLayer.Internal.d.ts +9 -0
- package/dist/layers/{UIFullscreenLayer.d.ts → UIFullscreenLayer/UIFullscreenLayer.d.ts} +4 -8
- package/dist/layers/UILayer/UILayer.Internal.d.ts +29 -0
- package/dist/layers/{UILayer.d.ts → UILayer/UILayer.d.ts} +4 -9
- package/dist/miscellaneous/asserts.d.ts +1 -1
- package/dist/miscellaneous/shared.d.ts +1 -1
- package/package.json +1 -1
- package/dist/layers/UILayer.Internal.d.ts +0 -15
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
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
170
|
-
button
|
|
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
|
-
|
|
173
|
-
console.log('
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import type { UILayer } from "../layers/UILayer";
|
|
1
|
+
import type { UILayer } from "../layers/UILayer/UILayer";
|
|
2
2
|
import type { UISolverWrapperInterface } from "../wrappers/UISolverWrapper.Internal";
|
|
3
3
|
/** Base class for layout constraints */
|
|
4
4
|
export declare abstract class UIConstraint {
|
|
@@ -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 {
|
package/dist/constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint.Internal.d.ts
CHANGED
|
@@ -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) */
|
package/dist/constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint.d.ts
CHANGED
|
@@ -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 "
|
|
2
|
-
import type { UIPriority } from "
|
|
3
|
-
import type { UIRelation } from "
|
|
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 "
|
|
2
|
-
import { UIOrientation } from "
|
|
3
|
-
import type { UIPriority } from "
|
|
4
|
-
import type { UIRelation } from "
|
|
5
|
-
import { UIConstraint } from "
|
|
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 {
|
package/dist/constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint.Internal.d.ts
CHANGED
|
@@ -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 */
|
package/dist/constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint.d.ts
CHANGED
|
@@ -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 {
|
package/dist/constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint.Internal.d.ts
CHANGED
|
@@ -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,5 +1,5 @@
|
|
|
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
4
|
import type { UISolverWrapperInterface } from "../../wrappers/UISolverWrapper.Internal";
|
|
5
5
|
import type { UIAnchorOptions } from "./UIAnchor.Internal";
|
|
@@ -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 UILoopMode {
|
|
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
|
-
/**
|
|
19
|
-
|
|
27
|
+
/** Playback speed multiplier. Can be negative for reverse playback. */
|
|
28
|
+
timeScale: number;
|
|
29
|
+
/** Loop behavior */
|
|
30
|
+
loopMode: UILoopMode;
|
|
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
|
|
35
|
+
export declare const ANIMATED_IMAGE_DEFAULT_TIME_SCALE = 1;
|
|
36
|
+
export declare const ANIMATED_IMAGE_DEFAULT_LOOP_MODE = UILoopMode.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
4
|
import { UITextureView } from "../../miscellaneous/texture/UITextureView";
|
|
5
5
|
import type { UITextureConfig } from "../../miscellaneous/texture/UITextureView.Internal";
|
|
6
6
|
import { UIElement } from "../UIElement/UIElement";
|
|
7
7
|
import type { UIAnimatedImageOptions } from "./UIAnimatedImage.Internal";
|
|
8
|
+
import { UILoopMode } from "./UIAnimatedImage.Internal";
|
|
8
9
|
/** Frame-based texture animation element */
|
|
9
10
|
export declare class UIAnimatedImage extends UIElement {
|
|
10
11
|
/** Multiplicative tint. Alpha channel controls opacity. */
|
|
11
12
|
readonly color: UIColor;
|
|
12
13
|
private readonly sequenceInternal;
|
|
13
14
|
private frameRateInternal;
|
|
14
|
-
private
|
|
15
|
+
private timeScaleInternal;
|
|
16
|
+
private loopModeInternal;
|
|
15
17
|
private readonly textureTransform;
|
|
16
18
|
private isPlaying;
|
|
17
19
|
private sequenceFrameIndex;
|
|
@@ -31,16 +33,20 @@ export declare class UIAnimatedImage extends UIElement {
|
|
|
31
33
|
get sequence(): readonly UITextureView[];
|
|
32
34
|
/** Animation speed in frames per second */
|
|
33
35
|
get frameRate(): number;
|
|
34
|
-
/**
|
|
35
|
-
get
|
|
36
|
+
/** Playback speed multiplier. Can be negative for reverse playback. */
|
|
37
|
+
get timeScale(): number;
|
|
38
|
+
/** Loop behavior */
|
|
39
|
+
get loopMode(): UILoopMode;
|
|
36
40
|
/** Total animation duration in seconds */
|
|
37
41
|
get duration(): number;
|
|
38
42
|
/** Replaces animation frames. Stops playback. */
|
|
39
43
|
set sequence(sequence: UITextureConfig[]);
|
|
40
44
|
/** Animation speed in frames per second */
|
|
41
45
|
set frameRate(value: number);
|
|
42
|
-
/**
|
|
43
|
-
set
|
|
46
|
+
/** Playback speed multiplier. Can be negative for reverse playback. */
|
|
47
|
+
set timeScale(value: number);
|
|
48
|
+
/** Loop behavior */
|
|
49
|
+
set loopMode(value: UILoopMode);
|
|
44
50
|
/** Removes element and frees resources */
|
|
45
51
|
destroy(): void;
|
|
46
52
|
/** Starts or resumes animation playback */
|
|
@@ -1,5 +1,5 @@
|
|
|
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 type { UIPropertyType } from "../../miscellaneous/generic-plane/shared";
|
|
4
4
|
import { UIMicro } from "../../miscellaneous/micro/UIMicro";
|
|
5
5
|
import type { UIMode } from "../../miscellaneous/UIMode";
|
|
@@ -1,5 +1,5 @@
|
|
|
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
4
|
import { UIElement } from "../UIElement/UIElement";
|
|
5
5
|
import type { UIGraphicsOptions } from "./UIGraphics.Internal";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { UILayer } from "../../layers/UILayer";
|
|
1
|
+
import type { UILayer } from "../../layers/UILayer/UILayer";
|
|
2
2
|
import { UIColor } from "../../miscellaneous/color/UIColor";
|
|
3
3
|
import { UITextureView } from "../../miscellaneous/texture/UITextureView";
|
|
4
4
|
import type { UITextureConfig } from "../../miscellaneous/texture/UITextureView.Internal";
|
|
@@ -1,4 +1,4 @@
|
|
|
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";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { UILayer } from "../../layers/UILayer";
|
|
1
|
+
import type { UILayer } from "../../layers/UILayer/UILayer";
|
|
2
2
|
import { UIColor } from "../../miscellaneous/color/UIColor";
|
|
3
3
|
import { UIInsets } from "../../miscellaneous/insets/UIInsets";
|
|
4
4
|
import { UITextureView } from "../../miscellaneous/texture/UITextureView";
|
|
5
|
-
import type
|
|
5
|
+
import { type UITextureConfig } from "../../miscellaneous/texture/UITextureView.Internal";
|
|
6
6
|
import { UIElement } from "../UIElement/UIElement";
|
|
7
7
|
import type { UINineSliceOptions } from "./UINineSlice.Internal";
|
|
8
8
|
import { UINineSliceRegionMode } from "./UINineSlice.Internal";
|
|
@@ -21,8 +21,9 @@ export declare class UINineSlice extends UIElement {
|
|
|
21
21
|
private readonly textureTransform;
|
|
22
22
|
private readonly sliceBordersVector;
|
|
23
23
|
private readonly sliceRegionsVector;
|
|
24
|
-
private
|
|
25
|
-
private
|
|
24
|
+
private lastElementWidth;
|
|
25
|
+
private lastElementHeight;
|
|
26
|
+
private textureDimensionsDirty;
|
|
26
27
|
/**
|
|
27
28
|
* Creates a new UINineSlice instance.
|
|
28
29
|
*
|
|
@@ -37,9 +38,12 @@ export declare class UINineSlice extends UIElement {
|
|
|
37
38
|
get regionMode(): UINineSliceRegionMode;
|
|
38
39
|
/** Controls how sliceRegions values are interpreted */
|
|
39
40
|
set regionMode(value: UINineSliceRegionMode);
|
|
41
|
+
/** Removes nine slice and frees resources */
|
|
42
|
+
destroy(): void;
|
|
40
43
|
protected setPlaneTransform(): void;
|
|
41
44
|
private calculateSliceBordersForShader;
|
|
42
45
|
private calculateSliceRegionsForShader;
|
|
43
|
-
private
|
|
44
|
-
private
|
|
46
|
+
private checkElementDimensionsDirty;
|
|
47
|
+
private setElementDimensionsDirtyFalse;
|
|
48
|
+
private readonly onTextureDimensionsChanged;
|
|
45
49
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Texture } 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
4
|
import type { UIProgressMaskFunction } from "../../miscellaneous/mask-function/UIProgressMaskFunction";
|
|
5
5
|
import { UITextureView } from "../../miscellaneous/texture/UITextureView";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Camera, WebGLRenderer } from "three";
|
|
2
2
|
import { Scene } from "three";
|
|
3
|
-
import type { UILayer } from "../../layers/UILayer";
|
|
3
|
+
import type { UILayer } from "../../layers/UILayer/UILayer";
|
|
4
4
|
import { UIColor } from "../../miscellaneous/color/UIColor";
|
|
5
5
|
import { UIElement } from "../UIElement/UIElement";
|
|
6
6
|
import type { UISceneOptions } from "./UIScene.Internal";
|
|
@@ -1,5 +1,5 @@
|
|
|
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
4
|
import { UIInsets } from "../../miscellaneous/insets/UIInsets";
|
|
5
5
|
import { UITextSpan } from "../../miscellaneous/text-span/UITextSpan";
|
|
@@ -54,7 +54,7 @@ export declare class UIText extends UIElement {
|
|
|
54
54
|
protected onWillRender(renderer: WebGLRenderer, deltaTime: number): void;
|
|
55
55
|
private tryToRenderTextScaleMode;
|
|
56
56
|
private tryToRenderTextBreakMode;
|
|
57
|
-
private
|
|
57
|
+
private updateProperties;
|
|
58
58
|
private buildTextChunks;
|
|
59
59
|
private checkDimensionsDirty;
|
|
60
60
|
private setDimensionsDirtyFalse;
|
package/dist/index.d.ts
CHANGED
|
@@ -7,13 +7,14 @@ export { UIHeightConstraint } from "./constraints/UIHeightConstraint/UIHeightCon
|
|
|
7
7
|
export { UIHorizontalDistanceConstraint } from "./constraints/UIHorizontalDistanceConstraint/UIHorizontalDistanceConstraint";
|
|
8
8
|
export { UIHorizontalInterpolationConstraint } from "./constraints/UIHorizontalInterpolationConstraint/UIHorizontalInterpolationConstraint";
|
|
9
9
|
export { UIHorizontalProportionConstraint } from "./constraints/UIHorizontalProportionConstraint/UIHorizontalProportionConstraint";
|
|
10
|
-
export { UISingleParameterConstraint } from "./constraints/UISingleParameterConstraint";
|
|
10
|
+
export { UISingleParameterConstraint } from "./constraints/UISingleParameterConstraint/UISingleParameterConstraint";
|
|
11
11
|
export { UIVerticalDistanceConstraint } from "./constraints/UIVerticalDistanceConstraint/UIVerticalDistanceConstraint";
|
|
12
12
|
export { UIVerticalInterpolationConstraint } from "./constraints/UIVerticalInterpolationConstraint/UIVerticalInterpolationConstraint";
|
|
13
13
|
export { UIVerticalProportionConstraint } from "./constraints/UIVerticalProportionConstraint/UIVerticalProportionConstraint";
|
|
14
14
|
export { UIWidthConstraint } from "./constraints/UIWidthConstraint/UIWidthConstraint";
|
|
15
15
|
export { UIAnchor } from "./elements/UIAnchor/UIAnchor";
|
|
16
16
|
export { UIAnimatedImage } from "./elements/UIAnimatedImage/UIAnimatedImage";
|
|
17
|
+
export { UILoopMode } from "./elements/UIAnimatedImage/UIAnimatedImage.Internal";
|
|
17
18
|
export { UIGraphics } from "./elements/UIGraphics/UIGraphics";
|
|
18
19
|
export { UIImage } from "./elements/UIImage/UIImage";
|
|
19
20
|
export { UIInputDummy } from "./elements/UIInputDummy/UIInputDummy";
|
|
@@ -24,7 +25,7 @@ export { UIScene } from "./elements/UIScene/UIScene";
|
|
|
24
25
|
export { UISceneUpdateMode } from "./elements/UIScene/UIScene.Internal";
|
|
25
26
|
export { UIText } from "./elements/UIText/UIText";
|
|
26
27
|
export { UITextResizeMode } from "./elements/UIText/UIText.Internal";
|
|
27
|
-
export { UIFullscreenLayer } from "./layers/UIFullscreenLayer";
|
|
28
|
+
export { UIFullscreenLayer } from "./layers/UIFullscreenLayer/UIFullscreenLayer";
|
|
28
29
|
export { UIAreaCircle } from "./miscellaneous/area/UIAreaCircle";
|
|
29
30
|
export { UIAreaPolygon } from "./miscellaneous/area/UIAreaPolygon";
|
|
30
31
|
export { UIAreaRectangle } from "./miscellaneous/area/UIAreaRectangle";
|