@galacean/engine-ui 0.0.0-experimental-2.0-skill.0 → 0.0.0-experimental-2.0-migrate.7
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 +2855 -1601
- 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 +2855 -1601
- package/dist/main.js.map +1 -1
- package/dist/module.js +2866 -1613
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/Utils.d.ts +10 -0
- package/types/component/UICanvas.d.ts +1 -0
- package/types/component/UIRenderer.d.ts +15 -1
- package/types/component/advanced/Image.d.ts +26 -1
- package/types/component/advanced/Mask.d.ts +22 -0
- package/types/component/advanced/RectMask2D.d.ts +30 -0
- package/types/component/advanced/Text.d.ts +19 -4
- package/types/component/index.d.ts +6 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-ui",
|
|
3
|
-
"version": "0.0.0-experimental-2.0-
|
|
3
|
+
"version": "0.0.0-experimental-2.0-migrate.7",
|
|
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": "0.0.0-experimental-2.0-
|
|
30
|
+
"@galacean/engine": "0.0.0-experimental-2.0-migrate.7"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@galacean/engine": "0.0.0-experimental-2.0-
|
|
33
|
+
"@galacean/engine": "0.0.0-experimental-2.0-migrate.7"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"b:types": "tsc"
|
package/types/Utils.d.ts
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
|
+
import { Matrix, Plane, Ray, Vector2, Vector3 } from "@galacean/engine";
|
|
2
|
+
import { UITransform } from "./component";
|
|
1
3
|
import { UICanvas } from "./component/UICanvas";
|
|
2
4
|
import { UIGroup } from "./component/UIGroup";
|
|
3
5
|
import { IElement } from "./interface/IElement";
|
|
4
6
|
import { IGroupAble } from "./interface/IGroupAble";
|
|
5
7
|
export declare class Utils {
|
|
8
|
+
static _tempRay: Ray;
|
|
9
|
+
static _tempPlane: Plane;
|
|
10
|
+
static _tempVec3: Vector3;
|
|
11
|
+
static _tempMat: Matrix;
|
|
12
|
+
/**
|
|
13
|
+
* Local position of a screen point in the component
|
|
14
|
+
*/
|
|
15
|
+
static screenToLocalPoint(position: Vector2, transform: UITransform, out: Vector3): boolean;
|
|
6
16
|
static setRootCanvasDirty(element: IElement): void;
|
|
7
17
|
static setRootCanvas(element: IElement, rootCanvas: UICanvas): void;
|
|
8
18
|
static cleanRootCanvas(element: IElement): void;
|
|
@@ -9,6 +9,7 @@ import { IElement } from "../interface/IElement";
|
|
|
9
9
|
*/
|
|
10
10
|
export declare class UICanvas extends Component implements IElement, ICloneHook<UICanvas> {
|
|
11
11
|
private static _tempGroupAbleList;
|
|
12
|
+
private static _tempRectMaskList;
|
|
12
13
|
private static _tempVec3;
|
|
13
14
|
private static _tempMat;
|
|
14
15
|
private _renderMode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Color, Renderer, Vector3, Vector4 } from "@galacean/engine";
|
|
1
|
+
import { Color, Renderer, SpriteMaskInteraction, SpriteMaskLayer, Vector3, Vector4 } from "@galacean/engine";
|
|
2
2
|
import { IGraphics } from "../interface/IGraphics";
|
|
3
3
|
export declare class UIRenderer extends Renderer implements IGraphics {
|
|
4
4
|
/**
|
|
@@ -13,6 +13,16 @@ export declare class UIRenderer extends Renderer implements IGraphics {
|
|
|
13
13
|
*/
|
|
14
14
|
get color(): Color;
|
|
15
15
|
set color(value: Color);
|
|
16
|
+
/**
|
|
17
|
+
* The mask layer the ui renderer belongs to.
|
|
18
|
+
*/
|
|
19
|
+
get maskLayer(): SpriteMaskLayer;
|
|
20
|
+
set maskLayer(value: SpriteMaskLayer);
|
|
21
|
+
/**
|
|
22
|
+
* Interacts with the masks.
|
|
23
|
+
*/
|
|
24
|
+
get maskInteraction(): SpriteMaskInteraction;
|
|
25
|
+
set maskInteraction(value: SpriteMaskInteraction);
|
|
16
26
|
/**
|
|
17
27
|
* Whether this renderer be picked up by raycast.
|
|
18
28
|
*/
|
|
@@ -26,6 +36,10 @@ export declare class UIRenderer extends Renderer implements IGraphics {
|
|
|
26
36
|
_onDisableInScene(): void;
|
|
27
37
|
private _onColorChanged;
|
|
28
38
|
protected _hitTest(localPosition: Vector3): boolean;
|
|
39
|
+
private _isRaycastVisibleByMask;
|
|
40
|
+
private _isRaycastVisibleByRectMask;
|
|
41
|
+
private _updateRectMaskClipState;
|
|
42
|
+
private _resetRectMaskClipState;
|
|
29
43
|
protected _onDestroy(): void;
|
|
30
44
|
}
|
|
31
45
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BoundingBox, ISpriteRenderer, Sprite, SpriteDrawMode, SpriteTileMode } from "@galacean/engine";
|
|
1
|
+
import { BoundingBox, ISpriteRenderer, Sprite, SpriteDrawMode, SpriteFilledMode, SpriteFilledOrigin, SpriteTileMode } from "@galacean/engine";
|
|
2
2
|
import { UIRenderer } from "../UIRenderer";
|
|
3
3
|
/**
|
|
4
4
|
* UI element that renders an image.
|
|
@@ -9,6 +9,10 @@ export declare class Image extends UIRenderer implements ISpriteRenderer {
|
|
|
9
9
|
private _assembler;
|
|
10
10
|
private _tileMode;
|
|
11
11
|
private _tiledAdaptiveThreshold;
|
|
12
|
+
private _filledMode;
|
|
13
|
+
private _filledAmount;
|
|
14
|
+
private _filledOrigin;
|
|
15
|
+
private _filledClockWise;
|
|
12
16
|
/**
|
|
13
17
|
* The draw mode of the image.
|
|
14
18
|
*/
|
|
@@ -24,6 +28,26 @@ export declare class Image extends UIRenderer implements ISpriteRenderer {
|
|
|
24
28
|
*/
|
|
25
29
|
get tiledAdaptiveThreshold(): number;
|
|
26
30
|
set tiledAdaptiveThreshold(value: number);
|
|
31
|
+
/**
|
|
32
|
+
* The fill amount of the image, range from 0 to 1. (Only works in filled mode.)
|
|
33
|
+
*/
|
|
34
|
+
get filledAmount(): number;
|
|
35
|
+
set filledAmount(value: number);
|
|
36
|
+
/**
|
|
37
|
+
* The fill mode of the image. (Only works in filled mode.)
|
|
38
|
+
*/
|
|
39
|
+
get filledMode(): SpriteFilledMode;
|
|
40
|
+
set filledMode(value: SpriteFilledMode);
|
|
41
|
+
/**
|
|
42
|
+
* The fill origin of the image. (Only works in filled mode.)
|
|
43
|
+
*/
|
|
44
|
+
get filledOrigin(): SpriteFilledOrigin;
|
|
45
|
+
set filledOrigin(value: SpriteFilledOrigin);
|
|
46
|
+
/**
|
|
47
|
+
* Whether the fill is clockwise. (Only works in filled radial mode.)
|
|
48
|
+
*/
|
|
49
|
+
get filledClockWise(): boolean;
|
|
50
|
+
set filledClockWise(value: boolean);
|
|
27
51
|
/**
|
|
28
52
|
* The Sprite to render.
|
|
29
53
|
*/
|
|
@@ -38,4 +62,5 @@ export declare class Image extends UIRenderer implements ISpriteRenderer {
|
|
|
38
62
|
protected _onTransformChanged(type: number): void;
|
|
39
63
|
protected _onDestroy(): void;
|
|
40
64
|
private _onSpriteChange;
|
|
65
|
+
private static _correctOrigin;
|
|
41
66
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BoundingBox, Vector2 } from "@galacean/engine";
|
|
2
|
+
import type { IMaskRenderable } from "@galacean/engine";
|
|
3
|
+
import { UIRenderer } from "../UIRenderer";
|
|
4
|
+
declare const Mask_base: (abstract new (...args: any[]) => IMaskRenderable) & typeof UIRenderer;
|
|
5
|
+
/**
|
|
6
|
+
* UI component that uses a sprite to mask child UI renderers via stencil.
|
|
7
|
+
*/
|
|
8
|
+
export declare class Mask extends Mask_base {
|
|
9
|
+
protected _updateBounds(worldBounds: BoundingBox): void;
|
|
10
|
+
/**
|
|
11
|
+
* @inheritdoc
|
|
12
|
+
*/
|
|
13
|
+
protected _render(context: any): void;
|
|
14
|
+
/**
|
|
15
|
+
* @inheritdoc
|
|
16
|
+
*/
|
|
17
|
+
protected _onDestroy(): void;
|
|
18
|
+
_getSpriteWidth(): number;
|
|
19
|
+
_getSpriteHeight(): number;
|
|
20
|
+
_getSpritePivot(): Vector2;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Component, Entity, Vector2 } from "@galacean/engine";
|
|
2
|
+
/**
|
|
3
|
+
* UI component that clips descendant graphics by an axis-aligned rectangle.
|
|
4
|
+
*/
|
|
5
|
+
export declare class RectMask2D extends Component {
|
|
6
|
+
private static _tempRect;
|
|
7
|
+
private static _tempCorner0;
|
|
8
|
+
private static _tempCorner1;
|
|
9
|
+
private static _tempCorner2;
|
|
10
|
+
private static _tempCorner3;
|
|
11
|
+
private _softness;
|
|
12
|
+
private _alphaClip;
|
|
13
|
+
/**
|
|
14
|
+
* Soft clipping width on X/Y axis in world space.
|
|
15
|
+
*/
|
|
16
|
+
get softness(): Vector2;
|
|
17
|
+
set softness(value: Vector2);
|
|
18
|
+
/**
|
|
19
|
+
* Whether to enable hard clip (discard) when outside the rect.
|
|
20
|
+
*/
|
|
21
|
+
get alphaClip(): boolean;
|
|
22
|
+
set alphaClip(value: boolean);
|
|
23
|
+
constructor(entity: Entity);
|
|
24
|
+
_onEnableInScene(): void;
|
|
25
|
+
_onDisableInScene(): void;
|
|
26
|
+
_onClone(target: RectMask2D): void;
|
|
27
|
+
protected _onDestroy(): void;
|
|
28
|
+
private _onSoftnessChanged;
|
|
29
|
+
private _clampSoftness;
|
|
30
|
+
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { BoundingBox, Entity, Font, FontStyle, ITextRenderer, OverflowMode, TextHorizontalAlignment, TextVerticalAlignment } from "@galacean/engine";
|
|
1
|
+
import { BoundingBox, Color, Entity, Font, FontStyle, ITextRenderer, OverflowMode, TextHorizontalAlignment, TextVerticalAlignment } from "@galacean/engine";
|
|
2
2
|
import { UIRenderer } from "../UIRenderer";
|
|
3
3
|
/**
|
|
4
4
|
* UI component used to render text.
|
|
5
5
|
*/
|
|
6
6
|
export declare class Text extends UIRenderer implements ITextRenderer {
|
|
7
7
|
private static _textTextureProperty;
|
|
8
|
+
private static _textTextureSizeProperty;
|
|
9
|
+
private static _outlineColorProperty;
|
|
10
|
+
private static _outlineWidthProperty;
|
|
8
11
|
private static _worldPositions;
|
|
9
12
|
private static _charRenderInfos;
|
|
10
13
|
private _textChunks;
|
|
@@ -20,6 +23,8 @@ export declare class Text extends UIRenderer implements ITextRenderer {
|
|
|
20
23
|
private _verticalAlignment;
|
|
21
24
|
private _enableWrapping;
|
|
22
25
|
private _overflowMode;
|
|
26
|
+
private _outlineColor;
|
|
27
|
+
private _outlineWidth;
|
|
23
28
|
/**
|
|
24
29
|
* Rendering string for the Text.
|
|
25
30
|
*/
|
|
@@ -71,10 +76,15 @@ export declare class Text extends UIRenderer implements ITextRenderer {
|
|
|
71
76
|
get overflowMode(): OverflowMode;
|
|
72
77
|
set overflowMode(value: OverflowMode);
|
|
73
78
|
/**
|
|
74
|
-
* The
|
|
79
|
+
* The outline width in pixels. 0 means outline is disabled. Clamped to [0, 8].
|
|
75
80
|
*/
|
|
76
|
-
get
|
|
77
|
-
set
|
|
81
|
+
get outlineWidth(): number;
|
|
82
|
+
set outlineWidth(value: number);
|
|
83
|
+
/**
|
|
84
|
+
* The outline color. Only effective when outlineWidth > 0.
|
|
85
|
+
*/
|
|
86
|
+
get outlineColor(): Color;
|
|
87
|
+
set outlineColor(value: Color);
|
|
78
88
|
/**
|
|
79
89
|
* The bounding volume of the TextRenderer.
|
|
80
90
|
*/
|
|
@@ -83,6 +93,10 @@ export declare class Text extends UIRenderer implements ITextRenderer {
|
|
|
83
93
|
protected _updateBounds(worldBounds: BoundingBox): void;
|
|
84
94
|
protected _render(context: any): void;
|
|
85
95
|
private _resetSubFont;
|
|
96
|
+
/**
|
|
97
|
+
* Switch the sub font to a specific font size, used by the SHRINK overflow measurement.
|
|
98
|
+
*/
|
|
99
|
+
private _applyFontSizeForShrink;
|
|
86
100
|
private _updatePosition;
|
|
87
101
|
private _updateColor;
|
|
88
102
|
private _updateLocalData;
|
|
@@ -90,4 +104,5 @@ export declare class Text extends UIRenderer implements ITextRenderer {
|
|
|
90
104
|
private _isTextNoVisible;
|
|
91
105
|
private _buildChunk;
|
|
92
106
|
private _freeTextChunks;
|
|
107
|
+
private _onOutlineColorChanged;
|
|
93
108
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
export { UICanvas } from "./UICanvas";
|
|
2
|
-
export { UIGroup } from "./UIGroup";
|
|
3
|
-
export { UIRenderer } from "./UIRenderer";
|
|
4
|
-
export { UITransform } from "./UITransform";
|
|
5
1
|
export { Button } from "./advanced/Button";
|
|
6
2
|
export { Image } from "./advanced/Image";
|
|
3
|
+
export { Mask } from "./advanced/Mask";
|
|
4
|
+
export { RectMask2D } from "./advanced/RectMask2D";
|
|
7
5
|
export { Text } from "./advanced/Text";
|
|
8
6
|
export { ColorTransition } from "./interactive/transition/ColorTransition";
|
|
9
7
|
export { ScaleTransition } from "./interactive/transition/ScaleTransition";
|
|
10
8
|
export { SpriteTransition } from "./interactive/transition/SpriteTransition";
|
|
11
9
|
export { Transition } from "./interactive/transition/Transition";
|
|
10
|
+
export { UICanvas } from "./UICanvas";
|
|
11
|
+
export { UIGroup } from "./UIGroup";
|
|
12
|
+
export { UIRenderer } from "./UIRenderer";
|
|
13
|
+
export { UITransform } from "./UITransform";
|