laymur 0.10.3 → 0.11.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 +20 -11
- package/dist/constraints/UIAspectConstraint.Internal.d.ts +6 -0
- package/dist/constraints/UIAspectConstraint.d.ts +9 -46
- package/dist/constraints/UIConstraint.d.ts +7 -27
- package/dist/constraints/UICustomConstraint.d.ts +13 -45
- package/dist/constraints/UIHeightConstraint.Internal.d.ts +6 -0
- package/dist/constraints/UIHeightConstraint.d.ts +8 -37
- package/dist/constraints/UIHorizontalDistanceConstraint.Internal.d.ts +11 -0
- package/dist/constraints/UIHorizontalDistanceConstraint.d.ts +16 -73
- package/dist/constraints/UIHorizontalProportionConstraint.Internal.d.ts +6 -0
- package/dist/constraints/UIHorizontalProportionConstraint.d.ts +8 -52
- package/dist/constraints/UISingleParameterConstraint.Internal.d.ts +12 -0
- package/dist/constraints/UISingleParameterConstraint.d.ts +24 -87
- package/dist/constraints/UIVerticalDistanceConstraint.Internal.d.ts +11 -0
- package/dist/constraints/UIVerticalDistanceConstraint.d.ts +12 -73
- package/dist/constraints/UIVerticalProportionConstraint.Internal.d.ts +6 -0
- package/dist/constraints/UIVerticalProportionConstraint.d.ts +8 -52
- package/dist/constraints/UIWidthConstraint.Internal.d.ts +6 -0
- package/dist/constraints/UIWidthConstraint.d.ts +8 -37
- package/dist/constraints/builders/UIConstraint2DBuilder.Internal.d.ts +45 -0
- package/dist/constraints/builders/UIConstraint2DBuilder.d.ts +35 -0
- package/dist/constraints/builders/UICoverConstraintBuilder.Internal.d.ts +13 -0
- package/dist/constraints/builders/UICoverConstraintBuilder.d.ts +29 -0
- package/dist/constraints/builders/UIFitConstraintBuilder.Internal.d.ts +13 -0
- package/dist/constraints/builders/UIFitConstraintBuilder.d.ts +29 -0
- package/dist/elements/UIAnchor.Internal.d.ts +9 -0
- package/dist/elements/UIAnchor.d.ts +17 -62
- package/dist/elements/UIAnimatedImage.Internal.d.ts +24 -0
- package/dist/elements/UIAnimatedImage.d.ts +38 -100
- package/dist/elements/UIDummy.Internal.d.ts +18 -0
- package/dist/elements/UIDummy.d.ts +51 -63
- package/dist/elements/UIElement.Internal.d.ts +11 -0
- package/dist/elements/UIElement.d.ts +28 -168
- package/dist/elements/UIGraphics.Internal.d.ts +7 -0
- package/dist/elements/UIGraphics.d.ts +29 -99
- package/dist/elements/UIImage.Internal.d.ts +7 -0
- package/dist/elements/UIImage.d.ts +18 -73
- package/dist/elements/UINineSlice.Internal.d.ts +23 -0
- package/dist/elements/UINineSlice.d.ts +45 -0
- package/dist/elements/UIProgress.Internal.d.ts +14 -0
- package/dist/elements/UIProgress.d.ts +26 -152
- package/dist/elements/UIScene.Internal.d.ts +43 -0
- package/dist/elements/UIScene.d.ts +29 -171
- package/dist/elements/UIText/UIText.Interfaces.d.ts +32 -0
- package/dist/elements/UIText/UIText.Internal.d.ts +26 -0
- package/dist/elements/UIText/UIText.Measuring.d.ts +49 -0
- package/dist/elements/UIText/UIText.Rendering.d.ts +19 -0
- package/dist/elements/UIText/UIText.d.ts +63 -0
- package/dist/index.d.ts +46 -46
- package/dist/index.js +4176 -4002
- 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.d.ts +33 -43
- package/dist/layers/UILayer.Internal.d.ts +15 -0
- package/dist/layers/UILayer.d.ts +29 -184
- package/dist/miscellaneous/UIExpression.d.ts +35 -83
- package/dist/miscellaneous/UIInputEvent.d.ts +11 -8
- package/dist/miscellaneous/UIMode.d.ts +19 -21
- package/dist/miscellaneous/UIOrientation.d.ts +7 -22
- package/dist/miscellaneous/UIPriority.d.ts +16 -40
- package/dist/miscellaneous/UIRelation.d.ts +11 -31
- package/dist/miscellaneous/UITransparencyMode.d.ts +4 -21
- package/dist/miscellaneous/area/UIArea.d.ts +3 -0
- package/dist/miscellaneous/area/UIAreaCircle.d.ts +15 -0
- package/dist/miscellaneous/area/UIAreaPolygon.d.ts +12 -0
- package/dist/miscellaneous/area/UIAreaRectangle.d.ts +17 -0
- package/dist/miscellaneous/area/UIAreaRoundedRectangle.d.ts +21 -0
- package/dist/miscellaneous/asserts.d.ts +39 -82
- package/dist/miscellaneous/color/UIColor.Internal.d.ts +7 -0
- package/dist/miscellaneous/color/UIColor.d.ts +197 -0
- package/dist/miscellaneous/computeTransform.d.ts +18 -0
- package/dist/miscellaneous/generic-plane/UIGenericInstancedPlane.Internal.d.ts +10 -0
- package/dist/miscellaneous/generic-plane/UIGenericInstancedPlane.d.ts +36 -0
- package/dist/miscellaneous/generic-plane/UIGenericPlane.Internal.d.ts +5 -0
- package/dist/miscellaneous/generic-plane/UIGenericPlane.d.ts +23 -0
- package/dist/miscellaneous/generic-plane/UIGenericPlaneRegistry.Internal.d.ts +6 -0
- package/dist/miscellaneous/generic-plane/UIGenericPlaneRegistry.d.ts +27 -0
- package/dist/miscellaneous/generic-plane/shared.d.ts +22 -0
- package/dist/miscellaneous/mask-function/UIProgressMaskFunction.d.ts +9 -0
- package/dist/miscellaneous/mask-function/UIProgressMaskFunctionCircular.d.ts +21 -0
- package/dist/miscellaneous/mask-function/UIProgressMaskFunctionDirectional.d.ts +16 -0
- package/dist/miscellaneous/micro/UIMicro.Internal.d.ts +31 -0
- package/dist/miscellaneous/micro/UIMicro.d.ts +59 -0
- package/dist/miscellaneous/padding/UIPadding.Internal.d.ts +11 -0
- package/dist/miscellaneous/padding/UIPadding.d.ts +46 -0
- package/dist/miscellaneous/resize-policy/UIResizePolicy.d.ts +3 -0
- package/dist/miscellaneous/resize-policy/UIResizePolicyCross.d.ts +22 -0
- package/dist/miscellaneous/resize-policy/UIResizePolicyCrossInverted.d.ts +22 -0
- package/dist/miscellaneous/resize-policy/UIResizePolicyFixedHeight.d.ts +22 -0
- package/dist/miscellaneous/resize-policy/UIResizePolicyFixedWidth.d.ts +22 -0
- package/dist/miscellaneous/resize-policy/UIResizePolicyNone.d.ts +5 -0
- package/dist/miscellaneous/text-span/UITextSpan.Internal.d.ts +8 -0
- package/dist/miscellaneous/text-span/UITextSpan.d.ts +14 -0
- package/dist/miscellaneous/text-style/UITextStyle.Internal.d.ts +48 -0
- package/dist/miscellaneous/text-style/UITextStyle.d.ts +85 -0
- package/dist/miscellaneous/texture/UITextureView.Internal.d.ts +54 -0
- package/dist/miscellaneous/texture/UITextureView.d.ts +61 -0
- package/dist/wrappers/UIInputWrapper.Internal.d.ts +17 -0
- package/dist/wrappers/UIInputWrapper.d.ts +13 -0
- package/dist/wrappers/UISceneWrapper.Internal.d.ts +13 -0
- package/dist/wrappers/UISceneWrapper.d.ts +12 -19
- package/dist/wrappers/UISolverWrapper.Internal.d.ts +49 -0
- package/dist/wrappers/UISolverWrapper.d.ts +2 -1
- package/package.json +3 -1
- package/dist/builders/UIConstraint2DBuilder.d.ts +0 -130
- package/dist/builders/UICoverConstraintBuilder.d.ts +0 -56
- package/dist/builders/UIFitConstraintBuilder.d.ts +0 -56
- package/dist/composer/UIComposer.d.ts +0 -0
- package/dist/composer/UIFullscreenQuad.d.ts +0 -0
- package/dist/composer/UIPass.d.ts +0 -0
- package/dist/elements/UINineSline.d.ts +0 -139
- package/dist/elements/UISpine.d.ts +0 -54
- package/dist/elements/UIText.d.ts +0 -149
- package/dist/miscellaneous/UIColor.d.ts +0 -245
- package/dist/miscellaneous/UIGenericInstancedPlane.d.ts +0 -32
- package/dist/miscellaneous/UIMicro.d.ts +0 -148
- package/dist/miscellaneous/UIMicroAnchorMode.d.ts +0 -9
- package/dist/miscellaneous/UINineSliceBorder.d.ts +0 -21
- package/dist/miscellaneous/UIResizePolicy.d.ts +0 -21
- package/dist/miscellaneous/UIResizePolicyCross.d.ts +0 -14
- package/dist/miscellaneous/UIResizePolicyCrossInverted.d.ts +0 -14
- package/dist/miscellaneous/UIResizePolicyFixedHeight.d.ts +0 -24
- package/dist/miscellaneous/UIResizePolicyFixedWidth.d.ts +0 -27
- package/dist/miscellaneous/UIResizePolicyNone.d.ts +0 -7
- package/dist/miscellaneous/UISceneWrapperClientAPI.d.ts +0 -12
- package/dist/miscellaneous/UITextPadding.d.ts +0 -7
- package/dist/miscellaneous/UITextSpan.d.ts +0 -6
- package/dist/miscellaneous/UITextStyle.d.ts +0 -20
- package/dist/miscellaneous/textInterfaces.d.ts +0 -19
- package/dist/miscellaneous/textTools.d.ts +0 -12
|
@@ -1,78 +1,33 @@
|
|
|
1
1
|
import { Eventail } from "eventail";
|
|
2
2
|
import type { UILayer } from "../layers/UILayer";
|
|
3
|
-
import type { UIPointElement } from "../miscellaneous/asserts";
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* A UIAnchor serves as the fundamental building block for UI layout systems,
|
|
9
|
-
* representing a single point with x and y coordinates. It provides constraint-based
|
|
10
|
-
* positioning through solver variables and serves as an anchor point for more
|
|
11
|
-
* complex UI elements.
|
|
12
|
-
*
|
|
13
|
-
* @see {@link UIPointElement} - Interface defining point element behavior
|
|
14
|
-
* @see {@link UILayer} - Container layer for UI elements
|
|
15
|
-
* @see {@link UISolverWrapper} - Constraint solver integration
|
|
16
|
-
*/
|
|
17
|
-
export declare class UIAnchor extends Eventail implements UIPointElement {
|
|
3
|
+
import type { UILayerElement, UIPointElement } from "../miscellaneous/asserts";
|
|
4
|
+
import type { UISolverWrapperInterface } from "../wrappers/UISolverWrapper.Internal";
|
|
5
|
+
import type { UIAnchorOptions } from "./UIAnchor.Internal";
|
|
6
|
+
/** Point in 2D space with constraint-based positioning */
|
|
7
|
+
export declare class UIAnchor extends Eventail implements UILayerElement, UIPointElement {
|
|
18
8
|
readonly layer: UILayer;
|
|
19
|
-
/** Optional
|
|
9
|
+
/** Optional identifier for debugging */
|
|
20
10
|
name: string;
|
|
21
|
-
/**
|
|
22
|
-
* Solver variable descriptor for the x-coordinate.
|
|
23
|
-
* This variable is managed by the constraint solver system.
|
|
24
|
-
*/
|
|
11
|
+
/** Solver variable for x coordinate */
|
|
25
12
|
readonly xVariable: number;
|
|
26
|
-
/**
|
|
27
|
-
* Solver variable descriptor for the y-coordinate.
|
|
28
|
-
* This variable is managed by the constraint solver system.
|
|
29
|
-
*/
|
|
13
|
+
/** Solver variable for y coordinate */
|
|
30
14
|
readonly yVariable: number;
|
|
31
|
-
|
|
32
|
-
* Reference to the constraint solver wrapper for variable management.
|
|
33
|
-
* @see {@link UISolverWrapper}
|
|
34
|
-
*/
|
|
35
|
-
protected readonly solverWrapper: UISolverWrapper;
|
|
15
|
+
protected readonly solverWrapper: UISolverWrapperInterface;
|
|
36
16
|
/**
|
|
37
17
|
* Creates a new UIAnchor instance.
|
|
38
18
|
*
|
|
39
|
-
* @param layer -
|
|
40
|
-
* @param
|
|
41
|
-
* @param y - Initial y-coordinate position
|
|
42
|
-
* @throws Will throw an error if x or y are not valid numbers
|
|
43
|
-
* @see {@link assertValidNumber}
|
|
44
|
-
*/
|
|
45
|
-
constructor(layer: UILayer, x: number, y: number);
|
|
46
|
-
/**
|
|
47
|
-
* Gets the current x-coordinate value from the solver.
|
|
48
|
-
* @returns The current x-coordinate position
|
|
19
|
+
* @param layer - Layer containing this anchor
|
|
20
|
+
* @param options - Configuration options
|
|
49
21
|
*/
|
|
22
|
+
constructor(layer: UILayer, options?: Partial<UIAnchorOptions>);
|
|
23
|
+
/** X coordinate relative to layer origin (bottom-left) */
|
|
50
24
|
get x(): number;
|
|
51
|
-
/**
|
|
52
|
-
* Gets the current y-coordinate value from the solver.
|
|
53
|
-
* @returns The current y-coordinate position
|
|
54
|
-
*/
|
|
25
|
+
/** Y coordinate relative to layer origin (bottom-left) */
|
|
55
26
|
get y(): number;
|
|
56
|
-
/**
|
|
57
|
-
* Sets the x-coordinate value through the solver system.
|
|
58
|
-
* @param value - The new x-coordinate value
|
|
59
|
-
* @throws Will throw an error if value is not a valid number
|
|
60
|
-
* @see {@link assertValidNumber}
|
|
61
|
-
*/
|
|
27
|
+
/** X coordinate relative to layer origin (bottom-left) */
|
|
62
28
|
set x(value: number);
|
|
63
|
-
/**
|
|
64
|
-
* Sets the y-coordinate value through the solver system.
|
|
65
|
-
* @param value - The new y-coordinate value
|
|
66
|
-
* @throws Will throw an error if value is not a valid number
|
|
67
|
-
* @see {@link assertValidNumber}
|
|
68
|
-
*/
|
|
29
|
+
/** Y coordinate relative to layer origin (bottom-left) */
|
|
69
30
|
set y(value: number);
|
|
70
|
-
/**
|
|
71
|
-
* Destroys the anchor by removing its solver variables.
|
|
72
|
-
*
|
|
73
|
-
* This method cleans up the solver variables associated with this anchor,
|
|
74
|
-
* effectively removing it from the constraint solving system. After calling
|
|
75
|
-
* this method, the anchor should not be used anymore.
|
|
76
|
-
*/
|
|
31
|
+
/** Removes anchor and frees resources */
|
|
77
32
|
destroy(): void;
|
|
78
33
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { UIColorConfig } from "../miscellaneous/color/UIColor.Internal";
|
|
2
|
+
import type { UIElementOptions } from "./UIElement.Internal";
|
|
3
|
+
/** Animation playback events */
|
|
4
|
+
export declare enum UIAnimatedImageEvent {
|
|
5
|
+
/** Animation started or resumed */
|
|
6
|
+
PLAYED = 0,
|
|
7
|
+
/** Animation paused */
|
|
8
|
+
PAUSED = 1,
|
|
9
|
+
/** Animation stopped and reset */
|
|
10
|
+
STOPPED = 2
|
|
11
|
+
}
|
|
12
|
+
/** Configuration options for UIAnimatedImage */
|
|
13
|
+
export interface UIAnimatedImageOptions extends UIElementOptions {
|
|
14
|
+
/** Multiplicative tint */
|
|
15
|
+
color: UIColorConfig;
|
|
16
|
+
/** Animation speed in frames per second */
|
|
17
|
+
frameRate: number;
|
|
18
|
+
/** Whether animation repeats after completion */
|
|
19
|
+
loop: boolean;
|
|
20
|
+
/** Whether to start playing immediately */
|
|
21
|
+
playByDefault: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare const ANIMATED_IMAGE_DEFAULT_FRAME_RATE = 24;
|
|
24
|
+
export declare const ANIMATED_IMAGE_DEFAULT_LOOP = true;
|
|
@@ -1,119 +1,57 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { WebGLRenderer } from "three";
|
|
2
2
|
import type { UILayer } from "../layers/UILayer";
|
|
3
|
-
import { UIColor } from "../miscellaneous/UIColor";
|
|
3
|
+
import { UIColor } from "../miscellaneous/color/UIColor";
|
|
4
|
+
import { UITextureView } from "../miscellaneous/texture/UITextureView";
|
|
5
|
+
import type { UITextureConfig } from "../miscellaneous/texture/UITextureView.Internal";
|
|
6
|
+
import type { UIAnimatedImageOptions } from "./UIAnimatedImage.Internal";
|
|
4
7
|
import { UIElement } from "./UIElement";
|
|
5
|
-
|
|
6
|
-
PLAY = 0,
|
|
7
|
-
PAUSE = 1,
|
|
8
|
-
STOP = 2
|
|
9
|
-
}
|
|
10
|
-
export type UIAnimatedImageSequence = {
|
|
11
|
-
texture: Texture;
|
|
12
|
-
transforms: Matrix3[];
|
|
13
|
-
} | Texture[];
|
|
14
|
-
/**
|
|
15
|
-
* Configuration options for creating a UIAnimatedImage element.
|
|
16
|
-
*/
|
|
17
|
-
export interface UIAnimatedImageOptions {
|
|
18
|
-
/** X position of the element */
|
|
19
|
-
x: number;
|
|
20
|
-
/** Y position of the element */
|
|
21
|
-
y: number;
|
|
22
|
-
/** Width of the element */
|
|
23
|
-
width: number;
|
|
24
|
-
/** Height of the element */
|
|
25
|
-
height: number;
|
|
26
|
-
/** Color tint applied to the image */
|
|
27
|
-
color: UIColor;
|
|
28
|
-
/** Frame rate for animation */
|
|
29
|
-
frameRate: number;
|
|
30
|
-
/** Whether animation should loop */
|
|
31
|
-
loop: boolean;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* UI element for displaying textured images.
|
|
35
|
-
*
|
|
36
|
-
* UIAnimatedImage is a concrete implementation of UIElement that renders a textured
|
|
37
|
-
* image using shader-based planes. It automatically sizes itself
|
|
38
|
-
* to match the texture dimensions and provides control over visual properties
|
|
39
|
-
* such as color tinting.
|
|
40
|
-
*
|
|
41
|
-
* @see {@link UIElement} - Base class providing UI element functionality
|
|
42
|
-
* @see {@link Texture} - Three.js texture for image data
|
|
43
|
-
*/
|
|
8
|
+
/** Frame-based texture animation element */
|
|
44
9
|
export declare class UIAnimatedImage extends UIElement {
|
|
45
|
-
/**
|
|
10
|
+
/** Multiplicative tint. Alpha channel controls opacity. */
|
|
11
|
+
readonly color: UIColor;
|
|
46
12
|
private readonly sequenceInternal;
|
|
47
|
-
/** Internal storage for the color tint */
|
|
48
|
-
private readonly colorInternal;
|
|
49
13
|
private frameRateInternal;
|
|
50
14
|
private loopInternal;
|
|
51
|
-
private
|
|
52
|
-
private
|
|
15
|
+
private readonly textureTransform;
|
|
16
|
+
private isPlaying;
|
|
17
|
+
private sequenceFrameIndex;
|
|
18
|
+
private currentFrameIndexDirty;
|
|
19
|
+
private accumulatedTime;
|
|
53
20
|
/**
|
|
54
21
|
* Creates a new UIAnimatedImage instance.
|
|
55
22
|
*
|
|
56
|
-
*
|
|
57
|
-
* All options have default values if not specified.
|
|
23
|
+
* Defaults size to first frame dimensions if width and height not provided.
|
|
58
24
|
*
|
|
59
|
-
* @param layer -
|
|
60
|
-
* @param
|
|
61
|
-
* @param options - Configuration options
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
* @returns The UIColor instance
|
|
68
|
-
*/
|
|
69
|
-
get color(): UIColor;
|
|
70
|
-
/**
|
|
71
|
-
* Gets the frame rate for animation.
|
|
72
|
-
* @returns The frame rate in frames per second
|
|
73
|
-
*/
|
|
25
|
+
* @param layer - Layer containing this element
|
|
26
|
+
* @param sequence - Array of textures forming animation
|
|
27
|
+
* @param options - Configuration options
|
|
28
|
+
*/
|
|
29
|
+
constructor(layer: UILayer, sequence: UITextureConfig[], options?: Partial<UIAnimatedImageOptions>);
|
|
30
|
+
/** Animation frames as readonly array */
|
|
31
|
+
get sequence(): readonly UITextureView[];
|
|
32
|
+
/** Animation speed in frames per second */
|
|
74
33
|
get frameRate(): number;
|
|
75
|
-
/**
|
|
76
|
-
* Gets whether the animation loops.
|
|
77
|
-
* @returns True if animation loops
|
|
78
|
-
*/
|
|
34
|
+
/** Whether animation repeats after completion */
|
|
79
35
|
get loop(): boolean;
|
|
80
|
-
/**
|
|
81
|
-
* Gets the total duration of the animation in seconds.
|
|
82
|
-
* @returns The duration in seconds
|
|
83
|
-
*/
|
|
36
|
+
/** Total animation duration in seconds */
|
|
84
37
|
get duration(): number;
|
|
85
|
-
/**
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
*/
|
|
89
|
-
set color(value: UIColor);
|
|
90
|
-
/**
|
|
91
|
-
* Sets the frame rate for animation.
|
|
92
|
-
* @param value - The frame rate in frames per second
|
|
93
|
-
*/
|
|
38
|
+
/** Replaces animation frames. Stops playback. */
|
|
39
|
+
set sequence(sequence: UITextureConfig[]);
|
|
40
|
+
/** Animation speed in frames per second */
|
|
94
41
|
set frameRate(value: number);
|
|
95
|
-
/**
|
|
96
|
-
* Sets whether the animation loops.
|
|
97
|
-
* @param value - True to enable looping
|
|
98
|
-
*/
|
|
42
|
+
/** Whether animation repeats after completion */
|
|
99
43
|
set loop(value: boolean);
|
|
100
|
-
/**
|
|
101
|
-
|
|
102
|
-
|
|
44
|
+
/** Removes element and frees resources */
|
|
45
|
+
destroy(): void;
|
|
46
|
+
/** Starts or resumes animation playback */
|
|
103
47
|
play(): void;
|
|
104
|
-
/**
|
|
105
|
-
* Pauses the animation at the current frame.
|
|
106
|
-
*/
|
|
48
|
+
/** Pauses animation at current frame */
|
|
107
49
|
pause(): void;
|
|
108
|
-
/**
|
|
109
|
-
* Stops the animation and resets to the first frame.
|
|
110
|
-
*/
|
|
50
|
+
/** Stops animation and resets to first frame */
|
|
111
51
|
stop(): void;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
private readonly onColorChange;
|
|
118
|
-
private updateFrame;
|
|
52
|
+
protected onWillRender(renderer: WebGLRenderer, deltaTime: number): void;
|
|
53
|
+
protected updatePlaneTransform(): void;
|
|
54
|
+
private readonly onTextureDimensionsChanged;
|
|
55
|
+
private subscribeSequenceEvents;
|
|
56
|
+
private unsubscribeSequenceEvents;
|
|
119
57
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { UIArea } from "../miscellaneous/area/UIArea";
|
|
2
|
+
import { UIMode } from "../miscellaneous/UIMode";
|
|
3
|
+
import type { UIAnchorOptions } from "./UIAnchor.Internal";
|
|
4
|
+
/** Configuration options for UIDummy */
|
|
5
|
+
export interface UIDummyOptions extends UIAnchorOptions {
|
|
6
|
+
/** Width in world units */
|
|
7
|
+
width: number;
|
|
8
|
+
/** Height in world units */
|
|
9
|
+
height: number;
|
|
10
|
+
/** Shape defining interactive region in normalized coordinates */
|
|
11
|
+
interactionArea: UIArea;
|
|
12
|
+
/** Controls visibility and interactivity */
|
|
13
|
+
mode: UIMode;
|
|
14
|
+
}
|
|
15
|
+
export declare const DUMMY_DEFAULT_WIDTH = 64;
|
|
16
|
+
export declare const DUMMY_DEFAULT_HEIGHT = 32;
|
|
17
|
+
export declare const DUMMY_DEFAULT_MODE = UIMode.VISIBLE;
|
|
18
|
+
export declare const DUMMY_DEFAULT_Z_INDEX = 0;
|
|
@@ -1,78 +1,66 @@
|
|
|
1
1
|
import type { UILayer } from "../layers/UILayer";
|
|
2
|
-
import {
|
|
2
|
+
import type { UIArea } from "../miscellaneous/area/UIArea";
|
|
3
|
+
import type { UIPlaneElement } from "../miscellaneous/asserts";
|
|
4
|
+
import { UIInputEvent } from "../miscellaneous/UIInputEvent";
|
|
5
|
+
import { UIMode } from "../miscellaneous/UIMode";
|
|
6
|
+
import type { UIInputWrapperInterface } from "../wrappers/UIInputWrapper.Internal";
|
|
3
7
|
import { UIAnchor } from "./UIAnchor";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
y: number;
|
|
7
|
-
width: number;
|
|
8
|
-
height: number;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* UI element that extends UIAnchor with dimensions but without rendering.
|
|
12
|
-
*
|
|
13
|
-
* UIDummy represents a rectangular area in the UI layout system that has position
|
|
14
|
-
* and dimensions (width and height) but does not perform any visual rendering.
|
|
15
|
-
* It serves as a placeholder or spacer element in constraint-based layouts,
|
|
16
|
-
* useful for defining layout structure without visual content.
|
|
17
|
-
*
|
|
18
|
-
* @see {@link UIAnchor} - Base class providing position functionality
|
|
19
|
-
* @see {@link UIPlaneElement} - Interface defining dimensional element behavior
|
|
20
|
-
* @see {@link UILayer} - Container layer for UI elements
|
|
21
|
-
*/
|
|
8
|
+
import type { UIDummyOptions } from "./UIDummy.Internal";
|
|
9
|
+
/** Rectangular area with dimensions but no rendering */
|
|
22
10
|
export declare class UIDummy extends UIAnchor implements UIPlaneElement {
|
|
23
|
-
/**
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
*/
|
|
11
|
+
/** Shape defining interactive region in normalized coordinates */
|
|
12
|
+
interactionArea: UIArea;
|
|
13
|
+
/** Solver variable for width */
|
|
27
14
|
readonly wVariable: number;
|
|
28
|
-
/**
|
|
29
|
-
* Solver variable descriptor for the height dimension.
|
|
30
|
-
* This variable is managed by the constraint solver system.
|
|
31
|
-
*/
|
|
15
|
+
/** Solver variable for height */
|
|
32
16
|
readonly hVariable: number;
|
|
17
|
+
protected modeInternal: UIMode;
|
|
18
|
+
protected readonly inputWrapper: UIInputWrapperInterface;
|
|
19
|
+
private readonly catcherHandler;
|
|
20
|
+
private lastPointerInside;
|
|
33
21
|
/**
|
|
34
|
-
* Creates a new UIDummy instance
|
|
22
|
+
* Creates a new UIDummy instance.
|
|
35
23
|
*
|
|
36
|
-
* @param layer -
|
|
37
|
-
* @param
|
|
38
|
-
* @param y - Initial y-coordinate position
|
|
39
|
-
* @param width - Initial width dimension (defaults to 100)
|
|
40
|
-
* @param height - Initial height dimension (defaults to 100)
|
|
41
|
-
* @throws Will throw an error if width or height are not valid positive numbers
|
|
42
|
-
* @see {@link assertValidPositiveNumber}
|
|
24
|
+
* @param layer - Layer containing this element
|
|
25
|
+
* @param options - Configuration options
|
|
43
26
|
*/
|
|
44
27
|
constructor(layer: UILayer, options?: Partial<UIDummyOptions>);
|
|
45
|
-
/**
|
|
46
|
-
* Gets the current width value from the solver.
|
|
47
|
-
* @returns The current width dimension
|
|
48
|
-
*/
|
|
28
|
+
/** Width in world units */
|
|
49
29
|
get width(): number;
|
|
50
|
-
/**
|
|
51
|
-
* Gets the current height value from the solver.
|
|
52
|
-
* @returns The current height dimension
|
|
53
|
-
*/
|
|
30
|
+
/** Height in world units */
|
|
54
31
|
get height(): number;
|
|
55
|
-
/**
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
32
|
+
/** X coordinate of right edge */
|
|
33
|
+
get oppositeX(): number;
|
|
34
|
+
/** Y coordinate of top edge */
|
|
35
|
+
get oppositeY(): number;
|
|
36
|
+
/** X coordinate of horizontal center */
|
|
37
|
+
get centerX(): number;
|
|
38
|
+
/** Y coordinate of vertical center */
|
|
39
|
+
get centerY(): number;
|
|
40
|
+
/** Controls visibility and interactivity */
|
|
41
|
+
get mode(): UIMode;
|
|
42
|
+
/** Rendering and input priority. Higher values on top. */
|
|
43
|
+
get zIndex(): number;
|
|
44
|
+
/** Width in world units */
|
|
61
45
|
set width(value: number);
|
|
62
|
-
/**
|
|
63
|
-
* Sets the height value through the solver system.
|
|
64
|
-
* @param value - The new height dimension (must be positive)
|
|
65
|
-
* @throws Will throw an error if value is not a valid positive number
|
|
66
|
-
* @see {@link assertValidPositiveNumber}
|
|
67
|
-
*/
|
|
46
|
+
/** Height in world units */
|
|
68
47
|
set height(value: number);
|
|
69
|
-
/**
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
48
|
+
/** X coordinate of right edge */
|
|
49
|
+
set oppositeX(value: number);
|
|
50
|
+
/** Y coordinate of top edge */
|
|
51
|
+
set oppositeY(value: number);
|
|
52
|
+
/** X coordinate of horizontal center */
|
|
53
|
+
set centerX(value: number);
|
|
54
|
+
/** Y coordinate of vertical center */
|
|
55
|
+
set centerY(value: number);
|
|
56
|
+
/** Controls visibility and interactivity */
|
|
57
|
+
set mode(value: UIMode);
|
|
58
|
+
/** Rendering and input priority. Higher values on top. */
|
|
59
|
+
set zIndex(value: number);
|
|
60
|
+
/** Removes element and frees resources */
|
|
77
61
|
destroy(): void;
|
|
62
|
+
protected readonly catchPointerDown: (x: number, y: number, identifier: number) => boolean;
|
|
63
|
+
protected readonly catchPointerMove: (x: number, y: number, identifier: number) => boolean;
|
|
64
|
+
protected readonly catchPointerUp: (x: number, y: number, identifier: number) => boolean;
|
|
65
|
+
protected handleInputEvent(x: number, y: number, identifier: number, inputEvent: UIInputEvent): boolean;
|
|
78
66
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { UIMicroConfig } from "../miscellaneous/micro/UIMicro.Internal";
|
|
2
|
+
import { UITransparencyMode } from "../miscellaneous/UITransparencyMode";
|
|
3
|
+
import type { UIDummyOptions } from "./UIDummy.Internal";
|
|
4
|
+
/** Configuration options for UIElement */
|
|
5
|
+
export interface UIElementOptions extends UIDummyOptions {
|
|
6
|
+
/** Transforms that don't affect constraints */
|
|
7
|
+
micro: UIMicroConfig;
|
|
8
|
+
/** Alpha blending mode */
|
|
9
|
+
transparencyMode: UITransparencyMode;
|
|
10
|
+
}
|
|
11
|
+
export declare const ELEMENT_DEFAULT_TRANSPARENCY_MODE = UITransparencyMode.BLEND;
|
|
@@ -1,177 +1,37 @@
|
|
|
1
1
|
import type { WebGLRenderer } from "three";
|
|
2
|
-
import type {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
*
|
|
14
|
-
* UIElement serves as the fundamental building block for all other UI elements
|
|
15
|
-
* that need to be visually rendered. It extends UIAnchor with dimensional properties
|
|
16
|
-
* and integrates with the Three.js rendering system through shader-based planes. This class
|
|
17
|
-
* provides essential functionality for positioning, sizing, rendering, visibility,
|
|
18
|
-
* z-index management, and user interaction.
|
|
19
|
-
*
|
|
20
|
-
* @see {@link UIAnchor} - Base class providing position functionality
|
|
21
|
-
* @see {@link UIPlaneElement} - Interface defining dimensional element behavior
|
|
22
|
-
* @see {@link UIMicro} - Micro-optimization utilities
|
|
23
|
-
*/
|
|
24
|
-
export declare abstract class UIElement extends UIAnchor implements UIPlaneElement, UILayerElement {
|
|
25
|
-
/** Micro-transformation system for non-constraint based positioning, scaling, and rotation adjustments. */
|
|
2
|
+
import type { UILayer } from "../layers/UILayer";
|
|
3
|
+
import type { UIPropertyType } from "../miscellaneous/generic-plane/shared";
|
|
4
|
+
import { UIMicro } from "../miscellaneous/micro/UIMicro";
|
|
5
|
+
import type { UIMode } from "../miscellaneous/UIMode";
|
|
6
|
+
import type { UITransparencyMode } from "../miscellaneous/UITransparencyMode";
|
|
7
|
+
import type { UISceneWrapperInterface } from "../wrappers/UISceneWrapper.Internal";
|
|
8
|
+
import { UIDummy } from "./UIDummy";
|
|
9
|
+
import type { UIElementOptions } from "./UIElement.Internal";
|
|
10
|
+
/** Base class for renderable UI elements */
|
|
11
|
+
export declare abstract class UIElement extends UIDummy {
|
|
12
|
+
/** Transforms that don't affect constraints */
|
|
26
13
|
readonly micro: UIMicro;
|
|
27
|
-
|
|
28
|
-
* Solver variable descriptor for the width dimension.
|
|
29
|
-
* This variable is managed by the constraint solver system.
|
|
30
|
-
*/
|
|
31
|
-
readonly wVariable: number;
|
|
32
|
-
/**
|
|
33
|
-
* Solver variable descriptor for the height dimension.
|
|
34
|
-
* This variable is managed by the constraint solver system.
|
|
35
|
-
*/
|
|
36
|
-
readonly hVariable: number;
|
|
37
|
-
/** Internal storage for the current visibility/interaction mode. */
|
|
38
|
-
protected modeInternal: UIMode;
|
|
39
|
-
/** Internal storage for the transparency rendering mode. */
|
|
40
|
-
protected transparencyInternal: UITransparencyMode;
|
|
41
|
-
/** Internal storage for the z-index (depth) value. */
|
|
42
|
-
protected zIndexInternal: number;
|
|
43
|
-
/** Optional input listener for handling user interactions when in interactive mode. */
|
|
44
|
-
protected listener?: UILayerInputListener;
|
|
45
|
-
protected isPointerInside: boolean;
|
|
46
|
-
/** Client API for interacting with the scene wrapper (rendering system). */
|
|
47
|
-
protected readonly sceneWrapper: UISceneWrapperClientAPI;
|
|
48
|
-
/** Handle to the plane object in the rendering system. */
|
|
14
|
+
protected readonly sceneWrapper: UISceneWrapperInterface;
|
|
49
15
|
protected readonly planeHandler: number;
|
|
16
|
+
private transparencyModeInternal;
|
|
17
|
+
private transparencyModeDirty;
|
|
18
|
+
private visibilityDirty;
|
|
50
19
|
/**
|
|
51
|
-
* Creates a new UIElement instance
|
|
20
|
+
* Creates a new UIElement instance.
|
|
52
21
|
*
|
|
53
|
-
* @param layer -
|
|
54
|
-
* @param
|
|
55
|
-
* @param
|
|
56
|
-
* @param
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
constructor(layer: UILayer, x: number, y: number, width: number, height: number, source: string, uniforms: Record<string, unknown>);
|
|
64
|
-
/**
|
|
65
|
-
* Gets the current width value from the solver.
|
|
66
|
-
* @returns The current width dimension
|
|
67
|
-
*/
|
|
68
|
-
get width(): number;
|
|
69
|
-
/**
|
|
70
|
-
* Gets the current height value from the solver.
|
|
71
|
-
* @returns The current height dimension
|
|
72
|
-
*/
|
|
73
|
-
get height(): number;
|
|
74
|
-
/**
|
|
75
|
-
* Gets the current z-index (depth) value.
|
|
76
|
-
* @returns The current z-index value
|
|
77
|
-
*/
|
|
78
|
-
get zIndex(): number;
|
|
79
|
-
/**
|
|
80
|
-
* The right edge X coordinate of this element (x + width).
|
|
81
|
-
*/
|
|
82
|
-
get oppositeX(): number;
|
|
83
|
-
/**
|
|
84
|
-
* The bottom edge Y coordinate of this element (y + height).
|
|
85
|
-
*/
|
|
86
|
-
get oppositeY(): number;
|
|
87
|
-
/**
|
|
88
|
-
* The X coordinate of the center of this element.
|
|
89
|
-
*/
|
|
90
|
-
get centerX(): number;
|
|
91
|
-
/**
|
|
92
|
-
* The Y coordinate of the center of this element.
|
|
93
|
-
*/
|
|
94
|
-
get centerY(): number;
|
|
95
|
-
/**
|
|
96
|
-
* Gets the current visibility and interaction mode.
|
|
97
|
-
* @returns The current UIMode setting
|
|
98
|
-
* @see {@link UIMode}
|
|
99
|
-
*/
|
|
100
|
-
get mode(): UIMode;
|
|
101
|
-
/**
|
|
102
|
-
* Gets the current transparency rendering mode.
|
|
103
|
-
* @returns The current transparency mode
|
|
104
|
-
* @see {@link UITransparencyMode}
|
|
105
|
-
*/
|
|
106
|
-
get transparency(): UITransparencyMode;
|
|
107
|
-
/**
|
|
108
|
-
* Sets the width value through the solver system.
|
|
109
|
-
* @param value - The new width dimension (must be positive)
|
|
110
|
-
* @throws Will throw an error if value is not a valid positive number
|
|
111
|
-
* @see {@link assertValidPositiveNumber}
|
|
112
|
-
*/
|
|
113
|
-
set width(value: number);
|
|
114
|
-
/**
|
|
115
|
-
* Sets the height value through the solver system.
|
|
116
|
-
* @param value - The new height dimension (must be positive)
|
|
117
|
-
* @throws Will throw an error if value is not a valid positive number
|
|
118
|
-
* @see {@link assertValidPositiveNumber}
|
|
119
|
-
*/
|
|
120
|
-
set height(value: number);
|
|
121
|
-
/**
|
|
122
|
-
* Sets the z-index (depth) value for rendering order and input handling.
|
|
123
|
-
* @param value - The new z-index value
|
|
124
|
-
* @throws Will throw an error if value is not a valid number
|
|
125
|
-
* @see {@link assertValidNumber}
|
|
126
|
-
*/
|
|
127
|
-
set zIndex(value: number);
|
|
128
|
-
/**
|
|
129
|
-
* The right edge X coordinate of this element (x + width).
|
|
130
|
-
*/
|
|
131
|
-
set oppositeX(value: number);
|
|
132
|
-
/**
|
|
133
|
-
* The bottom edge Y coordinate of this element (y + height).
|
|
134
|
-
*/
|
|
135
|
-
set oppositeY(value: number);
|
|
136
|
-
/**
|
|
137
|
-
* The X coordinate of the center of this element.
|
|
138
|
-
*/
|
|
139
|
-
set centerX(value: number);
|
|
140
|
-
/**
|
|
141
|
-
* The Y coordinate of the center of this element.
|
|
142
|
-
*/
|
|
143
|
-
set centerY(value: number);
|
|
144
|
-
/**
|
|
145
|
-
* Sets the current visibility and interaction mode.
|
|
146
|
-
* @param value - The new UIMode setting
|
|
147
|
-
* @see {@link UIMode}
|
|
148
|
-
*/
|
|
22
|
+
* @param layer - Layer containing this element
|
|
23
|
+
* @param source - GLSL shader source code
|
|
24
|
+
* @param properties - Shader uniform properties
|
|
25
|
+
* @param options - Configuration options
|
|
26
|
+
*/
|
|
27
|
+
constructor(layer: UILayer, source: string, properties: Record<string, UIPropertyType>, options?: Partial<UIElementOptions>);
|
|
28
|
+
/** Alpha blending mode */
|
|
29
|
+
get transparencyMode(): UITransparencyMode;
|
|
30
|
+
/** Alpha blending mode */
|
|
31
|
+
set transparencyMode(value: UITransparencyMode);
|
|
149
32
|
set mode(value: UIMode);
|
|
150
|
-
/**
|
|
151
|
-
* Sets the transparency rendering mode.
|
|
152
|
-
* @param value - The new transparency mode
|
|
153
|
-
* @see {@link UITransparencyMode}
|
|
154
|
-
*/
|
|
155
|
-
set transparency(value: UITransparencyMode);
|
|
156
|
-
/**
|
|
157
|
-
* Destroys the UI element by cleaning up all associated resources.
|
|
158
|
-
*
|
|
159
|
-
* This method removes the element from the rendering scene, cleans up
|
|
160
|
-
* dimension solver variables, removes input listeners, and calls the parent
|
|
161
|
-
* destroy method to clean up position variables. After calling this method,
|
|
162
|
-
* the element should not be used anymore.
|
|
163
|
-
*/
|
|
33
|
+
/** Removes element and frees resources */
|
|
164
34
|
destroy(): void;
|
|
165
|
-
protected
|
|
166
|
-
protected readonly catchPointerMove: (x: number, y: number, identifier: number) => boolean;
|
|
167
|
-
protected readonly catchPointerUp: (x: number, y: number, identifier: number) => boolean;
|
|
168
|
-
protected handleInputEvent(x: number, y: number, identifier: number, inputEvent: UIInputEvent): boolean;
|
|
169
|
-
/**
|
|
170
|
-
* Called before each render frame to update the element's transform matrix.
|
|
171
|
-
* Applies micro-transformations (position, rotation, scale, anchor) and updates
|
|
172
|
-
* the rendering system with the final transformation matrix.
|
|
173
|
-
* @param renderer - The WebGL renderer (unused in base implementation)
|
|
174
|
-
* @param deltaTime - Time since last frame in seconds (unused in base implementation)
|
|
175
|
-
*/
|
|
35
|
+
protected updatePlaneTransform(): void;
|
|
176
36
|
protected onWillRender(renderer: WebGLRenderer, deltaTime: number): void;
|
|
177
37
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { UIColorConfig } from "../miscellaneous/color/UIColor.Internal";
|
|
2
|
+
import type { UIElementOptions } from "./UIElement.Internal";
|
|
3
|
+
/** Configuration options for UIGraphics */
|
|
4
|
+
export interface UIGraphicsOptions extends UIElementOptions {
|
|
5
|
+
/** Multiplicative tint */
|
|
6
|
+
color: UIColorConfig;
|
|
7
|
+
}
|