@galacean/engine-spine 0.0.0-experimental-engine-spine-20240821 → 0.0.0-experimental-engine-spine-20241107

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 CHANGED
@@ -1,7 +1,6 @@
1
1
 
2
2
 
3
- # Galacean Engine spine runtime
4
- ![Jun-12-2021 18-37-22.gif](https://gw.alipayobjects.com/mdn/mybank_yul/afts/img/A*am1ySYTDBQAAAAAAAAAAAAAAARQnAQ)
3
+ # Galacean Engine Spine Runtime
5
4
 
6
5
 
7
6
  ![](https://img.shields.io/npm/v/@galacean/engine-spine#id=QfHW0&originHeight=20&originWidth=80&originalType=binary&ratio=1&status=done&style=none)
@@ -10,70 +9,95 @@
10
9
 
11
10
  ---
12
11
 
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
14
16
 
15
- Spine runtime for [Galacean engine](https://github.com/galacean/engine).
16
- ##
17
- ## Usage
17
+ Install **@galacean/engine-spine** via npm:
18
18
 
19
-
20
- ```typescript
21
- import { SpineAnimation } from '@galacean/engine-spine';
22
-
23
- // init oasis
24
- addSpine();
25
-
26
- async function addSpine() {
27
- const spineEntity = await engine.resourceManager.load(
28
- {
29
- url: 'https://sbfkcel.github.io/pixi-spine-debug/assets/spine/spineboy-pro.json',
30
- type: 'spine',
31
- },
32
- );
33
- rootEntity.addChild(spineEntity);
34
- const spineAnimation = spineEntity.getComponent(SpineAnimation);
35
- spineAnimation.state.setAnimation(0, 'walk', true);
36
- }
19
+ ```bash
20
+ npm install @galacean/engine-spine
37
21
  ```
38
22
 
39
23
 
40
- ## npm
41
- ```sh
42
- npm install @galacean/engine-spine
24
+ ## Quick Start
25
+
26
+ Here's a simple example to get started with **@galacean/engine-spine**:
27
+
28
+ ```typescript
29
+ import { SpineAnimationRenderer } from '@galacean/engine-spine';
30
+
31
+ // First setup for galacean engine, get scene and create root entity.
32
+ // Find setup code here:
33
+
34
+ // And then load spine resource and instantiate a spine entity with the resource.
35
+ const spineResource = await engine.resourceManager.load({
36
+ url: 'https://mdn.alipayobjects.com/huamei_kz4wfo/uri/file/as/2/kz4wfo/4/mp/yKbdfgijyLGzQDyQ/spineboy/spineboy.json',
37
+ type: 'spine',
38
+ });
39
+ const spineEntity = spineResource.instantiate();
40
+ rootEntity.addChild(spineEntity);
43
41
  ```
44
42
 
43
+ ## API Documentation
45
44
 
45
+ For a detailed overview of the API, including all classes, methods, and properties, please refer to the [Full API Documentation](https://galacean.antgroup.com/engine/en/docs/graphics/2D/spine/api/).
46
46
 
47
47
 
48
- ## Version
49
- @galacean/engine-spine currently only supports spine version 3.8
48
+ ## Version Compatibility
50
49
 
50
+ ### Package and Spine Version Compatibility
51
51
 
52
- ## Feature
52
+ | Package Version | Spine Version |
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 |
53
60
 
54
- - Simple in usage
55
- - High performance.
56
- - Intergrated with galacean engine.
57
- - Component based API.
61
+ > Note: Ensure that the package version aligns with the corresponding Spine editor version for compatibility.
58
62
 
63
+ ### Package and Galacean Engine Version Compatibility
59
64
 
65
+ | Package Version | Galacean Engine Version |
66
+ |-----------------|-------------------------|
67
+ | 4.0 and above | 1.3 and above |
68
+ | Below 4.0 (e.g., 1.2.0) | 1.2 |
60
69
 
61
- ## Contributing
62
- 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.
63
-
70
+ > Note: Please verify that the versions of both the package and the Galacean Engine are compatible, as mismatched versions may cause unexpected issues.
64
71
 
65
- Make sure to read the [Contributing Guide](.github/HOW_TO_CONTRIBUTE.md) before submitting changes.
66
72
 
73
+ ## Building and Development
67
74
 
68
- ## Links
75
+ To set up the project for development and build it for production, follow these steps:
69
76
 
70
- - [Examples](https://oasisengine.cn/#/examples/latest/spine-animation)
71
- - [Documentation](https://oasisengine.cn/#/docs/latest/cn/spine)
72
- - [GalaceanEngine](https://oasisengine.cn/)
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
+ ```
73
93
 
74
94
 
75
95
 
76
- ## License
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.
77
100
 
78
101
 
79
- The Oasis Engine is released under the [MIT](https://opensource.org/licenses/MIT) license. See LICENSE file.
102
+ ## License
103
+ The Galacean Engine is released under the [MIT](https://opensource.org/licenses/MIT) license. See LICENSE file.