laymur 0.0.9 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Elements/UIDummy.d.ts +2 -0
- package/dist/Elements/UIElement.d.ts +8 -2
- package/dist/Elements/UIImage.d.ts +9 -3
- package/dist/Elements/UIText.d.ts +10 -5
- package/dist/Miscellaneous/microTransformationTools.d.ts +1 -1
- package/dist/Miscellaneous/symbols.d.ts +1 -2
- package/dist/Passes/UIComposer.d.ts +12 -0
- package/dist/Passes/UIDrawPass.d.ts +8 -0
- package/dist/Passes/UIFullScreenQuad.d.ts +16 -0
- package/dist/Passes/UIMaterial.d.ts +9 -0
- package/dist/Passes/UIPass.d.ts +11 -0
- package/dist/index.js +1 -3688
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/Materials/UIEnhancedMaterial.d.ts +0 -17
- package/dist/Materials/UIMaterial.d.ts +0 -5
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { UILayer } from "../Layers/UILayer";
|
|
2
|
+
import { renderSymbol } from "../Miscellaneous/symbols";
|
|
2
3
|
import { UIElement } from "./UIElement";
|
|
3
4
|
export declare class UIDummy extends UIElement {
|
|
4
5
|
constructor(layer: UILayer, width?: number, height?: number);
|
|
6
|
+
[renderSymbol](): void;
|
|
5
7
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { Eventail } from "eventail";
|
|
2
2
|
import { Variable } from "kiwi.js";
|
|
3
|
+
import type { WebGLRenderer } from "three";
|
|
3
4
|
import { type Object3D } from "three";
|
|
4
5
|
import type { UILayer } from "../Layers/UILayer";
|
|
5
|
-
import { clickSymbol,
|
|
6
|
+
import { clickSymbol, heightSymbol, needsRecalculation, renderSymbol, widthSymbol, xSymbol, ySymbol } from "../Miscellaneous/symbols";
|
|
6
7
|
import { UIBehavior } from "../Miscellaneous/UIBehavior";
|
|
7
8
|
import { UIMicroTransformations } from "../Miscellaneous/UIMicroTransformations";
|
|
9
|
+
import { UIComposer } from "../Passes/UIComposer";
|
|
10
|
+
import type { UIPass } from "../Passes/UIPass";
|
|
8
11
|
export declare enum UIElementEvent {
|
|
9
12
|
CLICK = "click"
|
|
10
13
|
}
|
|
@@ -18,7 +21,9 @@ export declare abstract class UIElement extends Eventail {
|
|
|
18
21
|
[heightSymbol]: Variable;
|
|
19
22
|
[needsRecalculation]: boolean;
|
|
20
23
|
protected behaviorInternal: UIBehavior;
|
|
24
|
+
protected readonly composer: UIComposer;
|
|
21
25
|
constructor(layer: UILayer, object: Object3D, x: number, y: number, width: number, height: number);
|
|
26
|
+
get passes(): UIPass[];
|
|
22
27
|
get x(): number;
|
|
23
28
|
get y(): number;
|
|
24
29
|
get width(): number;
|
|
@@ -32,6 +37,7 @@ export declare abstract class UIElement extends Eventail {
|
|
|
32
37
|
set zIndex(value: number);
|
|
33
38
|
set behavior(value: UIBehavior);
|
|
34
39
|
destroy(): void;
|
|
35
|
-
[flushTransformSymbol](): void;
|
|
36
40
|
[clickSymbol](x: number, y: number): boolean;
|
|
41
|
+
protected flushTransform(): void;
|
|
42
|
+
protected abstract [renderSymbol](renderer: WebGLRenderer): void;
|
|
37
43
|
}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import type { Texture } from "three";
|
|
1
|
+
import type { Color, Texture, WebGLRenderer } from "three";
|
|
2
2
|
import type { UILayer } from "../Layers/UILayer";
|
|
3
|
-
import {
|
|
3
|
+
import { renderSymbol } from "../Miscellaneous/symbols";
|
|
4
4
|
import { UIElement } from "./UIElement";
|
|
5
5
|
export declare class UIImage extends UIElement {
|
|
6
|
-
readonly material
|
|
6
|
+
private readonly material;
|
|
7
|
+
private readonly texture;
|
|
7
8
|
constructor(layer: UILayer, texture: Texture);
|
|
9
|
+
get color(): Color;
|
|
10
|
+
get opacity(): number;
|
|
11
|
+
set color(value: Color);
|
|
12
|
+
set opacity(value: number);
|
|
8
13
|
destroy(): void;
|
|
14
|
+
[renderSymbol](renderer: WebGLRenderer): void;
|
|
9
15
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { Color, WebGLRenderer } from "three";
|
|
1
2
|
import type { UILayer } from "../Layers/UILayer";
|
|
2
|
-
import {
|
|
3
|
-
import { flushTransformSymbol } from "../Miscellaneous/symbols";
|
|
3
|
+
import { renderSymbol } from "../Miscellaneous/symbols";
|
|
4
4
|
import { UIElement } from "./UIElement";
|
|
5
5
|
import type { UITextPadding, UITextSpan, UITextStyle } from "./UITextInterfaces";
|
|
6
6
|
export interface UITextParameters {
|
|
@@ -9,14 +9,19 @@ export interface UITextParameters {
|
|
|
9
9
|
defaultStyle: Partial<UITextStyle>;
|
|
10
10
|
}
|
|
11
11
|
export declare class UIText extends UIElement {
|
|
12
|
-
readonly material
|
|
12
|
+
private readonly material;
|
|
13
|
+
private readonly texture;
|
|
13
14
|
private readonly canvas;
|
|
14
15
|
private readonly context;
|
|
15
|
-
private readonly texture;
|
|
16
16
|
private readonly textBlockSize;
|
|
17
17
|
private readonly padding;
|
|
18
18
|
private lastSuggestedAspect;
|
|
19
19
|
constructor(layer: UILayer, spans: (UITextSpan | string)[], parameters?: Partial<UITextParameters>);
|
|
20
|
+
get color(): Color;
|
|
21
|
+
get opacity(): number;
|
|
22
|
+
set color(value: Color);
|
|
23
|
+
set opacity(value: number);
|
|
20
24
|
destroy(): void;
|
|
21
|
-
|
|
25
|
+
flushTransform(): void;
|
|
26
|
+
[renderSymbol](renderer: WebGLRenderer): void;
|
|
22
27
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Object3D } from "three";
|
|
2
2
|
import type { UIMicroTransformations } from "./UIMicroTransformations";
|
|
3
|
-
export declare function applyMicroTransformations(object: Object3D, micro: UIMicroTransformations, x: number, y: number, width: number, height: number): void;
|
|
3
|
+
export declare function applyMicroTransformations(object: Object3D, micro: UIMicroTransformations, x: number, y: number, width: number, height: number, padding: number): void;
|
|
@@ -14,6 +14,5 @@ export declare const suggestVariableSymbol: unique symbol;
|
|
|
14
14
|
export declare const disableConstraintSymbol: unique symbol;
|
|
15
15
|
export declare const enableConstraintSymbol: unique symbol;
|
|
16
16
|
export declare const needsRecalculation: unique symbol;
|
|
17
|
-
export declare const
|
|
17
|
+
export declare const renderSymbol: unique symbol;
|
|
18
18
|
export declare const clickSymbol: unique symbol;
|
|
19
|
-
export declare const materialSymbol: unique symbol;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Texture, WebGLRenderer } from "three";
|
|
2
|
+
import type { UIPass } from "./UIPass";
|
|
3
|
+
export declare class UIComposer {
|
|
4
|
+
readonly passes: UIPass[];
|
|
5
|
+
private readonly drawPass;
|
|
6
|
+
private fromRenderTarget;
|
|
7
|
+
private toRenderTarget;
|
|
8
|
+
calculatePadding(): number;
|
|
9
|
+
render(renderer: WebGLRenderer, texture: Texture): Texture;
|
|
10
|
+
destroy(): void;
|
|
11
|
+
private reverseTargets;
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Texture, WebGLRenderer } from "three";
|
|
2
|
+
export declare class UIDrawPass {
|
|
3
|
+
private readonly screen;
|
|
4
|
+
constructor();
|
|
5
|
+
destroy(): void;
|
|
6
|
+
setPadding(width: number, height: number, padding: number): void;
|
|
7
|
+
render(renderer: WebGLRenderer, texture: Texture): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ShaderMaterial, WebGLRenderer } from "three";
|
|
2
|
+
export declare class UIFullScreenQuad {
|
|
3
|
+
private materialInternal;
|
|
4
|
+
private paddingHorizontalInternal;
|
|
5
|
+
private paddingVerticalInternal;
|
|
6
|
+
private readonly camera;
|
|
7
|
+
constructor(materialInternal: ShaderMaterial, paddingHorizontalInternal?: number, paddingVerticalInternal?: number);
|
|
8
|
+
get paddingHorizontal(): number;
|
|
9
|
+
get paddingVertical(): number;
|
|
10
|
+
get material(): ShaderMaterial;
|
|
11
|
+
set paddingHorizontal(value: number);
|
|
12
|
+
set paddingVertical(value: number);
|
|
13
|
+
set material(value: ShaderMaterial);
|
|
14
|
+
render(renderer: WebGLRenderer): void;
|
|
15
|
+
private updateCameraTransform;
|
|
16
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Texture } from "three";
|
|
2
|
+
import { Color, ShaderMaterial } from "three";
|
|
3
|
+
export declare class UIMaterial extends ShaderMaterial {
|
|
4
|
+
constructor(map: Texture);
|
|
5
|
+
get map(): Color;
|
|
6
|
+
get color(): Color;
|
|
7
|
+
set map(value: Texture);
|
|
8
|
+
set color(value: Color);
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Texture, WebGLRenderer } from "three";
|
|
2
|
+
export interface UIPassRenderParameters {
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
padding: number;
|
|
6
|
+
}
|
|
7
|
+
export declare abstract class UIPass {
|
|
8
|
+
abstract get padding(): number;
|
|
9
|
+
abstract get needsUpdate(): boolean;
|
|
10
|
+
abstract render(renderer: WebGLRenderer, texture: Texture, parameters: UIPassRenderParameters): void;
|
|
11
|
+
}
|