@galacean/engine-spine 4.2.2 → 4.2.4

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 (63) hide show
  1. package/dist/browser.js +1 -1
  2. package/dist/main.js +677 -251
  3. package/dist/main.js.map +1 -1
  4. package/dist/miniprogram.js +677 -251
  5. package/dist/module.js +678 -253
  6. package/dist/module.js.map +1 -1
  7. package/package.json +5 -4
  8. package/types/renderer/SpineAnimationRenderer.d.ts +18 -7
  9. package/types/renderer/SpineGenerator.d.ts +3 -4
  10. package/types/renderer/SpineMaterial.d.ts +23 -1
  11. package/types/SpineAnimation.d.ts +0 -48
  12. package/types/SpineLoader.d.ts +0 -32
  13. package/types/SpineMaterial.d.ts +0 -6
  14. package/types/SpineRenderer.d.ts +0 -38
  15. package/types/core/MeshGenerator.d.ts +0 -43
  16. package/types/core/SpineMesh.d.ts +0 -11
  17. package/types/spine-core/Animation.d.ts +0 -378
  18. package/types/spine-core/AnimationState.d.ts +0 -365
  19. package/types/spine-core/AnimationStateData.d.ts +0 -23
  20. package/types/spine-core/AssetManager.d.ts +0 -36
  21. package/types/spine-core/AtlasAttachmentLoader.d.ts +0 -23
  22. package/types/spine-core/BlendMode.d.ts +0 -7
  23. package/types/spine-core/Bone.d.ts +0 -110
  24. package/types/spine-core/BoneData.d.ts +0 -44
  25. package/types/spine-core/ConstraintData.d.ts +0 -7
  26. package/types/spine-core/Event.d.ts +0 -16
  27. package/types/spine-core/EventData.d.ts +0 -13
  28. package/types/spine-core/IkConstraint.d.ts +0 -38
  29. package/types/spine-core/IkConstraintData.d.ts +0 -26
  30. package/types/spine-core/PathConstraint.d.ts +0 -46
  31. package/types/spine-core/PathConstraintData.d.ts +0 -52
  32. package/types/spine-core/SharedAssetManager.d.ts +0 -19
  33. package/types/spine-core/Skeleton.d.ts +0 -134
  34. package/types/spine-core/SkeletonBinary.d.ts +0 -49
  35. package/types/spine-core/SkeletonBounds.d.ts +0 -48
  36. package/types/spine-core/SkeletonClipping.d.ts +0 -22
  37. package/types/spine-core/SkeletonData.d.ts +0 -89
  38. package/types/spine-core/SkeletonJson.d.ts +0 -34
  39. package/types/spine-core/Skin.d.ts +0 -43
  40. package/types/spine-core/Slot.d.ts +0 -42
  41. package/types/spine-core/SlotData.d.ts +0 -23
  42. package/types/spine-core/Texture.d.ts +0 -46
  43. package/types/spine-core/TextureAtlas.d.ts +0 -30
  44. package/types/spine-core/TransformConstraint.d.ts +0 -36
  45. package/types/spine-core/TransformConstraintData.d.ts +0 -34
  46. package/types/spine-core/Triangulator.d.ts +0 -14
  47. package/types/spine-core/Updatable.d.ts +0 -9
  48. package/types/spine-core/Utils.d.ts +0 -124
  49. package/types/spine-core/VertexEffect.d.ts +0 -7
  50. package/types/spine-core/attachments/Attachment.d.ts +0 -43
  51. package/types/spine-core/attachments/AttachmentLoader.d.ts +0 -25
  52. package/types/spine-core/attachments/AttachmentType.d.ts +0 -9
  53. package/types/spine-core/attachments/BoundingBoxAttachment.d.ts +0 -12
  54. package/types/spine-core/attachments/ClippingAttachment.d.ts +0 -14
  55. package/types/spine-core/attachments/MeshAttachment.d.ts +0 -46
  56. package/types/spine-core/attachments/PathAttachment.d.ts +0 -19
  57. package/types/spine-core/attachments/PointAttachment.d.ts +0 -20
  58. package/types/spine-core/attachments/RegionAttachment.d.ts +0 -88
  59. package/types/spine-core/polyfills.d.ts +0 -3
  60. package/types/spine-core/vertexeffects/JitterEffect.d.ts +0 -11
  61. package/types/spine-core/vertexeffects/SwirlEffect.d.ts +0 -16
  62. package/types/types.d.ts +0 -4
  63. package/types/util/BlendMode.d.ts +0 -4
