@galacean/engine-ui 2.0.0-alpha.5 → 2.0.0-alpha.51
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 +1 -1
- package/dist/browser.js +360 -471
- 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 +360 -471
- package/dist/main.js.map +1 -1
- package/dist/module.js +361 -472
- package/dist/module.js.map +1 -1
- package/package.json +5 -4
- package/types/Utils.d.ts +4 -4
- package/types/component/UIBatchSorter.d.ts +37 -0
- package/types/component/UICanvas.d.ts +83 -6
- package/types/component/UIGroup.d.ts +60 -1
- package/types/component/UIRenderer.d.ts +90 -4
- package/types/component/UITransform.d.ts +23 -2
- package/types/component/advanced/Button.d.ts +7 -10
- package/types/component/advanced/Image.d.ts +16 -2
- package/types/component/advanced/Text.d.ts +31 -5
- package/types/component/interactive/UIInteractive.d.ts +57 -2
- package/types/component/interactive/transition/SpriteTransition.d.ts +4 -4
- package/types/component/interactive/transition/Transition.d.ts +21 -4
- package/types/enums/ResolutionAdaptationMode.d.ts +6 -4
- package/types/index.d.ts +16 -2
- package/types/input/UIHitResult.d.ts +12 -1
- package/types/input/UIPointerEventEmitter.d.ts +27 -1
- package/types/interface/IElement.d.ts +2 -2
- package/types/interface/IGroupAble.d.ts +2 -2
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { Color, Sprite } from "@galacean/engine";
|
|
1
|
+
import { Color, DataObject, Sprite } from "@galacean/engine";
|
|
2
|
+
import type { ICloneHook } from "@galacean/engine";
|
|
2
3
|
import { UIRenderer } from "../../UIRenderer";
|
|
3
|
-
import { InteractiveState } from "../UIInteractive";
|
|
4
|
+
import { InteractiveState, UIInteractive } from "../UIInteractive";
|
|
4
5
|
/**
|
|
5
6
|
* The transition behavior of UIInteractive.
|
|
6
7
|
*/
|
|
7
|
-
export declare abstract class Transition<T extends TransitionValueType = TransitionValueType, K extends UIRenderer = UIRenderer> {
|
|
8
|
+
export declare abstract class Transition<T extends TransitionValueType = TransitionValueType, K extends UIRenderer = UIRenderer> extends DataObject implements ICloneHook<Transition<T, K>> {
|
|
9
|
+
/** @internal */
|
|
10
|
+
_interactive: UIInteractive | null;
|
|
8
11
|
protected _target: K;
|
|
9
12
|
protected _normal: T;
|
|
10
13
|
protected _pressed: T;
|
|
@@ -47,11 +50,25 @@ export declare abstract class Transition<T extends TransitionValueType = Transit
|
|
|
47
50
|
get duration(): number;
|
|
48
51
|
set duration(value: number);
|
|
49
52
|
destroy(): void;
|
|
53
|
+
/**
|
|
54
|
+
* @internal
|
|
55
|
+
* @inheritdoc
|
|
56
|
+
*/
|
|
57
|
+
_onClone(target: Transition<T, K>): void;
|
|
58
|
+
/**
|
|
59
|
+
* @internal
|
|
60
|
+
*/
|
|
61
|
+
_setState(state: InteractiveState, instant: boolean): void;
|
|
62
|
+
/**
|
|
63
|
+
* @internal
|
|
64
|
+
*/
|
|
65
|
+
_onUpdate(delta: number): void;
|
|
50
66
|
protected abstract _getTargetValueCopy(): T;
|
|
51
67
|
protected abstract _updateCurrentValue(srcValue: T, destValue: T, weight: number): void;
|
|
52
68
|
protected abstract _applyValue(value: T): void;
|
|
53
69
|
protected _onStateValueDirty(state: InteractiveState, preValue: T, curValue: T): void;
|
|
54
70
|
protected _updateValue(): void;
|
|
71
|
+
private _addStateValuesReferCount;
|
|
55
72
|
private _getValueByState;
|
|
56
73
|
}
|
|
57
|
-
export type TransitionValueType = number | Sprite | Color;
|
|
74
|
+
export type TransitionValueType = number | Sprite | Color | null;
|
|
@@ -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
|
@@ -1,22 +1,36 @@
|
|
|
1
1
|
import { Material } from "@galacean/engine";
|
|
2
2
|
export * from "./component";
|
|
3
3
|
export { CanvasRenderMode } from "./enums/CanvasRenderMode";
|
|
4
|
-
export { ResolutionAdaptationMode } from "./enums/ResolutionAdaptationMode";
|
|
5
|
-
export { UIPointerEventEmitter } from "./input/UIPointerEventEmitter";
|
|
6
4
|
export { HorizontalAlignmentMode } from "./enums/HorizontalAlignmentMode";
|
|
5
|
+
export { ResolutionAdaptationMode } from "./enums/ResolutionAdaptationMode";
|
|
7
6
|
export { VerticalAlignmentMode } from "./enums/VerticalAlignmentMode";
|
|
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 */
|
|
25
|
+
_uiDefaultMaterial: Material;
|
|
26
|
+
/** @internal */
|
|
27
|
+
_getUIDefaultMaterial(): Material;
|
|
18
28
|
}
|
|
19
29
|
interface Entity {
|
|
30
|
+
/** @internal */
|
|
31
|
+
_uiHierarchyVersion: number;
|
|
32
|
+
/** @internal */
|
|
33
|
+
_updateUIHierarchyVersion(version: number): void;
|
|
20
34
|
}
|
|
21
35
|
}
|
|
22
36
|
/**
|
|
@@ -1 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import { Entity, Vector3 } from "@galacean/engine";
|
|
2
|
+
import { UIRenderer } from "../component/UIRenderer";
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare class UIHitResult {
|
|
7
|
+
entity: Entity | null;
|
|
8
|
+
distance: number;
|
|
9
|
+
point: Vector3;
|
|
10
|
+
normal: Vector3;
|
|
11
|
+
component: UIRenderer | null;
|
|
12
|
+
}
|
|
@@ -1 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
import { Pointer, PointerEventEmitter, Scene } from "@galacean/engine";
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare class UIPointerEventEmitter extends PointerEventEmitter {
|
|
6
|
+
private static _compareRaycastOrder;
|
|
7
|
+
private static _MAX_PATH_DEPTH;
|
|
8
|
+
private static _tempSet;
|
|
9
|
+
private static _path;
|
|
10
|
+
private static _tempArray0;
|
|
11
|
+
private static _tempArray1;
|
|
12
|
+
private _enteredPath;
|
|
13
|
+
private _pressedPath;
|
|
14
|
+
private _draggedPath;
|
|
15
|
+
_init(): void;
|
|
16
|
+
processRaycast(scenes: readonly Scene[], pointer: Pointer): void;
|
|
17
|
+
processDrag(pointer: Pointer): void;
|
|
18
|
+
processDown(pointer: Pointer): void;
|
|
19
|
+
processUp(pointer: Pointer): void;
|
|
20
|
+
processLeave(pointer: Pointer): void;
|
|
21
|
+
dispose(): void;
|
|
22
|
+
private _updateRaycast;
|
|
23
|
+
private _composedPath;
|
|
24
|
+
private _findCommonInPath;
|
|
25
|
+
private _findDiffInPath;
|
|
26
|
+
private _bubble;
|
|
27
|
+
}
|
|
@@ -3,11 +3,11 @@ import { UICanvas } from "..";
|
|
|
3
3
|
import { RootCanvasModifyFlags } from "../component/UICanvas";
|
|
4
4
|
export interface IElement {
|
|
5
5
|
entity: Entity;
|
|
6
|
-
_rootCanvas: UICanvas;
|
|
6
|
+
_rootCanvas: UICanvas | null;
|
|
7
7
|
_indexInRootCanvas: number;
|
|
8
8
|
_rootCanvasListeningEntities: Entity[];
|
|
9
9
|
_isRootCanvasDirty: boolean;
|
|
10
|
-
_getRootCanvas(): UICanvas;
|
|
10
|
+
_getRootCanvas(): UICanvas | null;
|
|
11
11
|
_rootCanvasListener: (flag: number, param?: any) => void;
|
|
12
12
|
_onRootCanvasModify?(flag: RootCanvasModifyFlags): void;
|
|
13
13
|
}
|
|
@@ -2,13 +2,13 @@ import { Entity } from "@galacean/engine";
|
|
|
2
2
|
import { GroupModifyFlags, UIGroup } from "../component/UIGroup";
|
|
3
3
|
import { IElement } from "./IElement";
|
|
4
4
|
export interface IGroupAble extends IElement {
|
|
5
|
-
_group: UIGroup;
|
|
5
|
+
_group: UIGroup | null;
|
|
6
6
|
_indexInGroup: number;
|
|
7
7
|
_groupListeningEntities: Entity[];
|
|
8
8
|
_isGroupDirty: boolean;
|
|
9
9
|
_globalAlpha?: number;
|
|
10
10
|
_globalInteractive?: boolean;
|
|
11
|
-
_getGroup(): UIGroup;
|
|
11
|
+
_getGroup(): UIGroup | null;
|
|
12
12
|
_onGroupModify(flag: GroupModifyFlags, isPass?: boolean): void;
|
|
13
13
|
_groupListener(flag: number): void;
|
|
14
14
|
}
|