laymur 0.1.40 → 0.1.42
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/dist/Constraints/UIConstraint.d.ts +0 -2
- package/dist/Elements/UIDummy.d.ts +1 -2
- package/dist/Elements/UIElement.d.ts +16 -14
- package/dist/Elements/UIImage.d.ts +1 -2
- package/dist/Elements/UIProgress.d.ts +3 -3
- package/dist/Elements/UIScene.d.ts +1 -2
- package/dist/Elements/UIText.d.ts +3 -4
- package/dist/Layers/UILayer.d.ts +3 -3
- package/dist/Miscellaneous/UIBehavior.d.ts +1 -1
- package/dist/Miscellaneous/{UIMicroTransformations.d.ts → UIMicro.d.ts} +13 -11
- package/dist/Miscellaneous/microTransformationTools.d.ts +2 -2
- package/dist/Passes/UIComposer.d.ts +10 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -9,6 +9,4 @@ export declare abstract class UIConstraint {
|
|
|
9
9
|
destroy(): void;
|
|
10
10
|
abstract [disableConstraintSymbol](orientation: UIOrientation): void;
|
|
11
11
|
abstract [enableConstraintSymbol](orientation: UIOrientation): void;
|
|
12
|
-
protected abstract buildConstraints(): void;
|
|
13
|
-
protected abstract destroyConstraints(): void;
|
|
14
12
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { UILayer } from "../Layers/UILayer";
|
|
2
|
-
import { renderSymbol } from "../Miscellaneous/symbols";
|
|
3
2
|
import { UIElement } from "./UIElement";
|
|
4
3
|
export declare class UIDummy extends UIElement {
|
|
5
4
|
constructor(layer: UILayer, width?: number, height?: number);
|
|
6
|
-
|
|
5
|
+
protected render(): void;
|
|
7
6
|
}
|
|
@@ -4,42 +4,44 @@ import type { WebGLRenderer } from "three";
|
|
|
4
4
|
import { type Object3D } from "three";
|
|
5
5
|
import type { UILayer } from "../Layers/UILayer";
|
|
6
6
|
import { clickSymbol, heightSymbol, needsRecalculation, renderSymbol, widthSymbol, xSymbol, ySymbol } from "../Miscellaneous/symbols";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { UIComposer } from "../Passes/UIComposer";
|
|
10
|
-
import type { UIPass } from "../Passes/UIPass";
|
|
7
|
+
import { UIMode } from "../Miscellaneous/UIBehavior";
|
|
8
|
+
import { UIMicro, UIMicroInternal } from "../Miscellaneous/UIMicro";
|
|
9
|
+
import { UIComposer, UIComposerInternal } from "../Passes/UIComposer";
|
|
11
10
|
export declare enum UIElementEvent {
|
|
12
11
|
CLICK = "click"
|
|
13
12
|
}
|
|
14
13
|
export declare abstract class UIElement extends Eventail {
|
|
15
14
|
readonly layer: UILayer;
|
|
16
15
|
protected readonly object: Object3D;
|
|
17
|
-
name: string;
|
|
18
|
-
readonly micro: UIMicroTransformations;
|
|
19
16
|
[xSymbol]: Variable;
|
|
20
17
|
[ySymbol]: Variable;
|
|
21
18
|
[widthSymbol]: Variable;
|
|
22
19
|
[heightSymbol]: Variable;
|
|
23
20
|
[needsRecalculation]: boolean;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
name: string;
|
|
22
|
+
readonly micro: UIMicro;
|
|
23
|
+
readonly composer: UIComposer;
|
|
24
|
+
protected readonly microInternal: UIMicroInternal;
|
|
25
|
+
protected readonly composerInternal: UIComposerInternal;
|
|
26
|
+
protected modeInternal: UIMode;
|
|
27
27
|
constructor(layer: UILayer, object: Object3D, x: number, y: number, width: number, height: number);
|
|
28
|
-
get passes(): UIPass[];
|
|
29
28
|
get x(): number;
|
|
30
29
|
get y(): number;
|
|
31
30
|
get width(): number;
|
|
32
31
|
get height(): number;
|
|
33
32
|
get zIndex(): number;
|
|
34
|
-
get
|
|
33
|
+
get mode(): UIMode;
|
|
34
|
+
protected get needsRecalculation(): boolean;
|
|
35
35
|
set x(value: number);
|
|
36
36
|
set y(value: number);
|
|
37
37
|
set width(value: number);
|
|
38
38
|
set height(value: number);
|
|
39
39
|
set zIndex(value: number);
|
|
40
|
-
set
|
|
40
|
+
set mode(value: UIMode);
|
|
41
41
|
destroy(): void;
|
|
42
|
+
[renderSymbol](renderer: WebGLRenderer, deltaTime: number): void;
|
|
42
43
|
[clickSymbol](x: number, y: number): boolean;
|
|
43
|
-
protected
|
|
44
|
-
protected
|
|
44
|
+
protected applyTransformations(): void;
|
|
45
|
+
protected click(x: number, y: number): boolean;
|
|
46
|
+
protected abstract render(renderer: WebGLRenderer, deltaTime: number): void;
|
|
45
47
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { Texture, WebGLRenderer } from "three";
|
|
2
2
|
import type { UILayer } from "../Layers/UILayer";
|
|
3
|
-
import { renderSymbol } from "../Miscellaneous/symbols";
|
|
4
3
|
import { UIElement } from "./UIElement";
|
|
5
4
|
export declare class UIImage extends UIElement {
|
|
6
5
|
private readonly material;
|
|
@@ -12,5 +11,5 @@ export declare class UIImage extends UIElement {
|
|
|
12
11
|
set color(value: number);
|
|
13
12
|
set opacity(value: number);
|
|
14
13
|
destroy(): void;
|
|
15
|
-
|
|
14
|
+
protected render(renderer: WebGLRenderer): void;
|
|
16
15
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Texture, WebGLRenderer } from "three";
|
|
2
2
|
import type { UILayer } from "../Layers/UILayer";
|
|
3
|
-
import { renderSymbol } from "../Miscellaneous/symbols";
|
|
4
3
|
import { UIElement } from "./UIElement";
|
|
5
4
|
export interface UIProgressOptions {
|
|
5
|
+
textureBackground: Texture;
|
|
6
6
|
progress: number;
|
|
7
7
|
isForegroundDirection: boolean;
|
|
8
8
|
angle: number;
|
|
@@ -17,7 +17,7 @@ export declare class UIProgress extends UIElement {
|
|
|
17
17
|
private readonly material;
|
|
18
18
|
private readonly imageWidth;
|
|
19
19
|
private readonly imageHeight;
|
|
20
|
-
constructor(layer: UILayer, textureForeground: Texture,
|
|
20
|
+
constructor(layer: UILayer, textureForeground: Texture, options?: Partial<UIProgressOptions>);
|
|
21
21
|
get progress(): number;
|
|
22
22
|
get backgroundTexture(): Texture | undefined;
|
|
23
23
|
get foregroundTexture(): Texture;
|
|
@@ -39,5 +39,5 @@ export declare class UIProgress extends UIElement {
|
|
|
39
39
|
set angle(value: number);
|
|
40
40
|
set isForwardDirection(value: boolean);
|
|
41
41
|
destroy(): void;
|
|
42
|
-
|
|
42
|
+
protected render(renderer: WebGLRenderer): void;
|
|
43
43
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Camera, WebGLRenderer } from "three";
|
|
2
2
|
import { Scene } from "three";
|
|
3
3
|
import type { UILayer } from "../Layers/UILayer";
|
|
4
|
-
import { renderSymbol } from "../Miscellaneous/symbols";
|
|
5
4
|
import { UIElement } from "./UIElement";
|
|
6
5
|
export declare enum UISceneUpdateBehavior {
|
|
7
6
|
AUTO = "AUTO",
|
|
@@ -48,5 +47,5 @@ export declare class UIScene extends UIElement {
|
|
|
48
47
|
set resolutionFactor(value: number);
|
|
49
48
|
destroy(): void;
|
|
50
49
|
requestRender(): void;
|
|
51
|
-
|
|
50
|
+
protected render(renderer: WebGLRenderer): void;
|
|
52
51
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { WebGLRenderer } from "three";
|
|
2
2
|
import type { UILayer } from "../Layers/UILayer";
|
|
3
|
-
import { renderSymbol } from "../Miscellaneous/symbols";
|
|
4
3
|
import { UIElement } from "./UIElement";
|
|
5
4
|
import type { UITextPadding, UITextSpan, UITextStyle } from "./UITextInterfaces";
|
|
6
5
|
export interface UITextOptions {
|
|
@@ -15,13 +14,13 @@ export declare class UIText extends UIElement {
|
|
|
15
14
|
private readonly context;
|
|
16
15
|
private readonly textBlockSize;
|
|
17
16
|
private readonly padding;
|
|
18
|
-
private
|
|
17
|
+
private suggestedAspect;
|
|
19
18
|
constructor(layer: UILayer, spans: (UITextSpan | string)[] | UITextSpan | string, parameters?: Partial<UITextOptions>);
|
|
20
19
|
get color(): number;
|
|
21
20
|
get opacity(): number;
|
|
22
21
|
set color(value: number);
|
|
23
22
|
set opacity(value: number);
|
|
24
23
|
destroy(): void;
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
applyTransformations(): void;
|
|
25
|
+
protected render(renderer: WebGLRenderer): void;
|
|
27
26
|
}
|
package/dist/Layers/UILayer.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { OrthographicCamera, Scene } from "three";
|
|
|
5
5
|
import type { UIConstraint } from "../Constraints/UIConstraint";
|
|
6
6
|
import { UIElement } from "../Elements/UIElement";
|
|
7
7
|
import { addConstraintSymbol, addUIConstraintSymbol, addUIElementSymbol, addVariableSymbol, heightSymbol, removeConstraintSymbol, removeUIConstraintSymbol, removeUIElementSymbol, removeVariableSymbol, suggestVariableSymbol, widthSymbol, xSymbol, ySymbol } from "../Miscellaneous/symbols";
|
|
8
|
-
import {
|
|
8
|
+
import { UIMode } from "../Miscellaneous/UIBehavior";
|
|
9
9
|
import { UIOrientation } from "../Miscellaneous/UIOrientation";
|
|
10
10
|
interface VariableDescription {
|
|
11
11
|
strength: number;
|
|
@@ -25,7 +25,7 @@ export declare enum UILayerEvent {
|
|
|
25
25
|
ORIENTATION_CHANGED = "orientationChanged"
|
|
26
26
|
}
|
|
27
27
|
export declare abstract class UILayer extends Eventail {
|
|
28
|
-
behavior:
|
|
28
|
+
behavior: UIMode;
|
|
29
29
|
readonly [xSymbol]: Variable;
|
|
30
30
|
readonly [ySymbol]: Variable;
|
|
31
31
|
readonly [widthSymbol]: Variable;
|
|
@@ -52,7 +52,7 @@ export declare abstract class UILayer extends Eventail {
|
|
|
52
52
|
[addVariableSymbol](owner: UIElement | UIConstraint, variable: Variable, strength: number): void;
|
|
53
53
|
[removeVariableSymbol](owner: UIElement | UIConstraint, variable: Variable): void;
|
|
54
54
|
[suggestVariableSymbol](owner: UIElement | UIConstraint, variable: Variable, value: number): void;
|
|
55
|
-
render(renderer: WebGLRenderer): void;
|
|
55
|
+
render(renderer: WebGLRenderer, deltaTime: number): void;
|
|
56
56
|
protected clickInternal(x: number, y: number): void;
|
|
57
57
|
protected resizeInternal(width: number, height: number): void;
|
|
58
58
|
protected applyCameraSize(width: number, height: number): void;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import type { UIElement } from "../Elements/UIElement";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
export declare class UIMicroInternal {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
anchorX: number;
|
|
6
|
+
anchorY: number;
|
|
7
|
+
scaleX: number;
|
|
8
|
+
scaleY: number;
|
|
9
|
+
rotation: number;
|
|
10
|
+
needsRecalculation: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare class UIMicro {
|
|
13
|
+
private readonly raw;
|
|
4
14
|
private readonly owner;
|
|
5
|
-
|
|
6
|
-
private positionXInternal;
|
|
7
|
-
private positionYInternal;
|
|
8
|
-
private anchorXInternal;
|
|
9
|
-
private anchorYInternal;
|
|
10
|
-
private scaleXInternal;
|
|
11
|
-
private scaleYInternal;
|
|
12
|
-
private rotationInternal;
|
|
13
|
-
constructor(owner: UIElement);
|
|
15
|
+
constructor(raw: UIMicroInternal, owner: UIElement);
|
|
14
16
|
get x(): number;
|
|
15
17
|
get y(): number;
|
|
16
18
|
get anchorX(): number;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type Object3D } from "three";
|
|
2
|
-
import type {
|
|
3
|
-
export declare function applyMicroTransformations(object: Object3D, micro:
|
|
2
|
+
import type { UIMicroInternal } from "./UIMicro";
|
|
3
|
+
export declare function applyMicroTransformations(object: Object3D, micro: UIMicroInternal, x: number, y: number, width: number, height: number, padding: number): void;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import type { Material, WebGLRenderer } from "three";
|
|
2
2
|
import type { UIPass } from "./UIPass";
|
|
3
|
-
export declare class
|
|
3
|
+
export declare class UIComposerInternal {
|
|
4
4
|
readonly passes: UIPass[];
|
|
5
5
|
private fromRenderTarget;
|
|
6
6
|
private toRenderTarget;
|
|
7
7
|
private readonly defaultMaterial;
|
|
8
8
|
private readonly screen;
|
|
9
9
|
private needsUpdateInternal;
|
|
10
|
-
private
|
|
11
|
-
private
|
|
10
|
+
private paddingHasChangedInternal;
|
|
11
|
+
private paddingInternal;
|
|
12
12
|
constructor();
|
|
13
13
|
get needsUpdate(): boolean;
|
|
14
|
-
get
|
|
15
|
-
get
|
|
14
|
+
get paddingHasChanged(): boolean;
|
|
15
|
+
get padding(): number;
|
|
16
16
|
requestUpdate(): void;
|
|
17
17
|
compose(renderer: WebGLRenderer, width: number, height: number, material: Material, canOverrideBlending?: boolean): Material;
|
|
18
18
|
destroy(): void;
|
|
@@ -22,3 +22,8 @@ export declare class UIComposer {
|
|
|
22
22
|
private setScreenPadding;
|
|
23
23
|
private reverseRenderTargets;
|
|
24
24
|
}
|
|
25
|
+
export declare class UIComposer {
|
|
26
|
+
private readonly raw;
|
|
27
|
+
constructor(raw: UIComposerInternal);
|
|
28
|
+
get passes(): UIPass[];
|
|
29
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export * from "./Elements/UIProgress";
|
|
|
21
21
|
export * from "./Elements/UIScene";
|
|
22
22
|
export * from "./Elements/UIText";
|
|
23
23
|
export * from "./Layers/UIFullScreenLayer";
|
|
24
|
-
export
|
|
24
|
+
export * from "./Layers/UILayer";
|
|
25
25
|
export * from "./Layers/UIManualLayer";
|
|
26
26
|
export * from "./Miscellaneous/UIBehavior";
|
|
27
27
|
export { UIOrientation } from "./Miscellaneous/UIOrientation";
|