laymur 0.2.18 → 0.3.3
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 +87 -274
- package/dist/builders/UIConstraint2DBuilder.d.ts +1 -1
- package/dist/builders/UICoverConstraintBuilder.d.ts +3 -1
- package/dist/builders/UIFitConstraintBuilder.d.ts +3 -1
- package/dist/constraints/UIAspectConstraint.d.ts +0 -1
- package/dist/constraints/UIConstraint.d.ts +3 -0
- package/dist/constraints/UIHorizontalDistanceConstraint.d.ts +0 -1
- package/dist/constraints/UIHorizontalProportionConstraint.d.ts +2 -3
- package/dist/constraints/UISingleParameterConstraint.d.ts +0 -2
- package/dist/constraints/UIVerticalDistanceConstraint.d.ts +0 -1
- package/dist/constraints/UIVerticalProportionConstraint.d.ts +2 -3
- package/dist/elements/UIDummy.d.ts +7 -1
- package/dist/elements/UIElement.d.ts +52 -38
- package/dist/elements/UIImage.d.ts +30 -42
- package/dist/elements/UINineSline.d.ts +61 -68
- package/dist/elements/UIProgress.d.ts +86 -110
- package/dist/elements/UIScene.d.ts +21 -30
- package/dist/elements/UIText.d.ts +27 -41
- package/dist/index.d.ts +6 -1
- package/dist/index.js +1663 -939
- 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 +0 -4
- package/dist/layers/UILayer.d.ts +62 -4
- package/dist/miscellaneous/UIColor.d.ts +171 -0
- package/dist/miscellaneous/UIGenericInstancedPlane.d.ts +32 -0
- package/dist/miscellaneous/UIInputEvent.d.ts +7 -0
- package/dist/miscellaneous/UIMicro.d.ts +3 -3
- package/dist/miscellaneous/{UIAnchorMode.d.ts → UIMicroAnchorMode.d.ts} +1 -1
- package/dist/miscellaneous/UINineSliceBorder.d.ts +6 -6
- package/dist/miscellaneous/UISceneWrapperClientAPI.d.ts +12 -0
- package/dist/miscellaneous/UITextPadding.d.ts +1 -1
- package/dist/miscellaneous/UITransparencyMode.d.ts +26 -0
- package/dist/miscellaneous/asserts.d.ts +9 -9
- package/dist/miscellaneous/textTools.d.ts +4 -4
- package/dist/wrappers/UISceneWrapper.d.ts +21 -14
- package/dist/wrappers/UISolverWrapper.d.ts +185 -0
- package/package.json +7 -4
- package/dist/materials/UIMaterial.d.ts +0 -13
- package/dist/materials/UINineSliceMaterial.d.ts +0 -27
- package/dist/materials/UIProgressMaterial.d.ts +0 -29
- package/dist/miscellaneous/threeInstances.d.ts +0 -2
- package/dist/scalable/UIScalableMesh.d.ts +0 -16
- package/dist/scalable/UIScalablePlaneMesh.d.ts +0 -14
|
@@ -1,34 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
1
|
+
import type { WebGLRenderer } from "three";
|
|
2
|
+
import type { UILayerInputListener } from "../layers/UILayer";
|
|
3
|
+
import { type UILayer } from "../layers/UILayer";
|
|
3
4
|
import type { UILayerElement, UIPlaneElement } from "../miscellaneous/asserts";
|
|
4
5
|
import { UIMicro } from "../miscellaneous/UIMicro";
|
|
5
6
|
import { UIMode } from "../miscellaneous/UIMode";
|
|
6
|
-
import type {
|
|
7
|
+
import type { UISceneWrapperClientAPI } from "../miscellaneous/UISceneWrapperClientAPI";
|
|
8
|
+
import { UITransparencyMode } from "../miscellaneous/UITransparencyMode";
|
|
7
9
|
import { UIAnchor } from "./UIAnchor";
|
|
8
|
-
/**
|
|
9
|
-
* Events that can be emitted by UI elements.
|
|
10
|
-
*/
|
|
11
|
-
export declare enum UIElementEvent {
|
|
12
|
-
/** Emitted when the element is clicked. */
|
|
13
|
-
CLICK = "click"
|
|
14
|
-
}
|
|
15
10
|
/**
|
|
16
11
|
* Abstract base class for all renderable UI elements with dimensions.
|
|
17
12
|
*
|
|
18
13
|
* UIElement serves as the fundamental building block for all other UI elements
|
|
19
14
|
* that need to be visually rendered. It extends UIAnchor with dimensional properties
|
|
20
|
-
* and integrates with the Three.js rendering system through
|
|
15
|
+
* and integrates with the Three.js rendering system through shader-based planes. This class
|
|
21
16
|
* provides essential functionality for positioning, sizing, rendering, visibility,
|
|
22
17
|
* z-index management, and user interaction.
|
|
23
18
|
*
|
|
24
|
-
* @template T - The type of Three.js Object3D used for rendering
|
|
25
19
|
* @see {@link UIAnchor} - Base class providing position functionality
|
|
26
20
|
* @see {@link UIPlaneElement} - Interface defining dimensional element behavior
|
|
27
|
-
* @see {@link UISceneWrapper} - Scene management for rendering
|
|
28
21
|
* @see {@link UIMicro} - Micro-optimization utilities
|
|
29
22
|
*/
|
|
30
|
-
export declare abstract class UIElement
|
|
31
|
-
protected readonly object: T;
|
|
23
|
+
export declare abstract class UIElement extends UIAnchor implements UIPlaneElement, UILayerElement {
|
|
32
24
|
/** Micro-transformation system for non-constraint based positioning, scaling, and rotation adjustments. */
|
|
33
25
|
readonly micro: UIMicro;
|
|
34
26
|
/**
|
|
@@ -41,13 +33,18 @@ export declare abstract class UIElement<T extends Object3D = Object3D> extends U
|
|
|
41
33
|
* This variable is managed by the constraint solver system.
|
|
42
34
|
*/
|
|
43
35
|
readonly hVariable: number;
|
|
44
|
-
/**
|
|
45
|
-
* Reference to the scene wrapper for rendering management.
|
|
46
|
-
* @see {@link UISceneWrapper}
|
|
47
|
-
*/
|
|
48
|
-
protected readonly sceneWrapper: UISceneWrapper;
|
|
49
36
|
/** Internal storage for the current visibility/interaction mode. */
|
|
50
37
|
protected modeInternal: UIMode;
|
|
38
|
+
/** Internal storage for the transparency rendering mode. */
|
|
39
|
+
protected transparencyInternal: UITransparencyMode;
|
|
40
|
+
/** Internal storage for the z-index (depth) value. */
|
|
41
|
+
protected zIndexInternal: number;
|
|
42
|
+
/** Optional input listener for handling user interactions when in interactive mode. */
|
|
43
|
+
protected listener?: UILayerInputListener;
|
|
44
|
+
/** Client API for interacting with the scene wrapper (rendering system). */
|
|
45
|
+
protected readonly sceneWrapper: UISceneWrapperClientAPI;
|
|
46
|
+
/** Handle to the plane object in the rendering system. */
|
|
47
|
+
protected readonly planeHandler: number;
|
|
51
48
|
/**
|
|
52
49
|
* Creates a new UIElement instance with rendering capabilities.
|
|
53
50
|
*
|
|
@@ -56,11 +53,12 @@ export declare abstract class UIElement<T extends Object3D = Object3D> extends U
|
|
|
56
53
|
* @param y - Initial y-coordinate position
|
|
57
54
|
* @param width - Initial width dimension (must be positive)
|
|
58
55
|
* @param height - Initial height dimension (must be positive)
|
|
59
|
-
* @param
|
|
56
|
+
* @param source - GLSL shader source code for rendering this element
|
|
57
|
+
* @param uniforms - Uniform values to pass to the shader
|
|
60
58
|
* @throws Will throw an error if width or height are not valid positive numbers
|
|
61
59
|
* @see {@link assertValidPositiveNumber}
|
|
62
60
|
*/
|
|
63
|
-
constructor(layer: UILayer, x: number, y: number, width: number, height: number,
|
|
61
|
+
constructor(layer: UILayer, x: number, y: number, width: number, height: number, source: string, uniforms: Record<string, unknown>);
|
|
64
62
|
/**
|
|
65
63
|
* Gets the current width value from the solver.
|
|
66
64
|
* @returns The current width dimension
|
|
@@ -72,8 +70,8 @@ export declare abstract class UIElement<T extends Object3D = Object3D> extends U
|
|
|
72
70
|
*/
|
|
73
71
|
get height(): number;
|
|
74
72
|
/**
|
|
75
|
-
* Gets the current z-index (depth) value
|
|
76
|
-
* @returns The current z-index
|
|
73
|
+
* Gets the current z-index (depth) value.
|
|
74
|
+
* @returns The current z-index value
|
|
77
75
|
*/
|
|
78
76
|
get zIndex(): number;
|
|
79
77
|
/**
|
|
@@ -82,6 +80,12 @@ export declare abstract class UIElement<T extends Object3D = Object3D> extends U
|
|
|
82
80
|
* @see {@link UIMode}
|
|
83
81
|
*/
|
|
84
82
|
get mode(): UIMode;
|
|
83
|
+
/**
|
|
84
|
+
* Gets the current transparency rendering mode.
|
|
85
|
+
* @returns The current transparency mode
|
|
86
|
+
* @see {@link UITransparencyMode}
|
|
87
|
+
*/
|
|
88
|
+
get transparency(): UITransparencyMode;
|
|
85
89
|
/**
|
|
86
90
|
* Sets the width value through the solver system.
|
|
87
91
|
* @param value - The new width dimension (must be positive)
|
|
@@ -97,36 +101,46 @@ export declare abstract class UIElement<T extends Object3D = Object3D> extends U
|
|
|
97
101
|
*/
|
|
98
102
|
set height(value: number);
|
|
99
103
|
/**
|
|
100
|
-
* Sets the z-index (depth) value for rendering order.
|
|
104
|
+
* Sets the z-index (depth) value for rendering order and input handling.
|
|
101
105
|
* @param value - The new z-index value
|
|
102
106
|
* @throws Will throw an error if value is not a valid number
|
|
103
107
|
* @see {@link assertValidNumber}
|
|
104
108
|
*/
|
|
105
109
|
set zIndex(value: number);
|
|
106
110
|
/**
|
|
107
|
-
* Sets the visibility and interaction mode.
|
|
111
|
+
* Sets the current visibility and interaction mode.
|
|
108
112
|
* @param value - The new UIMode setting
|
|
109
113
|
* @see {@link UIMode}
|
|
110
114
|
*/
|
|
111
115
|
set mode(value: UIMode);
|
|
116
|
+
/**
|
|
117
|
+
* Sets the transparency rendering mode.
|
|
118
|
+
* @param value - The new transparency mode
|
|
119
|
+
* @see {@link UITransparencyMode}
|
|
120
|
+
*/
|
|
121
|
+
set transparency(value: UITransparencyMode);
|
|
112
122
|
/**
|
|
113
123
|
* Destroys the UI element by cleaning up all associated resources.
|
|
114
124
|
*
|
|
115
125
|
* This method removes the element from the rendering scene, cleans up
|
|
116
|
-
* dimension solver variables, and calls the parent
|
|
117
|
-
* clean up position variables. After calling this method,
|
|
118
|
-
* should not be used anymore.
|
|
126
|
+
* dimension solver variables, removes input listeners, and calls the parent
|
|
127
|
+
* destroy method to clean up position variables. After calling this method,
|
|
128
|
+
* the element should not be used anymore.
|
|
119
129
|
*/
|
|
120
130
|
destroy(): void;
|
|
121
131
|
/**
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
*
|
|
132
|
+
* Handles click events when the element is in interactive mode.
|
|
133
|
+
* @param x - The x coordinate of the click
|
|
134
|
+
* @param y - The y coordinate of the click
|
|
135
|
+
* @returns True if the click was within this element's bounds
|
|
136
|
+
*/
|
|
137
|
+
protected readonly onClick: (x: number, y: number) => boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Called before each render frame to update the element's transform matrix.
|
|
140
|
+
* Applies micro-transformations (position, rotation, scale, anchor) and updates
|
|
141
|
+
* the rendering system with the final transformation matrix.
|
|
142
|
+
* @param renderer - The WebGL renderer (unused in base implementation)
|
|
143
|
+
* @param deltaTime - Time since last frame in seconds (unused in base implementation)
|
|
130
144
|
*/
|
|
131
|
-
protected
|
|
145
|
+
protected onWillRender(renderer: WebGLRenderer, deltaTime: number): void;
|
|
132
146
|
}
|
|
@@ -1,36 +1,46 @@
|
|
|
1
1
|
import type { Texture } from "three";
|
|
2
|
-
import { Mesh } from "three";
|
|
3
2
|
import type { UILayer } from "../layers/UILayer";
|
|
3
|
+
import { UIColor } from "../miscellaneous/UIColor";
|
|
4
4
|
import { UIElement } from "./UIElement";
|
|
5
|
+
/**
|
|
6
|
+
* Configuration options for creating a UIImage element.
|
|
7
|
+
*/
|
|
8
|
+
export interface UIImageOptions {
|
|
9
|
+
/** X position of the element */
|
|
10
|
+
x: number;
|
|
11
|
+
/** Y position of the element */
|
|
12
|
+
y: number;
|
|
13
|
+
/** Color tint applied to the image */
|
|
14
|
+
color: UIColor;
|
|
15
|
+
}
|
|
5
16
|
/**
|
|
6
17
|
* UI element for displaying textured images.
|
|
7
18
|
*
|
|
8
19
|
* UIImage is a concrete implementation of UIElement that renders a textured
|
|
9
|
-
* image using
|
|
20
|
+
* image using shader-based planes. It automatically sizes itself
|
|
10
21
|
* to match the texture dimensions and provides control over visual properties
|
|
11
|
-
* such as color tinting
|
|
22
|
+
* such as color tinting.
|
|
12
23
|
*
|
|
13
24
|
* @see {@link UIElement} - Base class providing UI element functionality
|
|
14
|
-
* @see {@link UIMaterial} - Material system for rendering
|
|
15
25
|
* @see {@link Texture} - Three.js texture for image data
|
|
16
26
|
*/
|
|
17
|
-
export declare class UIImage extends UIElement
|
|
18
|
-
/**
|
|
19
|
-
private
|
|
20
|
-
/** Internal storage for the
|
|
21
|
-
private readonly
|
|
27
|
+
export declare class UIImage extends UIElement {
|
|
28
|
+
/** Internal storage for the current texture */
|
|
29
|
+
private textureInternal;
|
|
30
|
+
/** Internal storage for the color tint */
|
|
31
|
+
private readonly colorInternal;
|
|
22
32
|
/**
|
|
23
33
|
* Creates a new UIImage instance.
|
|
24
34
|
*
|
|
25
35
|
* The image will automatically size itself to match the texture's dimensions.
|
|
26
|
-
*
|
|
36
|
+
* All options have default values if not specified.
|
|
27
37
|
*
|
|
28
38
|
* @param layer - The UI layer that contains this image
|
|
29
39
|
* @param texture - The Three.js texture to display
|
|
30
|
-
* @param
|
|
31
|
-
* @
|
|
40
|
+
* @param options - Configuration options for the image
|
|
41
|
+
* @throws Will throw an error if the texture dimensions are not valid positive numbers
|
|
32
42
|
*/
|
|
33
|
-
constructor(layer: UILayer, texture: Texture,
|
|
43
|
+
constructor(layer: UILayer, texture: Texture, options?: Partial<UIImageOptions>);
|
|
34
44
|
/**
|
|
35
45
|
* Gets the current texture being displayed.
|
|
36
46
|
* @returns The current Three.js texture
|
|
@@ -38,19 +48,9 @@ export declare class UIImage extends UIElement<Mesh> {
|
|
|
38
48
|
get texture(): Texture;
|
|
39
49
|
/**
|
|
40
50
|
* Gets the current color tint applied to the image.
|
|
41
|
-
* @returns The
|
|
51
|
+
* @returns The UIColor instance
|
|
42
52
|
*/
|
|
43
|
-
get color():
|
|
44
|
-
/**
|
|
45
|
-
* Gets the current opacity level of the image.
|
|
46
|
-
* @returns The opacity value between 0.0 (transparent) and 1.0 (opaque)
|
|
47
|
-
*/
|
|
48
|
-
get opacity(): number;
|
|
49
|
-
/**
|
|
50
|
-
* Gets whether transparency is enabled for the image.
|
|
51
|
-
* @returns True if transparency is enabled, false otherwise
|
|
52
|
-
*/
|
|
53
|
-
get transparency(): boolean;
|
|
53
|
+
get color(): UIColor;
|
|
54
54
|
/**
|
|
55
55
|
* Sets a new texture for the image.
|
|
56
56
|
*
|
|
@@ -64,25 +64,13 @@ export declare class UIImage extends UIElement<Mesh> {
|
|
|
64
64
|
set texture(value: Texture);
|
|
65
65
|
/**
|
|
66
66
|
* Sets the color tint applied to the image.
|
|
67
|
-
* @param value - The
|
|
68
|
-
*/
|
|
69
|
-
set color(value: number);
|
|
70
|
-
/**
|
|
71
|
-
* Sets the opacity level of the image.
|
|
72
|
-
* @param value - The opacity value between 0.0 (transparent) and 1.0 (opaque)
|
|
67
|
+
* @param value - The UIColor instance
|
|
73
68
|
*/
|
|
74
|
-
set
|
|
69
|
+
set color(value: UIColor);
|
|
75
70
|
/**
|
|
76
|
-
*
|
|
77
|
-
* @param value - True to enable transparency, false to disable
|
|
78
|
-
*/
|
|
79
|
-
set transparency(value: boolean);
|
|
80
|
-
/**
|
|
81
|
-
* Destroys the image by cleaning up all associated resources.
|
|
82
|
-
*
|
|
83
|
-
* This method disposes of the material resources and calls the parent
|
|
84
|
-
* destroy method to clean up the underlying UI element. After calling
|
|
85
|
-
* this method, the image should not be used anymore.
|
|
71
|
+
* Destroys the UI image by cleaning up color event listeners and all associated resources.
|
|
86
72
|
*/
|
|
87
73
|
destroy(): void;
|
|
74
|
+
/** Event handler for when the color changes */
|
|
75
|
+
private readonly onColorChange;
|
|
88
76
|
}
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import type { Texture } from "three";
|
|
2
|
-
import { Mesh } from "three";
|
|
1
|
+
import type { Texture, WebGLRenderer } from "three";
|
|
3
2
|
import { type UILayer } from "../layers/UILayer";
|
|
4
|
-
import {
|
|
3
|
+
import { UIColor } from "../miscellaneous/UIColor";
|
|
4
|
+
import { type UINineSliceBorders } from "../miscellaneous/UINineSliceBorder";
|
|
5
5
|
import { UIElement } from "./UIElement";
|
|
6
6
|
/**
|
|
7
7
|
* Configuration options for creating a UINineSlice element.
|
|
8
8
|
*/
|
|
9
9
|
export interface UINineSliceOptions {
|
|
10
|
-
/** Nine-slice border configuration (can be number, object with horizontal/vertical, or full border object) */
|
|
11
|
-
sliceBorder: UINineSliceBorder;
|
|
12
10
|
/** X position of the element */
|
|
13
11
|
x: number;
|
|
14
12
|
/** Y position of the element */
|
|
15
13
|
y: number;
|
|
14
|
+
/** Color tint applied to the nine-slice element */
|
|
15
|
+
color: UIColor;
|
|
16
|
+
/** Nine-slice border configuration (can be number, object with horizontal/vertical, or full border object) */
|
|
17
|
+
sliceBorders: UINineSliceBorders;
|
|
16
18
|
}
|
|
17
19
|
/**
|
|
18
20
|
* Nine-slice UI element for scalable images with preserved border regions.
|
|
@@ -22,122 +24,113 @@ export interface UINineSliceOptions {
|
|
|
22
24
|
* scales in both dimensions. This technique is commonly used for creating scalable UI
|
|
23
25
|
* panels, buttons, and borders that maintain visual quality at any size.
|
|
24
26
|
*/
|
|
25
|
-
export declare class UINineSlice extends UIElement
|
|
26
|
-
|
|
27
|
+
export declare class UINineSlice extends UIElement {
|
|
28
|
+
/** Internal storage for the current texture */
|
|
27
29
|
private readonly textureInternal;
|
|
30
|
+
/** Internal storage for the color tint */
|
|
31
|
+
private readonly colorInternal;
|
|
32
|
+
/** Internal storage for the nine-slice border values (left, right, top, bottom) */
|
|
33
|
+
private readonly sliceBordersInternal;
|
|
34
|
+
/** Internal storage for texture and world dimensions (texture width, texture height, world width, world height) */
|
|
35
|
+
private readonly dimensions;
|
|
28
36
|
/**
|
|
29
37
|
* Creates a new nine-slice UI element.
|
|
30
38
|
*
|
|
39
|
+
* The element initially sizes itself to match the texture's dimensions.
|
|
40
|
+
* Border regions are defined by the slice borders configuration.
|
|
41
|
+
*
|
|
31
42
|
* @param layer - The UI layer to add this element to
|
|
32
43
|
* @param texture - The texture to use for nine-slice rendering
|
|
33
44
|
* @param options - Configuration options for the nine-slice element
|
|
45
|
+
* @throws Will throw an error if the texture dimensions are not valid positive numbers
|
|
34
46
|
*/
|
|
35
47
|
constructor(layer: UILayer, texture: Texture, options?: Partial<UINineSliceOptions>);
|
|
48
|
+
/**
|
|
49
|
+
* Gets the current texture being displayed.
|
|
50
|
+
* @returns The current Three.js texture
|
|
51
|
+
*/
|
|
52
|
+
get texture(): Texture;
|
|
53
|
+
/**
|
|
54
|
+
* Gets the current color tint applied to the nine-slice element.
|
|
55
|
+
* @returns The UIColor instance
|
|
56
|
+
*/
|
|
57
|
+
get color(): UIColor;
|
|
36
58
|
/**
|
|
37
59
|
* Gets the left border size for nine-slice scaling.
|
|
38
|
-
* @returns The left border size
|
|
60
|
+
* @returns The left border size as a percentage (0-1) of texture width
|
|
39
61
|
*/
|
|
40
62
|
get sliceBorderLeft(): number;
|
|
41
63
|
/**
|
|
42
64
|
* Gets the right border size for nine-slice scaling.
|
|
43
|
-
* @returns The right border size
|
|
65
|
+
* @returns The right border size as a percentage (0-1) of texture width
|
|
44
66
|
*/
|
|
45
67
|
get sliceBorderRight(): number;
|
|
46
68
|
/**
|
|
47
69
|
* Gets the top border size for nine-slice scaling.
|
|
48
|
-
* @returns The top border size
|
|
70
|
+
* @returns The top border size as a percentage (0-1) of texture height
|
|
49
71
|
*/
|
|
50
72
|
get sliceBorderTop(): number;
|
|
51
73
|
/**
|
|
52
74
|
* Gets the bottom border size for nine-slice scaling.
|
|
53
|
-
* @returns The bottom border size
|
|
75
|
+
* @returns The bottom border size as a percentage (0-1) of texture height
|
|
54
76
|
*/
|
|
55
77
|
get sliceBorderBottom(): number;
|
|
56
78
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
*
|
|
63
|
-
* @
|
|
64
|
-
|
|
65
|
-
get color(): number;
|
|
66
|
-
/**
|
|
67
|
-
* Gets the current opacity level of the image.
|
|
68
|
-
* @returns The opacity value between 0.0 (transparent) and 1.0 (opaque)
|
|
79
|
+
* Sets a new texture for the nine-slice element.
|
|
80
|
+
*
|
|
81
|
+
* When setting a new texture, the element will update its internal dimensions
|
|
82
|
+
* but maintain the current world size. The nine-slice borders remain unchanged.
|
|
83
|
+
*
|
|
84
|
+
* @param value - The new Three.js texture to display
|
|
85
|
+
* @throws Will throw an error if the texture dimensions are not valid positive numbers
|
|
86
|
+
* @see {@link assertValidPositiveNumber}
|
|
69
87
|
*/
|
|
70
|
-
|
|
88
|
+
set texture(value: Texture);
|
|
71
89
|
/**
|
|
72
|
-
*
|
|
73
|
-
* @
|
|
90
|
+
* Sets the color tint applied to the nine-slice element.
|
|
91
|
+
* @param value - The UIColor instance
|
|
74
92
|
*/
|
|
75
|
-
|
|
93
|
+
set color(value: UIColor);
|
|
76
94
|
/**
|
|
77
95
|
* Sets the left border size for nine-slice scaling.
|
|
78
|
-
* @param value - The left border size
|
|
96
|
+
* @param value - The left border size as a percentage (0-1) of texture width
|
|
79
97
|
*/
|
|
80
98
|
set sliceBorderLeft(value: number);
|
|
81
99
|
/**
|
|
82
100
|
* Sets the right border size for nine-slice scaling.
|
|
83
|
-
* @param value - The right border size
|
|
101
|
+
* @param value - The right border size as a percentage (0-1) of texture width
|
|
84
102
|
*/
|
|
85
103
|
set sliceBorderRight(value: number);
|
|
86
104
|
/**
|
|
87
105
|
* Sets the top border size for nine-slice scaling.
|
|
88
|
-
* @param value - The top border size
|
|
106
|
+
* @param value - The top border size as a percentage (0-1) of texture height
|
|
89
107
|
*/
|
|
90
108
|
set sliceBorderTop(value: number);
|
|
91
109
|
/**
|
|
92
110
|
* Sets the bottom border size for nine-slice scaling.
|
|
93
|
-
* @param value - The bottom border size
|
|
111
|
+
* @param value - The bottom border size as a percentage (0-1) of texture height
|
|
94
112
|
*/
|
|
95
113
|
set sliceBorderBottom(value: number);
|
|
96
|
-
/**
|
|
97
|
-
* Sets a new texture for the image.
|
|
98
|
-
*
|
|
99
|
-
* When setting a new texture, the image will automatically resize to match
|
|
100
|
-
* the new texture's dimensions.
|
|
101
|
-
*
|
|
102
|
-
* @param value - The new Three.js texture to display
|
|
103
|
-
* @throws Will throw an error if the texture dimensions are not valid positive numbers
|
|
104
|
-
* @see {@link assertValidPositiveNumber}
|
|
105
|
-
*/
|
|
106
|
-
set texture(value: Texture);
|
|
107
|
-
/**
|
|
108
|
-
* Sets the color tint applied to the image.
|
|
109
|
-
* @param value - The color value as a number (e.g., 0xFFFFFF for white)
|
|
110
|
-
*/
|
|
111
|
-
set color(value: number);
|
|
112
|
-
/**
|
|
113
|
-
* Sets the opacity level of the image.
|
|
114
|
-
* @param value - The opacity value between 0.0 (transparent) and 1.0 (opaque)
|
|
115
|
-
*/
|
|
116
|
-
set opacity(value: number);
|
|
117
|
-
/**
|
|
118
|
-
* Sets whether transparency is enabled for the image.
|
|
119
|
-
* @param value - True to enable transparency, false to disable
|
|
120
|
-
*/
|
|
121
|
-
set transparency(value: boolean);
|
|
122
114
|
/**
|
|
123
115
|
* Sets all four border sizes for nine-slice scaling at once.
|
|
124
116
|
*
|
|
125
|
-
* @param left - The left border size
|
|
126
|
-
* @param right - The right border size
|
|
127
|
-
* @param top - The top border size
|
|
128
|
-
* @param bottom - The bottom border size
|
|
117
|
+
* @param left - The left border size as a percentage (0-1) of texture width
|
|
118
|
+
* @param right - The right border size as a percentage (0-1) of texture width
|
|
119
|
+
* @param top - The top border size as a percentage (0-1) of texture height
|
|
120
|
+
* @param bottom - The bottom border size as a percentage (0-1) of texture height
|
|
129
121
|
*/
|
|
130
122
|
setSliceBorders(left: number, right: number, top: number, bottom: number): void;
|
|
131
123
|
/**
|
|
132
|
-
* Destroys the nine-slice element
|
|
133
|
-
*
|
|
134
|
-
* This method removes event listeners, disposes of the material,
|
|
135
|
-
* and calls the parent destroy method.
|
|
124
|
+
* Destroys the nine-slice UI element by cleaning up color event listeners and all associated resources.
|
|
136
125
|
*/
|
|
137
126
|
destroy(): void;
|
|
138
127
|
/**
|
|
139
|
-
*
|
|
140
|
-
*
|
|
128
|
+
* Called before each render frame to update the element's dimensions for nine-slice scaling.
|
|
129
|
+
* Updates the world dimensions (z, w components) based on current width, height, and micro scaling.
|
|
130
|
+
* @param renderer - The WebGL renderer
|
|
131
|
+
* @param deltaTime - Time since last frame in seconds
|
|
141
132
|
*/
|
|
142
|
-
|
|
133
|
+
protected onWillRender(renderer: WebGLRenderer, deltaTime: number): void;
|
|
134
|
+
/** Event handler for when the color changes */
|
|
135
|
+
private readonly onColorChange;
|
|
143
136
|
}
|