@galacean/effects-core 2.3.0-alpha.0 → 2.3.0-alpha.2
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/components/base-render-component.d.ts +2 -0
- package/dist/components/shape-component.d.ts +92 -5
- package/dist/fallback/migration.d.ts +1 -1
- package/dist/index.js +511 -413
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +511 -413
- package/dist/index.mjs.map +1 -1
- package/dist/plugins/shape/build-line.d.ts +6 -4
- package/dist/plugins/shape/graphics-path.d.ts +1 -1
- package/dist/plugins/shape/polygon.d.ts +4 -0
- package/dist/plugins/shape/rectangle.d.ts +21 -88
- package/dist/plugins/shape/shape-path.d.ts +1 -1
- package/dist/plugins/text/text-item.d.ts +15 -0
- package/package.json +2 -2
|
@@ -6,6 +6,7 @@ import type { GeometryDrawMode, Renderer } from '../render';
|
|
|
6
6
|
import { Geometry } from '../render';
|
|
7
7
|
import type { Engine } from '../engine';
|
|
8
8
|
import type { BoundingBoxTriangle, HitTestTriangleParams } from '../plugins';
|
|
9
|
+
import type { MaterialProps } from '../material';
|
|
9
10
|
import { Material } from '../material';
|
|
10
11
|
import type { GeometryFromShape } from '../shape';
|
|
11
12
|
/**
|
|
@@ -102,6 +103,7 @@ export declare class BaseRenderComponent extends RendererComponent {
|
|
|
102
103
|
atlasOffset: number[];
|
|
103
104
|
};
|
|
104
105
|
protected createGeometry(mode: GeometryDrawMode): Geometry;
|
|
106
|
+
protected getMaterialProps(renderInfo: ItemRenderInfo, count: number): MaterialProps;
|
|
105
107
|
protected createMaterial(renderInfo: ItemRenderInfo, count: number): Material;
|
|
106
108
|
getTextures(): Texture[];
|
|
107
109
|
/**
|
|
@@ -1,20 +1,107 @@
|
|
|
1
1
|
import * as spec from '@galacean/effects-specification';
|
|
2
2
|
import type { Engine } from '../engine';
|
|
3
3
|
import { MeshComponent } from './mesh-component';
|
|
4
|
+
interface ShapeAttribute {
|
|
5
|
+
/**
|
|
6
|
+
* 矢量图形类型
|
|
7
|
+
*/
|
|
8
|
+
type: spec.ShapePrimitiveType;
|
|
9
|
+
/**
|
|
10
|
+
* 填充属性
|
|
11
|
+
*/
|
|
12
|
+
fill?: spec.ShapeFillParam;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 椭圆组件参数
|
|
16
|
+
*/
|
|
17
|
+
export interface EllipseAttribute extends ShapeAttribute {
|
|
18
|
+
type: spec.ShapePrimitiveType.Ellipse;
|
|
19
|
+
/**
|
|
20
|
+
* x 轴半径
|
|
21
|
+
* -- TODO 后续完善类型
|
|
22
|
+
* -- TODO 可以看一下用xRadius/yRadius 还是 width/height
|
|
23
|
+
*/
|
|
24
|
+
xRadius: number;
|
|
25
|
+
/**
|
|
26
|
+
* y 轴半径
|
|
27
|
+
*/
|
|
28
|
+
yRadius: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* 矩形参数
|
|
32
|
+
*/
|
|
33
|
+
export interface RectangleAttribute extends ShapeAttribute {
|
|
34
|
+
/**
|
|
35
|
+
* 宽度
|
|
36
|
+
*/
|
|
37
|
+
width: number;
|
|
38
|
+
/**
|
|
39
|
+
* 高度
|
|
40
|
+
*/
|
|
41
|
+
height: number;
|
|
42
|
+
/**
|
|
43
|
+
* 角点元素
|
|
44
|
+
*/
|
|
45
|
+
roundness: number;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* 星形参数
|
|
49
|
+
*/
|
|
50
|
+
export interface StarAttribute extends ShapeAttribute {
|
|
51
|
+
/**
|
|
52
|
+
* 顶点数 - 内外顶点同数
|
|
53
|
+
*/
|
|
54
|
+
pointCount: number;
|
|
55
|
+
/**
|
|
56
|
+
* 内径
|
|
57
|
+
*/
|
|
58
|
+
innerRadius: number;
|
|
59
|
+
/**
|
|
60
|
+
* 外径
|
|
61
|
+
*/
|
|
62
|
+
outerRadius: number;
|
|
63
|
+
/**
|
|
64
|
+
* 内径点圆度
|
|
65
|
+
*/
|
|
66
|
+
innerRoundness: number;
|
|
67
|
+
/**
|
|
68
|
+
* 外径点圆度
|
|
69
|
+
*/
|
|
70
|
+
outerRoundness: number;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* 多边形参数
|
|
74
|
+
*/
|
|
75
|
+
export interface PolygonAttribute extends ShapeAttribute {
|
|
76
|
+
/**
|
|
77
|
+
* 顶点数
|
|
78
|
+
*/
|
|
79
|
+
pointCount: number;
|
|
80
|
+
/**
|
|
81
|
+
* 外切圆半径
|
|
82
|
+
*/
|
|
83
|
+
radius: number;
|
|
84
|
+
/**
|
|
85
|
+
* 角点圆度
|
|
86
|
+
*/
|
|
87
|
+
roundness: number;
|
|
88
|
+
}
|
|
4
89
|
/**
|
|
5
90
|
* 图形组件
|
|
6
91
|
* @since 2.1.0
|
|
7
92
|
*/
|
|
8
93
|
export declare class ShapeComponent extends MeshComponent {
|
|
9
|
-
isStroke
|
|
94
|
+
private isStroke;
|
|
95
|
+
private isFill;
|
|
96
|
+
private shapeDirty;
|
|
10
97
|
private graphicsPath;
|
|
11
98
|
private curveValues;
|
|
12
|
-
private
|
|
13
|
-
private shapeDirty;
|
|
99
|
+
private fillAttribute;
|
|
14
100
|
private strokeAttributes;
|
|
101
|
+
private shapeAttribute;
|
|
15
102
|
private vert;
|
|
16
103
|
private frag;
|
|
17
|
-
get
|
|
104
|
+
get shape(): ShapeAttribute;
|
|
18
105
|
/**
|
|
19
106
|
*
|
|
20
107
|
* @param engine
|
|
@@ -24,6 +111,6 @@ export declare class ShapeComponent extends MeshComponent {
|
|
|
24
111
|
onUpdate(dt: number): void;
|
|
25
112
|
private buildGeometryFromPath;
|
|
26
113
|
private buildPath;
|
|
27
|
-
private setFillColor;
|
|
28
114
|
fromData(data: spec.ShapeComponentData): void;
|
|
29
115
|
}
|
|
116
|
+
export {};
|
|
@@ -11,7 +11,7 @@ export declare function version22Migration(json: JSONSceneLegacy): JSONSceneLega
|
|
|
11
11
|
* 3.1 版本数据适配
|
|
12
12
|
* - 富文本插件名称的适配
|
|
13
13
|
*/
|
|
14
|
-
export declare function version31Migration(json:
|
|
14
|
+
export declare function version31Migration(json: JSONScene): JSONScene;
|
|
15
15
|
/**
|
|
16
16
|
* 3.0 以下版本数据适配(runtime 2.0及以上版本支持)
|
|
17
17
|
*/
|