@galacean/effects-core 1.1.0 → 1.1.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/index.js +39 -35
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -35
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/asset-manager.d.ts +0 -135
- package/dist/camera.d.ts +0 -183
- package/dist/comp-vfx-item.d.ts +0 -71
- package/dist/composition-source-manager.d.ts +0 -41
- package/dist/composition.d.ts +0 -406
- package/dist/config.d.ts +0 -7
- package/dist/constants.d.ts +0 -11
- package/dist/downloader.d.ts +0 -83
- package/dist/engine.d.ts +0 -38
- package/dist/filter.d.ts +0 -63
- package/dist/filters/alpha-frame.d.ts +0 -5
- package/dist/filters/alpha-mask.d.ts +0 -5
- package/dist/filters/bloom.d.ts +0 -8
- package/dist/filters/camera-move.d.ts +0 -5
- package/dist/filters/delay.d.ts +0 -14
- package/dist/filters/distortion.d.ts +0 -5
- package/dist/filters/gaussian.d.ts +0 -27
- package/dist/filters/index.d.ts +0 -2
- package/dist/filters/lum.d.ts +0 -5
- package/dist/filters/utils.d.ts +0 -7
- package/dist/gl/create-gl-context.d.ts +0 -9
- package/dist/gl/gpu-time.d.ts +0 -5
- package/dist/gl/index.d.ts +0 -6
- package/dist/index.d.ts +0 -31
- package/dist/libs/earcut.d.ts +0 -37
- package/dist/material/index.d.ts +0 -4
- package/dist/material/material-data-block.d.ts +0 -27
- package/dist/material/material.d.ts +0 -347
- package/dist/material/types.d.ts +0 -66
- package/dist/material/utils.d.ts +0 -17
- package/dist/math/float16array-wrapper.d.ts +0 -5
- package/dist/math/index.d.ts +0 -4
- package/dist/math/translate.d.ts +0 -10
- package/dist/math/utils.d.ts +0 -19
- package/dist/math/value-getter.d.ts +0 -127
- package/dist/paas-texture-cache.d.ts +0 -24
- package/dist/pass-render-level.d.ts +0 -1
- package/dist/plugin-system.d.ts +0 -34
- package/dist/plugins/cal/calculate-item.d.ts +0 -84
- package/dist/plugins/cal/calculate-loader.d.ts +0 -3
- package/dist/plugins/cal/calculate-vfx-item.d.ts +0 -26
- package/dist/plugins/camera/camera-controller-node.d.ts +0 -17
- package/dist/plugins/camera/camera-vfx-item-loader.d.ts +0 -3
- package/dist/plugins/camera/camera-vfx-item.d.ts +0 -13
- package/dist/plugins/index.d.ts +0 -26
- package/dist/plugins/interact/click-handler.d.ts +0 -66
- package/dist/plugins/interact/event-system.d.ts +0 -37
- package/dist/plugins/interact/interact-item.d.ts +0 -2
- package/dist/plugins/interact/interact-loader.d.ts +0 -13
- package/dist/plugins/interact/interact-mesh.d.ts +0 -16
- package/dist/plugins/interact/interact-vfx-item.d.ts +0 -28
- package/dist/plugins/particle/burst.d.ts +0 -21
- package/dist/plugins/particle/link.d.ts +0 -21
- package/dist/plugins/particle/particle-loader.d.ts +0 -18
- package/dist/plugins/particle/particle-mesh.d.ts +0 -164
- package/dist/plugins/particle/particle-system.d.ts +0 -198
- package/dist/plugins/particle/particle-vfx-item.d.ts +0 -28
- package/dist/plugins/particle/trail-mesh.d.ts +0 -61
- package/dist/plugins/plugin.d.ts +0 -125
- package/dist/plugins/sprite/filter-sprite-vfx-item.d.ts +0 -13
- package/dist/plugins/sprite/sprite-group.d.ts +0 -95
- package/dist/plugins/sprite/sprite-item.d.ts +0 -106
- package/dist/plugins/sprite/sprite-loader.d.ts +0 -20
- package/dist/plugins/sprite/sprite-mesh.d.ts +0 -67
- package/dist/plugins/sprite/sprite-vfx-item.d.ts +0 -33
- package/dist/plugins/text/text-item.d.ts +0 -117
- package/dist/plugins/text/text-layout.d.ts +0 -28
- package/dist/plugins/text/text-loader.d.ts +0 -18
- package/dist/plugins/text/text-mesh.d.ts +0 -15
- package/dist/plugins/text/text-style.d.ts +0 -67
- package/dist/plugins/text/text-vfx-item.d.ts +0 -28
- package/dist/polyfill.d.ts +0 -4
- package/dist/render/create-copy-shader.d.ts +0 -6
- package/dist/render/frame-buffer.d.ts +0 -48
- package/dist/render/geometry.d.ts +0 -118
- package/dist/render/global-volume.d.ts +0 -15
- package/dist/render/gpu-capability.d.ts +0 -49
- package/dist/render/index.d.ts +0 -12
- package/dist/render/mesh.d.ts +0 -82
- package/dist/render/post-process-pass.d.ts +0 -37
- package/dist/render/render-buffer.d.ts +0 -20
- package/dist/render/render-frame.d.ts +0 -269
- package/dist/render/render-pass.d.ts +0 -309
- package/dist/render/renderer.d.ts +0 -62
- package/dist/render/shader.d.ts +0 -97
- package/dist/render/types.d.ts +0 -5
- package/dist/scene.d.ts +0 -29
- package/dist/semantic-map.d.ts +0 -14
- package/dist/shader/index.d.ts +0 -30
- package/dist/shape/2d-shape.d.ts +0 -32
- package/dist/shape/cone.d.ts +0 -11
- package/dist/shape/donut.d.ts +0 -9
- package/dist/shape/earcut.d.ts +0 -1
- package/dist/shape/geometry.d.ts +0 -30
- package/dist/shape/index.d.ts +0 -3
- package/dist/shape/shape.d.ts +0 -21
- package/dist/shape/sphere.d.ts +0 -15
- package/dist/shape/texture-shape.d.ts +0 -11
- package/dist/template-image/index.d.ts +0 -67
- package/dist/template-image/qcanvas-viewer.d.ts +0 -21
- package/dist/template-image/qtext.d.ts +0 -96
- package/dist/template-image/template-v1.d.ts +0 -27
- package/dist/template-image/text-metrics.d.ts +0 -18
- package/dist/texture/index.d.ts +0 -5
- package/dist/texture/ktx-texture.d.ts +0 -21
- package/dist/texture/texture-factory.d.ts +0 -13
- package/dist/texture/texture.d.ts +0 -78
- package/dist/texture/types.d.ts +0 -165
- package/dist/texture/utils.d.ts +0 -5
- package/dist/ticker.d.ts +0 -48
- package/dist/transform.d.ts +0 -221
- package/dist/utils/array.d.ts +0 -19
- package/dist/utils/asserts.d.ts +0 -2
- package/dist/utils/color.d.ts +0 -10
- package/dist/utils/device.d.ts +0 -4
- package/dist/utils/image-data.d.ts +0 -10
- package/dist/utils/index.d.ts +0 -67
- package/dist/utils/sortable.d.ts +0 -23
- package/dist/utils/timeline-component.d.ts +0 -39
- package/dist/vfx-item.d.ts +0 -360
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import type { Vector3 } from '@galacean/effects-math/es/core/index';
|
|
2
|
-
import * as spec from '@galacean/effects-specification';
|
|
3
|
-
import type { vec2, vec4, TypedArray, TextureSheetAnimation } from '@galacean/effects-specification';
|
|
4
|
-
import type { FilterDefine } from '../../filter';
|
|
5
|
-
import type { ValueGetter } from '../../math';
|
|
6
|
-
import type { GeometryFromShape } from '../../shape';
|
|
7
|
-
import type { Texture } from '../../texture';
|
|
8
|
-
import type { CalculateItemOptions } from '../cal/calculate-item';
|
|
9
|
-
import { CalculateItem } from '../cal/calculate-item';
|
|
10
|
-
import type { SpriteMesh, SpriteRenderData } from './sprite-mesh';
|
|
11
|
-
import type { SpriteVFXItem } from './sprite-vfx-item';
|
|
12
|
-
/**
|
|
13
|
-
* 用于创建 spriteItem 的数据类型, 经过处理后的 spec.SpriteContent
|
|
14
|
-
*/
|
|
15
|
-
export interface SpriteItemProps extends Omit<spec.SpriteContent, 'renderer'> {
|
|
16
|
-
listIndex?: number;
|
|
17
|
-
renderer: {
|
|
18
|
-
mask: number;
|
|
19
|
-
shape: GeometryFromShape;
|
|
20
|
-
texture: Texture;
|
|
21
|
-
} & Omit<spec.RendererOptions, 'texture'>;
|
|
22
|
-
filter?: {
|
|
23
|
-
feather: number | spec.FunctionExpression;
|
|
24
|
-
} & Omit<spec.FilterParams, 'feather'>;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* 图层元素基础属性, 经过处理后的 spec.SpriteContent.options
|
|
28
|
-
*/
|
|
29
|
-
export type SpriteItemOptions = {
|
|
30
|
-
startColor: vec4;
|
|
31
|
-
renderLevel?: string;
|
|
32
|
-
} & CalculateItemOptions;
|
|
33
|
-
/**
|
|
34
|
-
* 图层元素渲染属性, 经过处理后的 spec.SpriteContent.renderer
|
|
35
|
-
*/
|
|
36
|
-
export interface SpriteItemRenderer extends Required<Omit<spec.RendererOptions, 'texture' | 'shape' | 'anchor' | 'particleOrigin'>> {
|
|
37
|
-
order: number;
|
|
38
|
-
mask: number;
|
|
39
|
-
texture: Texture;
|
|
40
|
-
shape?: GeometryFromShape;
|
|
41
|
-
anchor?: vec2;
|
|
42
|
-
particleOrigin?: spec.ParticleOrigin;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* 图层的渲染属性,用于 Mesh 的合并判断
|
|
46
|
-
*/
|
|
47
|
-
export interface SpriteItemRenderInfo {
|
|
48
|
-
side: number;
|
|
49
|
-
occlusion: boolean;
|
|
50
|
-
blending: number;
|
|
51
|
-
cachePrefix: string;
|
|
52
|
-
mask: number;
|
|
53
|
-
maskMode: number;
|
|
54
|
-
cacheId: string;
|
|
55
|
-
filter?: FilterDefine;
|
|
56
|
-
wireframe?: boolean;
|
|
57
|
-
}
|
|
58
|
-
export type splitsDataType = [r: number, x: number, y: number, w: number, h: number | undefined][];
|
|
59
|
-
export declare class SpriteItem extends CalculateItem {
|
|
60
|
-
options: SpriteItemOptions;
|
|
61
|
-
renderer: SpriteItemRenderer;
|
|
62
|
-
interaction?: {
|
|
63
|
-
behavior: spec.InteractBehavior;
|
|
64
|
-
} | undefined;
|
|
65
|
-
listIndex: number;
|
|
66
|
-
parentId?: string;
|
|
67
|
-
reusable: boolean;
|
|
68
|
-
cachePrefix: string;
|
|
69
|
-
geoData: {
|
|
70
|
-
aPoint: number[] | TypedArray;
|
|
71
|
-
index: number[] | TypedArray;
|
|
72
|
-
};
|
|
73
|
-
mesh?: SpriteMesh;
|
|
74
|
-
anchor?: vec2;
|
|
75
|
-
readonly feather?: ValueGetter<number>;
|
|
76
|
-
readonly textureSheetAnimation?: TextureSheetAnimation;
|
|
77
|
-
readonly splits: splitsDataType;
|
|
78
|
-
readonly startColor: vec4;
|
|
79
|
-
readonly emptyTexture: Texture;
|
|
80
|
-
private customColor;
|
|
81
|
-
private customOpacity;
|
|
82
|
-
private _filter?;
|
|
83
|
-
/***********************/
|
|
84
|
-
private readonly colorOverLifetime;
|
|
85
|
-
private readonly opacityOverLifetime;
|
|
86
|
-
private readonly _renderInfo;
|
|
87
|
-
constructor(props: SpriteItemProps, opts: {
|
|
88
|
-
emptyTexture: Texture;
|
|
89
|
-
}, vfxItem: SpriteVFXItem);
|
|
90
|
-
get filter(): FilterDefine | undefined;
|
|
91
|
-
set filter(f: FilterDefine | undefined);
|
|
92
|
-
get renderInfo(): SpriteItemRenderInfo;
|
|
93
|
-
initTexture(texture: Texture, emptyTexture: Texture): Texture;
|
|
94
|
-
getTextures(): Texture[];
|
|
95
|
-
/**
|
|
96
|
-
* @internal
|
|
97
|
-
*/
|
|
98
|
-
setColor(r: number, g: number, b: number, a: number): void;
|
|
99
|
-
setOpacity(opacity: number): void;
|
|
100
|
-
/**
|
|
101
|
-
* @internal
|
|
102
|
-
*/
|
|
103
|
-
getCustomOpacity(): number;
|
|
104
|
-
getRenderData(_time: number, init?: boolean): SpriteRenderData;
|
|
105
|
-
protected calculateScaling(sizeChanged: boolean, sizeInc: Vector3, init?: boolean): void;
|
|
106
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import * as spec from '@galacean/effects-specification';
|
|
2
|
-
import type { Composition } from '../../composition';
|
|
3
|
-
import type { SpriteItem } from '../index';
|
|
4
|
-
import { AbstractPlugin } from '../index';
|
|
5
|
-
import { type VFXItem } from '../../vfx-item';
|
|
6
|
-
import type { LayerInfo } from './sprite-group';
|
|
7
|
-
import type { RenderFrame, Renderer } from '../../render';
|
|
8
|
-
import type { PrecompileOptions } from '../../plugin-system';
|
|
9
|
-
export declare class SpriteLoader extends AbstractPlugin {
|
|
10
|
-
layerInfo?: LayerInfo;
|
|
11
|
-
name: string;
|
|
12
|
-
static precompile(compositions: spec.Composition[], render: Renderer, options?: PrecompileOptions): Promise<any>;
|
|
13
|
-
onCompositionDestroyed(composition: Composition): void;
|
|
14
|
-
onCompositionReset(composition: Composition, pipeline: RenderFrame): void;
|
|
15
|
-
onCompositionItemLifeBegin(composition: Composition, item: VFXItem<SpriteItem>): void;
|
|
16
|
-
onCompositionItemRemoved(composition: Composition, item: VFXItem<SpriteItem>): void;
|
|
17
|
-
onCompositionUpdate(composition: Composition, dt: number): void;
|
|
18
|
-
prepareRenderFrame(composition: Composition, renderFrame: RenderFrame): boolean;
|
|
19
|
-
postProcessFrame(composition: Composition, pipeline: RenderFrame): void;
|
|
20
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import type * as spec from '@galacean/effects-specification';
|
|
2
|
-
import { Vector3 } from '@galacean/effects-math/es/core/index';
|
|
3
|
-
import type { Composition } from '../../composition';
|
|
4
|
-
import type { FilterShaderDefine } from '../../filter';
|
|
5
|
-
import type { GPUCapabilityDetail, SharedShaderWithSource } from '../../render';
|
|
6
|
-
import { Mesh } from '../../render';
|
|
7
|
-
import type { Transform } from '../../transform';
|
|
8
|
-
import type { SpriteItem, SpriteItemRenderInfo } from './sprite-item';
|
|
9
|
-
import type { Engine } from '../../engine';
|
|
10
|
-
export type SpriteRenderData = {
|
|
11
|
-
life: number;
|
|
12
|
-
transform: Transform;
|
|
13
|
-
visible?: boolean;
|
|
14
|
-
startSize?: Vector3;
|
|
15
|
-
color?: spec.vec4;
|
|
16
|
-
texOffset?: spec.vec4;
|
|
17
|
-
active?: boolean;
|
|
18
|
-
anchor?: spec.vec3;
|
|
19
|
-
};
|
|
20
|
-
export type SpriteRegionData = {
|
|
21
|
-
color: spec.vec4;
|
|
22
|
-
position: spec.vec3;
|
|
23
|
-
quat: spec.vec4;
|
|
24
|
-
size: spec.vec2;
|
|
25
|
-
};
|
|
26
|
-
export declare let maxSpriteMeshItemCount: number;
|
|
27
|
-
export declare let maxSpriteTextureCount: number;
|
|
28
|
-
export declare class SpriteMesh {
|
|
29
|
-
engine: Engine;
|
|
30
|
-
private readonly composition;
|
|
31
|
-
items: SpriteItem[];
|
|
32
|
-
splitLayer: boolean;
|
|
33
|
-
readonly mesh: Mesh;
|
|
34
|
-
protected readonly lineMode: boolean;
|
|
35
|
-
private readonly wireframe?;
|
|
36
|
-
private dirty;
|
|
37
|
-
private preMultiAlpha;
|
|
38
|
-
private mtlSlotCount;
|
|
39
|
-
constructor(engine: Engine, renderInfo: SpriteItemRenderInfo, composition: Composition);
|
|
40
|
-
setItems(items: SpriteItem[]): true | undefined;
|
|
41
|
-
updateItem(item: SpriteItem, init?: boolean): void;
|
|
42
|
-
applyChange(): void;
|
|
43
|
-
getItemInitData(item: SpriteItem, idx: number, pointStartIndex: number, textureIndex: number): {
|
|
44
|
-
aPoint: spec.TypedArray | number[];
|
|
45
|
-
index: number[];
|
|
46
|
-
};
|
|
47
|
-
getItemRegionData(item: SpriteItem): SpriteRegionData | void;
|
|
48
|
-
invalidMaterial(): void;
|
|
49
|
-
private createGeometry;
|
|
50
|
-
private createMaterial;
|
|
51
|
-
getItemGeometryData(item: SpriteItem, aIndex: number): {
|
|
52
|
-
index: Uint16Array | number[];
|
|
53
|
-
aPoint: number[];
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
export declare function setSpriteMeshMaxItemCountByGPU(gpuCapability: GPUCapabilityDetail): 16 | 32 | undefined;
|
|
57
|
-
export declare function getImageItemRenderInfo(item: SpriteItem): SpriteItemRenderInfo;
|
|
58
|
-
export declare function spriteMeshShaderFromFilter(level: number, filter?: FilterShaderDefine, options?: {
|
|
59
|
-
count?: number;
|
|
60
|
-
ignoreBlend?: boolean;
|
|
61
|
-
wireframe?: boolean;
|
|
62
|
-
env?: string;
|
|
63
|
-
}): SharedShaderWithSource;
|
|
64
|
-
export declare function spriteMeshShaderIdFromRenderInfo(renderInfo: SpriteItemRenderInfo, count: number): string;
|
|
65
|
-
export declare function spriteMeshShaderFromRenderInfo(renderInfo: SpriteItemRenderInfo, count: number, level: number, env?: string): SharedShaderWithSource;
|
|
66
|
-
export declare function setMaxSpriteMeshItemCount(count: number): void;
|
|
67
|
-
export declare function setSpriteMeshMaxFragmentTextures(count: number): void;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import * as spec from '@galacean/effects-specification';
|
|
2
|
-
import { Vector3 } from '@galacean/effects-math/es/core/index';
|
|
3
|
-
import { VFXItem } from '../../vfx-item';
|
|
4
|
-
import type { Composition } from '../../composition';
|
|
5
|
-
import type { HitTestTriangleParams, BoundingBoxTriangle } from '../interact/click-handler';
|
|
6
|
-
import { SpriteItem } from './sprite-item';
|
|
7
|
-
import type { SpriteRenderData } from './sprite-mesh';
|
|
8
|
-
import { SpriteMesh } from './sprite-mesh';
|
|
9
|
-
export declare class SpriteVFXItem extends VFXItem<SpriteItem> {
|
|
10
|
-
composition: Composition;
|
|
11
|
-
cachePrefix?: string;
|
|
12
|
-
protected sprite?: spec.SpriteContent | spec.FilterContent;
|
|
13
|
-
get type(): spec.ItemType;
|
|
14
|
-
onConstructed(props: spec.SpriteItem | spec.FilterItem): void;
|
|
15
|
-
onLifetimeBegin(composition: Composition, content: SpriteItem): void;
|
|
16
|
-
onItemRemoved(composition: Composition, content?: SpriteItem): void;
|
|
17
|
-
onItemUpdate(dt: number, lifetime: number): void;
|
|
18
|
-
getCurrentPosition(): Vector3;
|
|
19
|
-
/**
|
|
20
|
-
* @internal
|
|
21
|
-
*/
|
|
22
|
-
setColor(r: number, g: number, b: number, a: number): void;
|
|
23
|
-
setOpacity(opacity: number): void;
|
|
24
|
-
/**
|
|
25
|
-
* 获取图层包围盒的类型和世界坐标
|
|
26
|
-
* @returns
|
|
27
|
-
*/
|
|
28
|
-
getBoundingBox(): BoundingBoxTriangle | void;
|
|
29
|
-
getHitTestParams(force?: boolean): HitTestTriangleParams | void;
|
|
30
|
-
getRenderData(): SpriteRenderData;
|
|
31
|
-
protected doCreateContent(composition: Composition): SpriteItem;
|
|
32
|
-
createWireframeMesh(item: SpriteItem, color: spec.vec4): SpriteMesh;
|
|
33
|
-
}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import * as spec from '@galacean/effects-specification';
|
|
2
|
-
import { Texture } from '../../texture';
|
|
3
|
-
import type { TextVFXItem } from './text-vfx-item';
|
|
4
|
-
import { SpriteItem } from '../sprite/sprite-item';
|
|
5
|
-
import { TextStyle } from './text-style';
|
|
6
|
-
import { TextLayout } from './text-layout';
|
|
7
|
-
export declare class TextItem extends SpriteItem {
|
|
8
|
-
textStyle: TextStyle;
|
|
9
|
-
isDirty: boolean;
|
|
10
|
-
canvas: HTMLCanvasElement;
|
|
11
|
-
context: CanvasRenderingContext2D | null;
|
|
12
|
-
textLayout: TextLayout;
|
|
13
|
-
text: string;
|
|
14
|
-
private engine;
|
|
15
|
-
private char;
|
|
16
|
-
constructor(props: spec.TextContent, opts: {
|
|
17
|
-
emptyTexture: Texture;
|
|
18
|
-
}, vfxItem: TextVFXItem);
|
|
19
|
-
/**
|
|
20
|
-
* 设置字号大小
|
|
21
|
-
* @param value - 字号
|
|
22
|
-
* @returns
|
|
23
|
-
*/
|
|
24
|
-
setFontSize(value: number): void;
|
|
25
|
-
/**
|
|
26
|
-
* 设置字重
|
|
27
|
-
* @param value - 字重类型
|
|
28
|
-
* @returns
|
|
29
|
-
*/
|
|
30
|
-
setFontWeight(value: spec.TextWeight): void;
|
|
31
|
-
/**
|
|
32
|
-
* 设置字体类型
|
|
33
|
-
* @param value 字体类型
|
|
34
|
-
* @returns
|
|
35
|
-
*/
|
|
36
|
-
setFontStyle(value: spec.FontStyle): void;
|
|
37
|
-
/**
|
|
38
|
-
* 设置文本
|
|
39
|
-
* @param value - 文本内容
|
|
40
|
-
* @returns
|
|
41
|
-
*/
|
|
42
|
-
setText(value: string): void;
|
|
43
|
-
/**
|
|
44
|
-
* 设置文本水平布局
|
|
45
|
-
* @param value - 布局选项
|
|
46
|
-
* @returns
|
|
47
|
-
*/
|
|
48
|
-
setTextAlign(value: spec.TextAlignment): void;
|
|
49
|
-
/**
|
|
50
|
-
* 设置文本垂直布局
|
|
51
|
-
* @param value - 布局选项
|
|
52
|
-
* @returns
|
|
53
|
-
*/
|
|
54
|
-
setTextBaseline(value: spec.TextBaseline): void;
|
|
55
|
-
/**
|
|
56
|
-
* 设置文本颜色
|
|
57
|
-
* @param value - 颜色内容
|
|
58
|
-
* @returns
|
|
59
|
-
*/
|
|
60
|
-
setTextColor(value: spec.RGBAColorValue): void;
|
|
61
|
-
/**
|
|
62
|
-
* 设置文本字体
|
|
63
|
-
* @param value - 文本字体
|
|
64
|
-
* @returns
|
|
65
|
-
*/
|
|
66
|
-
setFontFamily(value: string): void;
|
|
67
|
-
/**
|
|
68
|
-
* 设置外描边文本颜色
|
|
69
|
-
* @param value - 颜色内容
|
|
70
|
-
* @returns
|
|
71
|
-
*/
|
|
72
|
-
setOutlineColor(value: spec.RGBAColorValue): void;
|
|
73
|
-
/**
|
|
74
|
-
* 设置外描边文本宽度
|
|
75
|
-
* @param value - 外描边宽度
|
|
76
|
-
* @returns
|
|
77
|
-
*/
|
|
78
|
-
setOutlineWidth(value: number): void;
|
|
79
|
-
/**
|
|
80
|
-
* 设置阴影模糊
|
|
81
|
-
* @param value - 阴影模糊强度
|
|
82
|
-
* @returns
|
|
83
|
-
*/
|
|
84
|
-
setShadowBlur(value: number): void;
|
|
85
|
-
/**
|
|
86
|
-
* 设置阴影颜色
|
|
87
|
-
* @param value - 阴影颜色
|
|
88
|
-
* @returns
|
|
89
|
-
*/
|
|
90
|
-
setShadowColor(value: spec.RGBAColorValue): void;
|
|
91
|
-
/**
|
|
92
|
-
* 设置阴影水平偏移距离
|
|
93
|
-
* @param value - 水平偏移距离
|
|
94
|
-
* @returns
|
|
95
|
-
*/
|
|
96
|
-
setShadowOffsetX(value: number): void;
|
|
97
|
-
/**
|
|
98
|
-
* 设置阴影水平偏移距离
|
|
99
|
-
* @param value - 水平偏移距离
|
|
100
|
-
* @returns
|
|
101
|
-
*/
|
|
102
|
-
setShadowOffsetY(value: number): void;
|
|
103
|
-
/**
|
|
104
|
-
* 设置字体清晰度
|
|
105
|
-
* @param value - 字体清晰度
|
|
106
|
-
* @returns
|
|
107
|
-
*/
|
|
108
|
-
setFontScale(value: number): void;
|
|
109
|
-
/**
|
|
110
|
-
* 更新文本
|
|
111
|
-
* @returns
|
|
112
|
-
*/
|
|
113
|
-
updateTexture(): void;
|
|
114
|
-
private getFontDesc;
|
|
115
|
-
private setupOutline;
|
|
116
|
-
private setupShadow;
|
|
117
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import * as spec from '@galacean/effects-specification';
|
|
2
|
-
import type { TextStyle } from './text-style';
|
|
3
|
-
export declare class TextLayout {
|
|
4
|
-
textBaseline: spec.TextBaseline;
|
|
5
|
-
textAlign: spec.TextAlignment;
|
|
6
|
-
letterSpace: number;
|
|
7
|
-
overFlow: spec.TextOverflow;
|
|
8
|
-
width: number;
|
|
9
|
-
height: number;
|
|
10
|
-
/**
|
|
11
|
-
* 自适应宽高开关
|
|
12
|
-
*/
|
|
13
|
-
autoWidth: boolean;
|
|
14
|
-
readonly maxTextWidth: number;
|
|
15
|
-
/**
|
|
16
|
-
* 行高
|
|
17
|
-
*/
|
|
18
|
-
lineHeight: number;
|
|
19
|
-
constructor(options: spec.TextContentOptions);
|
|
20
|
-
getOffsetY(style: TextStyle): number;
|
|
21
|
-
getOffsetX(style: TextStyle, maxWidth: number): number;
|
|
22
|
-
/**
|
|
23
|
-
* 设置文本框的宽度和高度
|
|
24
|
-
* @param width 文本框宽度
|
|
25
|
-
* @param height 文本框高度
|
|
26
|
-
*/
|
|
27
|
-
setSize(width: number, height: number): void;
|
|
28
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Composition } from '../../composition';
|
|
2
|
-
import { AbstractPlugin } from '../index';
|
|
3
|
-
import type { VFXItem } from '../../vfx-item';
|
|
4
|
-
import type { Mesh, RenderFrame } from '../../render';
|
|
5
|
-
import type { TextItem } from './text-item';
|
|
6
|
-
import { TextVFXItem } from './text-vfx-item';
|
|
7
|
-
export declare class TextLoader extends AbstractPlugin {
|
|
8
|
-
name: string;
|
|
9
|
-
addItems: TextVFXItem[];
|
|
10
|
-
removeItems: TextVFXItem[];
|
|
11
|
-
readonly meshes: Mesh[];
|
|
12
|
-
onCompositionDestroyed(composition: Composition): void;
|
|
13
|
-
onCompositionUpdate(composition: Composition, dt: number): void;
|
|
14
|
-
onCompositionItemLifeBegin(composition: Composition, item: VFXItem<TextItem>): void;
|
|
15
|
-
onCompositionReset(composition: Composition, pipeline: RenderFrame): void;
|
|
16
|
-
onCompositionItemRemoved(composition: Composition, item: VFXItem<TextItem>): void;
|
|
17
|
-
prepareRenderFrame(composition: Composition, renderFrame: RenderFrame): boolean;
|
|
18
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { SpriteItem } from '../sprite/sprite-item';
|
|
2
|
-
import { SpriteMesh } from '../sprite/sprite-mesh';
|
|
3
|
-
export declare class TextMesh extends SpriteMesh {
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
* @override
|
|
7
|
-
* @param item
|
|
8
|
-
* @param aIndex
|
|
9
|
-
* @returns
|
|
10
|
-
*/
|
|
11
|
-
getItemGeometryData(item: SpriteItem, aIndex: number): {
|
|
12
|
-
index: Uint16Array | number[];
|
|
13
|
-
aPoint: number[];
|
|
14
|
-
};
|
|
15
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import * as spec from '@galacean/effects-specification';
|
|
2
|
-
export declare class TextStyle {
|
|
3
|
-
/**
|
|
4
|
-
* 字重
|
|
5
|
-
*/
|
|
6
|
-
textWeight: spec.TextWeight;
|
|
7
|
-
/**
|
|
8
|
-
* 字体样式
|
|
9
|
-
*/
|
|
10
|
-
fontStyle: spec.FontStyle;
|
|
11
|
-
/**
|
|
12
|
-
* 是否有下划线(暂时无效)
|
|
13
|
-
*/
|
|
14
|
-
isUnderline: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* 下划线高度(暂时无效)
|
|
17
|
-
*/
|
|
18
|
-
underlineHeight: number;
|
|
19
|
-
/**
|
|
20
|
-
* 是否有外描边
|
|
21
|
-
*/
|
|
22
|
-
isOutlined: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* 外描边颜色
|
|
25
|
-
*/
|
|
26
|
-
outlineColor: spec.vec4;
|
|
27
|
-
/**
|
|
28
|
-
* 外描边宽度
|
|
29
|
-
*/
|
|
30
|
-
outlineWidth: number;
|
|
31
|
-
/**
|
|
32
|
-
* 是否有阴影
|
|
33
|
-
*/
|
|
34
|
-
hasShadow: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* 阴影颜色
|
|
37
|
-
*/
|
|
38
|
-
shadowColor: spec.vec4;
|
|
39
|
-
/**
|
|
40
|
-
* 阴影模糊
|
|
41
|
-
*/
|
|
42
|
-
shadowBlur: number;
|
|
43
|
-
/**
|
|
44
|
-
* 阴影水平偏移距离
|
|
45
|
-
*/
|
|
46
|
-
shadowOffsetX: number;
|
|
47
|
-
/**
|
|
48
|
-
* 阴影高度偏移距离
|
|
49
|
-
*/
|
|
50
|
-
shadowOffsetY: number;
|
|
51
|
-
/**
|
|
52
|
-
* 文本颜色
|
|
53
|
-
*/
|
|
54
|
-
textColor: spec.vec4;
|
|
55
|
-
/**
|
|
56
|
-
* 字体大小
|
|
57
|
-
*/
|
|
58
|
-
fontSize: number;
|
|
59
|
-
fontFamily: string;
|
|
60
|
-
fontDesc: string;
|
|
61
|
-
/**
|
|
62
|
-
* 字体倍数
|
|
63
|
-
*/
|
|
64
|
-
fontScale: number;
|
|
65
|
-
readonly fontOffset = 0;
|
|
66
|
-
constructor(options: spec.TextContentOptions);
|
|
67
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import * as spec from '@galacean/effects-specification';
|
|
2
|
-
import { Vector3 } from '@galacean/effects-math/es/core/index';
|
|
3
|
-
import { VFXItem } from '../../vfx-item';
|
|
4
|
-
import type { Composition } from '../../composition';
|
|
5
|
-
import type { HitTestTriangleParams, BoundingBoxTriangle } from '../interact/click-handler';
|
|
6
|
-
import { TextItem } from './text-item';
|
|
7
|
-
import type { SpriteRenderData } from '../sprite/sprite-mesh';
|
|
8
|
-
import { TextMesh } from './text-mesh';
|
|
9
|
-
export declare class TextVFXItem extends VFXItem<TextItem> {
|
|
10
|
-
composition: Composition;
|
|
11
|
-
cachePrefix?: string;
|
|
12
|
-
textContext: spec.TextContent;
|
|
13
|
-
get type(): spec.ItemType;
|
|
14
|
-
onConstructed(props: spec.TextItem): void;
|
|
15
|
-
onLifetimeBegin(composition: Composition, content: TextItem): void;
|
|
16
|
-
onItemRemoved(composition: Composition, content?: TextItem): void;
|
|
17
|
-
onItemUpdate(dt: number, lifetime: number): void;
|
|
18
|
-
getCurrentPosition(): Vector3;
|
|
19
|
-
/**
|
|
20
|
-
* 获取图层包围盒的类型和世界坐标
|
|
21
|
-
* @returns
|
|
22
|
-
*/
|
|
23
|
-
getBoundingBox(): BoundingBoxTriangle | void;
|
|
24
|
-
getHitTestParams(force?: boolean): HitTestTriangleParams | void;
|
|
25
|
-
getRenderData(): SpriteRenderData;
|
|
26
|
-
protected doCreateContent(composition: Composition): TextItem;
|
|
27
|
-
createWireframeMesh(item: TextItem, color: spec.vec4): TextMesh;
|
|
28
|
-
}
|
package/dist/polyfill.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { SharedShaderWithSource } from './shader';
|
|
2
|
-
export declare const EFFECTS_COPY_MESH_NAME = "effects-internal-copy";
|
|
3
|
-
export declare const COPY_MESH_SHADER_ID = "effects-internal-copy-mesh";
|
|
4
|
-
export declare const COPY_VERTEX_SHADER = "\n#ifdef WEBGL2\n#define vsIn in\n#define vsOut out\n#else\n#define vsIn attribute\n#define vsOut varying\n#endif\nprecision highp float;\nvsIn vec2 aPos;\nvsOut vec2 vTex;\nvoid main(){\n gl_Position = vec4(aPos,0.,1.0);\n vTex = (aPos + vec2(1.0))/2.;\n}";
|
|
5
|
-
export declare const COPY_FRAGMENT_SHADER: string;
|
|
6
|
-
export declare function createCopyShader(level: number, writeDepth?: boolean): SharedShaderWithSource;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { Texture } from '../texture';
|
|
2
|
-
import type { RenderBuffer } from './render-buffer';
|
|
3
|
-
import type { RenderPassAttachmentStorageType, RenderPassDepthStencilAttachmentOptions } from './render-pass';
|
|
4
|
-
import type { RenderPassDestroyAttachmentType, RenderPassStoreAction } from './render-pass';
|
|
5
|
-
import type { Renderer } from './renderer';
|
|
6
|
-
export interface FrameBufferProps {
|
|
7
|
-
attachments: Texture[];
|
|
8
|
-
depthStencilAttachment?: RenderPassDepthStencilAttachmentOptions;
|
|
9
|
-
isCustomViewport?: boolean;
|
|
10
|
-
viewport: [x: number, y: number, width: number, height: number];
|
|
11
|
-
viewportScale?: number;
|
|
12
|
-
storeAction: RenderPassStoreAction;
|
|
13
|
-
name?: string;
|
|
14
|
-
}
|
|
15
|
-
export declare enum FilterMode {
|
|
16
|
-
Nearest = 0,
|
|
17
|
-
Linear = 1
|
|
18
|
-
}
|
|
19
|
-
export declare enum RenderTextureFormat {
|
|
20
|
-
RGBA32 = 0,
|
|
21
|
-
RGBAHalf = 1
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
*
|
|
25
|
-
*/
|
|
26
|
-
export declare class FrameBuffer {
|
|
27
|
-
depthStencilStorageType: RenderPassAttachmentStorageType;
|
|
28
|
-
name: string;
|
|
29
|
-
viewportScale: number;
|
|
30
|
-
viewport: [x: number, y: number, width: number, height: number];
|
|
31
|
-
ready: boolean;
|
|
32
|
-
externalStorage: boolean;
|
|
33
|
-
storeAction: RenderPassStoreAction;
|
|
34
|
-
isCustomViewport: boolean;
|
|
35
|
-
static create: (props: FrameBufferProps, renderer: Renderer) => FrameBuffer;
|
|
36
|
-
resize(x: number, y: number, width: number, height: number): void;
|
|
37
|
-
resetColorTextures(textures: Texture[]): void;
|
|
38
|
-
unbind(): void;
|
|
39
|
-
bind(): void;
|
|
40
|
-
get stencilStorage(): RenderBuffer | undefined;
|
|
41
|
-
get depthStorage(): RenderBuffer | undefined;
|
|
42
|
-
getDepthTexture(): Texture | undefined;
|
|
43
|
-
getStencilTexture(): Texture | undefined;
|
|
44
|
-
getColorTextures(): Texture[];
|
|
45
|
-
dispose(opt?: {
|
|
46
|
-
depthStencilAttachment?: RenderPassDestroyAttachmentType;
|
|
47
|
-
}): void;
|
|
48
|
-
}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import type * as spec from '@galacean/effects-specification';
|
|
2
|
-
import type { Disposable } from '../utils';
|
|
3
|
-
import type { Engine } from '../engine';
|
|
4
|
-
export declare const BYTES_TYPE_MAP: Record<string, number>;
|
|
5
|
-
/**
|
|
6
|
-
* Geometry 的绘制模式
|
|
7
|
-
*/
|
|
8
|
-
export type GeometryDrawMode = WebGLRenderingContext['POINTS'] | WebGLRenderingContext['TRIANGLES'] | WebGLRenderingContext['TRIANGLE_STRIP'] | WebGLRenderingContext['TRIANGLE_FAN'] | WebGLRenderingContext['LINES'] | WebGLRenderingContext['LINE_STRIP'] | WebGLRenderingContext['LINE_LOOP'];
|
|
9
|
-
export type Attribute = spec.AttributeWithData | spec.AttributeWithDataPointer | spec.AttributeWithType | spec.AttributeWithDataSource;
|
|
10
|
-
export interface GeometryProps {
|
|
11
|
-
name?: string;
|
|
12
|
-
attributes: Record<string, Attribute>;
|
|
13
|
-
indices?: {
|
|
14
|
-
data: spec.TypedArray;
|
|
15
|
-
releasable?: boolean;
|
|
16
|
-
};
|
|
17
|
-
mode?: GeometryDrawMode;
|
|
18
|
-
drawCount?: number;
|
|
19
|
-
drawStart?: number;
|
|
20
|
-
instanceCount?: number;
|
|
21
|
-
bufferUsage?: WebGLRenderingContext['STATIC_DRAW'] | WebGLRenderingContext['DYNAMIC_DRAW'];
|
|
22
|
-
/**
|
|
23
|
-
* 粒子最大数量,适用于无法更新 GPU 缓存长度的引擎接入
|
|
24
|
-
*/
|
|
25
|
-
maxVertex?: number;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Geometry 抽象类
|
|
29
|
-
*/
|
|
30
|
-
export declare abstract class Geometry implements Disposable {
|
|
31
|
-
/**
|
|
32
|
-
* Geometry 的名称
|
|
33
|
-
*/
|
|
34
|
-
readonly name: string;
|
|
35
|
-
/**
|
|
36
|
-
* Geometry 创建函数
|
|
37
|
-
* @param name - 名称
|
|
38
|
-
*/
|
|
39
|
-
constructor(name: string);
|
|
40
|
-
/**
|
|
41
|
-
* Geometry 创建函数
|
|
42
|
-
*/
|
|
43
|
-
static create: (engine: Engine, opts: GeometryProps) => Geometry;
|
|
44
|
-
/**
|
|
45
|
-
* 获取 Geometry 的 attribute 数据。
|
|
46
|
-
* @param name - attribute 名称
|
|
47
|
-
*/
|
|
48
|
-
abstract getAttributeData(name: string): spec.TypedArray | undefined;
|
|
49
|
-
/**
|
|
50
|
-
* 设置 Geometry 的 attribute 数据。
|
|
51
|
-
* @param name - attribute 名称
|
|
52
|
-
* @param data - 要设置的 attribute 数据
|
|
53
|
-
*/
|
|
54
|
-
abstract setAttributeData(name: string, data: spec.TypedArray): void;
|
|
55
|
-
/**
|
|
56
|
-
* 设置 attribute 的部分数据,当 attribute 数据只有部分更新时,可调用此函数。
|
|
57
|
-
* @param name - attribute 名称
|
|
58
|
-
* @param offset - 更新数据在 attribute 数组的起始位置 index
|
|
59
|
-
* @param data - 要设置的 attribute 数据
|
|
60
|
-
*/
|
|
61
|
-
abstract setAttributeSubData(name: string, offset: number, data: spec.TypedArray): void;
|
|
62
|
-
/**
|
|
63
|
-
* 获取 attribute 的步长
|
|
64
|
-
* @param name - attribute 名称
|
|
65
|
-
*/
|
|
66
|
-
abstract getAttributeStride(name: string): number;
|
|
67
|
-
/**
|
|
68
|
-
* 获取当前 Geometry 所有的 attribute 名称。
|
|
69
|
-
*/
|
|
70
|
-
abstract getAttributeNames(): string[];
|
|
71
|
-
/**
|
|
72
|
-
* 获取当前 Geometry 的 indices 数据。
|
|
73
|
-
*/
|
|
74
|
-
abstract getIndexData(): spec.TypedArray | undefined;
|
|
75
|
-
/**
|
|
76
|
-
* 设置 Geometry 的 indices 数据。
|
|
77
|
-
* @param data - 要设置的 indices 数据
|
|
78
|
-
*/
|
|
79
|
-
abstract setIndexData(data?: spec.TypedArray): void;
|
|
80
|
-
/**
|
|
81
|
-
* 设置 indices 的部分数据,当 indices 数据只有部分更新时,可调用此函数。
|
|
82
|
-
* @param offset - 更新数据在 indices 数组的起始位置 index
|
|
83
|
-
* @param data - 要设置的 indices 数据
|
|
84
|
-
*/
|
|
85
|
-
abstract setIndexSubData(offset: number, data: spec.TypedArray): void;
|
|
86
|
-
/**
|
|
87
|
-
* 设置 Geometry 绘制的 drawStart
|
|
88
|
-
* @param value 要设置的 drawStart 值
|
|
89
|
-
*/
|
|
90
|
-
abstract setDrawStart(count: number): void;
|
|
91
|
-
/**
|
|
92
|
-
* 获取当前 Geometry 的 drawStart
|
|
93
|
-
*/
|
|
94
|
-
abstract getDrawStart(): number;
|
|
95
|
-
/**
|
|
96
|
-
* 设置 Geometry 绘制的 drawCount。
|
|
97
|
-
* @param count 要设置的 drawCount 值
|
|
98
|
-
*/
|
|
99
|
-
abstract setDrawCount(count: number): void;
|
|
100
|
-
/**
|
|
101
|
-
* 获取当前 Geometry 的 drawcount
|
|
102
|
-
*/
|
|
103
|
-
abstract getDrawCount(): number;
|
|
104
|
-
/**
|
|
105
|
-
* 销毁当前资源
|
|
106
|
-
*/
|
|
107
|
-
abstract dispose(): void;
|
|
108
|
-
/**
|
|
109
|
-
* 初始化 GPU 资源
|
|
110
|
-
* @override
|
|
111
|
-
*/
|
|
112
|
-
initialize(): void;
|
|
113
|
-
/**
|
|
114
|
-
* 几何数据刷新
|
|
115
|
-
*/
|
|
116
|
-
flush(): void;
|
|
117
|
-
}
|
|
118
|
-
export declare function generateEmptyTypedArray(type: number): Float32Array | Int32Array | Int16Array;
|