@galacean/engine-spine 4.2.0 → 4.2.1

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,72 +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
+ ```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**:
19
27
 
20
28
  ```typescript
21
29
  import { SpineAnimationRenderer } from '@galacean/engine-spine';
22
30
 
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
- }
39
- ```
40
-
31
+ // First setup for galacean engine, get scene and create root entity.
32
+ // Find setup code here:
41
33
 
42
- ## npm
43
- ```sh
44
- npm install @galacean/engine-spine
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);
45
41
  ```
46
42
 
43
+ ## API Documentation
47
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/).
48
46
 
49
47
 
50
- ## Version
51
- @galacean/engine-spine currently only supports spine version 3.8
48
+ ## Version Compatibility
52
49
 
50
+ ### Package and Spine Version Compatibility
53
51
 
54
- ## 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 |
55
60
 
56
- - Simple in usage
57
- - High performance.
58
- - Intergrated with galacean engine.
59
- - Component based API.
61
+ > Note: Ensure that the package version aligns with the corresponding Spine editor version for compatibility.
60
62
 
63
+ ### Package and Galacean Engine Version Compatibility
61
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 |
62
69
 
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
-
70
+ > Note: Please verify that the versions of both the package and the Galacean Engine are compatible, as mismatched versions may cause unexpected issues.
66
71
 
67
- Make sure to read the [Contributing Guide](.github/HOW_TO_CONTRIBUTE.md) before submitting changes.
68
72
 
73
+ ## Building and Development
69
74
 
70
- ## Links
75
+ To set up the project for development and build it for production, follow these steps:
71
76
 
72
- - [Examples](https://oasisengine.cn/#/examples/latest/spine-animation)
73
- - [Documentation](https://oasisengine.cn/#/docs/latest/cn/spine)
74
- - [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
+ ```
75
93
 
76
94
 
77
95
 
78
- ## 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.
79
100
 
80
101
 
102
+ ## License
81
103
  The Galacean Engine is released under the [MIT](https://opensource.org/licenses/MIT) license. See LICENSE file.