modern-canvas 0.27.5 → 0.27.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/Engine.d.ts +9 -0
- package/dist/core/renderers/gl/Batch2DEffect.d.ts +7 -0
- package/dist/core/renderers/gl/GlBatch2DSystem.d.ts +2 -0
- package/dist/index.js +393 -343
- package/dist/scene/2d/element/Element2D.d.ts +7 -0
- package/dist/scene/2d/element/Element2DOutline.d.ts +2 -0
- package/dist/scene/2d/element/Element2DText.d.ts +2 -0
- package/dist/scene/effects/DrawboardEffect.d.ts +13 -15
- package/dist/scene/main/SceneTree.d.ts +16 -0
- package/package.json +1 -1
package/dist/Engine.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Batch2DEffect } from './core';
|
|
1
2
|
import type { Node, SceneTreeEvents, SceneTreeProperties } from './scene';
|
|
2
3
|
import { WebGLRenderer } from './core';
|
|
3
4
|
import { SceneTree } from './scene';
|
|
@@ -43,6 +44,14 @@ export declare class Engine extends SceneTree {
|
|
|
43
44
|
get height(): number;
|
|
44
45
|
get pixelRatio(): number;
|
|
45
46
|
set pixelRatio(val: number);
|
|
47
|
+
protected _flowEffect?: Batch2DEffect;
|
|
48
|
+
get flowEffect(): Batch2DEffect | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* 切换描边/连线的「流动」预设:引擎只内置 flowStreak,其余样式(箭头/生长线/虚线等)
|
|
51
|
+
* 由宿主传自定义 Batch2DEffect。占用同一 flow 槽(按名替换 + 重编译),传 undefined 恢复默认。
|
|
52
|
+
* 颜色/周期仍走 flowColor / flowPeriod(effectUniforms)。
|
|
53
|
+
*/
|
|
54
|
+
set flowEffect(effect: Batch2DEffect | undefined);
|
|
46
55
|
protected _resizeObserver: ResizeObserver | undefined;
|
|
47
56
|
constructor(properties?: Partial<EngineProperties>);
|
|
48
57
|
protected _updateProperty(key: string, value: any, oldValue: any): void;
|
|
@@ -27,6 +27,13 @@ export interface Batch2DEffect {
|
|
|
27
27
|
uniformDecls?: string;
|
|
28
28
|
/** uniform 默认值;宿主可经 `batch2D.effectUniforms` 逐帧覆盖。 */
|
|
29
29
|
uniformDefaults?: Record<string, any>;
|
|
30
|
+
/**
|
|
31
|
+
* flow 描边的 vUv.x 归一化到「每条线 0..1」(除以整条线总弧长)而非默认的
|
|
32
|
+
* 路径像素弧长。归一化在批打包阶段按当前激活效果动态处理,顶点布局不变。
|
|
33
|
+
* - true(箭头 / 生长线):效果在「每条线」空间里工作 —— 严格一个 / 走满整条。
|
|
34
|
+
* - false/缺省(流光 / 虚线):像素弧长 —— 段长固定物理尺寸,与线长无关。
|
|
35
|
+
*/
|
|
36
|
+
uvNormalized?: boolean;
|
|
30
37
|
}
|
|
31
38
|
/** aTextureParams.y bit0:UV 越界裁剪(核心语义,效果位从 bit1 起)。 */
|
|
32
39
|
export declare const FLAG_CLIP_OUTSIDE_UV = 1;
|
|
@@ -59,6 +59,8 @@ interface BatchSlot {
|
|
|
59
59
|
indexData?: Uint32Array<ArrayBuffer>;
|
|
60
60
|
refs: any[];
|
|
61
61
|
drawCalls: DrawCall[];
|
|
62
|
+
/** 上次重建时的效果修订号;效果注册变更(含 flow uv 归一化模式)后强制失效。 */
|
|
63
|
+
effectsRevision?: number;
|
|
62
64
|
}
|
|
63
65
|
export declare class GlBatch2DSystem extends GlSystem {
|
|
64
66
|
install(renderer: WebGLRenderer): void;
|