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