@galacean/engine-spine 0.0.0-experimental-2024071602 → 0.0.0-experimental-2024071901
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 +8 -6
- 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 +15 -5
- package/types/cypress.config.d.ts +2 -0
- package/types/e2e/case/.mockForE2E.d.ts +3 -0
- package/types/e2e/case/mix-and-match.d.ts +1 -0
- package/types/e2e/case/raptor.d.ts +1 -0
- package/types/e2e/case/spine-boy.d.ts +1 -0
- package/types/e2e/config.d.ts +19 -0
- package/types/e2e/support/commands.d.ts +8 -0
- package/types/e2e/support/e2e.d.ts +1 -0
- package/types/e2e/tests/index.cy.d.ts +1 -0
- package/types/example/main.d.ts +1 -0
- package/types/example/outline.d.ts +11 -0
- package/types/jest.setup.d.ts +5 -0
- package/types/src/SpineAnimationRenderer.d.ts +213 -0
- package/types/src/SpineGenerator.d.ts +37 -0
- package/types/src/SpineMaterial.d.ts +6 -0
- package/types/src/index.d.ts +7 -0
- package/types/src/loader/EditorSpineAtlasLoader.d.ts +6 -0
- package/types/src/loader/LoaderUtils.d.ts +18 -0
- package/types/src/loader/SkeletonDataResource.d.ts +12 -0
- package/types/src/loader/SpineLoader.d.ts +29 -0
- package/types/src/util/BlendMode.d.ts +4 -0
- package/types/src/util/BufferReader.d.ts +10 -0
- package/types/src/util/ClearablePool.d.ts +8 -0
- package/types/src/util/ReturnablePool.d.ts +8 -0
- package/types/tests/SpineAnimation.test.d.ts +1 -0
- package/types/tests/SpineGenerator.test.d.ts +1 -0
- package/types/tests/SpineMaterial.test.d.ts +1 -0
- package/types/tests/loader/EditorSpineAtlasLoader.test.d.ts +1 -0
- package/types/tests/loader/SkeletonDataResource.test.d.ts +1 -0
- package/types/tests/loader/SpineLoader.test.d.ts +1 -0
- package/types/tests/loader/loaderUtil.test.d.ts +0 -0
- package/types/tests/testUtils.d.ts +3 -0
- package/types/tests/util/BlendMode.test.d.ts +1 -0
- package/types/tests/util/BufferReader.test.d.ts +1 -0
- package/types/tests/util/ClearablePool.test.d.ts +1 -0
- package/types/tests/util/ReturnablePool.test.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.0.0-experimental-
|
|
2
|
+
"version": "0.0.0-experimental-2024071901",
|
|
3
3
|
"description": "galacean spine runtime",
|
|
4
4
|
"name": "@galacean/engine-spine",
|
|
5
5
|
"main": "dist/main.js",
|
|
@@ -36,15 +36,17 @@
|
|
|
36
36
|
"@vitejs/plugin-basic-ssl": "^1.1.0",
|
|
37
37
|
"babel-core": "^6.26.3",
|
|
38
38
|
"babel-jest": "^29.7.0",
|
|
39
|
-
"canvas": "^2.11.2",
|
|
40
39
|
"chai": "^4.3.6",
|
|
41
40
|
"chai-spies": "^1.0.0",
|
|
42
41
|
"cross-env": "^5.2.1",
|
|
43
42
|
"cypress": "^13.13.0",
|
|
43
|
+
"cypress-recurse": "^1.35.3",
|
|
44
44
|
"dat.gui": "^0.7.9",
|
|
45
|
-
"electron": "^12.0.0",
|
|
46
45
|
"jest": "^29.7.0",
|
|
47
46
|
"jest-environment-jsdom": "^29.7.0",
|
|
47
|
+
"jest-webgl-canvas-mock": "^2.5.3",
|
|
48
|
+
"nock": "^13.5.4",
|
|
49
|
+
"odiff-bin": "^3.0.1",
|
|
48
50
|
"react": "^16.14.0",
|
|
49
51
|
"react-dom": "^16.14.0",
|
|
50
52
|
"regenerator-runtime": "^0.14.1",
|
|
@@ -55,12 +57,13 @@
|
|
|
55
57
|
"rollup-plugin-swc3": "^0.8.0",
|
|
56
58
|
"rollup-plugin-terser": "^7.0.2",
|
|
57
59
|
"rollup-plugin-version-injector": "^1.3.3",
|
|
60
|
+
"sass": "^1.77.8",
|
|
58
61
|
"sinon": "^18.0.0",
|
|
59
62
|
"ts-jest": "^29.2.2",
|
|
60
63
|
"ts-node": "^10.9.2",
|
|
61
64
|
"tsconfig-paths": "^4.2.0",
|
|
62
65
|
"typescript": "^5.5.3",
|
|
63
|
-
"vite": "^
|
|
66
|
+
"vite": "^5.3.4"
|
|
64
67
|
},
|
|
65
68
|
"ci": {
|
|
66
69
|
"type": "aci",
|
|
@@ -74,7 +77,7 @@
|
|
|
74
77
|
"runner": "jest-runner",
|
|
75
78
|
"testEnvironment": "jsdom",
|
|
76
79
|
"testEnvironmentOptions": {
|
|
77
|
-
"url": "https://
|
|
80
|
+
"url": "https://mdn.alipayobjects.com/",
|
|
78
81
|
"userAgent": "Agent/007"
|
|
79
82
|
},
|
|
80
83
|
"preset": "ts-jest",
|
|
@@ -89,6 +92,10 @@
|
|
|
89
92
|
},
|
|
90
93
|
"transformIgnorePatterns": [
|
|
91
94
|
"node_modules/(?!(.*@esotericsoftware/spine-core.*))"
|
|
95
|
+
],
|
|
96
|
+
"setupFilesAfterEnv": [
|
|
97
|
+
"./jest.setup.ts",
|
|
98
|
+
"jest-webgl-canvas-mock"
|
|
92
99
|
]
|
|
93
100
|
},
|
|
94
101
|
"scripts": {
|
|
@@ -96,6 +103,9 @@
|
|
|
96
103
|
"test": "jest",
|
|
97
104
|
"test:cov": "jest --coverage",
|
|
98
105
|
"test:debug": "cross-env DEBUG_MODE=1 jest",
|
|
106
|
+
"e2e:case": "vite serve ./e2e/.dev --config ./e2e/.dev/vite.config.js",
|
|
107
|
+
"e2e": "cypress run --browser chrome --headless",
|
|
108
|
+
"e2e:debug": "cypress open",
|
|
99
109
|
"dev": "rollup -cw",
|
|
100
110
|
"build": "npm run b:types && cross-env BUILD_TYPE=ALL rollup -c",
|
|
101
111
|
"build:watch": "npm run b:types && cross-env BUILD_TYPE=ALL rollup -c --watch",
|
|
@@ -0,0 +1,3 @@
|
|
|
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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./commands";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,213 @@
|
|
|
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
|
+
/**
|
|
5
|
+
* Spine animation renderer, capable of rendering spine animations and providing functions for animation and skeleton manipulation.
|
|
6
|
+
*/
|
|
7
|
+
export declare class SpineAnimationRenderer extends Renderer {
|
|
8
|
+
private static _defaultMaterial;
|
|
9
|
+
private static _spineGenerator;
|
|
10
|
+
private static _positionVertexElement;
|
|
11
|
+
private static _colorVertexElement;
|
|
12
|
+
private static _uvVertexElement;
|
|
13
|
+
/** @internal */
|
|
14
|
+
static _materialCache: Map<string, Material>;
|
|
15
|
+
/** @internal */
|
|
16
|
+
static _animationDataCache: Map<SkeletonData, AnimationStateData>;
|
|
17
|
+
/** @internal */
|
|
18
|
+
static _getDefaultMaterial(engine: Engine): Material;
|
|
19
|
+
/** Render setting for spine rendering. */
|
|
20
|
+
setting: SpineRenderSetting;
|
|
21
|
+
/**
|
|
22
|
+
* Default state for spine animation.
|
|
23
|
+
* Contains the default animation name to be played, whether this animation should loop,
|
|
24
|
+
* the default skin name, and the default scale of the skeleton.
|
|
25
|
+
*/
|
|
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
|
+
* Spine resource of current spine animation.This property allows you to switch between different animations at runtime.
|
|
49
|
+
*/
|
|
50
|
+
get resource(): SkeletonDataResource;
|
|
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
|
+
constructor(entity: Entity);
|
|
67
|
+
/**
|
|
68
|
+
* Separate slot by slot name. This will add a new sub primitive, and new materials.
|
|
69
|
+
*/
|
|
70
|
+
addSeparateSlot(slotName: string): void;
|
|
71
|
+
/**
|
|
72
|
+
* @internal
|
|
73
|
+
*/
|
|
74
|
+
_onEnable(): void;
|
|
75
|
+
/**
|
|
76
|
+
* @internal
|
|
77
|
+
*/
|
|
78
|
+
update(delta: number): void;
|
|
79
|
+
/**
|
|
80
|
+
* @internal
|
|
81
|
+
*/
|
|
82
|
+
_render(context: any): void;
|
|
83
|
+
/**
|
|
84
|
+
* @internal
|
|
85
|
+
*/
|
|
86
|
+
_updateBounds(worldBounds: BoundingBox): void;
|
|
87
|
+
/**
|
|
88
|
+
* @internal
|
|
89
|
+
*/
|
|
90
|
+
_calculateGeneratorBounds(worldBounds: BoundingBox): void;
|
|
91
|
+
/**
|
|
92
|
+
* @internal
|
|
93
|
+
*/
|
|
94
|
+
_cloneTo(target: SpineAnimationRenderer): void;
|
|
95
|
+
/**
|
|
96
|
+
* @internal
|
|
97
|
+
*/
|
|
98
|
+
_onDestroy(): void;
|
|
99
|
+
/**
|
|
100
|
+
* @internal
|
|
101
|
+
*/
|
|
102
|
+
_createBuffer(vertexCount: number): void;
|
|
103
|
+
/**
|
|
104
|
+
* @internal
|
|
105
|
+
*/
|
|
106
|
+
_addSubPrimitive(subPrimitive: SubPrimitive): void;
|
|
107
|
+
/**
|
|
108
|
+
* @internal
|
|
109
|
+
*/
|
|
110
|
+
_clearSubPrimitives(): void;
|
|
111
|
+
/**
|
|
112
|
+
* @internal
|
|
113
|
+
*/
|
|
114
|
+
_isContainDirtyFlag(type: number): boolean;
|
|
115
|
+
/**
|
|
116
|
+
* @internal
|
|
117
|
+
*/
|
|
118
|
+
_setDirtyFlagFalse(type: number): void;
|
|
119
|
+
/**
|
|
120
|
+
* @internal
|
|
121
|
+
*/
|
|
122
|
+
_onWorldVolumeChanged(): void;
|
|
123
|
+
private _onAnimationStart;
|
|
124
|
+
private _onAnimationComplete;
|
|
125
|
+
private _clearMaterialCache;
|
|
126
|
+
private _initializeDefaultState;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* @internal
|
|
130
|
+
*/
|
|
131
|
+
export declare enum SpineAnimationUpdateFlags {
|
|
132
|
+
/** On World Transform Changed */
|
|
133
|
+
TransformVolume = 1,
|
|
134
|
+
/** On Animation start play */
|
|
135
|
+
AnimationVolume = 2,
|
|
136
|
+
/** On skeleton data asset changed */
|
|
137
|
+
InitialVolume = 4
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* @internal
|
|
141
|
+
*/
|
|
142
|
+
export declare enum RendererUpdateFlags {
|
|
143
|
+
/** Include world position and world bounds. */
|
|
144
|
+
WorldVolume = 1
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Render setting for spine rendering.
|
|
148
|
+
*/
|
|
149
|
+
export declare class SpineRenderSetting {
|
|
150
|
+
/**
|
|
151
|
+
* The spacing between z layers @defaultValue `0.01`
|
|
152
|
+
*/
|
|
153
|
+
zSpacing: number;
|
|
154
|
+
/**
|
|
155
|
+
* Whether to use clipping @defaultValue `true`
|
|
156
|
+
*/
|
|
157
|
+
useClipping: boolean;
|
|
158
|
+
/**
|
|
159
|
+
* Creates an instance of SpineRenderSetting.
|
|
160
|
+
*/
|
|
161
|
+
constructor(
|
|
162
|
+
/**
|
|
163
|
+
* The spacing between z layers @defaultValue `0.01`
|
|
164
|
+
*/
|
|
165
|
+
zSpacing?: number,
|
|
166
|
+
/**
|
|
167
|
+
* Whether to use clipping @defaultValue `true`
|
|
168
|
+
*/
|
|
169
|
+
useClipping?: boolean);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Default state for spine animation.
|
|
173
|
+
* Contains the default animation name to be played, whether this animation should loop,
|
|
174
|
+
* the default skin name, and the default scale of the skeleton.
|
|
175
|
+
*/
|
|
176
|
+
export declare class DefaultState {
|
|
177
|
+
/**
|
|
178
|
+
* The default scale of the animation @defaultValue `1`
|
|
179
|
+
*/
|
|
180
|
+
scale: number;
|
|
181
|
+
/**
|
|
182
|
+
* Whether the default animation should loop @defaultValue `true. The default animation should loop`
|
|
183
|
+
*/
|
|
184
|
+
loop: boolean;
|
|
185
|
+
/**
|
|
186
|
+
* The name of the default animation @defaultValue `null. Do not play any animation by default`
|
|
187
|
+
*/
|
|
188
|
+
animationName: string | null;
|
|
189
|
+
/**
|
|
190
|
+
* The name of the default skin @defaultValue `default`
|
|
191
|
+
*/
|
|
192
|
+
skinName: string;
|
|
193
|
+
/**
|
|
194
|
+
* Creates an instance of DefaultState
|
|
195
|
+
*/
|
|
196
|
+
constructor(
|
|
197
|
+
/**
|
|
198
|
+
* The default scale of the animation @defaultValue `1`
|
|
199
|
+
*/
|
|
200
|
+
scale?: number,
|
|
201
|
+
/**
|
|
202
|
+
* Whether the default animation should loop @defaultValue `true. The default animation should loop`
|
|
203
|
+
*/
|
|
204
|
+
loop?: boolean,
|
|
205
|
+
/**
|
|
206
|
+
* The name of the default animation @defaultValue `null. Do not play any animation by default`
|
|
207
|
+
*/
|
|
208
|
+
animationName?: string | null,
|
|
209
|
+
/**
|
|
210
|
+
* The name of the default skin @defaultValue `default`
|
|
211
|
+
*/
|
|
212
|
+
skinName?: string);
|
|
213
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,7 @@
|
|
|
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";
|
|
@@ -0,0 +1,6 @@
|
|
|
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 };
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
private decodeText;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|