@@ -1,365 +0,0 @@
1
- import { AnimationStateData } from "./AnimationStateData";
2
- import { IntSet, Pool } from "./Utils";
3
- import { Skeleton } from "./Skeleton";
4
- import { MixBlend, AttachmentTimeline, Timeline } from "./Animation";
5
- import { Slot } from "./Slot";
6
- import { Animation } from "./Animation";
7
- import { Event } from "./Event";
8
- /** Applies animations over time, queues animations for later playback, mixes (crossfading) between animations, and applies
9
- * multiple animations on top of each other (layering).
10
- *
11
- * See [Applying Animations](http://esotericsoftware.com/spine-applying-animations/) in the Spine Runtimes Guide. */
12
- export declare class AnimationState {
13
- static emptyAnimation: Animation;
14
- /** 1. A previously applied timeline has set this property.
15
- *
16
- * Result: Mix from the current pose to the timeline pose. */
17
- static SUBSEQUENT: number;
18
- /** 1. This is the first timeline to set this property.
19
- * 2. The next track entry applied after this one does not have a timeline to set this property.
20
- *
21
- * Result: Mix from the setup pose to the timeline pose. */
22
- static FIRST: number;
23
- /** 1) A previously applied timeline has set this property.<br>
24
- * 2) The next track entry to be applied does have a timeline to set this property.<br>
25
- * 3) The next track entry after that one does not have a timeline to set this property.<br>
26
- * Result: Mix from the current pose to the timeline pose, but do not mix out. This avoids "dipping" when crossfading
27
- * animations that key the same property. A subsequent timeline will set this property using a mix. */
28
- static HOLD_SUBSEQUENT: number;
29
- /** 1) This is the first timeline to set this property.<br>
30
- * 2) The next track entry to be applied does have a timeline to set this property.<br>
31
- * 3) The next track entry after that one does not have a timeline to set this property.<br>
32
- * Result: Mix from the setup pose to the timeline pose, but do not mix out. This avoids "dipping" when crossfading animations
33
- * that key the same property. A subsequent timeline will set this property using a mix. */
34
- static HOLD_FIRST: number;
35
- /** 1. This is the first timeline to set this property.
36
- * 2. The next track entry to be applied does have a timeline to set this property.
37
- * 3. The next track entry after that one does have a timeline to set this property.
38
- * 4. timelineHoldMix stores the first subsequent track entry that does not have a timeline to set this property.
39
- *
40
- * Result: The same as HOLD except the mix percentage from the timelineHoldMix track entry is used. This handles when more than
41
- * 2 track entries in a row have a timeline that sets the same property.
42
- *
43
- * Eg, A -> B -> C -> D where A, B, and C have a timeline setting same property, but D does not. When A is applied, to avoid
44
- * "dipping" A is not mixed out, however D (the first entry that doesn't set the property) mixing in is used to mix out A
45
- * (which affects B and C). Without using D to mix out, A would be applied fully until mixing completes, then snap into
46
- * place. */
47
- static HOLD_MIX: number;
48
- static SETUP: number;
49
- static CURRENT: number;
50
- /** The AnimationStateData to look up mix durations. */
51
- data: AnimationStateData;
52
- /** The list of tracks that currently have animations, which may contain null entries. */
53
- tracks: TrackEntry[];
54
- /** Multiplier for the delta time when the animation state is updated, causing time for all animations and mixes to play slower
55
- * or faster. Defaults to 1.
56
- *
57
- * See TrackEntry {@link TrackEntry#timeScale} for affecting a single animation. */
58
- timeScale: number;
59
- unkeyedState: number;
60
- events: Event[];
61
- listeners: AnimationStateListener[];
62
- queue: EventQueue;
63
- propertyIDs: IntSet;
64
- animationsChanged: boolean;
65
- trackEntryPool: Pool<TrackEntry>;
66
- constructor(data: AnimationStateData);
67
- /** Increments each track entry {@link TrackEntry#trackTime()}, setting queued animations as current if needed. */
68
- update(delta: number): void;
69
- /** Returns true when all mixing from entries are complete. */
70
- updateMixingFrom(to: TrackEntry, delta: number): boolean;
71
- /** Poses the skeleton using the track entry animations. There are no side effects other than invoking listeners, so the
72
- * animation state can be applied to multiple skeletons to pose them identically.
73
- * @returns True if any animations were applied. */
74
- apply(skeleton: Skeleton): boolean;
75
- applyMixingFrom(to: TrackEntry, skeleton: Skeleton, blend: MixBlend): number;
76
- applyAttachmentTimeline(timeline: AttachmentTimeline, skeleton: Skeleton, time: number, blend: MixBlend, attachments: boolean): void;
77
- setAttachment(skeleton: Skeleton, slot: Slot, attachmentName: string, attachments: boolean): void;
78
- applyRotateTimeline(timeline: Timeline, skeleton: Skeleton, time: number, alpha: number, blend: MixBlend, timelinesRotation: Array<number>, i: number, firstFrame: boolean): void;
79
- queueEvents(entry: TrackEntry, animationTime: number): void;
80
- /** Removes all animations from all tracks, leaving skeletons in their current pose.
81
- *
82
- * It may be desired to use {@link AnimationState#setEmptyAnimation()} to mix the skeletons back to the setup pose,
83
- * rather than leaving them in their current pose. */
84
- clearTracks(): void;
85
- /** Removes all animations from the track, leaving skeletons in their current pose.
86
- *
87
- * It may be desired to use {@link AnimationState#setEmptyAnimation()} to mix the skeletons back to the setup pose,
88
- * rather than leaving them in their current pose. */
89
- clearTrack(trackIndex: number): void;
90
- setCurrent(index: number, current: TrackEntry, interrupt: boolean): void;
91
- /** Sets an animation by name.
92
- *
93
- * {@link #setAnimationWith(}. */
94
- setAnimation(trackIndex: number, animationName: string, loop: boolean): TrackEntry;
95
- /** Sets the current animation for a track, discarding any queued animations. If the formerly current track entry was never
96
- * applied to a skeleton, it is replaced (not mixed from).
97
- * @param loop If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its
98
- * duration. In either case {@link TrackEntry#trackEnd} determines when the track is cleared.
99
- * @returns A track entry to allow further customization of animation playback. References to the track entry must not be kept
100
- * after the {@link AnimationStateListener#dispose()} event occurs. */
101
- setAnimationWith(trackIndex: number, animation: Animation, loop: boolean): TrackEntry;
102
- /** Queues an animation by name.
103
- *
104
- * See {@link #addAnimationWith()}. */
105
- addAnimation(trackIndex: number, animationName: string, loop: boolean, delay: number): TrackEntry;
106
- /** Adds an animation to be played after the current or last queued animation for a track. If the track is empty, it is
107
- * equivalent to calling {@link #setAnimationWith()}.
108
- * @param delay If > 0, sets {@link TrackEntry#delay}. If <= 0, the delay set is the duration of the previous track entry
109
- * minus any mix duration (from the {@link AnimationStateData}) plus the specified `delay` (ie the mix
110
- * ends at (`delay` = 0) or before (`delay` < 0) the previous track entry duration). If the
111
- * previous entry is looping, its next loop completion is used instead of its duration.
112
- * @returns A track entry to allow further customization of animation playback. References to the track entry must not be kept
113
- * after the {@link AnimationStateListener#dispose()} event occurs. */
114
- addAnimationWith(trackIndex: number, animation: Animation, loop: boolean, delay: number): TrackEntry;
115
- /** Sets an empty animation for a track, discarding any queued animations, and sets the track entry's
116
- * {@link TrackEntry#mixduration}. An empty animation has no timelines and serves as a placeholder for mixing in or out.
117
- *
118
- * Mixing out is done by setting an empty animation with a mix duration using either {@link #setEmptyAnimation()},
119
- * {@link #setEmptyAnimations()}, or {@link #addEmptyAnimation()}. Mixing to an empty animation causes
120
- * the previous animation to be applied less and less over the mix duration. Properties keyed in the previous animation
121
- * transition to the value from lower tracks or to the setup pose value if no lower tracks key the property. A mix duration of
122
- * 0 still mixes out over one frame.
123
- *
124
- * Mixing in is done by first setting an empty animation, then adding an animation using
125
- * {@link #addAnimation()} and on the returned track entry, set the
126
- * {@link TrackEntry#setMixDuration()}. Mixing from an empty animation causes the new animation to be applied more and
127
- * more over the mix duration. Properties keyed in the new animation transition from the value from lower tracks or from the
128
- * setup pose value if no lower tracks key the property to the value keyed in the new animation. */
129
- setEmptyAnimation(trackIndex: number, mixDuration: number): TrackEntry;
130
- /** Adds an empty animation to be played after the current or last queued animation for a track, and sets the track entry's
131
- * {@link TrackEntry#mixDuration}. If the track is empty, it is equivalent to calling
132
- * {@link #setEmptyAnimation()}.
133
- *
134
- * See {@link #setEmptyAnimation()}.
135
- * @param delay If > 0, sets {@link TrackEntry#delay}. If <= 0, the delay set is the duration of the previous track entry
136
- * minus any mix duration plus the specified `delay` (ie the mix ends at (`delay` = 0) or
137
- * before (`delay` < 0) the previous track entry duration). If the previous entry is looping, its next
138
- * loop completion is used instead of its duration.
139
- * @return A track entry to allow further customization of animation playback. References to the track entry must not be kept
140
- * after the {@link AnimationStateListener#dispose()} event occurs. */
141
- addEmptyAnimation(trackIndex: number, mixDuration: number, delay: number): TrackEntry;
142
- /** Sets an empty animation for every track, discarding any queued animations, and mixes to it over the specified mix
143
- * duration. */
144
- setEmptyAnimations(mixDuration: number): void;
145
- expandToIndex(index: number): TrackEntry;
146
- /** @param last May be null. */
147
- trackEntry(trackIndex: number, animation: Animation, loop: boolean, last: TrackEntry): TrackEntry;
148
- disposeNext(entry: TrackEntry): void;
149
- _animationsChanged(): void;
150
- computeHold(entry: TrackEntry): void;
151
- /** Returns the track entry for the animation currently playing on the track, or null if no animation is currently playing. */
152
- getCurrent(trackIndex: number): TrackEntry;
153
- /** Adds a listener to receive events for all track entries. */
154
- addListener(listener: AnimationStateListener): void;
155
- /** Removes the listener added with {@link #addListener()}. */
156
- removeListener(listener: AnimationStateListener): void;
157
- /** Removes all listeners added with {@link #addListener()}. */
158
- clearListeners(): void;
159
- /** Discards all listener notifications that have not yet been delivered. This can be useful to call from an
160
- * {@link AnimationStateListener} when it is known that further notifications that may have been already queued for delivery
161
- * are not wanted because new animations are being set. */
162
- clearListenerNotifications(): void;
163
- }
164
- /** Stores settings and other state for the playback of an animation on an {@link AnimationState} track.
165
- *
166
- * References to a track entry must not be kept after the {@link AnimationStateListener#dispose()} event occurs. */
167
- export declare class TrackEntry {
168
- /** The animation to apply for this track entry. */
169
- animation: Animation;
170
- /** The animation queued to start after this animation, or null. `next` makes up a linked list. */
171
- next: TrackEntry;
172
- /** The track entry for the previous animation when mixing from the previous animation to this animation, or null if no
173
- * mixing is currently occuring. When mixing from multiple animations, `mixingFrom` makes up a linked list. */
174
- mixingFrom: TrackEntry;
175
- /** The track entry for the next animation when mixing from this animation to the next animation, or null if no mixing is
176
- * currently occuring. When mixing to multiple animations, `mixingTo` makes up a linked list. */
177
- mixingTo: TrackEntry;
178
- /** The listener for events generated by this track entry, or null.
179
- *
180
- * A track entry returned from {@link AnimationState#setAnimation()} is already the current animation
181
- * for the track, so the track entry listener {@link AnimationStateListener#start()} will not be called. */
182
- listener: AnimationStateListener;
183
- /** The index of the track where this track entry is either current or queued.
184
- *
185
- * See {@link AnimationState#getCurrent()}. */
186
- trackIndex: number;
187
- /** If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its
188
- * duration. */
189
- loop: boolean;
190
- /** If true, when mixing from the previous animation to this animation, the previous animation is applied as normal instead
191
- * of being mixed out.
192
- *
193
- * When mixing between animations that key the same property, if a lower track also keys that property then the value will
194
- * briefly dip toward the lower track value during the mix. This happens because the first animation mixes from 100% to 0%
195
- * while the second animation mixes from 0% to 100%. Setting `holdPrevious` to true applies the first animation
196
- * at 100% during the mix so the lower track value is overwritten. Such dipping does not occur on the lowest track which
197
- * keys the property, only when a higher track also keys the property.
198
- *
199
- * Snapping will occur if `holdPrevious` is true and this animation does not key all the same properties as the
200
- * previous animation. */
201
- holdPrevious: boolean;
202
- /** When the mix percentage ({@link #mixTime} / {@link #mixDuration}) is less than the
203
- * `eventThreshold`, event timelines are applied while this animation is being mixed out. Defaults to 0, so event
204
- * timelines are not applied while this animation is being mixed out. */
205
- eventThreshold: number;
206
- /** When the mix percentage ({@link #mixtime} / {@link #mixDuration}) is less than the
207
- * `attachmentThreshold`, attachment timelines are applied while this animation is being mixed out. Defaults to
208
- * 0, so attachment timelines are not applied while this animation is being mixed out. */
209
- attachmentThreshold: number;
210
- /** When the mix percentage ({@link #mixTime} / {@link #mixDuration}) is less than the
211
- * `drawOrderThreshold`, draw order timelines are applied while this animation is being mixed out. Defaults to 0,
212
- * so draw order timelines are not applied while this animation is being mixed out. */
213
- drawOrderThreshold: number;
214
- /** Seconds when this animation starts, both initially and after looping. Defaults to 0.
215
- *
216
- * When changing the `animationStart` time, it often makes sense to set {@link #animationLast} to the same
217
- * value to prevent timeline keys before the start time from triggering. */
218
- animationStart: number;
219
- /** Seconds for the last frame of this animation. Non-looping animations won't play past this time. Looping animations will
220
- * loop back to {@link #animationStart} at this time. Defaults to the animation {@link Animation#duration}. */
221
- animationEnd: number;
222
- /** The time in seconds this animation was last applied. Some timelines use this for one-time triggers. Eg, when this
223
- * animation is applied, event timelines will fire all events between the `animationLast` time (exclusive) and
224
- * `animationTime` (inclusive). Defaults to -1 to ensure triggers on frame 0 happen the first time this animation
225
- * is applied. */
226
- animationLast: number;
227
- nextAnimationLast: number;
228
- /** Seconds to postpone playing the animation. When this track entry is the current track entry, `delay`
229
- * postpones incrementing the {@link #trackTime}. When this track entry is queued, `delay` is the time from
230
- * the start of the previous animation to when this track entry will become the current track entry (ie when the previous
231
- * track entry {@link TrackEntry#trackTime} >= this track entry's `delay`).
232
- *
233
- * {@link #timeScale} affects the delay. */
234
- delay: number;
235
- /** Current time in seconds this track entry has been the current track entry. The track time determines
236
- * {@link #animationTime}. The track time can be set to start the animation at a time other than 0, without affecting
237
- * looping. */
238
- trackTime: number;
239
- trackLast: number;
240
- nextTrackLast: number;
241
- /** The track time in seconds when this animation will be removed from the track. Defaults to the highest possible float
242
- * value, meaning the animation will be applied until a new animation is set or the track is cleared. If the track end time
243
- * is reached, no other animations are queued for playback, and mixing from any previous animations is complete, then the
244
- * properties keyed by the animation are set to the setup pose and the track is cleared.
245
- *
246
- * It may be desired to use {@link AnimationState#addEmptyAnimation()} rather than have the animation
247
- * abruptly cease being applied. */
248
- trackEnd: number;
249
- /** Multiplier for the delta time when this track entry is updated, causing time for this animation to pass slower or
250
- * faster. Defaults to 1.
251
- *
252
- * {@link #mixTime} is not affected by track entry time scale, so {@link #mixDuration} may need to be adjusted to
253
- * match the animation speed.
254
- *
255
- * When using {@link AnimationState#addAnimation()} with a `delay` <= 0, note the
256
- * {@link #delay} is set using the mix duration from the {@link AnimationStateData}, assuming time scale to be 1. If
257
- * the time scale is not 1, the delay may need to be adjusted.
258
- *
259
- * See AnimationState {@link AnimationState#timeScale} for affecting all animations. */
260
- timeScale: number;
261
- /** Values < 1 mix this animation with the skeleton's current pose (usually the pose resulting from lower tracks). Defaults
262
- * to 1, which overwrites the skeleton's current pose with this animation.
263
- *
264
- * Typically track 0 is used to completely pose the skeleton, then alpha is used on higher tracks. It doesn't make sense to
265
- * use alpha on track 0 if the skeleton pose is from the last frame render. */
266
- alpha: number;
267
- /** Seconds from 0 to the {@link #getMixDuration()} when mixing from the previous animation to this animation. May be
268
- * slightly more than `mixDuration` when the mix is complete. */
269
- mixTime: number;
270
- /** Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData
271
- * {@link AnimationStateData#getMix()} based on the animation before this animation (if any).
272
- *
273
- * A mix duration of 0 still mixes out over one frame to provide the track entry being mixed out a chance to revert the
274
- * properties it was animating.
275
- *
276
- * The `mixDuration` can be set manually rather than use the value from
277
- * {@link AnimationStateData#getMix()}. In that case, the `mixDuration` can be set for a new
278
- * track entry only before {@link AnimationState#update(float)} is first called.
279
- *
280
- * When using {@link AnimationState#addAnimation()} with a `delay` <= 0, note the
281
- * {@link #delay} is set using the mix duration from the {@link AnimationStateData}, not a mix duration set
282
- * afterward. */
283
- mixDuration: number;
284
- interruptAlpha: number;
285
- totalAlpha: number;
286
- /** Controls how properties keyed in the animation are mixed with lower tracks. Defaults to {@link MixBlend#replace}, which
287
- * replaces the values from the lower tracks with the animation values. {@link MixBlend#add} adds the animation values to
288
- * the values from the lower tracks.
289
- *
290
- * The `mixBlend` can be set for a new track entry only before {@link AnimationState#apply()} is first
291
- * called. */
292
- mixBlend: MixBlend;
293
- timelineMode: number[];
294
- timelineHoldMix: TrackEntry[];
295
- timelinesRotation: number[];
296
- reset(): void;
297
- /** Uses {@link #trackTime} to compute the `animationTime`, which is between {@link #animationStart}
298
- * and {@link #animationEnd}. When the `trackTime` is 0, the `animationTime` is equal to the
299
- * `animationStart` time. */
300
- getAnimationTime(): number;
301
- setAnimationLast(animationLast: number): void;
302
- /** Returns true if at least one loop has been completed.
303
- *
304
- * See {@link AnimationStateListener#complete()}. */
305
- isComplete(): boolean;
306
- /** Resets the rotation directions for mixing this entry's rotate timelines. This can be useful to avoid bones rotating the
307
- * long way around when using {@link #alpha} and starting animations on other tracks.
308
- *
309
- * Mixing with {@link MixBlend#replace} involves finding a rotation between two others, which has two possible solutions:
310
- * the short way or the long way around. The two rotations likely change over time, so which direction is the short or long
311
- * way also changes. If the short way was always chosen, bones would flip to the other side when that direction became the
312
- * long way. TrackEntry chooses the short way the first time it is applied and remembers that direction. */
313
- resetRotationDirections(): void;
314
- }
315
- export declare class EventQueue {
316
- objects: Array<any>;
317
- drainDisabled: boolean;
318
- animState: AnimationState;
319
- constructor(animState: AnimationState);
320
- start(entry: TrackEntry): void;
321
- interrupt(entry: TrackEntry): void;
322
- end(entry: TrackEntry): void;
323
- dispose(entry: TrackEntry): void;
324
- complete(entry: TrackEntry): void;
325
- event(entry: TrackEntry, event: Event): void;
326
- drain(): void;
327
- clear(): void;
328
- }
329
- export declare enum EventType {
330
- start = 0,
331
- interrupt = 1,
332
- end = 2,
333
- dispose = 3,
334
- complete = 4,
335
- event = 5
336
- }
337
- /** The interface to implement for receiving TrackEntry events. It is always safe to call AnimationState methods when receiving
338
- * events.
339
- *
340
- * See TrackEntry {@link TrackEntry#listener} and AnimationState
341
- * {@link AnimationState#addListener()}. */
342
- export interface AnimationStateListener {
343
- /** Invoked when this entry has been set as the current entry. */
344
- start(entry: TrackEntry): void;
345
- /** Invoked when another entry has replaced this entry as the current entry. This entry may continue being applied for
346
- * mixing. */
347
- interrupt(entry: TrackEntry): void;
348
- /** Invoked when this entry is no longer the current entry and will never be applied again. */
349
- end(entry: TrackEntry): void;
350
- /** Invoked when this entry will be disposed. This may occur without the entry ever being set as the current entry.
351
- * References to the entry should not be kept after dispose is called, as it may be destroyed or reused. */
352
- dispose(entry: TrackEntry): void;
353
- /** Invoked every time this entry's animation completes a loop. */
354
- complete(entry: TrackEntry): void;
355
- /** Invoked when this entry's animation triggers an event. */
356
- event(entry: TrackEntry, event: Event): void;
357
- }
358
- export declare abstract class AnimationStateAdapter implements AnimationStateListener {
359
- start(entry: TrackEntry): void;
360
- interrupt(entry: TrackEntry): void;
361
- end(entry: TrackEntry): void;
362
- dispose(entry: TrackEntry): void;
363
- complete(entry: TrackEntry): void;
364
- event(entry: TrackEntry, event: Event): void;
365
- }
@@ -1,23 +0,0 @@
1
- import { SkeletonData } from "./SkeletonData";
2
- import { Animation } from "./Animation";
3
- import { Map } from "./Utils";
4
- /** Stores mix (crossfade) durations to be applied when {@link AnimationState} animations are changed. */
5
- export declare class AnimationStateData {
6
- /** The SkeletonData to look up animations when they are specified by name. */
7
- skeletonData: SkeletonData;
8
- animationToMixTime: Map<number>;
9
- /** The mix duration to use when no mix duration has been defined between two animations. */
10
- defaultMix: number;
11
- constructor(skeletonData: SkeletonData);
12
- /** Sets a mix duration by animation name.
13
- *
14
- * See {@link #setMixWith()}. */
15
- setMix(fromName: string, toName: string, duration: number): void;
16
- /** Sets the mix duration when changing from the specified animation to the other.
17
- *
18
- * See {@link TrackEntry#mixDuration}. */
19
- setMixWith(from: Animation, to: Animation, duration: number): void;
20
- /** Returns the mix duration to use when changing from the specified animation to the other, or the {@link #defaultMix} if
21
- * no mix duration has been set. */
22
- getMix(from: Animation, to: Animation): number;
23
- }
@@ -1,36 +0,0 @@
1
- import { AssetType, Engine, Texture2D } from "@galacean/engine";
2
- import { Disposable, Map } from "./Utils";
3
- import { TextureAtlas } from "./TextureAtlas";
4
- import { AdaptiveTexture } from "../SpineLoader";
5
- export declare class AssetManager implements Disposable {
6
- private _engine;
7
- protected pathPrefix: string;
8
- protected textureLoader: (texture: Texture2D) => AdaptiveTexture;
9
- protected assets: Map<any>;
10
- protected errors: Map<string>;
11
- protected toLoad: number;
12
- protected loaded: number;
13
- protected rawDataUris: Map<string>;
14
- onLoadComplete: any;
15
- get engine(): Engine;
16
- constructor(engine: Engine, pathPrefix?: string, textureLoader?: (texture: Texture2D) => AdaptiveTexture);
17
- private downloadText;
18
- protected downloadBinary(url: string, success: (data: Uint8Array) => void, error: (status: number, responseText: string) => void): void;
19
- setRawDataURI(path: string, data: string): void;
20
- loadBinary(path: string, success?: (path: string, binary: Uint8Array) => void, error?: (error: string) => void): void;
21
- loadText(path: string, success?: (path: string, text: string) => void, error?: (error: string) => void): void;
22
- loadImage(path: string, success?: (path: string, image: HTMLImageElement) => void, error?: (error: string) => void): void;
23
- loadTexture(path: string, success?: (path: string, texture: AdaptiveTexture) => void, error?: (error: string) => void): void;
24
- loadEngineTexture(path: string, type: AssetType, success?: (path: string, texture: AdaptiveTexture) => void, error?: (error: string) => void): void;
25
- loadTextureAtlas(path: string, success?: (path: string, atlas: TextureAtlas) => void, error?: (error: string) => void): void;
26
- get(path: string): any;
27
- remove(path: string): void;
28
- removeAll(): void;
29
- isLoadingComplete(): boolean;
30
- onLoad(): void;
31
- getToLoad(): number;
32
- getLoaded(): number;
33
- dispose(): void;
34
- hasErrors(): boolean;
35
- getErrors(): Map<string>;
36
- }
@@ -1,23 +0,0 @@
1
- import { AttachmentLoader } from "./attachments/AttachmentLoader";
2
- import { TextureAtlas } from "./TextureAtlas";
3
- import { Skin } from "./Skin";
4
- import { RegionAttachment } from "./attachments/RegionAttachment";
5
- import { MeshAttachment } from "./attachments/MeshAttachment";
6
- import { BoundingBoxAttachment } from "./attachments/BoundingBoxAttachment";
7
- import { PathAttachment } from "./attachments/PathAttachment";
8
- import { PointAttachment } from "./attachments/PointAttachment";
9
- import { ClippingAttachment } from "./attachments/ClippingAttachment";
10
- /** An {@link AttachmentLoader} that configures attachments using texture regions from an {@link TextureAtlas}.
11
- *
12
- * See [Loading skeleton data](http://esotericsoftware.com/spine-loading-skeleton-data#JSON-and-binary-data) in the
13
- * Spine Runtimes Guide. */
14
- export declare class AtlasAttachmentLoader implements AttachmentLoader {
15
- atlas: TextureAtlas;
16
- constructor(atlas: TextureAtlas);
17
- newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
18
- newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
19
- newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
20
- newPathAttachment(skin: Skin, name: string): PathAttachment;
21
- newPointAttachment(skin: Skin, name: string): PointAttachment;
22
- newClippingAttachment(skin: Skin, name: string): ClippingAttachment;
23
- }
@@ -1,7 +0,0 @@
1
- /** Determines how images are blended with existing pixels when drawn. */
2
- export declare enum BlendMode {
3
- Normal = 0,
4
- Additive = 1,
5
- Multiply = 2,
6
- Screen = 3
7
- }
@@ -1,110 +0,0 @@
1
- import { Updatable } from "./Updatable";
2
- import { BoneData } from "./BoneData";
3
- import { Skeleton } from "./Skeleton";
4
- import { Vector2 } from "./Utils";
5
- /** Stores a bone's current pose.
6
- *
7
- * A bone has a local transform which is used to compute its world transform. A bone also has an applied transform, which is a
8
- * local transform that can be applied to compute the world transform. The local transform and applied transform may differ if a
9
- * constraint or application code modifies the world transform after it was computed from the local transform. */
10
- export declare class Bone implements Updatable {
11
- /** The bone's setup pose data. */
12
- data: BoneData;
13
- /** The skeleton this bone belongs to. */
14
- skeleton: Skeleton;
15
- /** The parent bone, or null if this is the root bone. */
16
- parent: Bone;
17
- /** The immediate children of this bone. */
18
- children: Bone[];
19
- /** The local x translation. */
20
- x: number;
21
- /** The local y translation. */
22
- y: number;
23
- /** The local rotation in degrees, counter clockwise. */
24
- rotation: number;
25
- /** The local scaleX. */
26
- scaleX: number;
27
- /** The local scaleY. */
28
- scaleY: number;
29
- /** The local shearX. */
30
- shearX: number;
31
- /** The local shearY. */
32
- shearY: number;
33
- /** The applied local x translation. */
34
- ax: number;
35
- /** The applied local y translation. */
36
- ay: number;
37
- /** The applied local rotation in degrees, counter clockwise. */
38
- arotation: number;
39
- /** The applied local scaleX. */
40
- ascaleX: number;
41
- /** The applied local scaleY. */
42
- ascaleY: number;
43
- /** The applied local shearX. */
44
- ashearX: number;
45
- /** The applied local shearY. */
46
- ashearY: number;
47
- /** If true, the applied transform matches the world transform. If false, the world transform has been modified since it was
48
- * computed and {@link #updateAppliedTransform()} must be called before accessing the applied transform. */
49
- appliedValid: boolean;
50
- /** Part of the world transform matrix for the X axis. If changed, {@link #appliedValid} should be set to false. */
51
- a: number;
52
- /** Part of the world transform matrix for the Y axis. If changed, {@link #appliedValid} should be set to false. */
53
- b: number;
54
- /** Part of the world transform matrix for the X axis. If changed, {@link #appliedValid} should be set to false. */
55
- c: number;
56
- /** Part of the world transform matrix for the Y axis. If changed, {@link #appliedValid} should be set to false. */
57
- d: number;
58
- /** The world X position. If changed, {@link #appliedValid} should be set to false. */
59
- worldY: number;
60
- /** The world Y position. If changed, {@link #appliedValid} should be set to false. */
61
- worldX: number;
62
- sorted: boolean;
63
- active: boolean;
64
- /** @param parent May be null. */
65
- constructor(data: BoneData, skeleton: Skeleton, parent: Bone);
66
- /** Returns false when the bone has not been computed because {@link BoneData#skinRequired} is true and the
67
- * {@link Skeleton#skin active skin} does not {@link Skin#bones contain} this bone. */
68
- isActive(): boolean;
69
- /** Same as {@link #updateWorldTransform()}. This method exists for Bone to implement {@link Updatable}. */
70
- update(): void;
71
- /** Computes the world transform using the parent bone and this bone's local transform.
72
- *
73
- * See {@link #updateWorldTransformWith()}. */
74
- updateWorldTransform(): void;
75
- /** Computes the world transform using the parent bone and the specified local transform. Child bones are not updated.
76
- *
77
- * See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms) in the Spine
78
- * Runtimes Guide. */
79
- updateWorldTransformWith(x: number, y: number, rotation: number, scaleX: number, scaleY: number, shearX: number, shearY: number): void;
80
- /** Sets this bone's local transform to the setup pose. */
81
- setToSetupPose(): void;
82
- /** The world rotation for the X axis, calculated using {@link #a} and {@link #c}. */
83
- getWorldRotationX(): number;
84
- /** The world rotation for the Y axis, calculated using {@link #b} and {@link #d}. */
85
- getWorldRotationY(): number;
86
- /** The magnitude (always positive) of the world scale X, calculated using {@link #a} and {@link #c}. */
87
- getWorldScaleX(): number;
88
- /** The magnitude (always positive) of the world scale Y, calculated using {@link #b} and {@link #d}. */
89
- getWorldScaleY(): number;
90
- /** Computes the applied transform values from the world transform. This allows the applied transform to be accessed after the
91
- * world transform has been modified (by a constraint, {@link #rotateWorld()}, etc).
92
- *
93
- * If {@link #updateWorldTransform()} has been called for a bone and {@link #appliedValid} is false, then
94
- * {@link #updateAppliedTransform()} must be called before accessing the applied transform.
95
- *
96
- * Some information is ambiguous in the world transform, such as -1,-1 scale versus 180 rotation. The applied transform after
97
- * calling this method is equivalent to the local tranform used to compute the world transform, but may not be identical. */
98
- updateAppliedTransform(): void;
99
- /** Transforms a point from world coordinates to the bone's local coordinates. */
100
- worldToLocal(world: Vector2): Vector2;
101
- /** Transforms a point from the bone's local coordinates to world coordinates. */
102
- localToWorld(local: Vector2): Vector2;
103
- /** Transforms a world rotation to a local rotation. */
104
- worldToLocalRotation(worldRotation: number): number;
105
- /** Transforms a local rotation to a world rotation. */
106
- localToWorldRotation(localRotation: number): number;
107
- /** Rotates the world transform the specified amount and sets {@link #appliedValid} to false.
108
- * {@link #updateWorldTransform()} will need to be called on any child bones, recursively, and any constraints reapplied. */
109
- rotateWorld(degrees: number): void;
110
- }
@@ -1,44 +0,0 @@
1
- import { Color } from "./Utils";
2
- /** Stores the setup pose for a {@link Bone}. */
3
- export declare class BoneData {
4
- /** The index of the bone in {@link Skeleton#getBones()}. */
5
- index: number;
6
- /** The name of the bone, which is unique across all bones in the skeleton. */
7
- name: string;
8
- /** @returns May be null. */
9
- parent: BoneData;
10
- /** The bone's length. */
11
- length: number;
12
- /** The local x translation. */
13
- x: number;
14
- /** The local y translation. */
15
- y: number;
16
- /** The local rotation. */
17
- rotation: number;
18
- /** The local scaleX. */
19
- scaleX: number;
20
- /** The local scaleY. */
21
- scaleY: number;
22
- /** The local shearX. */
23
- shearX: number;
24
- /** The local shearX. */
25
- shearY: number;
26
- /** The transform mode for how parent world transforms affect this bone. */
27
- transformMode: TransformMode;
28
- /** When true, {@link Skeleton#updateWorldTransform()} only updates this bone if the {@link Skeleton#skin} contains this
29
- * bone.
30
- * @see Skin#bones */
31
- skinRequired: boolean;
32
- /** The color of the bone as it was in Spine. Available only when nonessential data was exported. Bones are not usually
33
- * rendered at runtime. */
34
- color: Color;
35
- constructor(index: number, name: string, parent: BoneData);
36
- }
37
- /** Determines how a bone inherits world transforms from parent bones. */
38
- export declare enum TransformMode {
39
- Normal = 0,
40
- OnlyTranslation = 1,
41
- NoRotationOrReflection = 2,
42
- NoScale = 3,
43
- NoScaleOrReflection = 4
44
- }
@@ -1,7 +0,0 @@
1
- /** The base class for all constraint datas. */
2
- export declare abstract class ConstraintData {
3
- name: string;
4
- order: number;
5
- skinRequired: boolean;
6
- constructor(name: string, order: number, skinRequired: boolean);
7
- }
@@ -1,16 +0,0 @@
1
- import { EventData } from "./EventData";
2
- /** Stores the current pose values for an {@link Event}.
3
- *
4
- * See Timeline {@link Timeline#apply()},
5
- * AnimationStateListener {@link AnimationStateListener#event()}, and
6
- * [Events](http://esotericsoftware.com/spine-events) in the Spine User Guide. */
7
- export declare class Event {
8
- data: EventData;
9
- intValue: number;
10
- floatValue: number;
11
- stringValue: string;
12
- time: number;
13
- volume: number;
14
- balance: number;
15
- constructor(time: number, data: EventData);
16
- }
@@ -1,13 +0,0 @@
1
- /** Stores the setup pose values for an {@link Event}.
2
- *
3
- * See [Events](http://esotericsoftware.com/spine-events) in the Spine User Guide. */
4
- export declare class EventData {
5
- name: string;
6
- intValue: number;
7
- floatValue: number;
8
- stringValue: string;
9
- audioPath: string;
10
- volume: number;
11
- balance: number;
12
- constructor(name: string);
13
- }