@galacean/engine-spine 0.0.0-experimental-2024071801 → 0.0.0-experimental-2024071902

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.
Files changed (56) hide show
  1. package/README.md +7 -5
  2. package/dist/browser.js +1 -1
  3. package/dist/main.js +1 -1
  4. package/dist/main.js.map +1 -1
  5. package/dist/miniprogram.js +1 -1
  6. package/dist/module.js +1 -1
  7. package/dist/module.js.map +1 -1
  8. package/package.json +2 -2
  9. package/types/{src/SpineAnimationRenderer.d.ts → SpineAnimationRenderer.d.ts} +21 -21
  10. package/types/SpineGenerator.d.ts +5 -5
  11. package/types/index.d.ts +1 -1
  12. package/types/loader/SpineLoader.d.ts +1 -1
  13. package/types/SpineAnimation.d.ts +0 -147
  14. package/types/core/MeshGenerator.d.ts +0 -43
  15. package/types/core/SpineGenerator.d.ts +0 -42
  16. package/types/core/SpineMesh.d.ts +0 -11
  17. package/types/core/SpinePrimitive.d.ts +0 -15
  18. package/types/cypress.config.d.ts +0 -2
  19. package/types/e2e/case/.mockForE2E.d.ts +0 -3
  20. package/types/e2e/case/mix-and-match.d.ts +0 -1
  21. package/types/e2e/case/raptor.d.ts +0 -1
  22. package/types/e2e/case/spine-boy.d.ts +0 -1
  23. package/types/e2e/config.d.ts +0 -19
  24. package/types/e2e/support/commands.d.ts +0 -8
  25. package/types/e2e/support/e2e.d.ts +0 -1
  26. package/types/e2e/tests/index.cy.d.ts +0 -1
  27. package/types/example/main.d.ts +0 -1
  28. package/types/example/outline.d.ts +0 -11
  29. package/types/jest.setup.d.ts +0 -5
  30. package/types/loader/BufferReader.d.ts +0 -9
  31. package/types/loader/EditorSkeletonDataLoader.d.ts +0 -6
  32. package/types/src/SpineGenerator.d.ts +0 -37
  33. package/types/src/SpineMaterial.d.ts +0 -6
  34. package/types/src/index.d.ts +0 -7
  35. package/types/src/loader/EditorSpineAtlasLoader.d.ts +0 -6
  36. package/types/src/loader/LoaderUtils.d.ts +0 -18
  37. package/types/src/loader/SkeletonDataResource.d.ts +0 -12
  38. package/types/src/loader/SpineLoader.d.ts +0 -29
  39. package/types/src/util/BlendMode.d.ts +0 -4
  40. package/types/src/util/BufferReader.d.ts +0 -10
  41. package/types/src/util/ClearablePool.d.ts +0 -8
  42. package/types/src/util/ReturnablePool.d.ts +0 -8
  43. package/types/tests/SpineAnimation.test.d.ts +0 -1
  44. package/types/tests/SpineGenerator.test.d.ts +0 -1
  45. package/types/tests/SpineMaterial.test.d.ts +0 -1
  46. package/types/tests/loader/EditorSpineAtlasLoader.test.d.ts +0 -1
  47. package/types/tests/loader/SkeletonDataResource.test.d.ts +0 -1
  48. package/types/tests/loader/SpineLoader.test.d.ts +0 -1
  49. package/types/tests/loader/loaderUtil.test.d.ts +0 -0
  50. package/types/tests/testUtils.d.ts +0 -3
  51. package/types/tests/util/BlendMode.test.d.ts +0 -1
  52. package/types/tests/util/BufferReader.test.d.ts +0 -1
  53. package/types/tests/util/ClearablePool.test.d.ts +0 -1
  54. package/types/tests/util/ReturnablePool.test.d.ts +0 -1
  55. package/types/types.d.ts +0 -4
  56. package/types/util/Cache.d.ts +0 -19
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.0-experimental-2024071801",
2
+ "version": "0.0.0-experimental-2024071902",
3
3
  "description": "galacean spine runtime",
