laymur 0.10.3 → 0.11.1
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
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Matrix4, Mesh } from "three";
|
|
2
|
+
import { UITransparencyMode } from "../UITransparencyMode";
|
|
3
|
+
import type { GenericPlaneData, UIPropertyType } from "./shared";
|
|
4
|
+
export declare class UIGenericInstancedPlane extends Mesh {
|
|
5
|
+
readonly source: string;
|
|
6
|
+
readonly transparency: UITransparencyMode;
|
|
7
|
+
private readonly handlerToIndex;
|
|
8
|
+
private readonly propertyBuffers;
|
|
9
|
+
private readonly instancedGeometry;
|
|
10
|
+
private readonly shaderMaterial;
|
|
11
|
+
private readonly uniformProperties;
|
|
12
|
+
private readonly varyingProperties;
|
|
13
|
+
private lastHandler;
|
|
14
|
+
private capacity;
|
|
15
|
+
constructor(source: string, properties: Record<string, UIPropertyType>, transparency?: UITransparencyMode, initialCapacity?: number);
|
|
16
|
+
get instanceCount(): number;
|
|
17
|
+
get properties(): Record<string, UIPropertyType>;
|
|
18
|
+
createInstance(): number;
|
|
19
|
+
destroyInstance(handler: number): void;
|
|
20
|
+
setProperties(handler: number, properties: Record<string, UIPropertyType>): void;
|
|
21
|
+
setTransform(handler: number, transform: Matrix4): void;
|
|
22
|
+
setVisibility(handler: number, visible: boolean): void;
|
|
23
|
+
isCompatible(source: string, properties: Record<string, UIPropertyType>, transparency?: UITransparencyMode): boolean;
|
|
24
|
+
arePropertiesCompatible(properties: Record<string, UIPropertyType>): boolean;
|
|
25
|
+
extractInstanceData(handler: number): GenericPlaneData;
|
|
26
|
+
extractProperties(handler: number): Record<string, UIPropertyType>;
|
|
27
|
+
extractTransform(handler: number): Matrix4;
|
|
28
|
+
extractVisibility(handler: number): boolean;
|
|
29
|
+
destroy(): void;
|
|
30
|
+
private initializeInstanceDefaults;
|
|
31
|
+
private ensureCapacity;
|
|
32
|
+
private moveInstanceData;
|
|
33
|
+
private updateIndicesAfterMove;
|
|
34
|
+
private resolveIndex;
|
|
35
|
+
private resolveAttribute;
|
|
36
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PlaneGeometry, ShaderMaterial } from "three";
|
|
2
|
+
import { UITransparencyMode } from "../UITransparencyMode";
|
|
3
|
+
import type { UIPropertyType } from "./shared";
|
|
4
|
+
export declare const PLANE_GEOMETRY: PlaneGeometry;
|
|
5
|
+
export declare function buildGenericPlaneMaterial(source: string, properties: Record<string, UIPropertyType>, transparency: UITransparencyMode): ShaderMaterial;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Matrix4, Mesh } from "three";
|
|
2
|
+
import { UITransparencyMode } from "../UITransparencyMode";
|
|
3
|
+
import type { GenericPlaneData, UIPropertyType } from "./shared";
|
|
4
|
+
export declare class UIGenericPlane extends Mesh {
|
|
5
|
+
readonly source: string;
|
|
6
|
+
private readonly shaderMaterial;
|
|
7
|
+
private readonly propertiesInternal;
|
|
8
|
+
private readonly transformInternal;
|
|
9
|
+
private transparencyInternal;
|
|
10
|
+
constructor(source: string, properties: Record<string, UIPropertyType>, transparency: UITransparencyMode);
|
|
11
|
+
get properties(): Record<string, UIPropertyType>;
|
|
12
|
+
get transform(): Matrix4;
|
|
13
|
+
get visibility(): boolean;
|
|
14
|
+
get transparency(): UITransparencyMode;
|
|
15
|
+
setProperties(properties: Record<string, UIPropertyType>): void;
|
|
16
|
+
setTransform(transform: Matrix4): void;
|
|
17
|
+
setVisibility(visibility: boolean): void;
|
|
18
|
+
setTransparency(transparency: UITransparencyMode): void;
|
|
19
|
+
extractInstanceData(): GenericPlaneData;
|
|
20
|
+
isCompatible(source: string, properties: Record<string, UIPropertyType>, transparency: UITransparencyMode): boolean;
|
|
21
|
+
arePropertiesCompatible(properties: Record<string, UIPropertyType>): boolean;
|
|
22
|
+
destroy(): void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Matrix4, Scene } from "three";
|
|
2
|
+
import type { UITransparencyMode } from "../UITransparencyMode";
|
|
3
|
+
import type { UIPropertyType } from "./shared";
|
|
4
|
+
export declare class UIPlaneRegistry {
|
|
5
|
+
private readonly scene;
|
|
6
|
+
private readonly descriptors;
|
|
7
|
+
private lastHandler;
|
|
8
|
+
constructor(scene: Scene);
|
|
9
|
+
create(source: string, properties: Record<string, UIPropertyType>, transparency: UITransparencyMode): number;
|
|
10
|
+
destroy(handler: number): void;
|
|
11
|
+
setTransform(handler: number, transform: Matrix4): void;
|
|
12
|
+
setProperties(handler: number, properties: Record<string, UIPropertyType>): void;
|
|
13
|
+
setVisibility(handler: number, visible: boolean): void;
|
|
14
|
+
setTransparency(handler: number, transparency: UITransparencyMode): void;
|
|
15
|
+
private placeInstance;
|
|
16
|
+
private extractInstanceData;
|
|
17
|
+
private removeFromCurrentPlane;
|
|
18
|
+
private updatePropertiesInPlace;
|
|
19
|
+
private checkNeedsRelocation;
|
|
20
|
+
private attachToInstancedPlane;
|
|
21
|
+
private createSinglePlane;
|
|
22
|
+
private findCompatibleSinglePlane;
|
|
23
|
+
private findCompatibleInstancedPlane;
|
|
24
|
+
private promoteToInstanced;
|
|
25
|
+
private demoteToSingle;
|
|
26
|
+
private resolveDescriptor;
|
|
27
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { IUniform, ShaderMaterial } from "three";
|
|
2
|
+
import { Matrix3, Matrix4, Texture, Vector2, Vector3, Vector4 } from "three";
|
|
3
|
+
import type { UITransparencyMode } from "../UITransparencyMode";
|
|
4
|
+
import { UIColor } from "../color/UIColor";
|
|
5
|
+
export type UIPropertyType = Texture | UIColor | Vector2 | Vector3 | Vector4 | Matrix3 | Matrix4 | number;
|
|
6
|
+
export interface GLSLTypeInfo {
|
|
7
|
+
instantiable: boolean;
|
|
8
|
+
glslType: string;
|
|
9
|
+
itemSize: number;
|
|
10
|
+
}
|
|
11
|
+
export interface GenericPlaneData {
|
|
12
|
+
source: string;
|
|
13
|
+
properties: Record<string, UIPropertyType>;
|
|
14
|
+
transparency: UITransparencyMode;
|
|
15
|
+
transform: Matrix4;
|
|
16
|
+
visibility: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare const DEFAULT_ALPHA_TEST = 0.5;
|
|
19
|
+
export declare function resolveGLSLTypeInfo(value: UIPropertyType): GLSLTypeInfo;
|
|
20
|
+
export declare function resolveUniform(name: string, material: ShaderMaterial): IUniform<unknown>;
|
|
21
|
+
export declare function arePropertiesCompatible(currentProperties: Record<string, UIPropertyType>, newProperties: Record<string, UIPropertyType>): boolean;
|
|
22
|
+
export declare function buildGenericPlaneFragmentShader(uniformDeclarations: string[], varyingDeclarations: string[], source: string): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Base class for progress bar fill functions */
|
|
2
|
+
export declare abstract class UIProgressMaskFunction {
|
|
3
|
+
/** GLSL shader source code defining fill behavior */
|
|
4
|
+
readonly source: string;
|
|
5
|
+
protected dirtyInternal: boolean;
|
|
6
|
+
protected constructor(
|
|
7
|
+
/** GLSL shader source code defining fill behavior */
|
|
8
|
+
source: string);
|
|
9
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { UIProgressMaskFunction } from "./UIProgressMaskFunction";
|
|
2
|
+
/** Circular radial progress fill */
|
|
3
|
+
export declare class UIProgressMaskFunctionCircular extends UIProgressMaskFunction {
|
|
4
|
+
private startAngleInternal;
|
|
5
|
+
private inverseDirectionInternal;
|
|
6
|
+
/**
|
|
7
|
+
* Creates circular mask function.
|
|
8
|
+
*
|
|
9
|
+
* @param startAngle - Starting angle in radians
|
|
10
|
+
* @param inverseDirection - Whether to fill counter-clockwise
|
|
11
|
+
*/
|
|
12
|
+
constructor(startAngle?: number, inverseDirection?: boolean);
|
|
13
|
+
/** Starting angle in radians */
|
|
14
|
+
get startAngle(): number;
|
|
15
|
+
/** Whether fill is counter-clockwise */
|
|
16
|
+
get inverseDirection(): boolean;
|
|
17
|
+
/** Starting angle in radians */
|
|
18
|
+
set startAngle(value: number);
|
|
19
|
+
/** Whether fill is counter-clockwise */
|
|
20
|
+
set inverseDirection(value: boolean);
|
|
21
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Vector2Like } from "three";
|
|
2
|
+
import { Vector2 } from "three";
|
|
3
|
+
import { UIProgressMaskFunction } from "./UIProgressMaskFunction";
|
|
4
|
+
/** Linear directional progress fill */
|
|
5
|
+
export declare class UIProgressMaskFunctionDirectional extends UIProgressMaskFunction {
|
|
6
|
+
/** Fill direction as normalized vector */
|
|
7
|
+
readonly direction: Vector2;
|
|
8
|
+
private readonly cachedDirection;
|
|
9
|
+
/**
|
|
10
|
+
* Creates directional mask function.
|
|
11
|
+
*
|
|
12
|
+
* @param direction - Fill direction vector. Automatically normalized.
|
|
13
|
+
*/
|
|
14
|
+
constructor(direction?: Vector2Like);
|
|
15
|
+
private ensureDirectionNormalized;
|
|
16
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** Controls which transforms apply relative to anchor */
|
|
2
|
+
export declare enum UIMicroAnchorMode {
|
|
3
|
+
/** Apply rotation and scale around anchor point */
|
|
4
|
+
ROTATION_SCALE = 0,
|
|
5
|
+
/** Apply position, rotation, and scale around anchor point */
|
|
6
|
+
POSITION_ROTATION_SCALE = 1
|
|
7
|
+
}
|
|
8
|
+
/** Configuration options for UIMicro */
|
|
9
|
+
export interface UIMicroConfig {
|
|
10
|
+
/** X offset in world units */
|
|
11
|
+
x: number;
|
|
12
|
+
/** Y offset in world units */
|
|
13
|
+
y: number;
|
|
14
|
+
/** X anchor in normalized coordinates (0 to 1) */
|
|
15
|
+
anchorX: number;
|
|
16
|
+
/** Y anchor in normalized coordinates (0 to 1) */
|
|
17
|
+
anchorY: number;
|
|
18
|
+
/** X scale multiplier */
|
|
19
|
+
scaleX: number;
|
|
20
|
+
/** Y scale multiplier */
|
|
21
|
+
scaleY: number;
|
|
22
|
+
/** Rotation in radians */
|
|
23
|
+
rotation: number;
|
|
24
|
+
/** Which transforms apply relative to anchor */
|
|
25
|
+
anchorMode: UIMicroAnchorMode;
|
|
26
|
+
}
|
|
27
|
+
export declare const MICRO_DEFAULT_POSITION = 0;
|
|
28
|
+
export declare const MICRO_DEFAULT_ANCHOR = 0.5;
|
|
29
|
+
export declare const MICRO_DEFAULT_SCALE = 1;
|
|
30
|
+
export declare const MICRO_DEFAULT_ROTATION = 0;
|
|
31
|
+
export declare const MICRO_DEFAULT_ANCHOR_MODE = UIMicroAnchorMode.ROTATION_SCALE;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { UIMicroAnchorMode, UIMicroConfig } from "./UIMicro.Internal";
|
|
2
|
+
/** Transforms that don't affect constraints */
|
|
3
|
+
export declare class UIMicro {
|
|
4
|
+
private xInternal;
|
|
5
|
+
private yInternal;
|
|
6
|
+
private anchorXInternal;
|
|
7
|
+
private anchorYInternal;
|
|
8
|
+
private scaleXInternal;
|
|
9
|
+
private scaleYInternal;
|
|
10
|
+
private rotationInternal;
|
|
11
|
+
private anchorModeInternal;
|
|
12
|
+
private dirtyInternal;
|
|
13
|
+
/**
|
|
14
|
+
* Creates UIMicro instance.
|
|
15
|
+
*
|
|
16
|
+
* @param config - Transform configuration
|
|
17
|
+
*/
|
|
18
|
+
constructor(config?: Partial<UIMicroConfig>);
|
|
19
|
+
/** X offset in world units */
|
|
20
|
+
get x(): number;
|
|
21
|
+
/** Y offset in world units */
|
|
22
|
+
get y(): number;
|
|
23
|
+
/** X anchor in normalized coordinates (0 to 1) */
|
|
24
|
+
get anchorX(): number;
|
|
25
|
+
/** Y anchor in normalized coordinates (0 to 1) */
|
|
26
|
+
get anchorY(): number;
|
|
27
|
+
/** X scale multiplier */
|
|
28
|
+
get scaleX(): number;
|
|
29
|
+
/** Y scale multiplier */
|
|
30
|
+
get scaleY(): number;
|
|
31
|
+
/** Rotation in degrees */
|
|
32
|
+
get angle(): number;
|
|
33
|
+
/** Which transforms apply relative to anchor */
|
|
34
|
+
get anchorMode(): UIMicroAnchorMode;
|
|
35
|
+
/** Rotation in radians */
|
|
36
|
+
get rotation(): number;
|
|
37
|
+
/** X offset in world units */
|
|
38
|
+
set x(value: number);
|
|
39
|
+
/** Y offset in world units */
|
|
40
|
+
set y(value: number);
|
|
41
|
+
/** X anchor in normalized coordinates (0 to 1) */
|
|
42
|
+
set anchorX(value: number);
|
|
43
|
+
/** Y anchor in normalized coordinates (0 to 1) */
|
|
44
|
+
set anchorY(value: number);
|
|
45
|
+
/** X scale multiplier */
|
|
46
|
+
set scaleX(value: number);
|
|
47
|
+
/** Y scale multiplier */
|
|
48
|
+
set scaleY(value: number);
|
|
49
|
+
/** Rotation in degrees */
|
|
50
|
+
set angle(value: number);
|
|
51
|
+
/** Rotation in radians */
|
|
52
|
+
set rotation(value: number);
|
|
53
|
+
/** Which transforms apply relative to anchor */
|
|
54
|
+
set anchorMode(value: UIMicroAnchorMode);
|
|
55
|
+
/** Resets all transforms to defaults */
|
|
56
|
+
reset(): void;
|
|
57
|
+
/** Copies transforms from another instance */
|
|
58
|
+
copy(value: UIMicro): void;
|
|
59
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Padding configuration as number, per-side, or per-axis */
|
|
2
|
+
export type UIPaddingConfig = {
|
|
3
|
+
horizontal: number;
|
|
4
|
+
vertical: number;
|
|
5
|
+
} | {
|
|
6
|
+
left: number;
|
|
7
|
+
right: number;
|
|
8
|
+
top: number;
|
|
9
|
+
bottom: number;
|
|
10
|
+
} | number;
|
|
11
|
+
export declare const PADDING_DEFAULT_VALUE = 0;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Vector4 } from "three";
|
|
2
|
+
import type { UIPaddingConfig } from "./UIPadding.Internal";
|
|
3
|
+
/** Padding values for four sides */
|
|
4
|
+
export declare class UIPadding {
|
|
5
|
+
private lInternal;
|
|
6
|
+
private rInternal;
|
|
7
|
+
private tInternal;
|
|
8
|
+
private bInternal;
|
|
9
|
+
private dirtyInternal;
|
|
10
|
+
/**
|
|
11
|
+
* Creates UIPadding instance.
|
|
12
|
+
*
|
|
13
|
+
* @param config - Padding configuration
|
|
14
|
+
*/
|
|
15
|
+
constructor(config?: UIPaddingConfig);
|
|
16
|
+
/** Left padding */
|
|
17
|
+
get left(): number;
|
|
18
|
+
/** Right padding */
|
|
19
|
+
get right(): number;
|
|
20
|
+
/** Top padding */
|
|
21
|
+
get top(): number;
|
|
22
|
+
/** Bottom padding */
|
|
23
|
+
get bottom(): number;
|
|
24
|
+
/** Left padding */
|
|
25
|
+
set left(value: number);
|
|
26
|
+
/** Right padding */
|
|
27
|
+
set right(value: number);
|
|
28
|
+
/** Top padding */
|
|
29
|
+
set top(value: number);
|
|
30
|
+
/** Bottom padding */
|
|
31
|
+
set bottom(value: number);
|
|
32
|
+
/** Sets left and right to same value */
|
|
33
|
+
setHorizontal(value: number): void;
|
|
34
|
+
/** Sets top and bottom to same value */
|
|
35
|
+
setVertical(value: number): void;
|
|
36
|
+
/** Sets all sides to same value */
|
|
37
|
+
setUnified(value: number): void;
|
|
38
|
+
/** Sets from Vector4 (x=left, y=right, z=top, w=bottom) */
|
|
39
|
+
setVector4(vector: Vector4): void;
|
|
40
|
+
/** Converts to Vector4 (left, right, top, bottom) */
|
|
41
|
+
toVector4(result?: Vector4): Vector4;
|
|
42
|
+
/** Resets all sides to 0 */
|
|
43
|
+
reset(): void;
|
|
44
|
+
/** Copies from another instance */
|
|
45
|
+
copy(other: UIPadding): void;
|
|
46
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { UIResizePolicy } from "./UIResizePolicy";
|
|
2
|
+
/** Scales by width in landscape, by height in portrait */
|
|
3
|
+
export declare class UIResizePolicyCross extends UIResizePolicy {
|
|
4
|
+
private fixedWidthLandscapeInternal;
|
|
5
|
+
private fixedHeightPortraitInternal;
|
|
6
|
+
/**
|
|
7
|
+
* Creates cross resize policy.
|
|
8
|
+
*
|
|
9
|
+
* @param fixedWidthLandscape - Target width when landscape
|
|
10
|
+
* @param fixedHeightPortrait - Target height when portrait
|
|
11
|
+
*/
|
|
12
|
+
constructor(fixedWidthLandscape: number, fixedHeightPortrait: number);
|
|
13
|
+
/** Target width when landscape */
|
|
14
|
+
get fixedWidthLandscape(): number;
|
|
15
|
+
/** Target height when portrait */
|
|
16
|
+
get fixedHeightPortrait(): number;
|
|
17
|
+
/** Target width when landscape */
|
|
18
|
+
set fixedWidthLandscape(value: number);
|
|
19
|
+
/** Target height when portrait */
|
|
20
|
+
set fixedHeightPortrait(value: number);
|
|
21
|
+
calculateScale(width: number, height: number): number;
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { UIResizePolicy } from "./UIResizePolicy";
|
|
2
|
+
/** Scales by height in landscape, by width in portrait */
|
|
3
|
+
export declare class UIResizePolicyCrossInverted extends UIResizePolicy {
|
|
4
|
+
private fixedHeightLandscapeInternal;
|
|
5
|
+
private fixedWidthPortraitInternal;
|
|
6
|
+
/**
|
|
7
|
+
* Creates inverted cross resize policy.
|
|
8
|
+
*
|
|
9
|
+
* @param fixedHeightLandscape - Target height when landscape
|
|
10
|
+
* @param fixedWidthPortrait - Target width when portrait
|
|
11
|
+
*/
|
|
12
|
+
constructor(fixedHeightLandscape: number, fixedWidthPortrait: number);
|
|
13
|
+
/** Target height when landscape */
|
|
14
|
+
get fixedHeightLandscape(): number;
|
|
15
|
+
/** Target width when portrait */
|
|
16
|
+
get fixedWidthPortrait(): number;
|
|
17
|
+
/** Target height when landscape */
|
|
18
|
+
set fixedHeightLandscape(value: number);
|
|
19
|
+
/** Target width when portrait */
|
|
20
|
+
set fixedWidthPortrait(value: number);
|
|
21
|
+
calculateScale(width: number, height: number): number;
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { UIResizePolicy } from "./UIResizePolicy";
|
|
2
|
+
/** Scales by height with orientation-specific targets */
|
|
3
|
+
export declare class UIResizePolicyFixedHeight extends UIResizePolicy {
|
|
4
|
+
private fixedHeightLandscapeInternal;
|
|
5
|
+
private fixedHeightPortraitInternal;
|
|
6
|
+
/**
|
|
7
|
+
* Creates fixed height resize policy.
|
|
8
|
+
*
|
|
9
|
+
* @param fixedHeightLandscape - Target height when landscape
|
|
10
|
+
* @param fixedHeightPortrait - Target height when portrait
|
|
11
|
+
*/
|
|
12
|
+
constructor(fixedHeightLandscape: number, fixedHeightPortrait: number);
|
|
13
|
+
/** Target height when landscape */
|
|
14
|
+
get fixedHeightLandscape(): number;
|
|
15
|
+
/** Target height when portrait */
|
|
16
|
+
get fixedHeightPortrait(): number;
|
|
17
|
+
/** Target height when landscape */
|
|
18
|
+
set fixedHeightLandscape(value: number);
|
|
19
|
+
/** Target height when portrait */
|
|
20
|
+
set fixedHeightPortrait(value: number);
|
|
21
|
+
calculateScale(width: number, height: number): number;
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { UIResizePolicy } from "./UIResizePolicy";
|
|
2
|
+
/** Scales by width with orientation-specific targets */
|
|
3
|
+
export declare class UIResizePolicyFixedWidth extends UIResizePolicy {
|
|
4
|
+
private fixedWidthLandscapeInternal;
|
|
5
|
+
private fixedWidthPortraitInternal;
|
|
6
|
+
/**
|
|
7
|
+
* Creates fixed width resize policy.
|
|
8
|
+
*
|
|
9
|
+
* @param fixedWidthLandscape - Target width when landscape
|
|
10
|
+
* @param fixedWidthPortrait - Target width when portrait
|
|
11
|
+
*/
|
|
12
|
+
constructor(fixedWidthLandscape: number, fixedWidthPortrait: number);
|
|
13
|
+
/** Target width when landscape */
|
|
14
|
+
get fixedWidthLandscape(): number;
|
|
15
|
+
/** Target width when portrait */
|
|
16
|
+
get fixedWidthPortrait(): number;
|
|
17
|
+
/** Target width when landscape */
|
|
18
|
+
set fixedWidthLandscape(value: number);
|
|
19
|
+
/** Target width when portrait */
|
|
20
|
+
set fixedWidthPortrait(value: number);
|
|
21
|
+
calculateScale(width: number, height: number): number;
|
|
22
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { UITextStyleConfig } from "../text-style/UITextStyle.Internal";
|
|
2
|
+
/** Configuration for creating a text span */
|
|
3
|
+
export interface UITextSpanConfig {
|
|
4
|
+
/** Text content */
|
|
5
|
+
text: string;
|
|
6
|
+
/** Style properties */
|
|
7
|
+
style?: Partial<UITextStyleConfig>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { UITextStyle } from "../text-style/UITextStyle";
|
|
2
|
+
import type { UITextSpanConfig } from "./UITextSpan.Internal";
|
|
3
|
+
/** Text span with associated style */
|
|
4
|
+
export declare class UITextSpan {
|
|
5
|
+
/** Text style */
|
|
6
|
+
style: UITextStyle;
|
|
7
|
+
private textInternal;
|
|
8
|
+
private dirtyInternal;
|
|
9
|
+
/** @param config Text span configuration */
|
|
10
|
+
constructor(config: UITextSpanConfig);
|
|
11
|
+
/** Text content */
|
|
12
|
+
get text(): string;
|
|
13
|
+
set text(value: string);
|
|
14
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** Complete text style configuration with all properties resolved */
|
|
2
|
+
export interface UITextStyleConfig {
|
|
3
|
+
/** Text color */
|
|
4
|
+
color: string;
|
|
5
|
+
/** Text alignment */
|
|
6
|
+
align: "left" | "center" | "right";
|
|
7
|
+
/** Font family name */
|
|
8
|
+
fontFamily: string;
|
|
9
|
+
/** Font size in pixels */
|
|
10
|
+
fontSize: number;
|
|
11
|
+
/** Font style */
|
|
12
|
+
fontStyle: "normal" | "italic" | "oblique";
|
|
13
|
+
/** Font weight */
|
|
14
|
+
fontWeight: "normal" | "bold" | "bolder" | "lighter" | number;
|
|
15
|
+
/** Line height in pixels */
|
|
16
|
+
lineHeight: number;
|
|
17
|
+
/** Whether shadow is enabled */
|
|
18
|
+
enableShadow: boolean;
|
|
19
|
+
/** Shadow horizontal offset in pixels */
|
|
20
|
+
shadowOffsetX: number;
|
|
21
|
+
/** Shadow vertical offset in pixels */
|
|
22
|
+
shadowOffsetY: number;
|
|
23
|
+
/** Shadow blur radius in pixels */
|
|
24
|
+
shadowBlur: number;
|
|
25
|
+
/** Shadow color */
|
|
26
|
+
shadowColor: string;
|
|
27
|
+
/** Whether stroke is enabled */
|
|
28
|
+
enableStroke: boolean;
|
|
29
|
+
/** Stroke color */
|
|
30
|
+
strokeColor: string;
|
|
31
|
+
/** Stroke thickness in pixels */
|
|
32
|
+
strokeThickness: number;
|
|
33
|
+
}
|
|
34
|
+
export declare const TEXT_STYLE_DEFAULT_COLOR = "#000000";
|
|
35
|
+
export declare const TEXT_STYLE_DEFAULT_ALIGN: "left";
|
|
36
|
+
export declare const TEXT_STYLE_DEFAULT_FONT_FAMILY = "Arial";
|
|
37
|
+
export declare const TEXT_STYLE_DEFAULT_FONT_SIZE = 16;
|
|
38
|
+
export declare const TEXT_STYLE_DEFAULT_FONT_STYLE: "normal";
|
|
39
|
+
export declare const TEXT_STYLE_DEFAULT_FONT_WEIGHT: "normal";
|
|
40
|
+
export declare const TEXT_STYLE_DEFAULT_LINE_HEIGHT = 1.2;
|
|
41
|
+
export declare const TEXT_STYLE_DEFAULT_ENABLE_SHADOW = false;
|
|
42
|
+
export declare const TEXT_STYLE_DEFAULT_SHADOW_OFFSET_X = 0;
|
|
43
|
+
export declare const TEXT_STYLE_DEFAULT_SHADOW_OFFSET_Y = 0;
|
|
44
|
+
export declare const TEXT_STYLE_DEFAULT_SHADOW_BLUR = 0;
|
|
45
|
+
export declare const TEXT_STYLE_DEFAULT_SHADOW_COLOR = "transparent";
|
|
46
|
+
export declare const TEXT_STYLE_DEFAULT_ENABLE_STROKE = false;
|
|
47
|
+
export declare const TEXT_STYLE_DEFAULT_STROKE_COLOR = "#000000";
|
|
48
|
+
export declare const TEXT_STYLE_DEFAULT_STROKE_THICKNESS = 0;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { UITextStyleConfig } from "./UITextStyle.Internal";
|
|
2
|
+
/** Text style configuration for UI text rendering */
|
|
3
|
+
export declare class UITextStyle {
|
|
4
|
+
private colorInternal?;
|
|
5
|
+
private alignInternal?;
|
|
6
|
+
private fontFamilyInternal?;
|
|
7
|
+
private fontSizeInternal?;
|
|
8
|
+
private fontStyleInternal?;
|
|
9
|
+
private fontWeightInternal?;
|
|
10
|
+
private lineHeightInternal?;
|
|
11
|
+
private enableShadowInternal?;
|
|
12
|
+
private shadowOffsetXInternal?;
|
|
13
|
+
private shadowOffsetYInternal?;
|
|
14
|
+
private shadowBlurInternal?;
|
|
15
|
+
private shadowColorInternal?;
|
|
16
|
+
private enableStrokeInternal?;
|
|
17
|
+
private strokeColorInternal?;
|
|
18
|
+
private strokeThicknessInternal?;
|
|
19
|
+
private dirtyInternal;
|
|
20
|
+
/** @param config Partial style configuration. Unspecified properties remain undefined. */
|
|
21
|
+
constructor(config?: Partial<UITextStyleConfig>);
|
|
22
|
+
/** Text color */
|
|
23
|
+
get color(): string | undefined;
|
|
24
|
+
/** Text alignment */
|
|
25
|
+
get align(): "left" | "center" | "right" | undefined;
|
|
26
|
+
/** Font family name */
|
|
27
|
+
get fontFamily(): string | undefined;
|
|
28
|
+
/** Font size in pixels */
|
|
29
|
+
get fontSize(): number | undefined;
|
|
30
|
+
/** Font style */
|
|
31
|
+
get fontStyle(): "normal" | "italic" | "oblique" | undefined;
|
|
32
|
+
/** Font weight */
|
|
33
|
+
get fontWeight(): "normal" | "bold" | "bolder" | "lighter" | number | undefined;
|
|
34
|
+
/** Line height in pixels */
|
|
35
|
+
get lineHeight(): number | undefined;
|
|
36
|
+
/** Whether shadow is enabled */
|
|
37
|
+
get enableShadow(): boolean | undefined;
|
|
38
|
+
/** Shadow horizontal offset in pixels */
|
|
39
|
+
get shadowOffsetX(): number | undefined;
|
|
40
|
+
/** Shadow vertical offset in pixels */
|
|
41
|
+
get shadowOffsetY(): number | undefined;
|
|
42
|
+
/** Shadow blur radius in pixels */
|
|
43
|
+
get shadowBlur(): number | undefined;
|
|
44
|
+
/** Shadow color */
|
|
45
|
+
get shadowColor(): string | undefined;
|
|
46
|
+
/** Whether stroke is enabled */
|
|
47
|
+
get enableStroke(): boolean | undefined;
|
|
48
|
+
/** Stroke color */
|
|
49
|
+
get strokeColor(): string | undefined;
|
|
50
|
+
/** Stroke thickness in pixels */
|
|
51
|
+
get strokeThickness(): number | undefined;
|
|
52
|
+
set color(value: string | undefined);
|
|
53
|
+
set align(value: "left" | "center" | "right" | undefined);
|
|
54
|
+
set fontFamily(value: string | undefined);
|
|
55
|
+
set fontSize(value: number | undefined);
|
|
56
|
+
set fontStyle(value: "normal" | "italic" | "oblique" | undefined);
|
|
57
|
+
set fontWeight(value: "normal" | "bold" | "bolder" | "lighter" | number | undefined);
|
|
58
|
+
set lineHeight(value: number | undefined);
|
|
59
|
+
set enableShadow(value: boolean | undefined);
|
|
60
|
+
set shadowOffsetX(value: number | undefined);
|
|
61
|
+
set shadowOffsetY(value: number | undefined);
|
|
62
|
+
set shadowBlur(value: number | undefined);
|
|
63
|
+
set shadowColor(value: string | undefined);
|
|
64
|
+
set enableStroke(value: boolean | undefined);
|
|
65
|
+
set strokeColor(value: string | undefined);
|
|
66
|
+
set strokeThickness(value: number | undefined);
|
|
67
|
+
/**
|
|
68
|
+
* Resolves complete style from primary and fallback sources.
|
|
69
|
+
* @param primary First style to check for each property
|
|
70
|
+
* @param fallback Second style to check if primary is undefined
|
|
71
|
+
* @returns Complete style configuration with all defaults applied
|
|
72
|
+
*/
|
|
73
|
+
static resolve(primary?: UITextStyle, fallback?: UITextStyle): UITextStyleConfig;
|
|
74
|
+
/** Sets all properties to default values */
|
|
75
|
+
setDefaults(): void;
|
|
76
|
+
/** Sets all properties to undefined */
|
|
77
|
+
clear(): void;
|
|
78
|
+
/** Copies from another style instance */
|
|
79
|
+
copy(value: UITextStyle): void;
|
|
80
|
+
/**
|
|
81
|
+
* Calculates maximum padding required for stroke and shadow.
|
|
82
|
+
* @returns Padding in pixels needed on all sides
|
|
83
|
+
*/
|
|
84
|
+
calculatePadding(): number;
|
|
85
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Texture } from "three";
|
|
2
|
+
export declare const TEXTURE_DEFAULT_TEXTURE: Texture;
|
|
3
|
+
export declare const TEXTURE_DEFAULT_SIZE = 2;
|
|
4
|
+
/** Events emitted by UITexture */
|
|
5
|
+
export declare enum UITextureViewEvent {
|
|
6
|
+
/** Emitted when width or height changes */
|
|
7
|
+
DIMENSIONS_CHANGED = 0
|
|
8
|
+
}
|
|
9
|
+
/** Rectangle coordinates and dimensions in atlas */
|
|
10
|
+
export interface UITextureRect {
|
|
11
|
+
/** X coordinate in pixels */
|
|
12
|
+
x: number;
|
|
13
|
+
/** Y coordinate in pixels */
|
|
14
|
+
y: number;
|
|
15
|
+
/** Width in pixels */
|
|
16
|
+
w: number;
|
|
17
|
+
/** Height in pixels */
|
|
18
|
+
h: number;
|
|
19
|
+
}
|
|
20
|
+
/** Size dimensions */
|
|
21
|
+
export interface UITextureSize {
|
|
22
|
+
/** Width in pixels */
|
|
23
|
+
w: number;
|
|
24
|
+
/** Height in pixels */
|
|
25
|
+
h: number;
|
|
26
|
+
}
|
|
27
|
+
/** Transparent padding around visible content */
|
|
28
|
+
export interface UITextureTrim {
|
|
29
|
+
/** Left padding in world units */
|
|
30
|
+
left: number;
|
|
31
|
+
/** Right padding in world units */
|
|
32
|
+
right: number;
|
|
33
|
+
/** Top padding in world units */
|
|
34
|
+
top: number;
|
|
35
|
+
/** Bottom padding in world units */
|
|
36
|
+
bottom: number;
|
|
37
|
+
}
|
|
38
|
+
/** Configuration for texture atlas sprite */
|
|
39
|
+
export interface UITextureAtlasConfig {
|
|
40
|
+
/** Source texture atlas */
|
|
41
|
+
texture: Texture;
|
|
42
|
+
/** Rectangle in atlas containing sprite */
|
|
43
|
+
frame: UITextureRect;
|
|
44
|
+
/** Whether sprite is rotated 90 degrees clockwise */
|
|
45
|
+
rotated?: boolean;
|
|
46
|
+
/** Position and size within original image before trimming */
|
|
47
|
+
spriteSourceSize: UITextureRect;
|
|
48
|
+
/** Original image dimensions before trimming */
|
|
49
|
+
sourceSize: UITextureSize;
|
|
50
|
+
/** Scale factor for resolution independence */
|
|
51
|
+
scale?: number;
|
|
52
|
+
}
|
|
53
|
+
/** Texture configuration from direct texture or atlas sprite */
|
|
54
|
+
export type UITextureConfig = Texture | UITextureAtlasConfig;
|