@galacean/engine-ui 2.0.0-alpha.46 → 2.0.0-alpha.47
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 +34 -31
- 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 +34 -31
- package/dist/main.js.map +1 -1
- package/dist/module.js +35 -32
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/component/UICanvas.d.ts +7 -5
- package/types/component/UIRenderer.d.ts +1 -1
- package/types/component/UITransform.d.ts +2 -1
- package/types/component/advanced/Text.d.ts +3 -1
- package/types/enums/ResolutionAdaptationMode.d.ts +6 -4
- 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.47",
|
|
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.47"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@galacean/engine": "2.0.0-alpha.
|
|
33
|
+
"@galacean/engine": "2.0.0-alpha.47"
|
|
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
|
*/
|
|
@@ -92,7 +92,7 @@ export declare class UIRenderer extends Renderer implements IGraphics {
|
|
|
92
92
|
/**
|
|
93
93
|
* @internal
|
|
94
94
|
*/
|
|
95
|
-
_raycast(ray: Ray, out: UIHitResult, distance
|
|
95
|
+
_raycast(ray: Ray, out: UIHitResult, distance: number): boolean;
|
|
96
96
|
protected _hitTest(localPosition: Vector3): boolean;
|
|
97
97
|
protected _onDestroy(): void;
|
|
98
98
|
}
|
|
@@ -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);
|
|
@@ -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);
|
|
@@ -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
|
}
|
|
@@ -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;
|