@eva/plugin-renderer-dragonbone 2.0.1-beta.3 → 2.0.1-beta.30
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.
|
@@ -38,19 +38,72 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
/**
|
|
42
|
+
* DragonBones 骨骼动画组件
|
|
43
|
+
*
|
|
44
|
+
* DragonBone 组件用于播放 DragonBones 骨骼动画。
|
|
45
|
+
* DragonBones 是一个开源的 2D 骨骼动画解决方案,
|
|
46
|
+
* 支持复杂的角色动画、换装、动画融合等高级功能,
|
|
47
|
+
* 适用于游戏角色、UI 动效等需要骨骼动画的场景。
|
|
48
|
+
*
|
|
49
|
+
* 主要功能:
|
|
50
|
+
* - 播放 DragonBones 骨骼动画
|
|
51
|
+
* - 支持多个骨架(Armature)
|
|
52
|
+
* - 支持动画切换和融合
|
|
53
|
+
* - 支持骨骼和插槽操作
|
|
54
|
+
* - 支持换装和皮肤切换
|
|
55
|
+
* - 提供动画事件监听
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```typescript
|
|
59
|
+
* // 基础用法
|
|
60
|
+
* const character = new GameObject('character');
|
|
61
|
+
* character.addComponent(new DragonBone({
|
|
62
|
+
* resource: 'heroAnimation', // DragonBones 资源
|
|
63
|
+
* armatureName: 'Hero', // 骨架名称
|
|
64
|
+
* animationName: 'idle', // 默认动画
|
|
65
|
+
* autoPlay: true
|
|
66
|
+
* }));
|
|
67
|
+
*
|
|
68
|
+
* // 切换动画
|
|
69
|
+
* const dragonbone = character.getComponent('DragonBone');
|
|
70
|
+
* dragonbone.play('run'); // 播放跑步动画
|
|
71
|
+
* dragonbone.play('attack', 1); // 播放攻击动画 1 次
|
|
72
|
+
*
|
|
73
|
+
* // 停止动画
|
|
74
|
+
* dragonbone.stop();
|
|
75
|
+
* dragonbone.stop('walk'); // 停止指定动画
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
41
78
|
class DragonBone$3 extends eva_js.Component {
|
|
42
79
|
constructor() {
|
|
43
80
|
super(...arguments);
|
|
81
|
+
/** 等待播放标志 */
|
|
44
82
|
this.waitPlay = false;
|
|
83
|
+
/** 等待停止标志 */
|
|
45
84
|
this.waitStop = false;
|
|
85
|
+
/** 待播放的动画信息 */
|
|
46
86
|
this.waitPlayInfo = {
|
|
47
87
|
animationName: null,
|
|
48
88
|
};
|
|
89
|
+
/** DragonBones 资源名称 */
|
|
49
90
|
this.resource = '';
|
|
91
|
+
/** 骨架名称 */
|
|
50
92
|
this.armatureName = '';
|
|
93
|
+
/** 动画名称 */
|
|
51
94
|
this.animationName = '';
|
|
95
|
+
/** 是否自动播放 */
|
|
52
96
|
this.autoPlay = true;
|
|
53
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* 初始化组件
|
|
100
|
+
* @param obj - 初始化参数
|
|
101
|
+
* @param obj.resource - DragonBones 资源名称
|
|
102
|
+
* @param obj.armatureName - 骨架名称(必填)
|
|
103
|
+
* @param obj.animationName - 默认动画名称
|
|
104
|
+
* @param obj.autoPlay - 是否自动播放
|
|
105
|
+
* @throws 如果未提供 armatureName 则抛出错误
|
|
106
|
+
*/
|
|
54
107
|
init(obj) {
|
|
55
108
|
if (!obj)
|
|
56
109
|
return;
|
|
@@ -100,6 +153,7 @@ class DragonBone$3 extends eva_js.Component {
|
|
|
100
153
|
this.removeAllListeners();
|
|
101
154
|
}
|
|
102
155
|
}
|
|
156
|
+
/** 组件名称 */
|
|
103
157
|
DragonBone$3.componentName = 'DragonBone';
|
|
104
158
|
__decorate([
|
|
105
159
|
inspectorDecorator.type('string')
|
|
@@ -7,16 +7,71 @@ import { Renderer } from '@eva/plugin-renderer';
|
|
|
7
7
|
import { RendererManager } from '@eva/plugin-renderer';
|
|
8
8
|
import { RendererSystem } from '@eva/plugin-renderer';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* DragonBones 骨骼动画组件
|
|
12
|
+
*
|
|
13
|
+
* DragonBone 组件用于播放 DragonBones 骨骼动画。
|
|
14
|
+
* DragonBones 是一个开源的 2D 骨骼动画解决方案,
|
|
15
|
+
* 支持复杂的角色动画、换装、动画融合等高级功能,
|
|
16
|
+
* 适用于游戏角色、UI 动效等需要骨骼动画的场景。
|
|
17
|
+
*
|
|
18
|
+
* 主要功能:
|
|
19
|
+
* - 播放 DragonBones 骨骼动画
|
|
20
|
+
* - 支持多个骨架(Armature)
|
|
21
|
+
* - 支持动画切换和融合
|
|
22
|
+
* - 支持骨骼和插槽操作
|
|
23
|
+
* - 支持换装和皮肤切换
|
|
24
|
+
* - 提供动画事件监听
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* // 基础用法
|
|
29
|
+
* const character = new GameObject('character');
|
|
30
|
+
* character.addComponent(new DragonBone({
|
|
31
|
+
* resource: 'heroAnimation', // DragonBones 资源
|
|
32
|
+
* armatureName: 'Hero', // 骨架名称
|
|
33
|
+
* animationName: 'idle', // 默认动画
|
|
34
|
+
* autoPlay: true
|
|
35
|
+
* }));
|
|
36
|
+
*
|
|
37
|
+
* // 切换动画
|
|
38
|
+
* const dragonbone = character.getComponent('DragonBone');
|
|
39
|
+
* dragonbone.play('run'); // 播放跑步动画
|
|
40
|
+
* dragonbone.play('attack', 1); // 播放攻击动画 1 次
|
|
41
|
+
*
|
|
42
|
+
* // 停止动画
|
|
43
|
+
* dragonbone.stop();
|
|
44
|
+
* dragonbone.stop('walk'); // 停止指定动画
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
10
47
|
export declare class DragonBone extends Component<DragonBoneParams> {
|
|
48
|
+
/** 组件名称 */
|
|
11
49
|
static componentName: string;
|
|
50
|
+
/** DragonBones 骨架实例 */
|
|
12
51
|
private _armature;
|
|
52
|
+
/** 等待播放标志 */
|
|
13
53
|
private waitPlay;
|
|
54
|
+
/** 等待停止标志 */
|
|
14
55
|
private waitStop;
|
|
56
|
+
/** 待播放的动画信息 */
|
|
15
57
|
private waitPlayInfo;
|
|
58
|
+
/** DragonBones 资源名称 */
|
|
16
59
|
resource: string;
|
|
60
|
+
/** 骨架名称 */
|
|
17
61
|
armatureName: string;
|
|
62
|
+
/** 动画名称 */
|
|
18
63
|
animationName: string;
|
|
64
|
+
/** 是否自动播放 */
|
|
19
65
|
autoPlay: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* 初始化组件
|
|
68
|
+
* @param obj - 初始化参数
|
|
69
|
+
* @param obj.resource - DragonBones 资源名称
|
|
70
|
+
* @param obj.armatureName - 骨架名称(必填)
|
|
71
|
+
* @param obj.animationName - 默认动画名称
|
|
72
|
+
* @param obj.autoPlay - 是否自动播放
|
|
73
|
+
* @throws 如果未提供 armatureName 则抛出错误
|
|
74
|
+
*/
|
|
20
75
|
init(obj?: DragonBoneParams): void;
|
|
21
76
|
play(name?: string, times?: number): void;
|
|
22
77
|
stop(name?: string): void;
|
|
@@ -34,19 +34,72 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
/**
|
|
38
|
+
* DragonBones 骨骼动画组件
|
|
39
|
+
*
|
|
40
|
+
* DragonBone 组件用于播放 DragonBones 骨骼动画。
|
|
41
|
+
* DragonBones 是一个开源的 2D 骨骼动画解决方案,
|
|
42
|
+
* 支持复杂的角色动画、换装、动画融合等高级功能,
|
|
43
|
+
* 适用于游戏角色、UI 动效等需要骨骼动画的场景。
|
|
44
|
+
*
|
|
45
|
+
* 主要功能:
|
|
46
|
+
* - 播放 DragonBones 骨骼动画
|
|
47
|
+
* - 支持多个骨架(Armature)
|
|
48
|
+
* - 支持动画切换和融合
|
|
49
|
+
* - 支持骨骼和插槽操作
|
|
50
|
+
* - 支持换装和皮肤切换
|
|
51
|
+
* - 提供动画事件监听
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```typescript
|
|
55
|
+
* // 基础用法
|
|
56
|
+
* const character = new GameObject('character');
|
|
57
|
+
* character.addComponent(new DragonBone({
|
|
58
|
+
* resource: 'heroAnimation', // DragonBones 资源
|
|
59
|
+
* armatureName: 'Hero', // 骨架名称
|
|
60
|
+
* animationName: 'idle', // 默认动画
|
|
61
|
+
* autoPlay: true
|
|
62
|
+
* }));
|
|
63
|
+
*
|
|
64
|
+
* // 切换动画
|
|
65
|
+
* const dragonbone = character.getComponent('DragonBone');
|
|
66
|
+
* dragonbone.play('run'); // 播放跑步动画
|
|
67
|
+
* dragonbone.play('attack', 1); // 播放攻击动画 1 次
|
|
68
|
+
*
|
|
69
|
+
* // 停止动画
|
|
70
|
+
* dragonbone.stop();
|
|
71
|
+
* dragonbone.stop('walk'); // 停止指定动画
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
37
74
|
class DragonBone$3 extends Component {
|
|
38
75
|
constructor() {
|
|
39
76
|
super(...arguments);
|
|
77
|
+
/** 等待播放标志 */
|
|
40
78
|
this.waitPlay = false;
|
|
79
|
+
/** 等待停止标志 */
|
|
41
80
|
this.waitStop = false;
|
|
81
|
+
/** 待播放的动画信息 */
|
|
42
82
|
this.waitPlayInfo = {
|
|
43
83
|
animationName: null,
|
|
44
84
|
};
|
|
85
|
+
/** DragonBones 资源名称 */
|
|
45
86
|
this.resource = '';
|
|
87
|
+
/** 骨架名称 */
|
|
46
88
|
this.armatureName = '';
|
|
89
|
+
/** 动画名称 */
|
|
47
90
|
this.animationName = '';
|
|
91
|
+
/** 是否自动播放 */
|
|
48
92
|
this.autoPlay = true;
|
|
49
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* 初始化组件
|
|
96
|
+
* @param obj - 初始化参数
|
|
97
|
+
* @param obj.resource - DragonBones 资源名称
|
|
98
|
+
* @param obj.armatureName - 骨架名称(必填)
|
|
99
|
+
* @param obj.animationName - 默认动画名称
|
|
100
|
+
* @param obj.autoPlay - 是否自动播放
|
|
101
|
+
* @throws 如果未提供 armatureName 则抛出错误
|
|
102
|
+
*/
|
|
50
103
|
init(obj) {
|
|
51
104
|
if (!obj)
|
|
52
105
|
return;
|
|
@@ -96,6 +149,7 @@ class DragonBone$3 extends Component {
|
|
|
96
149
|
this.removeAllListeners();
|
|
97
150
|
}
|
|
98
151
|
}
|
|
152
|
+
/** 组件名称 */
|
|
99
153
|
DragonBone$3.componentName = 'DragonBone';
|
|
100
154
|
__decorate([
|
|
101
155
|
type('string')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eva/plugin-renderer-dragonbone",
|
|
3
|
-
"version": "2.0.1-beta.
|
|
3
|
+
"version": "2.0.1-beta.30",
|
|
4
4
|
"description": "@eva/plugin-renderer-dragonbone",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/plugin-renderer-dragonbone.esm.js",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"homepage": "https://eva.js.org",
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@eva/inspector-decorator": "^0.0.5",
|
|
22
|
-
"@eva/plugin-renderer": "2.0.1-beta.
|
|
23
|
-
"@eva/eva.js": "2.0.1-beta.
|
|
22
|
+
"@eva/plugin-renderer": "2.0.1-beta.30",
|
|
23
|
+
"@eva/eva.js": "2.0.1-beta.30",
|
|
24
24
|
"pixi.js": "^8.8.1"
|
|
25
25
|
}
|
|
26
26
|
}
|