@galacean/engine-spine 0.0.0-experimental-engine-spine-20241116 → 0.0.0-experimental-engine-spine-caifu.0
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/README.md +42 -64
- package/dist/browser.js +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +1 -1
- package/dist/module.js +1 -1
- package/dist/module.js.map +1 -1
- package/package.json +36 -36
- package/types/SpineAnimationRenderer.d.ts +60 -43
- package/types/SpineGenerator.d.ts +4 -1
- package/types/index.d.ts +1 -1
- package/types/loader/SkeletonDataResource.d.ts +1 -1
- package/types/loader/SpineLoader.d.ts +3 -3
- package/types/util/AttachmentTools.d.ts +22 -0
- package/types/util/BlendMode.d.ts +1 -1
- package/types/util/BufferReader.d.ts +2 -4
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
# Galacean Engine
|
|
3
|
+
# Galacean Engine spine runtime
|
|
4
|
+

|
|
4
5
|
|
|
5
6
|
|
|
6
7
|

|
|
@@ -9,95 +10,72 @@
|
|
|
9
10
|
|
|
10
11
|
---
|
|
11
12
|
|
|
12
|
-
[@galacean/engine-spine](https://www.npmjs.com/package/@galacean/engine-spine) is the Spine runtime module for the [Galacean engine](https://github.com/galacean/engine), providing efficient support for Spine animations. This package enables developers to seamlessly integrate and use Spine animations, delivering smooth skeletal animation effects optimized for both web and mobile platforms.
|
|
13
13
|
|
|
14
|
-
##
|
|
15
|
-
## Installation
|
|
16
14
|
|
|
17
|
-
|
|
15
|
+
Spine runtime for [Galacean engine](https://github.com/galacean/engine).
|
|
16
|
+
##
|
|
17
|
+
## Usage
|
|
18
18
|
|
|
19
|
-
```bash
|
|
20
|
-
npm install @galacean/engine-spine
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
## Quick Start
|
|
25
|
-
|
|
26
|
-
Here's a simple example to get started with **@galacean/engine-spine**:
|
|
27
19
|
|
|
28
20
|
```typescript
|
|
29
21
|
import { SpineAnimationRenderer } from '@galacean/engine-spine';
|
|
30
22
|
|
|
31
|
-
//
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
23
|
+
// init oasis
|
|
24
|
+
addSpine();
|
|
25
|
+
|
|
26
|
+
async function addSpine() {
|
|
27
|
+
const resource = await engine.resourceManager.load(
|
|
28
|
+
{
|
|
29
|
+
url: 'https://mdn.alipayobjects.com/huamei_kz4wfo/uri/file/as/2/kz4wfo/4/mp/yKbdfgijyLGzQDyQ/spineboy/spineboy.json',
|
|
30
|
+
type: 'spine',
|
|
31
|
+
},
|
|
32
|
+
);
|
|
33
|
+
const spineEntity = new Entity(engine);
|
|
34
|
+
const spine = entity.addComponent(SpineAnimationRenderer);
|
|
35
|
+
spine.resource = resource;
|
|
36
|
+
spine.defaultState.animationName = 'walk';
|
|
37
|
+
rootEntity.addChild(spineEntity);
|
|
38
|
+
}
|
|
41
39
|
```
|
|
42
40
|
|
|
43
|
-
## API Documentation
|
|
44
41
|
|
|
45
|
-
|
|
42
|
+
## npm
|
|
43
|
+
```sh
|
|
44
|
+
npm install @galacean/engine-spine
|
|
45
|
+
```
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
## Version Compatibility
|
|
49
48
|
|
|
50
|
-
### Package and Spine Version Compatibility
|
|
51
49
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
| Below 4.0 | Spine 3.8 |
|
|
55
|
-
| 4.0 | Spine 4.0 |
|
|
56
|
-
| 4.1 | Spine 4.1 |
|
|
57
|
-
| 4.2 | Spine 4.2 |
|
|
58
|
-
| 4.x (e.g., 4.0, 4.1) | Corresponds to Spine x.x |
|
|
59
|
-
| 4.x.y (minor version `y`) | Independent from Spine |
|
|
50
|
+
## Version
|
|
51
|
+
@galacean/engine-spine currently only supports spine version 3.8
|
|
60
52
|
|
|
61
|
-
> Note: Ensure that the package version aligns with the corresponding Spine editor version for compatibility.
|
|
62
53
|
|
|
63
|
-
|
|
54
|
+
## Feature
|
|
64
55
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
56
|
+
- Simple in usage
|
|
57
|
+
- High performance.
|
|
58
|
+
- Intergrated with galacean engine.
|
|
59
|
+
- Component based API.
|
|
69
60
|
|
|
70
|
-
> Note: Please verify that the versions of both the package and the Galacean Engine are compatible, as mismatched versions may cause unexpected issues.
|
|
71
61
|
|
|
72
62
|
|
|
73
|
-
##
|
|
63
|
+
## Contributing
|
|
64
|
+
Everyone is welcome to join us! Whether you find a bug, have a great feature request or you fancy owning a task from the road map feel free to get in touch.
|
|
65
|
+
|
|
74
66
|
|
|
75
|
-
|
|
67
|
+
Make sure to read the [Contributing Guide](.github/HOW_TO_CONTRIBUTE.md) before submitting changes.
|
|
76
68
|
|
|
77
|
-
1. **Install dependencies**:
|
|
78
|
-
```bash
|
|
79
|
-
npm install
|
|
80
|
-
```
|
|
81
|
-
2. **Start development environment**:
|
|
82
|
-
```bash
|
|
83
|
-
npm run dev
|
|
84
|
-
```
|
|
85
|
-
3. **Build for production**:
|
|
86
|
-
```bash
|
|
87
|
-
npm run build
|
|
88
|
-
```
|
|
89
|
-
4. **Run examples**:
|
|
90
|
-
```bash
|
|
91
|
-
npm run example
|
|
92
|
-
```
|
|
93
69
|
|
|
70
|
+
## Links
|
|
94
71
|
|
|
72
|
+
- [Examples](https://oasisengine.cn/#/examples/latest/spine-animation)
|
|
73
|
+
- [Documentation](https://oasisengine.cn/#/docs/latest/cn/spine)
|
|
74
|
+
- [GalaceanEngine](https://oasisengine.cn/)
|
|
95
75
|
|
|
96
|
-
## Links
|
|
97
|
-
- [Examples](https://galacean.antgroup.com/engine/en/docs/graphics/2D/spine/example/) - View usage examples for common scenarios.
|
|
98
|
-
- [User Guide](https://galacean.antgroup.com/engine/en/docs/graphics/2D/spine/overview/) - Comprehensive guide for using this package within the Galacean editor and in scripts.
|
|
99
|
-
- [API Reference](https://galacean.antgroup.com/engine/en/docs/graphics/2D/spine/api/) - Complete API documentation for all available classes, methods, and properties.
|
|
100
76
|
|
|
101
77
|
|
|
102
78
|
## License
|
|
79
|
+
|
|
80
|
+
|
|
103
81
|
The Galacean Engine is released under the [MIT](https://opensource.org/licenses/MIT) license. See LICENSE file.
|