4
4
  "name": "@galacean/engine-spine",
5
5
  "main": "dist/main.js",
@@ -20,7 +20,7 @@
20
20
  "@babel/plugin-transform-object-assign": "^7.12.1",
21
21
  "@babel/preset-env": "^7.24.8",
22
22
  "@babel/preset-typescript": "^7.24.7",
23
- "@galacean/engine": "1.3.0-alpha.0",
23
+ "@galacean/engine": "^1.3.0-alpha.3",
24
24
  "@galacean/engine-toolkit": "beta",
25
25
  "@rollup/plugin-babel": "^5.2.1",
26
26
  "@rollup/plugin-commonjs": "^16.0.0",
@@ -1,6 +1,9 @@
1
1
  import { Skeleton, SkeletonData, AnimationState, AnimationStateData } from "@esotericsoftware/spine-core";
2
2
  import { Buffer, Renderer, Entity, Material, Engine, BoundingBox, Primitive, SubPrimitive } from "@galacean/engine";
3
3
  import { SkeletonDataResource } from "./loader/SkeletonDataResource";
4
+ /**
5
+ * Spine animation renderer, capable of rendering spine animations and providing functions for animation and skeleton manipulation.
6
+ */
4
7
  export declare class SpineAnimationRenderer extends Renderer {
5
8
  private static _defaultMaterial;
6
9
  private static _spineGenerator;
@@ -42,9 +45,9 @@ export declare class SpineAnimationRenderer extends Renderer {
42
45
  private _skeleton;
43
46
  private _state;
44
47
  /**
45
- * Setting `skeletonData` initializes a new Spine animation with the provided data.
46
- * This property allows you to switch between different animations at runtime.
48
+ * Spine resource of current spine animation.This property allows you to switch between different animations at runtime.
47
49
  */
50
+ get resource(): SkeletonDataResource;
48
51
  set resource(value: SkeletonDataResource);
49
52
  /**
50
53
  * Provides access to `AnimationState` which controls animation playback on a skeleton.
@@ -57,6 +60,9 @@ export declare class SpineAnimationRenderer extends Renderer {
57
60
  * and change spine attachment to customize character appearances dynamically during runtime.
58
61
  */
59
62
  get skeleton(): Skeleton;
63
+ /**
64
+ * @internal
65
+ */
60
66
  constructor(entity: Entity);
61
67
  /**
62
68
  * Separate slot by slot name. This will add a new sub primitive, and new materials.
@@ -142,25 +148,23 @@ export declare enum RendererUpdateFlags {
142
148
  */
143
149
  export declare class SpineRenderSetting {
144
150
  /**
145
- * The spacing between z layers.
151
+ * The spacing between z layers @defaultValue `0.01`
146
152
  */
147
153
  zSpacing: number;
148
154
  /**
149
- * Whether to use clipping.
155
+ * Whether to use clipping @defaultValue `true`
150
156
  */
151
157
  useClipping: boolean;
152
158
  /**
153
159
  * Creates an instance of SpineRenderSetting.
154
- * @param {number} [zSpacing=0.01] - The spacing between z layers.
155
- * @param {boolean} [useClipping=true] - Whether to use clipping.
156
160
  */
157
161
  constructor(
158
162
  /**
159
- * The spacing between z layers.
163
+ * The spacing between z layers @defaultValue `0.01`
160
164
  */
161
165
  zSpacing?: number,
162
166
  /**
163
- * Whether to use clipping.
167
+ * Whether to use clipping @defaultValue `true`
164
168
  */
165
169
  useClipping?: boolean);
166
170
  }
@@ -171,43 +175,39 @@ export declare class SpineRenderSetting {
171
175
  */
172
176
  export declare class DefaultState {
173
177
  /**
174
- * The default scale of the animation.
178
+ * The default scale of the animation @defaultValue `1`
175
179
  */
176
180
  scale: number;
177
181
  /**
178
- * Whether the default animation should loop.
182
+ * Whether the default animation should loop @defaultValue `true. The default animation should loop`
179
183
  */
180
184
  loop: boolean;
181
185
  /**
182
- * The name of the default animation.
186
+ * The name of the default animation @defaultValue `null. Do not play any animation by default`
183
187
  */
184
188
  animationName: string | null;
185
189
  /**
186
- * The name of the default skin.
190
+ * The name of the default skin @defaultValue `default`
187
191
  */
188
192
  skinName: string;
189
193
  /**
190
- * Creates an instance of DefaultState.
191
- * @param {number} [scale=1] - The default scale of the animation.
192
- * @param {boolean} [loop=false] - Whether the default animation should loop.
193
- * @param {string | null} [animationName=null] - The name of the default animation.
194
- * @param {string} [skinName="default"] - The name of the default skin.
194
+ * Creates an instance of DefaultState
195
195
  */
196
196
  constructor(
197
197
  /**
198
- * The default scale of the animation.
198
+ * The default scale of the animation @defaultValue `1`
199
199
  */
200
200
  scale?: number,
201
201
  /**
202
- * Whether the default animation should loop.
202
+ * Whether the default animation should loop @defaultValue `true. The default animation should loop`
203
203
  */
204
204
  loop?: boolean,
205
205
  /**
206
- * The name of the default animation.
206
+ * The name of the default animation @defaultValue `null. Do not play any animation by default`
207
207
  */
208
208
  animationName?: string | null,
209
209
  /**
210
- * The name of the default skin.
210
+ * The name of the default skin @defaultValue `default`
211
211
  */
212
212
  skinName?: string);
213
213
  }
@@ -1,6 +1,6 @@
1
1
  import { Texture2D, SubPrimitive, BoundingBox } from "@galacean/engine";
2
2
  import { Skeleton, Color, BlendMode, SkeletonData } from "@esotericsoftware/spine-core";
3
- import { SpineAnimation } from "./SpineAnimation";
3
+ import { SpineAnimationRenderer } from "./SpineAnimationRenderer";
4
4
  import { AdaptiveTexture } from "./loader/LoaderUtils";
5
5
  import { ReturnablePool } from "./util/ReturnablePool";
6
6
  import { ClearablePool } from "./util/ClearablePool";
@@ -27,11 +27,11 @@ export declare class SpineGenerator {
27
27
  private _separateSlots;
28
28
  private _separateSlotTextureMap;
29
29
  getMaxVertexCount(skeletonData: SkeletonData): number;
30
- buildPrimitive(skeleton: Skeleton, renderer: SpineAnimation): void;
30
+ buildPrimitive(skeleton: Skeleton, renderer: SpineAnimationRenderer): void;
31
31
  addSeparateSlot(slotName: string): void;
32
32
  addSeparateSlotTexture(slotName: string, texture: Texture2D): void;
33
- private createMaterialForTexture;
34
- private expandByPoint;
35
- private getSkinVertexCount;
33
+ private _createMaterialForTexture;
34
+ private _expandByPoint;
35
+ private _getSkinVertexCount;
36
36
  }
37
37
  export {};
package/types/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import "./loader/SpineLoader";
2
2
  import "./loader/EditorSpineAtlasLoader";
3
- export { SpineAnimation } from "./SpineAnimation";
3
+ export { SpineAnimationRenderer } from "./SpineAnimationRenderer";
4
4
  export { SkeletonDataResource } from "./loader/SkeletonDataResource";
5
5
  export { createTextureAtlas } from "./loader/LoaderUtils";
6
6
  export * from "@esotericsoftware/spine-core";
@@ -24,6 +24,6 @@ export declare class SpineLoader extends Loader<SkeletonDataResource> {
24
24
  load(item: SpineLoadItem, resourceManager: ResourceManager): AssetPromise<SkeletonDataResource>;
25
25
  private _handleEditorAsset;
26
26
  private _handleOriginAsset;
27
- private determineSkeletonDataType;
27
+ private _determineSkeletonDataType;
28
28
  }
29
29
  export {};
@@ -1,147 +0,0 @@
1
- import { Skeleton, SkeletonData, AnimationState, AnimationStateData } from "@esotericsoftware/spine-core";
2
- import { Buffer, Renderer, Entity, Material, Engine, BoundingBox, Primitive, SubPrimitive } from "@galacean/engine";
3
- import { SkeletonDataResource } from "./loader/SkeletonDataResource";
4
- interface DefaultState {
5
- animationName: string;
6
- skinName: string;
7
- loop: boolean;
8
- scale: number;
9
- }
10
- export type SpineRenderSetting = {
11
- useClipping: boolean;
12
- zSpacing: number;
13
- };
14
- export declare class SpineAnimation extends Renderer {
15
- private static _defaultMaterial;
16
- private static _spineGenerator;
17
- private static positionVertexElement;
18
- private static colorVertexElement;
19
- private static uvVertexElement;
20
- static materialCache: Map<string, Material>;
21
- static animationDataCache: Map<SkeletonData, AnimationStateData>;
22
- static getDefaultMaterial(engine: Engine): Material;
23
- /** Render setting for spine rendering. */
24
- setting: SpineRenderSetting;
25
- /** Initial spine animation and skin state. */
26
- defaultState: DefaultState;
27
- /** @internal */
28
- _primitive: Primitive;
29
- /** @internal */
30
- _subPrimitives: SubPrimitive[];
31
- /** @internal */
32
- _indexBuffer: Buffer;
33
- /** @internal */
34
- _vertexBuffer: Buffer;
35
- /** @internal */
36
- _vertices: Float32Array;
37
- /** @internal */
38
- _indices: Uint16Array;
39
- /** @internal */
40
- _needResizeBuffer: boolean;
41
- /** @internal */
42
- _vertexCount: number;
43
- /** @internal */
44
- _resource: SkeletonDataResource;
45
- private _skeleton;
46
- private _state;
47
- /**
48
- * Setting `skeletonData` initializes a new Spine animation with the provided data.
49
- * This property allows you to switch between different animations at runtime.
50
- */
51
- set resource(value: SkeletonDataResource);
52
- /**
53
- * Provides access to `AnimationState` which controls animation playback on a skeleton.
54
- * You can use its API to manage, blend, and transition between multiple simultaneous animations effectively.
55
- */
56
- get state(): AnimationState;
57
- /**
58
- * Provides access to `Skeleton`, which defines the structure of a Spine model.
59
- * Through its API, users can manipulate bone positions, rotations, scaling
60
- * and change spine attachment to customize character appearances dynamically during runtime.
61
- */
62
- get skeleton(): Skeleton;
63
- /**
64
- * @internal
65
- */
66
- get engine(): Engine;
67
- constructor(entity: Entity);
68
- /**
69
- * @internal
70
- */
71
- _onEnable(): void;
72
- /**
73
- * Separate slot by slot name. This will add a new sub primitive, and new materials.
74
- */
75
- addSeparateSlot(slotName: string): void;
76
- /**
77
- * @internal
78
- */
79
- update(delta: number): void;
80
- /**
81
- * @internal
82
- */
83
- _render(context: any): void;
84
- /**
85
- * @internal
86
- */
87
- _updateBounds(worldBounds: BoundingBox): void;
88
- /**
89
- * @internal
90
- */
91
- _calculateGeneratorBounds(worldBounds: BoundingBox): void;
92
- /**
93
- * @internal
94
- */
95
- _cloneTo(target: SpineAnimation): void;
96
- /**
97
- * @internal
98
- */
99
- _onDestroy(): void;
100
- /**
101
- * @internal
102
- */
103
- _createBuffer(vertexCount: number): void;
104
- /**
105
- * @internal
106
- */
107
- _addSubPrimitive(subPrimitive: SubPrimitive): void;
108
- /**
109
- * @internal
110
- */
111
- _clearSubPrimitives(): void;
112
- /**
113
- * @internal
114
- */
115
- _isContainDirtyFlag(type: number): boolean;
116
- /**
117
- * @internal
118
- */
119
- _setDirtyFlagFalse(type: number): void;
120
- /**
121
- * @internal
122
- */
123
- _onWorldVolumeChanged(): void;
124
- private onAnimationStart;
125
- private onAnimationComplete;
126
- private _clearMaterialCache;
127
- private _initializeDefaultState;
128
- }
129
- /**
130
- * @internal
131
- */
132
- export declare enum SpineAnimationUpdateFlags {
133
- /** On World Transform Changed */
134
- TransformVolume = 1,
135
- /** On Animation start play */
136
- AnimationVolume = 2,
137
- /** On skeleton data asset changed */
138
- InitialVolume = 4
139
- }
140
- /**
141
- * @internal
142
- */
143
- export declare enum RendererUpdateFlags {
144
- /** Include world position and world bounds. */
145
- WorldVolume = 1
146
- }
147
- export {};
@@ -1,43 +0,0 @@
1
- import { Engine, SubMesh, Texture2D } from "@galacean/engine";
2
- import { Skeleton, SkeletonData, Color, BlendMode } from "@esotericsoftware/spine-core";
3
- import { SpineRenderSetting } from "../types";
4
- import { AdaptiveTexture } from "../loader/LoaderUtils";
5
- import { SpineAnimation } from "../SpineAnimation";
6
- type SubMeshItem = {
7
- subMesh: SubMesh;
8
- blendMode: BlendMode;
9
- texture: any;
10
- slotName?: string;
11
- };
12
- export declare class MeshGenerator {
13
- static QUAD_TRIANGLES: number[];
14
- static VERTEX_SIZE: number;
15
- static VERTEX_STRIDE: number;
16
- static tempColor: Color;
17
- static tempDark: Color;
18
- static tempBlendMode: BlendMode | null;
19
- static tempTexture: AdaptiveTexture | null;
20
- private _setting;
21
- private _engine;
22
- private _clipper;
23
- private _spineMesh;
24
- private _renderer;
25
- private _vertexCount;
26
- private _vertices;
27
- private _verticesWithZ;
28
- private _indices;
29
- private _needResize;
30
- private _subMeshItems;
31
- readonly separateSlots: string[];
32
- readonly separateSlotTextureMap: Map<string, Texture2D>;
33
- get mesh(): import("@galacean/engine").BufferMesh;
34
- get subMeshItems(): SubMeshItem[];
35
- constructor(engine: Engine, renderer: SpineAnimation);
36
- initialize(skeletonData: SkeletonData, setting?: SpineRenderSetting): void;
37
- buildMesh(skeleton: Skeleton): void;
38
- addSeparateSlot(slotName: string): void;
39
- addSeparateSlotTexture(slotName: string, texture: Texture2D): void;
40
- private _prepareBufferData;
41
- private setBlendMode;
42
- }
43
- export {};
@@ -1,42 +0,0 @@
1
- import { Engine, Texture2D, SubPrimitive } from "@galacean/engine";
2
- import { Skeleton, SkeletonData, Color, BlendMode } from "@esotericsoftware/spine-core";
3
- import { SpineRenderSetting } from "../types";
4
- import { AdaptiveTexture } from "../loader/LoaderUtils";
5
- import { SpineAnimation } from "../SpineAnimation";
6
- type subRenderItems = {
7
- subPrimitive: SubPrimitive;
8
- blendMode: BlendMode;
9
- texture: any;
10
- slotName?: string;
11
- };
12
- export declare class SpineGenerator {
13
- static QUAD_TRIANGLES: number[];
14
- static VERTEX_SIZE: number;
15
- static VERTEX_STRIDE: number;
16
- static tempColor: Color;
17
- static tempDark: Color;
18
- static tempBlendMode: BlendMode | null;
19
- static tempTexture: AdaptiveTexture | null;
20
- private _setting;
21
- private _engine;
22
- private _clipper;
23
- private _spinePrimitive;
24
- private _renderer;
25
- private _vertexCount;
26
- private _vertices;
27
- private _verticesWithZ;
28
- private _indices;
29
- private _needResize;
30
- private _subRenderItems;
31
- readonly separateSlots: string[];
32
- readonly separateSlotTextureMap: Map<string, Texture2D>;
33
- get subRenderItems(): subRenderItems[];
34
- constructor(engine: Engine, renderer: SpineAnimation);
35
- initialize(skeletonData: SkeletonData, setting?: SpineRenderSetting): void;
36
- buildPrimitive(skeleton: Skeleton): void;
37
- addSeparateSlot(slotName: string): void;
38
- addSeparateSlotTexture(slotName: string, texture: Texture2D): void;
39
- private _prepareBufferData;
40
- private setBlendMode;
41
- }
42
- export {};
@@ -1,11 +0,0 @@
1
- import { BufferMesh, Engine, Buffer } from '@galacean/engine';
2
- export declare class SpineMesh {
3
- private _mesh;
4
- private _indexBuffer;
5
- private _vertexBuffer;
6
- get mesh(): BufferMesh;
7
- get indexBuffer(): Buffer;
8
- get vertexBuffer(): Buffer;
9
- initialize(engine: Engine, vertexCount: number): void;
10
- changeBuffer(engine: Engine, vertexCount: number): void;
11
- }
@@ -1,15 +0,0 @@
1
- import { Engine, Buffer, SubPrimitive } from '@galacean/engine';
2
- export declare class SpinePrimitive {
3
- private _primitive;
4
- private _subPrimitive;
5
- private _indexBuffer;
6
- private _vertexBuffer;
7
- get primitive(): Primitive;
8
- get subPrimitive(): SubPrimitive[];
9
- get indexBuffer(): Buffer;
10
- get vertexBuffer(): Buffer;
11
- initialize(engine: Engine, vertexCount: number): void;
12
- addSubPrimitive(subPrimitive: SubPrimitive): void;
13
- clearSubPrimitive(): void;
14
- changeBuffer(engine: Engine, vertexCount: number): void;
15
- }
@@ -1,2 +0,0 @@
1
- declare const _default: Cypress.ConfigOptions<any>;
2
- export default _default;
@@ -1,3 +0,0 @@
1
- import { Camera, Engine } from "@galacean/engine-core";
2
- export declare const updateForE2E: (engine: any, deltaTime?: number, loopTime?: number) => void;
3
- export declare function initScreenshot(engine: Engine, camera: Camera, width?: number, height?: number, flipY?: boolean, isPNG?: boolean, jpgQuality?: number): void;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,19 +0,0 @@
1
- export declare const E2E_CONFIG: {
2
- Spine: {
3
- 'spine-boy': {
4
- category: string;
5
- caseFileName: string;
6
- threshold: number;
7
- };
8
- raptor: {
9
- category: string;
10
- caseFileName: string;
11
- threshold: number;
12
- };
13
- 'mix-and-match': {
14
- category: string;
15
- caseFileName: string;
16
- threshold: number;
17
- };
18
- };
19
- };
@@ -1,8 +0,0 @@
1
- declare global {
2
- namespace Cypress {
3
- interface Chainable {
4
- screenshotWithThreshold(category: string, name: string, threshold?: number): Chainable<Element>;
5
- }
6
- }
7
- }
8
- export {};
@@ -1 +0,0 @@
1
- import "./commands";
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,11 +0,0 @@
1
- import { Entity, MeshRenderer, Camera } from '@galacean/engine';
2
- export default class BoundingBoxLine extends MeshRenderer {
3
- private attachedEntity;
4
- private renderers;
5
- private boundingBox;
6
- constructor(entity: Entity);
7
- updateBoundingBox(): void;
8
- attachToEntity(entity: Entity): void;
9
- private updateVertices;
10
- _render(camera: Camera): void;
11
- }
@@ -1,5 +0,0 @@
1
- declare class MockImage {
2
- onload: () => void;
3
- onerror: () => void;
4
- set src(_url: string);
5
- }
@@ -1,9 +0,0 @@
1
- export declare class BufferReader {
2
- data: Uint8Array;
3
- private _dataView;
4
- private _position;
5
- constructor(data: Uint8Array, byteOffset?: number, byteLength?: number);
6
- nextUint16(): number;
7
- nextStr(): string;
8
- nextImageData(): Uint8Array;
9
- }
@@ -1,6 +0,0 @@
1
- import { AssetPromise, Loader, LoadItem, ResourceManager } from "@galacean/engine";
2
- import { SkeletonDataResource } from "./SkeletonDataResource";
3
- declare class EditorSkeletonDataLoader extends Loader<SkeletonDataResource> {
4
- load(item: LoadItem, resourceManager: ResourceManager): AssetPromise<SkeletonDataResource>;
5
- }
6
- export { EditorSkeletonDataLoader };
@@ -1,37 +0,0 @@
1
- import { Texture2D, SubPrimitive, BoundingBox } from "@galacean/engine";
2
- import { Skeleton, Color, BlendMode, SkeletonData } from "@esotericsoftware/spine-core";
3
- import { SpineAnimationRenderer } from "./SpineAnimationRenderer";
4
- import { AdaptiveTexture } from "./loader/LoaderUtils";
5
- import { ReturnablePool } from "./util/ReturnablePool";
6
- import { ClearablePool } from "./util/ClearablePool";
7
- declare class SubRenderItem {
8
- subPrimitive: SubPrimitive;
9
- blendMode: BlendMode;
10
- texture: any;
11
- slotName?: string;
12
- }
13
- export declare class SpineGenerator {
14
- static QUAD_TRIANGLES: number[];
15
- static VERTEX_SIZE: number;
16
- static VERTEX_STRIDE: number;
17
- static tempDark: Color;
18
- static tempColor: Color;
19
- static tempVerts: any[];
20
- static tempBlendMode: BlendMode | null;
21
- static tempTexture: AdaptiveTexture | null;
22
- static subPrimitivePool: ReturnablePool<SubPrimitive>;
23
- static subRenderItemPool: ClearablePool<SubRenderItem>;
24
- static bounds: BoundingBox;
25
- private _clipper;
26
- private _subRenderItems;
27
- private _separateSlots;
28
- private _separateSlotTextureMap;
29
- getMaxVertexCount(skeletonData: SkeletonData): number;
30
- buildPrimitive(skeleton: Skeleton, renderer: SpineAnimationRenderer): void;
31
- addSeparateSlot(slotName: string): void;
32
- addSeparateSlotTexture(slotName: string, texture: Texture2D): void;
33
- private _createMaterialForTexture;
34
- private _expandByPoint;
35
- private _getSkinVertexCount;
36
- }
37
- export {};
@@ -1,6 +0,0 @@
1
- import { Engine, Material } from "@galacean/engine";
2
- export declare class SpineMaterial extends Material {
3
- private static _spineVS;
4
- private static _spineFS;
5
- constructor(engine: Engine);
6
- }
@@ -1,7 +0,0 @@
1
- import "./loader/SpineLoader";
2
- import "./loader/EditorSpineAtlasLoader";
3
- export { SpineAnimationRenderer } from "./SpineAnimationRenderer";
4
- export { SkeletonDataResource } from "./loader/SkeletonDataResource";
5
- export { createTextureAtlas } from "./loader/LoaderUtils";
6
- export * from "@esotericsoftware/spine-core";
7
- export declare const version = "__buildVersion";
@@ -1,6 +0,0 @@
1
- import { AssetPromise, Loader, ResourceManager, LoadItem } from "@galacean/engine";
2
- import { TextureAtlas } from "@esotericsoftware/spine-core";
3
- declare class EditorSpineAtlasLoader extends Loader<TextureAtlas> {
4
- load(item: LoadItem, resourceManager: ResourceManager): AssetPromise<TextureAtlas>;
5
- }
6
- export { EditorSpineAtlasLoader };
@@ -1,18 +0,0 @@
1
- import { AssetPromise, Engine, Texture2D } from "@galacean/engine";
2
- import { TextureAtlas, SkeletonData, Texture, TextureFilter, TextureWrap } from "@esotericsoftware/spine-core";
3
- export declare function createSkeletonData(textureAtlas: TextureAtlas, skeletonTextData: string | ArrayBuffer, skeletonFileType: 'json' | 'skel'): SkeletonData;
4
- export declare function loadTexturesByPath(imagePaths: string[], imageExtensions: string[], engine: Engine): Promise<Texture2D[]>;
5
- export declare function loadTextureAtlas(atlasPath: string, engine: Engine): Promise<TextureAtlas>;
6
- export declare function createTextureAtlas(atlasText: string, textures: Texture2D[]): TextureAtlas;
7
- export declare function loadTexture(url: string, engine: Engine, imageLoaderType?: string): AssetPromise<Texture2D>;
8
- export declare function createAdaptiveTexture(texture: Texture2D): AdaptiveTexture;
9
- export declare function getBaseUrl(url: string): string;
10
- export declare class AdaptiveTexture extends Texture {
11
- texture: Texture2D;
12
- constructor(image: HTMLImageElement | ImageBitmap, texture: Texture2D);
13
- getImage(): any;
14
- setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void;
15
- setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void;
16
- dispose(): void;
17
- private _convertWrapMode;
18
- }
@@ -1,12 +0,0 @@
1
- import { SkeletonData } from "@esotericsoftware/spine-core";
2
- import { Engine, ReferResource, Texture2D } from "@galacean/engine";
3
- export declare class SkeletonDataResource extends ReferResource {
4
- readonly textures: Texture2D[];
5
- private _skeletonData;
6
- get skeletonData(): SkeletonData;
7
- constructor(engine: Engine, skeletonData: SkeletonData);
8
- protected _onDestroy(): void;
9
- private _disassociationSuperResource;
10
- private _associationTextureInSkeletonData;
11
- private _clearAttachmentTextures;
12
- }
@@ -1,29 +0,0 @@
1
- import { AssetPromise, Loader, LoadItem, ResourceManager } from "@galacean/engine";
2
- import { SkeletonDataResource } from "./SkeletonDataResource";
3
- export type SpineAssetBundle = {
4
- skeletonPath: string;
5
- skeletonExtension: string;
6
- skeletonTextData?: string | ArrayBuffer;
7
- atlasPath: string;
8
- imagePaths: string[];
9
- imageExtensions: string[];
10
- };
11
- type SpineLoaderParams = {
12
- fileExtensions?: string | string[];
13
- };
14
- type SpineLoadItem = LoadItem & {
15
- params?: SpineLoaderParams;
16
- };
17
- export declare class SpineLoader extends Loader<SkeletonDataResource> {
18
- static imageExtensions: string[];
19
- static skeletonExtensions: string[];
20
- static parseAndAssignSpineAsset(url: string, fileExtension: string | null, bundle: SpineAssetBundle): void;
21
- static deriveAndAssignSpineAsset(url: string, fileExtension: string | null, bundle: SpineAssetBundle): void;
22
- static verifyFileExtensions(fileExtensions: string | string[], expectArray: boolean): string | string[] | null;
23
- static getUrlExtension(url: string, fileExtension: string): string | null;
24
- load(item: SpineLoadItem, resourceManager: ResourceManager): AssetPromise<SkeletonDataResource>;
25
- private _handleEditorAsset;
26
- private _handleOriginAsset;
27
- private _determineSkeletonDataType;
28
- }
29
- export {};