@galacean/engine-ui 2.0.0-alpha.46 → 2.0.0-alpha.48
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/browser.js +83 -46
- package/dist/browser.js.map +1 -1
- package/dist/browser.min.js +1 -1
- package/dist/browser.min.js.map +1 -1
- package/dist/main.js +83 -46
- package/dist/main.js.map +1 -1
- package/dist/module.js +84 -47
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/component/UICanvas.d.ts +17 -5
- package/types/component/UIGroup.d.ts +6 -0
- package/types/component/UIRenderer.d.ts +19 -1
- package/types/component/UITransform.d.ts +3 -1
- package/types/component/advanced/Image.d.ts +1 -0
- package/types/component/advanced/Text.d.ts +3 -1
- package/types/component/interactive/UIInteractive.d.ts +6 -0
- package/types/component/interactive/transition/Transition.d.ts +1 -0
- package/types/enums/ResolutionAdaptationMode.d.ts +6 -4
- package/types/index.d.ts +10 -0
- package/types/input/UIPointerEventEmitter.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-ui",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.48",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"types/**/*"
|
|
28
28
|
],
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@galacean/engine": "2.0.0-alpha.
|
|
30
|
+
"@galacean/engine": "2.0.0-alpha.48"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@galacean/engine": "2.0.0-alpha.
|
|
33
|
+
"@galacean/engine": "2.0.0-alpha.48"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"b:types": "tsc"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Camera, Component, DisorderedArray, Entity, Ray, RenderElement, Vector2, Vector3 } from "@galacean/engine";
|
|
1
|
+
import { Camera, Component, DisorderedArray, Entity, Layer, Ray, RenderElement, Vector2, Vector3 } from "@galacean/engine";
|
|
2
2
|
import type { ICloneHook } from "@galacean/engine";
|
|
3
3
|
import { CanvasRenderMode } from "../enums/CanvasRenderMode";
|
|
4
4
|
import { ResolutionAdaptationMode } from "../enums/ResolutionAdaptationMode";
|
|
@@ -51,12 +51,14 @@ export declare class UICanvas extends Component implements IElement, ICloneHook<
|
|
|
51
51
|
private _center;
|
|
52
52
|
private _centerDirtyFlag;
|
|
53
53
|
/**
|
|
54
|
-
*
|
|
54
|
+
* Local UI units per sprite world unit for sliced borders and tile sizing.
|
|
55
|
+
* One glyph pixel maps to `referenceResolutionPerUnit / 100` local UI units.
|
|
55
56
|
*/
|
|
56
57
|
get referenceResolutionPerUnit(): number;
|
|
57
58
|
set referenceResolutionPerUnit(value: number);
|
|
58
59
|
/**
|
|
59
|
-
*
|
|
60
|
+
* Design resolution in pixels for {@link CanvasRenderMode.ScreenSpaceCamera} and {@link CanvasRenderMode.ScreenSpaceOverlay}.
|
|
61
|
+
* The root canvas adapts it to the camera viewport or engine canvas using {@link UICanvas.resolutionAdaptationMode}.
|
|
60
62
|
*/
|
|
61
63
|
get referenceResolution(): Vector2;
|
|
62
64
|
set referenceResolution(value: Vector2);
|
|
@@ -84,7 +86,7 @@ export declare class UICanvas extends Component implements IElement, ICloneHook<
|
|
|
84
86
|
get resolutionAdaptationMode(): ResolutionAdaptationMode;
|
|
85
87
|
set resolutionAdaptationMode(value: ResolutionAdaptationMode);
|
|
86
88
|
/**
|
|
87
|
-
* The rendering
|
|
89
|
+
* The rendering priority of the canvas.
|
|
88
90
|
*/
|
|
89
91
|
get sortOrder(): number;
|
|
90
92
|
set sortOrder(value: number);
|
|
@@ -100,7 +102,7 @@ export declare class UICanvas extends Component implements IElement, ICloneHook<
|
|
|
100
102
|
/**
|
|
101
103
|
* @internal
|
|
102
104
|
*/
|
|
103
|
-
_raycast(ray: Ray, out: UIHitResult, distance
|
|
105
|
+
_raycast(ray: Ray, out: UIHitResult, distance: number, cullingMask: Layer): boolean;
|
|
104
106
|
/**
|
|
105
107
|
* @internal
|
|
106
108
|
*/
|
|
@@ -121,14 +123,24 @@ export declare class UICanvas extends Component implements IElement, ICloneHook<
|
|
|
121
123
|
* @internal
|
|
122
124
|
*/
|
|
123
125
|
_updateSortDistance(isOrthographic: boolean, cameraPosition: Vector3, cameraForward: Vector3): void;
|
|
126
|
+
/**
|
|
127
|
+
* @internal
|
|
128
|
+
*/
|
|
124
129
|
_onEnableInScene(): void;
|
|
130
|
+
/**
|
|
131
|
+
* @internal
|
|
132
|
+
*/
|
|
125
133
|
_onDisableInScene(): void;
|
|
134
|
+
/**
|
|
135
|
+
* @internal
|
|
136
|
+
*/
|
|
126
137
|
_onDisable(): void;
|
|
127
138
|
/**
|
|
128
139
|
* @internal
|
|
129
140
|
*/
|
|
130
141
|
_rootCanvasListener(flag: number, param: any): void;
|
|
131
142
|
/**
|
|
143
|
+
* @internal
|
|
132
144
|
* @inheritdoc
|
|
133
145
|
*/
|
|
134
146
|
_onClone(target: UICanvas): void;
|
|
@@ -55,7 +55,13 @@ export declare class UIGroup extends Component implements IGroupAble {
|
|
|
55
55
|
*/
|
|
56
56
|
_getGlobalInteractive(): boolean;
|
|
57
57
|
constructor(entity: Entity);
|
|
58
|
+
/**
|
|
59
|
+
* @internal
|
|
60
|
+
*/
|
|
58
61
|
_onEnableInScene(): void;
|
|
62
|
+
/**
|
|
63
|
+
* @internal
|
|
64
|
+
*/
|
|
59
65
|
_onDisableInScene(): void;
|
|
60
66
|
/**
|
|
61
67
|
* @internal
|
|
@@ -54,11 +54,29 @@ export declare class UIRenderer extends Renderer implements IGraphics {
|
|
|
54
54
|
* @internal
|
|
55
55
|
*/
|
|
56
56
|
constructor(entity: Entity);
|
|
57
|
+
/**
|
|
58
|
+
* @internal
|
|
59
|
+
*/
|
|
57
60
|
_canBatch(preElement: any, curElement: any): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* @internal
|
|
63
|
+
*/
|
|
58
64
|
_batch(preElement: any, curElement: any): void;
|
|
65
|
+
/**
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
59
68
|
_updateTransformShaderData(context: any, onlyMVP: boolean): void;
|
|
69
|
+
/**
|
|
70
|
+
* @internal
|
|
71
|
+
*/
|
|
60
72
|
_prepareRender(context: any): void;
|
|
73
|
+
/**
|
|
74
|
+
* @internal
|
|
75
|
+
*/
|
|
61
76
|
_onEnableInScene(): void;
|
|
77
|
+
/**
|
|
78
|
+
* @internal
|
|
79
|
+
*/
|
|
62
80
|
_onDisableInScene(): void;
|
|
63
81
|
/**
|
|
64
82
|
* @internal
|
|
@@ -92,7 +110,7 @@ export declare class UIRenderer extends Renderer implements IGraphics {
|
|
|
92
110
|
/**
|
|
93
111
|
* @internal
|
|
94
112
|
*/
|
|
95
|
-
_raycast(ray: Ray, out: UIHitResult, distance
|
|
113
|
+
_raycast(ray: Ray, out: UIHitResult, distance: number): boolean;
|
|
96
114
|
protected _hitTest(localPosition: Vector3): boolean;
|
|
97
115
|
protected _onDestroy(): void;
|
|
98
116
|
}
|
|
@@ -17,7 +17,8 @@ export declare class UITransform extends Transform {
|
|
|
17
17
|
private _horizontalAlignment;
|
|
18
18
|
private _verticalAlignment;
|
|
19
19
|
/**
|
|
20
|
-
* Width and height
|
|
20
|
+
* Width and height in local units, before transform scaling.
|
|
21
|
+
* Screen-space units are pixels at the root canvas's {@link UICanvas.referenceResolution}; world-space units are scene units.
|
|
21
22
|
*/
|
|
22
23
|
get size(): Vector2;
|
|
23
24
|
set size(value: Vector2);
|
|
@@ -105,6 +106,7 @@ export declare class UITransform extends Transform {
|
|
|
105
106
|
*/
|
|
106
107
|
_parentChange(): void;
|
|
107
108
|
/**
|
|
109
|
+
* @internal
|
|
108
110
|
* @inheritdoc
|
|
109
111
|
*/
|
|
110
112
|
_onClone(target: UITransform): void;
|
|
@@ -32,7 +32,9 @@ export declare class Text extends UIRenderer implements ITextRenderer {
|
|
|
32
32
|
get font(): Font;
|
|
33
33
|
set font(value: Font);
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* Font size in pixels, used for glyph rasterization.
|
|
36
|
+
* Glyph pixel dimensions are converted to local UI units using the root canvas's
|
|
37
|
+
* {@link UICanvas.referenceResolutionPerUnit}.
|
|
36
38
|
*/
|
|
37
39
|
get fontSize(): number;
|
|
38
40
|
set fontSize(value: number);
|
|
@@ -75,7 +75,13 @@ export declare class UIInteractive extends Script implements IGroupAble {
|
|
|
75
75
|
* @internal
|
|
76
76
|
*/
|
|
77
77
|
_getGroup(): UIGroup;
|
|
78
|
+
/**
|
|
79
|
+
* @internal
|
|
80
|
+
*/
|
|
78
81
|
_onEnableInScene(): void;
|
|
82
|
+
/**
|
|
83
|
+
* @internal
|
|
84
|
+
*/
|
|
79
85
|
_onDisableInScene(): void;
|
|
80
86
|
/**
|
|
81
87
|
* @internal
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Resolution adaptation
|
|
3
|
-
*
|
|
2
|
+
* Resolution adaptation in screen space.
|
|
3
|
+
* Scale ratios are available size / `referenceResolution` per axis.
|
|
4
|
+
* Available size comes from the canvas in Overlay mode or the camera's standard projection at `distance`
|
|
5
|
+
* in Camera mode; a custom `Camera.projectionMatrix` is not reflected.
|
|
4
6
|
*/
|
|
5
7
|
export declare enum ResolutionAdaptationMode {
|
|
6
8
|
/** Adapt based on width.(`referenceResolution.x`) */
|
|
@@ -9,8 +11,8 @@ export declare enum ResolutionAdaptationMode {
|
|
|
9
11
|
HeightAdaptation = 1,
|
|
10
12
|
/** Adapt based on both width and height.(`referenceResolution`) */
|
|
11
13
|
BothAdaptation = 2,
|
|
12
|
-
/**
|
|
14
|
+
/** Use the smaller scale ratio to fit the reference rectangle; the UICanvas expands on the other axis. */
|
|
13
15
|
ExpandAdaptation = 3,
|
|
14
|
-
/**
|
|
16
|
+
/** Use the larger scale ratio to cover the available area; the reference rectangle may overflow. */
|
|
15
17
|
ShrinkAdaptation = 4
|
|
16
18
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -5,21 +5,31 @@ export { HorizontalAlignmentMode } from "./enums/HorizontalAlignmentMode";
|
|
|
5
5
|
export { ResolutionAdaptationMode } from "./enums/ResolutionAdaptationMode";
|
|
6
6
|
export { VerticalAlignmentMode } from "./enums/VerticalAlignmentMode";
|
|
7
7
|
export { UIPointerEventEmitter } from "./input/UIPointerEventEmitter";
|
|
8
|
+
/**
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
8
11
|
export declare class EngineExtension {
|
|
9
12
|
_uiDefaultMaterial: Material;
|
|
10
13
|
_getUIDefaultMaterial(): Material;
|
|
11
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
12
18
|
export declare class EntityExtension {
|
|
13
19
|
_uiHierarchyVersion: number;
|
|
14
20
|
_updateUIHierarchyVersion(version: number): void;
|
|
15
21
|
}
|
|
16
22
|
declare module "@galacean/engine" {
|
|
17
23
|
interface Engine {
|
|
24
|
+
/** @internal */
|
|
18
25
|
_uiDefaultMaterial: Material;
|
|
26
|
+
/** @internal */
|
|
19
27
|
_getUIDefaultMaterial(): Material;
|
|
20
28
|
}
|
|
21
29
|
interface Entity {
|
|
30
|
+
/** @internal */
|
|
22
31
|
_uiHierarchyVersion: number;
|
|
32
|
+
/** @internal */
|
|
23
33
|
_updateUIHierarchyVersion(version: number): void;
|
|
24
34
|
}
|
|
25
35
|
}
|
|
@@ -3,6 +3,7 @@ import { Pointer, PointerEventEmitter, Scene } from "@galacean/engine";
|
|
|
3
3
|
* @internal
|
|
4
4
|
*/
|
|
5
5
|
export declare class UIPointerEventEmitter extends PointerEventEmitter {
|
|
6
|
+
private static _compareRaycastOrder;
|
|
6
7
|
private static _MAX_PATH_DEPTH;
|
|
7
8
|
private static _tempSet;
|
|
8
9
|
private static _path;
|