laymur 0.2.0 → 0.2.2
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 +353 -2
- package/dist/builders/UIConstraint2DBuilder.d.ts +102 -14
- 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/constraints/UIAspectConstraint.d.ts +40 -36
- package/dist/constraints/UIConstraint.d.ts +17 -20
- package/dist/constraints/UICoverConstraint.d.ts +0 -72
- package/dist/constraints/UICustomConstraint.d.ts +60 -0
- package/dist/constraints/UIFitConstraint.d.ts +0 -72
- package/dist/constraints/UIHeightConstraint.d.ts +32 -38
- package/dist/constraints/UIHorizontalDistanceConstraint.d.ts +77 -46
- package/dist/constraints/UIHorizontalProportionConstraint.d.ts +49 -40
- package/dist/constraints/UISingleParameterConstraint.d.ts +108 -0
- package/dist/constraints/UIVerticalDistanceConstraint.d.ts +77 -46
- package/dist/constraints/UIVerticalProportionConstraint.d.ts +49 -40
- package/dist/constraints/UIWidthConstraint.d.ts +32 -38
- package/dist/elements/UIAnchor.d.ts +58 -45
- package/dist/elements/UIDummy.d.ts +63 -12
- package/dist/elements/UIElement.d.ts +81 -93
- package/dist/elements/UIImage.d.ts +64 -33
- package/dist/elements/UINineSline.d.ts +0 -0
- package/dist/elements/UIProgress.d.ts +7 -95
- package/dist/elements/UIScene.d.ts +142 -84
- package/dist/elements/UIText.d.ts +124 -43
- package/dist/index.d.ts +10 -11
- package/dist/index.js +2887 -2716
- 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 +112 -0
- package/dist/layers/UILayer.d.ts +134 -57
- package/dist/materials/UIInstancedMaterial.d.ts +0 -0
- package/dist/materials/UIMaterial.d.ts +6 -6
- package/dist/materials/UINineSliceMaterial.d.ts +0 -0
- package/dist/materials/UIProgressMaterial.d.ts +0 -4
- package/dist/miscellaneous/UIExpression.d.ts +117 -0
- package/dist/miscellaneous/UIMicro.d.ts +73 -119
- package/dist/miscellaneous/UIOrientation.d.ts +2 -9
- package/dist/miscellaneous/UIPriority.d.ts +56 -0
- package/dist/miscellaneous/UIRelation.d.ts +43 -0
- package/dist/miscellaneous/UITextPadding.d.ts +7 -0
- package/dist/miscellaneous/UITextSpan.d.ts +6 -0
- package/dist/miscellaneous/UITextStyle.d.ts +18 -0
- package/dist/miscellaneous/asserts.d.ts +111 -4
- package/dist/miscellaneous/textInterfaces.d.ts +19 -0
- package/dist/miscellaneous/textTools.d.ts +8 -5
- package/dist/scalable/UIScalableMesh.d.ts +16 -0
- package/dist/scalable/UIScalablePlaneMesh.d.ts +14 -0
- package/dist/wrappers/UISceneWrapper.d.ts +18 -0
- package/dist/wrappers/UISolverWrapper.d.ts +29 -0
- package/package.json +1 -1
- package/dist/Passes/UIComposer.d.ts +0 -114
- package/dist/Passes/UIFullScreenQuad.d.ts +0 -51
- package/dist/Passes/UIPass.d.ts +0 -43
- package/dist/builders/UIConstraintContainerBuilder.d.ts +0 -20
- package/dist/builders/UIConstraintStackBuilder.d.ts +0 -24
- package/dist/constraints/UIConstraintPower.d.ts +0 -57
- package/dist/constraints/UIConstraintRule.d.ts +0 -46
- package/dist/layers/UIFullScreenLayer.d.ts +0 -13
- package/dist/miscellaneous/UIBlending.d.ts +0 -7
- package/dist/miscellaneous/UITextInterfaces.d.ts +0 -49
- package/dist/miscellaneous/math.d.ts +0 -1
- package/dist/miscellaneous/microTransformationTools.d.ts +0 -3
|
@@ -1,141 +1,199 @@
|
|
|
1
|
-
import type { Camera
|
|
2
|
-
import { Scene } from "three";
|
|
1
|
+
import type { Camera } from "three";
|
|
2
|
+
import { Mesh, Scene } from "three";
|
|
3
3
|
import type { UILayer } from "../layers/UILayer";
|
|
4
4
|
import { UIElement } from "./UIElement";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Update modes for controlling when the 3D scene should be re-rendered.
|
|
7
7
|
*/
|
|
8
8
|
export declare enum UISceneUpdateMode {
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
|
|
9
|
+
/** Re-render the scene every frame. */
|
|
10
|
+
EACH_FRAME = 1,
|
|
11
|
+
/** Re-render the scene every second frame for performance. */
|
|
12
|
+
EACH_SECOND_FRAME = 2,
|
|
13
|
+
/** Re-render the scene only when properties change. */
|
|
14
|
+
PROPERTY_CHANGED = 3,
|
|
15
|
+
/** Re-render the scene only when manually requested. */
|
|
16
|
+
MANUAL = 4
|
|
15
17
|
}
|
|
16
18
|
/**
|
|
17
|
-
*
|
|
19
|
+
* Configuration options for UIScene element creation.
|
|
18
20
|
*/
|
|
19
21
|
export interface UISceneOptions {
|
|
20
|
-
/**
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
/** Width of the scene
|
|
22
|
+
/** Initial x-coordinate position. */
|
|
23
|
+
x: number;
|
|
24
|
+
/** Initial y-coordinate position. */
|
|
25
|
+
y: number;
|
|
26
|
+
/** Width of the scene render target in pixels. */
|
|
25
27
|
width: number;
|
|
26
|
-
/** Height of the scene
|
|
28
|
+
/** Height of the scene render target in pixels. */
|
|
27
29
|
height: number;
|
|
28
|
-
/**
|
|
30
|
+
/** Three.js scene to render. */
|
|
31
|
+
scene: Scene;
|
|
32
|
+
/** Camera to use for rendering the scene. */
|
|
33
|
+
camera: Camera;
|
|
34
|
+
/** Update mode controlling when the scene is re-rendered. */
|
|
35
|
+
updateMode: UISceneUpdateMode;
|
|
36
|
+
/** Resolution factor for render target sizing (0.1 to 2.0). */
|
|
29
37
|
resolutionFactor: number;
|
|
30
|
-
/**
|
|
31
|
-
renderedByDefault: boolean;
|
|
32
|
-
/** Whether to use a depth buffer for rendering */
|
|
33
|
-
useDepth: boolean;
|
|
34
|
-
/** Color to clear the scene with before rendering */
|
|
38
|
+
/** Clear color for the render target background. */
|
|
35
39
|
clearColor: number;
|
|
36
|
-
/**
|
|
40
|
+
/** Clear alpha for the render target background. */
|
|
37
41
|
clearAlpha: number;
|
|
38
|
-
/**
|
|
39
|
-
|
|
42
|
+
/** Whether to enable depth buffer for the render target. */
|
|
43
|
+
enableDepthBuffer: boolean;
|
|
40
44
|
}
|
|
41
45
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
46
|
+
* UI element for rendering 3D scenes to texture within the UI system.
|
|
47
|
+
*
|
|
48
|
+
* UIScene is a concrete implementation of UIElement that renders a Three.js
|
|
49
|
+
* scene to a WebGL render target and displays it as a texture. It provides
|
|
50
|
+
* control over rendering frequency, resolution, and visual properties. This
|
|
51
|
+
* allows embedding complex 3D content within the 2D UI layout system with
|
|
52
|
+
* performance optimizations through configurable update modes.
|
|
53
|
+
*
|
|
54
|
+
* @see {@link UIElement} - Base class providing UI element functionality
|
|
55
|
+
* @see {@link UISceneUpdateMode} - Update mode configuration
|
|
56
|
+
* @see {@link Scene} - Three.js scene for 3D content
|
|
57
|
+
* @see {@link Camera} - Three.js camera for scene rendering
|
|
44
58
|
*/
|
|
45
|
-
export declare class UIScene extends UIElement {
|
|
46
|
-
/**
|
|
59
|
+
export declare class UIScene extends UIElement<Mesh> {
|
|
60
|
+
/** The material used for rendering the scene texture. */
|
|
47
61
|
private readonly material;
|
|
48
|
-
/** WebGL render target
|
|
62
|
+
/** The WebGL render target for off-screen scene rendering. */
|
|
49
63
|
private readonly renderTarget;
|
|
50
|
-
/**
|
|
51
|
-
private clearColorInternal;
|
|
52
|
-
/** Alpha value for the clear color */
|
|
53
|
-
private clearAlphaInternal;
|
|
54
|
-
/** Whether the scene needs to be re-rendered on the next frame */
|
|
55
|
-
private needsRenderInternal;
|
|
56
|
-
/** When the scene should be automatically re-rendered */
|
|
57
|
-
private readonly updateModeInternal;
|
|
58
|
-
/** Resolution scaling factor for performance optimization */
|
|
59
|
-
private resolutionFactorInternal;
|
|
60
|
-
/** The Three.js scene being rendered */
|
|
64
|
+
/** Internal storage for the current Three.js scene. */
|
|
61
65
|
private sceneInternal;
|
|
62
|
-
/**
|
|
66
|
+
/** Internal storage for the current camera. */
|
|
63
67
|
private cameraInternal;
|
|
68
|
+
/** Internal storage for the current update mode. */
|
|
69
|
+
private updateModeInternal;
|
|
70
|
+
/** Internal storage for the current resolution factor. */
|
|
71
|
+
private resolutionFactorInternal;
|
|
72
|
+
/** Internal storage for the current clear color. */
|
|
73
|
+
private clearColorInternal;
|
|
74
|
+
/** Internal storage for the current clear alpha. */
|
|
75
|
+
private clearAlphaInternal;
|
|
76
|
+
/** Frame alternation boolean for EACH_SECOND_FRAME update mode. */
|
|
77
|
+
private frameBoolean;
|
|
78
|
+
/** Flag indicating if properties have changed requiring a re-render. */
|
|
79
|
+
private propertyChanged;
|
|
80
|
+
/** Flag indicating if a manual render has been requested. */
|
|
81
|
+
private renderRequired;
|
|
64
82
|
/**
|
|
65
|
-
* Creates a new scene
|
|
83
|
+
* Creates a new UIScene instance with 3D scene rendering capabilities.
|
|
84
|
+
*
|
|
85
|
+
* The scene element creates a WebGL render target for off-screen rendering
|
|
86
|
+
* and displays the result as a texture. A default perspective camera is
|
|
87
|
+
* created if none is provided.
|
|
66
88
|
*
|
|
67
|
-
* @param layer - The UI layer that contains this element
|
|
68
|
-
* @param options -
|
|
69
|
-
* @throws
|
|
89
|
+
* @param layer - The UI layer that contains this scene element
|
|
90
|
+
* @param options - Configuration options for scene rendering
|
|
91
|
+
* @throws Will throw an error if resolution factor is outside valid range (0.1-2.0)
|
|
70
92
|
*/
|
|
71
93
|
constructor(layer: UILayer, options?: Partial<UISceneOptions>);
|
|
72
|
-
/**
|
|
73
|
-
|
|
74
|
-
|
|
94
|
+
/**
|
|
95
|
+
* Gets the current color tint applied to the scene texture.
|
|
96
|
+
* @returns The color value as a number (e.g., 0xFFFFFF for white)
|
|
97
|
+
*/
|
|
75
98
|
get color(): number;
|
|
76
|
-
/**
|
|
99
|
+
/**
|
|
100
|
+
* Gets the current opacity level of the scene texture.
|
|
101
|
+
* @returns The opacity value between 0.0 (transparent) and 1.0 (opaque)
|
|
102
|
+
*/
|
|
77
103
|
get opacity(): number;
|
|
78
|
-
/**
|
|
104
|
+
/**
|
|
105
|
+
* Gets whether transparency is enabled for the scene texture.
|
|
106
|
+
* @returns True if transparency is enabled, false otherwise
|
|
107
|
+
*/
|
|
108
|
+
get transparency(): boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Gets the Three.js scene being rendered.
|
|
111
|
+
* @returns The current Three.js scene
|
|
112
|
+
*/
|
|
79
113
|
get scene(): Scene;
|
|
80
|
-
/**
|
|
114
|
+
/**
|
|
115
|
+
* Gets the camera used for rendering the scene.
|
|
116
|
+
* @returns The current Three.js camera
|
|
117
|
+
*/
|
|
81
118
|
get camera(): Camera;
|
|
82
|
-
/**
|
|
119
|
+
/**
|
|
120
|
+
* Gets the current update mode controlling render frequency.
|
|
121
|
+
* @returns The current update mode
|
|
122
|
+
*/
|
|
123
|
+
get updateMode(): UISceneUpdateMode;
|
|
124
|
+
/**
|
|
125
|
+
* Gets the resolution factor for render target sizing.
|
|
126
|
+
* @returns The resolution factor between 0.1 and 2.0
|
|
127
|
+
*/
|
|
128
|
+
get resolutionFactor(): number;
|
|
129
|
+
/**
|
|
130
|
+
* Gets the clear color used for the render target background.
|
|
131
|
+
* @returns The clear color as a number
|
|
132
|
+
*/
|
|
83
133
|
get clearColor(): number;
|
|
84
|
-
/**
|
|
134
|
+
/**
|
|
135
|
+
* Gets the clear alpha used for the render target background.
|
|
136
|
+
* @returns The clear alpha value between 0.0 and 1.0
|
|
137
|
+
*/
|
|
85
138
|
get clearAlpha(): number;
|
|
86
|
-
/** Gets the resolution scaling factor */
|
|
87
|
-
get resolutionFactor(): number;
|
|
88
139
|
/**
|
|
89
|
-
* Sets the color tint applied to the
|
|
90
|
-
* @param value -
|
|
140
|
+
* Sets the color tint applied to the scene texture.
|
|
141
|
+
* @param value - The color value as a number (e.g., 0xFFFFFF for white)
|
|
91
142
|
*/
|
|
92
143
|
set color(value: number);
|
|
93
144
|
/**
|
|
94
|
-
* Sets the opacity of the
|
|
95
|
-
* @param value -
|
|
145
|
+
* Sets the opacity level of the scene texture.
|
|
146
|
+
* @param value - The opacity value between 0.0 (transparent) and 1.0 (opaque)
|
|
96
147
|
*/
|
|
97
148
|
set opacity(value: number);
|
|
98
149
|
/**
|
|
99
|
-
* Sets
|
|
100
|
-
* @param value -
|
|
150
|
+
* Sets whether transparency is enabled for the scene texture.
|
|
151
|
+
* @param value - True to enable transparency, false to disable
|
|
152
|
+
*/
|
|
153
|
+
set transparency(value: boolean);
|
|
154
|
+
/**
|
|
155
|
+
* Sets a new Three.js scene to render and marks for re-render.
|
|
156
|
+
* @param value - The new Three.js scene
|
|
101
157
|
*/
|
|
102
158
|
set scene(value: Scene);
|
|
103
159
|
/**
|
|
104
|
-
* Sets
|
|
105
|
-
* @param value -
|
|
160
|
+
* Sets a new camera for rendering and marks for re-render.
|
|
161
|
+
* @param value - The new Three.js camera
|
|
106
162
|
*/
|
|
107
163
|
set camera(value: Camera);
|
|
108
164
|
/**
|
|
109
|
-
* Sets the
|
|
110
|
-
* @param value -
|
|
165
|
+
* Sets the update mode controlling render frequency and marks for re-render.
|
|
166
|
+
* @param value - The new update mode
|
|
111
167
|
*/
|
|
112
|
-
set
|
|
168
|
+
set updateMode(value: UISceneUpdateMode);
|
|
113
169
|
/**
|
|
114
|
-
* Sets the
|
|
115
|
-
* @param value -
|
|
170
|
+
* Sets the resolution factor and resizes the render target accordingly.
|
|
171
|
+
* @param value - The new resolution factor between 0.1 and 2.0
|
|
116
172
|
*/
|
|
117
|
-
set
|
|
173
|
+
set resolutionFactor(value: number);
|
|
118
174
|
/**
|
|
119
|
-
* Sets the
|
|
120
|
-
* @param value -
|
|
175
|
+
* Sets the clear color for the render target background and marks for re-render.
|
|
176
|
+
* @param value - The new clear color as a number
|
|
121
177
|
*/
|
|
122
|
-
set
|
|
178
|
+
set clearColor(value: number);
|
|
123
179
|
/**
|
|
124
|
-
*
|
|
125
|
-
*
|
|
180
|
+
* Sets the clear alpha for the render target background and marks for re-render.
|
|
181
|
+
* @param value - The new clear alpha value between 0.0 and 1.0
|
|
126
182
|
*/
|
|
127
|
-
|
|
183
|
+
set clearAlpha(value: number);
|
|
128
184
|
/**
|
|
129
|
-
*
|
|
130
|
-
*
|
|
185
|
+
* Destroys the scene element by cleaning up all associated resources.
|
|
186
|
+
*
|
|
187
|
+
* This method disposes of the material and render target resources,
|
|
188
|
+
* and calls the parent destroy method to clean up the underlying UI element.
|
|
189
|
+
* After calling this method, the scene element should not be used anymore.
|
|
131
190
|
*/
|
|
132
|
-
|
|
191
|
+
destroy(): void;
|
|
133
192
|
/**
|
|
134
|
-
*
|
|
135
|
-
* This will render the Three.js scene to a texture if needed,
|
|
136
|
-
* then apply that texture to the mesh.
|
|
193
|
+
* Manually requests a re-render of the scene.
|
|
137
194
|
*
|
|
138
|
-
*
|
|
195
|
+
* This method is useful when the update mode is set to MANUAL and you
|
|
196
|
+
* want to trigger a scene re-render without changing any properties.
|
|
139
197
|
*/
|
|
140
|
-
|
|
198
|
+
requestRender(): void;
|
|
141
199
|
}
|
|
@@ -1,76 +1,157 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Mesh } from "three";
|
|
2
2
|
import type { UILayer } from "../layers/UILayer";
|
|
3
|
-
import type {
|
|
3
|
+
import type { UITextContent } from "../miscellaneous/textInterfaces";
|
|
4
|
+
import { type UITextPadding } from "../miscellaneous/UITextPadding";
|
|
5
|
+
import { type UITextStyle } from "../miscellaneous/UITextStyle";
|
|
4
6
|
import { UIElement } from "./UIElement";
|
|
5
7
|
/**
|
|
6
|
-
*
|
|
8
|
+
* Configuration options for UIText element creation.
|
|
7
9
|
*/
|
|
8
10
|
export interface UITextOptions {
|
|
9
|
-
/** Maximum width
|
|
11
|
+
/** Maximum width in pixels before text wrapping occurs. */
|
|
10
12
|
maxWidth: number;
|
|
11
|
-
/** Padding
|
|
13
|
+
/** Padding configuration for text content. */
|
|
12
14
|
padding: Partial<UITextPadding>;
|
|
13
|
-
/**
|
|
14
|
-
|
|
15
|
+
/** Common style properties applied to all text content. */
|
|
16
|
+
commonStyle: Partial<UITextStyle>;
|
|
15
17
|
}
|
|
16
18
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
+
* UI element for rendering dynamic text with canvas-based rendering.
|
|
20
|
+
*
|
|
21
|
+
* UIText is a concrete implementation of UIElement that renders text content
|
|
22
|
+
* using HTML5 Canvas and displays it as a texture. It supports rich text
|
|
23
|
+
* formatting, automatic text wrapping, padding, and dynamic resizing based
|
|
24
|
+
* on content. The text is rendered to a canvas texture which is then applied
|
|
25
|
+
* to a Three.js mesh for display in the 3D scene.
|
|
26
|
+
*
|
|
27
|
+
* @see {@link UIElement} - Base class providing UI element functionality
|
|
28
|
+
* @see {@link UITextContent} - Text content structure
|
|
29
|
+
* @see {@link UITextStyle} - Text styling options
|
|
30
|
+
* @see {@link UITextPadding} - Padding configuration
|
|
19
31
|
*/
|
|
20
|
-
export declare class UIText extends UIElement {
|
|
21
|
-
/**
|
|
32
|
+
export declare class UIText extends UIElement<Mesh> {
|
|
33
|
+
/** The material used for rendering the text texture. */
|
|
22
34
|
private readonly material;
|
|
23
|
-
/**
|
|
35
|
+
/** The canvas texture containing the rendered text. */
|
|
24
36
|
private readonly texture;
|
|
25
|
-
/**
|
|
37
|
+
/** The HTML canvas element used for text rendering. */
|
|
26
38
|
private readonly canvas;
|
|
27
|
-
/** 2D rendering context for the canvas */
|
|
39
|
+
/** The 2D rendering context for drawing text on the canvas. */
|
|
28
40
|
private readonly context;
|
|
29
|
-
/**
|
|
30
|
-
private
|
|
31
|
-
/**
|
|
32
|
-
private
|
|
33
|
-
/**
|
|
34
|
-
private
|
|
35
|
-
/**
|
|
36
|
-
|
|
41
|
+
/** Internal storage for the current text content. */
|
|
42
|
+
private contentInternal;
|
|
43
|
+
/** Internal storage for the maximum width before text wrapping. */
|
|
44
|
+
private maxWidthInternal;
|
|
45
|
+
/** Internal storage for the current padding configuration. */
|
|
46
|
+
private paddingInternal;
|
|
47
|
+
/** Internal storage for the common text style properties. */
|
|
48
|
+
private commonStyleInternal;
|
|
49
|
+
/** Target aspect ratio for the text element based on content. */
|
|
50
|
+
private targetAspectRatio;
|
|
51
|
+
/** Last calculated aspect ratio for comparison during rendering. */
|
|
52
|
+
private lastAspectRatio;
|
|
53
|
+
/**
|
|
54
|
+
* Creates a new UIText instance with dynamic text rendering.
|
|
55
|
+
*
|
|
56
|
+
* The text element will automatically size itself based on the content
|
|
57
|
+
* and specified options. A canvas is created for rendering the text,
|
|
58
|
+
* which is then used as a texture for the 3D mesh.
|
|
37
59
|
*
|
|
38
|
-
* @param layer - The UI layer that contains this element
|
|
39
|
-
* @param
|
|
40
|
-
* @param options -
|
|
41
|
-
* @
|
|
60
|
+
* @param layer - The UI layer that contains this text element
|
|
61
|
+
* @param content - The text content to display
|
|
62
|
+
* @param options - Configuration options for text rendering
|
|
63
|
+
* @param x - Initial x-coordinate position (defaults to 0)
|
|
64
|
+
* @param y - Initial y-coordinate position (defaults to 0)
|
|
65
|
+
* @throws Will throw an error if canvas context creation fails
|
|
66
|
+
*/
|
|
67
|
+
constructor(layer: UILayer, content: UITextContent, options?: Partial<UITextOptions>, x?: number, y?: number);
|
|
68
|
+
/**
|
|
69
|
+
* Gets the current color tint applied to the text.
|
|
70
|
+
* @returns The color value as a number (e.g., 0xFFFFFF for white)
|
|
42
71
|
*/
|
|
43
|
-
constructor(layer: UILayer, spans: (UITextSpan | string)[] | UITextSpan | string, options?: Partial<UITextOptions>);
|
|
44
|
-
/** Gets the color tint applied to the text */
|
|
45
72
|
get color(): number;
|
|
46
|
-
/**
|
|
73
|
+
/**
|
|
74
|
+
* Gets the current opacity level of the text.
|
|
75
|
+
* @returns The opacity value between 0.0 (transparent) and 1.0 (opaque)
|
|
76
|
+
*/
|
|
47
77
|
get opacity(): number;
|
|
48
78
|
/**
|
|
49
|
-
*
|
|
50
|
-
* @
|
|
79
|
+
* Gets whether transparency is enabled for the text.
|
|
80
|
+
* @returns True if transparency is enabled, false otherwise
|
|
81
|
+
*/
|
|
82
|
+
get transparency(): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Gets the current text content being displayed.
|
|
85
|
+
* @returns The current text content structure
|
|
86
|
+
*/
|
|
87
|
+
get content(): UITextContent;
|
|
88
|
+
/**
|
|
89
|
+
* Gets the maximum width before text wrapping occurs.
|
|
90
|
+
* @returns The maximum width in pixels
|
|
91
|
+
*/
|
|
92
|
+
get maxWidth(): number;
|
|
93
|
+
/**
|
|
94
|
+
* Gets the current padding configuration.
|
|
95
|
+
* @returns The padding configuration for all sides
|
|
96
|
+
*/
|
|
97
|
+
get padding(): UITextPadding;
|
|
98
|
+
/**
|
|
99
|
+
* Gets the common style properties applied to the text.
|
|
100
|
+
* @returns The partial text style configuration
|
|
101
|
+
*/
|
|
102
|
+
get commonStyle(): Partial<UITextStyle>;
|
|
103
|
+
/**
|
|
104
|
+
* Sets the color tint applied to the text.
|
|
105
|
+
* @param value - The color value as a number (e.g., 0xFFFFFF for white)
|
|
51
106
|
*/
|
|
52
107
|
set color(value: number);
|
|
53
108
|
/**
|
|
54
|
-
* Sets the opacity of the text
|
|
55
|
-
* @param value -
|
|
109
|
+
* Sets the opacity level of the text.
|
|
110
|
+
* @param value - The opacity value between 0.0 (transparent) and 1.0 (opaque)
|
|
56
111
|
*/
|
|
57
112
|
set opacity(value: number);
|
|
58
113
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
114
|
+
* Sets whether transparency is enabled for the text.
|
|
115
|
+
* @param value - True to enable transparency, false to disable
|
|
61
116
|
*/
|
|
62
|
-
|
|
117
|
+
set transparency(value: boolean);
|
|
118
|
+
/**
|
|
119
|
+
* Sets new text content and triggers a rebuild.
|
|
120
|
+
* @param value - The new text content structure
|
|
121
|
+
*/
|
|
122
|
+
set content(value: UITextContent);
|
|
123
|
+
/**
|
|
124
|
+
* Sets the maximum width before text wrapping and triggers a rebuild.
|
|
125
|
+
* @param value - The new maximum width in pixels
|
|
126
|
+
*/
|
|
127
|
+
set maxWidth(value: number);
|
|
63
128
|
/**
|
|
64
|
-
*
|
|
65
|
-
*
|
|
129
|
+
* Sets new padding configuration and triggers a rebuild.
|
|
130
|
+
* @param value - The new padding configuration
|
|
131
|
+
*/
|
|
132
|
+
set padding(value: UITextPadding);
|
|
133
|
+
/**
|
|
134
|
+
* Sets new common style properties and triggers a rebuild.
|
|
135
|
+
* @param value - The new partial text style configuration
|
|
136
|
+
*/
|
|
137
|
+
set commonStyle(value: Partial<UITextStyle>);
|
|
138
|
+
/**
|
|
139
|
+
* Destroys the text element by cleaning up all associated resources.
|
|
66
140
|
*
|
|
67
|
-
* This
|
|
141
|
+
* This method disposes of the material and texture resources, removes
|
|
142
|
+
* the canvas element from the DOM, and calls the parent destroy method
|
|
143
|
+
* to clean up the underlying UI element. After calling this method,
|
|
144
|
+
* the text element should not be used anymore.
|
|
68
145
|
*/
|
|
69
|
-
|
|
146
|
+
destroy(): void;
|
|
70
147
|
/**
|
|
71
|
-
*
|
|
148
|
+
* Rebuilds the text canvas and texture based on current content and settings.
|
|
149
|
+
*
|
|
150
|
+
* This method calculates the text layout, resizes the canvas to fit the content
|
|
151
|
+
* with padding, renders the text lines to the canvas, and updates the texture.
|
|
152
|
+
* It also calculates and sets the target aspect ratio for proper display.
|
|
72
153
|
*
|
|
73
|
-
* @
|
|
154
|
+
* @private
|
|
74
155
|
*/
|
|
75
|
-
|
|
156
|
+
private rebuildText;
|
|
76
157
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
export * from "./builders/UIConstraint2DBuilder";
|
|
2
|
-
export * from "./builders/UIConstraintContainerBuilder";
|
|
3
|
-
export * from "./builders/UIConstraintStackBuilder";
|
|
4
2
|
export * from "./constraints/UIAspectConstraint";
|
|
5
3
|
export * from "./constraints/UIConstraint";
|
|
6
|
-
export * from "./constraints/
|
|
7
|
-
export * from "./constraints/UIConstraintRule";
|
|
8
|
-
export * from "./constraints/UICoverConstraint";
|
|
9
|
-
export * from "./constraints/UIFitConstraint";
|
|
4
|
+
export * from "./constraints/UICustomConstraint";
|
|
10
5
|
export * from "./constraints/UIHeightConstraint";
|
|
11
6
|
export * from "./constraints/UIHorizontalDistanceConstraint";
|
|
12
7
|
export * from "./constraints/UIHorizontalProportionConstraint";
|
|
8
|
+
export * from "./constraints/UISingleParameterConstraint";
|
|
13
9
|
export * from "./constraints/UIVerticalDistanceConstraint";
|
|
14
10
|
export * from "./constraints/UIVerticalProportionConstraint";
|
|
15
11
|
export * from "./constraints/UIWidthConstraint";
|
|
@@ -20,11 +16,14 @@ export * from "./elements/UIImage";
|
|
|
20
16
|
export * from "./elements/UIProgress";
|
|
21
17
|
export * from "./elements/UIScene";
|
|
22
18
|
export * from "./elements/UIText";
|
|
23
|
-
export * from "./layers/
|
|
19
|
+
export * from "./layers/UIFullscreenLayer";
|
|
24
20
|
export * from "./layers/UILayer";
|
|
25
|
-
export * from "./miscellaneous/
|
|
21
|
+
export * from "./miscellaneous/UIExpression";
|
|
22
|
+
export * from "./miscellaneous/UIMicro";
|
|
26
23
|
export * from "./miscellaneous/UIMode";
|
|
27
24
|
export * from "./miscellaneous/UIOrientation";
|
|
28
|
-
export * from "./miscellaneous/
|
|
29
|
-
export * from "./
|
|
30
|
-
export * from "./
|
|
25
|
+
export * from "./miscellaneous/UIPriority";
|
|
26
|
+
export * from "./miscellaneous/UIRelation";
|
|
27
|
+
export * from "./miscellaneous/UITextPadding";
|
|
28
|
+
export * from "./miscellaneous/UITextSpan";
|
|
29
|
+
export * from "./miscellaneous/UITextStyle";
|